Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit d1beb9d

Browse files
committed
document dialectic a bit
1 parent a5e4e33 commit d1beb9d

File tree

4 files changed

+75
-145
lines changed

4 files changed

+75
-145
lines changed

CLAUDE.md

Lines changed: 17 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -2,157 +2,30 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5-
@prompts/project/ongoing-work-tracking.md
6-
@prompts/project/ai-insights.md
7-
85
## Memory Bank Design Context
96

10-
### Maintenance & Workflow
11-
This mdBook content must be kept current as design evolves. "Checkpoint our work" includes:
12-
- Updating Current Design State with new insights/discoveries
13-
- Moving completed items from Open Questions to Key Design Decisions
14-
- Documenting any design pivots or new principles discovered
15-
16-
See project conventions:
17-
- GitHub tracking: @prompts/project/github-tracking-issues.md
18-
- Code documentation: @prompts/project/ai-insights.md
19-
20-
### Vision & Goals
21-
@src/introduction.md
22-
23-
### Design Foundation
24-
@src/design-foundation.md
25-
26-
### Current Design State
27-
@src/current-state.md
28-
(Check this section for latest open questions and discoveries)
29-
30-
### Full Documentation
31-
@src/SUMMARY.md
32-
(Complete architecture, implementation details, research archive)
33-
34-
## Project Overview
35-
36-
Socratic Shell is a research experiment in deliberate AI-human collaboration design. It consists of two main MCP (Model Context Protocol) servers that enable structured collaboration patterns and pattern testing.
37-
38-
### Core Components
39-
40-
1. **socratic-shell** - Memory consolidation MCP server for intelligent information storage and retrieval
41-
2. **dialectic** - Pattern testing MCP server for evaluating collaboration approaches through structured conversation scenarios
42-
43-
## Architecture
44-
45-
```
46-
socratic-shell/
47-
├── socratic-shell/ # Main MCP server for memory operations
48-
│ └── src/socratic_shell/
49-
│ ├── server.py # MCP server with consolidate/read_in/store_back tools
50-
│ └── models.py # Pydantic models for memory operations
51-
├── dialectic/ # Pattern testing MCP server
52-
│ └── src/dialectic/
53-
│ ├── server.py # MCP server with test_pattern tool
54-
│ ├── models.py # Data models for pattern testing
55-
│ └── sampling.py # Core sampling logic (placeholder)
56-
├── prompts/ # User and project patterns
57-
├── insights/ # Research findings on collaboration
58-
├── work-tracking/ # Documentation on tracking approaches
59-
└── references/ # Research materials and background
60-
```
61-
62-
## Common Development Commands
63-
64-
### Running the Servers
7+
@src/memory-bank/README.md
658

66-
**Socratic Shell server:**
67-
```bash
68-
cd socratic-shell
69-
uv sync --quiet
70-
uv run python -m socratic_shell
71-
```
72-
73-
**Dialectic server:**
74-
```bash
75-
./run-dialectic.sh
76-
# OR
77-
cd dialectic
78-
uv sync --quiet
79-
uv run python -m dialectic
80-
```
81-
82-
### Testing and Code Quality
83-
84-
**Run tests:**
85-
```bash
86-
cd dialectic # or socratic-shell
87-
uv run pytest
88-
```
89-
90-
**Linting and type checking:**
91-
```bash
92-
cd dialectic # or socratic-shell
93-
uv run ruff check .
94-
uv run mypy src/
95-
```
96-
97-
**Install development dependencies:**
98-
```bash
99-
cd dialectic # or socratic-shell
100-
uv sync # Installs dev dependencies from pyproject.toml
101-
```
102-
103-
## MCP Server Tools
104-
105-
### Socratic Shell Tools
106-
- `consolidate` - Store insights/patterns with category and importance
107-
- `read_in` - Retrieve relevant memories based on query/context
108-
- `store_back` - Update existing memories with new insights
109-
110-
### Dialectic Tools
111-
- `test_pattern` - Test collaboration patterns with multiple scenarios (currently returns placeholder results)
112-
113-
## Work Tracking
114-
115-
This repository uses the **ongoing files** approach for work tracking:
116-
117-
- Create `.ongoing/task-name.md` files for active development work
118-
- Update status, next steps, and context as work progresses
119-
- Delete files when work is complete
120-
- See `work-tracking/ongoing-files.md` for detailed conventions
121-
122-
**Check current work:**
123-
```bash
124-
ls -la .ongoing/ 2>/dev/null || echo "No ongoing work tracked"
125-
grep -h "^## Status:" .ongoing/*.md 2>/dev/null || echo "No status found"
126-
```
127-
128-
## Key Development Patterns
9+
### Maintenance & Workflow
10+
The mdBook whose table of contents lies in `src/SUMMARY.md` must be kept current as design evolves.
11+
The table of contents can be useful to find sources of additional information about the memory bank design.
12912

130-
### Python Environment
131-
- Both servers use **uv** for dependency management
132-
- Python 3.11+ required
133-
- Pydantic for data models
134-
- MCP framework for server implementations
13+
### Checkpointing
13514

136-
### Code Organization
137-
- Each server is self-contained in its own directory
138-
- Shared patterns documented in `prompts/` and `insights/`
139-
- Clear separation between MCP protocol handling and business logic
15+
When asked to "checkpoint our work", remember to take the following steps:
16+
- Update [Current Design State](./src/memory-bank/current-state.md) with new insights/discoveries
17+
- Move completed items from Open Questions to Key Design Decisions
18+
- Document new principles discovered in the [Design Foundation](./src/memory-bank/design-foundation.md)
19+
- Add new questions to cover design pivots in the [FAQ](./src/memory-bank/faq.md)
14020

141-
### Testing Strategy
142-
- `dialectic/` has placeholder MCP sampling capabilities (future: actual Claude API integration)
143-
- Test fixtures in `test/fixtures/` for system prompts and reminders
144-
- Pattern testing designed around real conversation scenarios
21+
## Dialectic testing tool
14522

146-
## Important Files
23+
@src/dialectic/README.md
14724

148-
- `run-dialectic.sh` - Quick start script for dialectic server
149-
- `prompts/user/main.md` - Core collaboration patterns (referenced by global CLAUDE.md)
150-
- `insights/*.md` - Research findings on effective AI-human collaboration
151-
- `work-tracking/*.md` - Documentation on different tracking approaches
25+
## Socratic Shell Conventions
15226

153-
## Notes
27+
@src/prompts/project/github-tracking-issues.md
28+
@src/prompts/project/ai-insights.md
15429

155-
- The `socratic-shell` server currently has dummy memory implementation
156-
- The `dialectic` server returns placeholder results until MCP sampling is fully implemented
157-
- Both servers log operations to stderr for debugging
158-
- This is research code - focus on collaboration patterns over production polish
30+
@src/SUMMARY.md
31+
(Complete architecture, implementation details, research archive)

src/SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
- [Vision and goals](./memory-bank/README.md)
1717
- [Design Foundation](./memory-bank/design-foundation.md)
1818
- [Current State](./memory-bank/current-state.md)
19+
- [Frequently asked questions](./memory-bank/faq.md)
20+
21+
# Dialectic
22+
23+
- [Introduction](./dialectic/README.md)
1924

2025
# Appendices
2126

src/dialectic/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Dialectic Testing Tool
2+
3+
Dialectic is a YAML-based test runner for validating collaboration patterns and prompt engineering approaches.
4+
5+
## Purpose
6+
7+
Test whether prompts produce expected behaviors by running conversation scenarios and validating:
8+
- Response content (what Claude says)
9+
- Tool usage (what Claude does)
10+
- Behavioral patterns (how Claude responds)
11+
12+
## Usage
13+
14+
```bash
15+
cd dialectic
16+
uv run python dialectic.py test-scripts/my-test.yaml
17+
```
18+
19+
## Test Format
20+
21+
```yaml
22+
name: "Test Name"
23+
description: "What this test validates"
24+
25+
conversation:
26+
- user: "User message"
27+
expected_response:
28+
should_contain: ["expected", "phrases"]
29+
should_not_contain: ["forbidden", "phrases"]
30+
expected_tools: [] # Empty = no tools should be called
31+
```
32+
33+
## Key Features
34+
35+
- **Fail-fast execution** - stops on first failure to avoid testing invalid conversation states
36+
- **Streaming output** - shows responses in real-time for debugging
37+
- **Tool parameter validation** - verifies correct parameters passed to tools
38+
- **Human-readable format** - easy to write and understand test cases
39+
40+
## Current Status
41+
42+
Working prototype using Claude Code SDK. Useful for testing prompt patterns before deploying them.
43+
44+
## Development
45+
46+
- Uses `uv` for dependency management
47+
- Fully typed with mypy type annotations
48+
- Run type checking: `uv run mypy src/`

src/memory-bank/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ The memory bank operates through three core operations:
3232

3333
These operations integrate seamlessly with existing collaboration patterns, using natural conversation signals (from CLAUDE.md) as triggers rather than requiring explicit memory management.
3434

35-
The system follows biological memory principles: frequent consolidation with natural decay, context-dependent retrieval, and intelligent forgetting that preserves signal while discarding noise.
35+
The system follows biological memory principles: frequent consolidation with natural decay, context-dependent retrieval, and intelligent forgetting that preserves signal while discarding noise.
36+
37+
## Testing tool
38+
39+
The dialectic testing tool is used

0 commit comments

Comments
 (0)