@tienne/gestalt 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.ko.md +15 -32
  3. package/README.md +183 -163
  4. package/dist/package.json +1 -1
  5. package/dist/src/execute/orchestrators/evaluation.d.ts +27 -0
  6. package/dist/src/execute/orchestrators/evaluation.d.ts.map +1 -0
  7. package/dist/src/execute/orchestrators/evaluation.js +169 -0
  8. package/dist/src/execute/orchestrators/evaluation.js.map +1 -0
  9. package/dist/src/execute/orchestrators/evolution.d.ts +50 -0
  10. package/dist/src/execute/orchestrators/evolution.d.ts.map +1 -0
  11. package/dist/src/execute/orchestrators/evolution.js +391 -0
  12. package/dist/src/execute/orchestrators/evolution.js.map +1 -0
  13. package/dist/src/execute/orchestrators/execution.d.ts +38 -0
  14. package/dist/src/execute/orchestrators/execution.d.ts.map +1 -0
  15. package/dist/src/execute/orchestrators/execution.js +328 -0
  16. package/dist/src/execute/orchestrators/execution.js.map +1 -0
  17. package/dist/src/execute/orchestrators/planning.d.ts +26 -0
  18. package/dist/src/execute/orchestrators/planning.d.ts.map +1 -0
  19. package/dist/src/execute/orchestrators/planning.js +269 -0
  20. package/dist/src/execute/orchestrators/planning.js.map +1 -0
  21. package/dist/src/execute/orchestrators/types.d.ts +137 -0
  22. package/dist/src/execute/orchestrators/types.d.ts.map +1 -0
  23. package/dist/src/execute/orchestrators/types.js +2 -0
  24. package/dist/src/execute/orchestrators/types.js.map +1 -0
  25. package/dist/src/execute/passthrough-engine.d.ts +9 -201
  26. package/dist/src/execute/passthrough-engine.d.ts.map +1 -1
  27. package/dist/src/execute/passthrough-engine.js +37 -1075
  28. package/dist/src/execute/passthrough-engine.js.map +1 -1
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -19,27 +19,52 @@
19
19
 
20
20
  ---
21
21
 
22
- ## What is Gestalt?
22
+ Gestalt is an MCP (Model Context Protocol) server that runs inside Claude Code. It conducts a structured requirement interview, generates a validated **Spec** — a JSON document capturing your goal, constraints, and acceptance criteria — and transforms that Spec into a dependency-aware execution plan.
23
23
 
24
- Gestalt is an MCP (Model Context Protocol) server that runs inside Claude Code. It conducts structured requirement interviews, generates a validated **Spec** (a JSON document capturing your goal, constraints, and acceptance criteria), and transforms that Spec into a dependency-aware execution plan.
24
+ Claude Code acts as the LLM throughout. Gestalt manages state, validates results, and advances the pipeline. No API key required.
25
25
 
26
- > **Prerequisites:** Node.js >= 20.0.0. Use `nvm install 22 && nvm use 22` if needed.
26
+ > **Requires Node.js >= 20.0.0.** Use `nvm install 22 && nvm use 22` if needed.
27
+
28
+ ---
29
+
30
+ ## Contents
31
+
32
+ - [Quick Start](#quick-start)
33
+ - [How It Works](#how-it-works)
34
+ - [Installation](#installation)
35
+ - [The Pipeline](#the-pipeline)
36
+ - [1. Interview](#1-interview)
37
+ - [2. Spec Generation](#2-spec-generation)
38
+ - [3. Execute](#3-execute)
39
+ - [4. Evaluate](#4-evaluate)
40
+ - [5. Evolve](#5-evolve)
41
+ - [6. Code Review](#6-code-review)
42
+ - [Agents](#agents)
43
+ - [CLI Mode](#cli-mode)
44
+ - [Project Memory](#project-memory)
45
+ - [Configuration](#configuration)
46
+ - [Architecture](#architecture)
27
47
 
28
48
  ---
29
49
 
30
50
  ## Quick Start
31
51
 
32
- Install the plugin once, then use it in any Claude Code session:
52
+ Install the plugin once, then use it in any Claude Code session.
53
+
54
+ **From a terminal (outside a session):**
33
55
 
34
56
  ```bash
35
- # Step 1: Add to marketplace (one-time setup)
36
- /plugin marketplace add tienne/gestalt
57
+ claude plugin install gestalt@gestalt
58
+ ```
37
59
 
38
- # Step 2: Install the plugin
60
+ **Inside a Claude Code session:**
61
+
62
+ ```bash
63
+ /plugin marketplace add tienne/gestalt
39
64
  /plugin install gestalt@gestalt
40
65
  ```
41
66
 
42
- Then in any Claude Code session:
67
+ Then run the pipeline:
43
68
 
44
69
  ```bash
45
70
  /interview "user authentication system"
@@ -47,34 +72,36 @@ Then in any Claude Code session:
47
72
  /execute
48
73
  ```
49
74
 
50
- **[Full MCP Reference](./docs/mcp-reference.md)** — all tools, parameters, and examples
75
+ **[Full MCP Reference](./docs/mcp-reference.md)** — all tools, parameters, and examples
51
76
 
52
77
  ---
53
78
 
54
- ## Why Gestalt?
79
+ ## How It Works
55
80
 
56
- Vague requirements are the primary source of implementation drift. When the goal isn't precise, Claude fills in gaps with assumptions — and those assumptions diverge from intent as the project grows.
81
+ Vague requirements are the primary cause of implementation drift. When the goal isn't precise, Claude fills gaps with assumptions — and those assumptions diverge from intent as the project grows.
57
82
 
58
- Gestalt addresses this at the source. Before any code is written, it runs a structured interview guided by **Gestalt psychology principles** to raise resolution to a measurable threshold (≥ 0.8). The result is a **Spec**: a validated JSON document that serves as the single source of truth for planning and execution.
83
+ Gestalt addresses this before any code is written. It runs a structured interview guided by five **Gestalt psychology principles** to raise requirement resolution to a measurable threshold (≥ 0.8). The result is a **Spec**: a validated JSON document that drives every subsequent step.
59
84
 
60
85
  ### The Five Gestalt Principles
61
86
 
62
- - **Closure** Finds what's missing; fills in implicit requirements
63
- - **Proximity** — Groups related features and tasks by domain
64
- - **Similarity** Identifies repeating patterns across requirements
65
- - **Figure-Ground** Separates MVP (figure) from nice-to-have (ground)
66
- - **Continuity** Validates dependency chains; detects contradictions
87
+ | Principle | Role |
88
+ |-----------|------|
89
+ | **Closure** | Finds what's missing; surfaces implicit requirements |
90
+ | **Proximity** | Groups related features and tasks by domain |
91
+ | **Similarity** | Identifies repeating patterns across requirements |
92
+ | **Figure-Ground** | Separates MVP (figure) from nice-to-have (ground) |
93
+ | **Continuity** | Validates dependency chains; detects contradictions |
67
94
 
68
- > "The whole is greater than the sum of its parts." — Aristotle
95
+ ### Passthrough Mode
69
96
 
70
- ### How does Passthrough Mode work?
97
+ Gestalt runs as an MCP server. Claude Code acts as the LLM: Gestalt returns prompts and context, and Claude Code does the reasoning. The server makes no API calls.
71
98
 
72
- Gestalt runs as an **MCP server**. Claude Code acts as the LLM: Gestalt returns prompts and context, and Claude Code does the reasoning. The server makes no API calls.
99
+ > **Note:** The Execute stage **always runs in Passthrough mode**, regardless of whether an API key is configured. Execute carries out real file edits and code execution through Claude Code's tools (Bash, Edit, etc.), so Claude Code must be the LLM that drives it this is by design, not a missing feature.
73
100
 
74
101
  ```
75
102
  You (in Claude Code)
76
103
 
77
- /interview "topic"
104
+ /interview "topic"
78
105
  Gestalt MCP Server
79
106
  (returns context + prompts)
80
107
 
@@ -86,32 +113,12 @@ You (in Claude Code)
86
113
  Gestalt MCP Server
87
114
  (validates, stores state, advances)
88
115
 
89
- repeat until resolution ≥ 0.8
116
+ repeat until resolution ≥ 0.8
90
117
  Final Spec → Execution Plan
91
118
  ```
92
119
 
93
120
  ---
94
121
 
95
- ## Project Memory
96
-
97
- Every spec and execution result is automatically recorded in `.gestalt/memory.json` at your repo root.
98
-
99
- ```json
100
- {
101
- "specHistory": [
102
- { "specId": "...", "goal": "Build a user auth system", "sourceType": "text" }
103
- ],
104
- "executionHistory": [],
105
- "architectureDecisions": []
106
- }
107
- ```
108
-
109
- - **Commit it** — `.gestalt/memory.json` is plain JSON. Commit it and teammates inherit all prior decisions on `git pull`.
110
- - **Context injection** — When generating the next spec, prior goals and architecture decisions are automatically injected into the prompt.
111
- - **User profile** — Personal preferences are stored in `~/.gestalt/profile.json` and are never committed.
112
-
113
- ---
114
-
115
122
  ## Installation
116
123
 
117
124
  ### Option 1: Claude Code Plugin (Recommended)
@@ -127,29 +134,24 @@ claude plugin install gestalt@gestalt
127
134
  **Inside a Claude Code session:**
128
135
 
129
136
  ```bash
130
- # Step 1: Add to marketplace (one-time setup)
131
137
  /plugin marketplace add tienne/gestalt
132
-
133
- # Step 2: Install the plugin
134
138
  /plugin install gestalt@gestalt
135
139
  ```
136
140
 
137
- What you get out of the box:
141
+ What you get:
138
142
 
139
143
  | Item | Details |
140
144
  |------|---------|
141
- | **MCP Tools** | `ges_interview`, `ges_generate_spec`, `ges_execute`, `ges_create_agent`, `ges_agent`, `ges_status`, `ges_code_graph`, `ges_graph_visualize`, `ges_benchmark` |
145
+ | **MCP Tools** | `ges_interview`, `ges_generate_spec`, `ges_execute`, `ges_create_agent`, `ges_agent`, `ges_status`, `ges_code_graph`, `ges_graph_visualize`, `ges_benchmark`, `ges_generate_kb`, `ges_search`, `ges_sync` |
142
146
  | **Slash Commands** | `/interview`, `/spec`, `/execute`, `/agent` |
143
- | **Agents** | 5 Gestalt pipeline agents + 9 Role agents + 3 Review agents |
147
+ | **Agents** | 5 pipeline agents + 9 Role agents + 3 Review agents |
144
148
  | **CLAUDE.md** | Project context and MCP usage guide auto-injected |
145
149
 
146
- > **Requires Node.js >= 20.0.0** — use [nvm](https://github.com/nvm-sh/nvm) if needed: `nvm install 22 && nvm use 22`
147
-
148
150
  ---
149
151
 
150
152
  ### Option 2: Claude Code Desktop
151
153
 
152
- Open your Claude Code Desktop settings and add to `settings.json` (or `claude_desktop_config.json`):
154
+ Add this to your `settings.json` (or `claude_desktop_config.json`) and restart:
153
155
 
154
156
  ```json
155
157
  {
@@ -162,18 +164,17 @@ Open your Claude Code Desktop settings and add to `settings.json` (or `claude_de
162
164
  }
163
165
  ```
164
166
 
165
- Restart Claude Code Desktop. The MCP tools become available immediately. Slash commands require the plugin or manual skills setup.
167
+ MCP tools are available immediately after restart. Slash commands require the plugin or manual skills setup.
166
168
 
167
169
  ---
168
170
 
169
171
  ### Option 3: Claude Code CLI
170
172
 
171
173
  ```bash
172
- # Via the claude CLI
173
174
  claude mcp add gestalt -- npx -y @tienne/gestalt
174
175
  ```
175
176
 
176
- Or edit `~/.claude/settings.json` directly:
177
+ Or add directly to `~/.claude/settings.json`:
177
178
 
178
179
  ```json
179
180
  {
@@ -188,11 +189,11 @@ Or edit `~/.claude/settings.json` directly:
188
189
 
189
190
  ---
190
191
 
191
- ## Usage: Full Pipeline
192
+ ## The Pipeline
192
193
 
193
- ### Step 1 Interview
194
+ ### 1. Interview
194
195
 
195
- Start with any topic. A single rough sentence is enough.
196
+ Start with any topic. A rough sentence is enough.
196
197
 
197
198
  ```bash
198
199
  /interview "I want to build a checkout flow with Stripe"
@@ -206,7 +207,7 @@ Gestalt conducts a multi-round interview. Each round targets a specific resoluti
206
207
  - **Figure-Ground** — What's the core MVP vs. what's optional?
207
208
  - **Continuity** — Any contradictions or conflicts?
208
209
 
209
- The interview continues until the **resolution score reaches ≥ 0.8**:
210
+ The interview continues until the resolution score reaches ≥ 0.8:
210
211
 
211
212
  ```
212
213
  Round 1 → resolution: 0.28 (lots of unknowns)
@@ -214,9 +215,9 @@ Round 4 → resolution: 0.55 (getting clearer)
214
215
  Round 8 → resolution: 0.81 ✓ ready for Spec
215
216
  ```
216
217
 
217
- #### Long interviews: Context Compression
218
+ #### Context Compression
218
219
 
219
- When rounds exceed 5, Gestalt automatically signals that compression is available. Use the `compress` action to summarize earlier rounds and keep the context window lean:
220
+ When rounds exceed 5, Gestalt signals that compression is available. Use the `compress` action to summarize earlier rounds and keep the context window lean:
220
221
 
221
222
  ```
222
223
  1. respond returns needsCompression: true + compressionContext
@@ -228,114 +229,113 @@ The compressed summary is automatically injected into all subsequent rounds.
228
229
 
229
230
  ---
230
231
 
231
- ### Step 2 Spec Generation
232
+ ### 2. Spec Generation
232
233
 
233
- **Option A — From text (no interview required):**
234
+ **From a completed interview:**
234
235
 
235
236
  ```bash
236
- ges_generate_spec({ text: "Build a checkout flow with Stripe" })
237
+ /spec
237
238
  ```
238
239
 
239
- **Option A-2 With a built-in template:**
240
+ **From text (no interview required):**
240
241
 
241
- Three starter templates pre-fill common constraints and acceptance criteria:
242
+ ```bash
243
+ ges_generate_spec({ text: "Build a checkout flow with Stripe" })
244
+ ```
245
+
246
+ **With a built-in template:**
242
247
 
243
248
  | Template ID | Description |
244
249
  |-------------|-------------|
245
- | `rest-api` | REST API server with auth, CRUD, and OpenAPI |
250
+ | `rest-api` | REST API with auth, CRUD, and OpenAPI |
246
251
  | `react-dashboard` | React dashboard with charts, filters, and responsive layout |
247
- | `cli-tool` | CLI tool with subcommands, config, and distribution |
252
+ | `cli-tool` | CLI with subcommands, config file, and distribution |
248
253
 
249
254
  ```bash
250
255
  ges_generate_spec({ text: "API with JWT authentication", template: "rest-api" })
251
256
  ```
252
257
 
253
- **Option B From a completed interview:**
254
-
255
- ```bash
256
- /spec
257
- ```
258
-
259
- Generates a structured **Spec** — a validated JSON document that drives the rest of the pipeline:
258
+ The generated Spec includes:
260
259
 
261
260
  ```
262
261
  goal → Clear, precise project objective
263
262
  constraints → Technical and business constraints
264
263
  acceptanceCriteria → Measurable, verifiable success conditions
265
- ontologySchema → Entity-relationship model (entities + relations)
264
+ ontologySchema → Entity-relationship model
266
265
  gestaltAnalysis → Key findings per Gestalt principle
267
266
  ```
268
267
 
269
268
  ---
270
269
 
271
- ### Step 3 Execute (Planning + Execution)
270
+ ### 3. Execute
272
271
 
273
- Transforms the Spec into a dependency-aware execution plan and runs it:
272
+ Transform the Spec into a dependency-aware execution plan and run it:
274
273
 
275
274
  ```bash
276
275
  /execute
277
276
  ```
278
277
 
279
- **Planning phase** applies 4 Gestalt principles in a fixed sequence:
278
+ > Execute **always runs in Passthrough mode** Claude Code performs the actual file edits and code execution through its tools (Bash, Edit, etc.). Configuring an API key does not switch Execute to a self-contained LLM mode; there is no such mode by design.
279
+
280
+ **Planning** applies four Gestalt principles in a fixed sequence:
280
281
 
281
282
  | Step | Principle | What it does |
282
283
  |:---:|-----------|-------------|
283
- | 1 | **Figure-Ground** | Classifies acceptance criteria (ACs) as critical (figure) vs. supplementary (ground) |
284
+ | 1 | **Figure-Ground** | Classifies acceptance criteria as critical vs. supplementary |
284
285
  | 2 | **Closure** | Decomposes ACs into atomic tasks, including implicit ones |
285
- | 3 | **Proximity** | Groups related tasks by domain into logical task groups |
286
- | 4 | **Continuity** | Validates the dependency DAG — no cycles, clear topological order |
286
+ | 3 | **Proximity** | Groups related tasks by domain |
287
+ | 4 | **Continuity** | Validates the dependency DAG — no cycles, topological order confirmed |
287
288
 
288
- **Execution phase** runs tasks in topological order. After each task, **drift detection** checks alignment with the Spec:
289
+ **Execution** runs tasks in topological order. After each task, drift detection checks alignment with the Spec:
289
290
 
290
291
  - 3-dimensional score: Goal (50%) + Constraint (30%) + Ontology (20%)
291
- - Jaccard similarity-based measurement
292
- - Auto-triggers a retrospective when drift exceeds threshold
292
+ - Jaccard similarity measurement
293
+ - Auto-triggers a retrospective when drift exceeds the threshold
293
294
 
294
- #### Parallel execution groups
295
+ #### Parallel Execution
295
296
 
296
- The `plan_complete` response includes `parallelGroups: string[][]`. Tasks with no mutual dependencies land in the same group and can be executed concurrently:
297
+ The `plan_complete` response includes `parallelGroups: string[][]`. Tasks with no mutual dependencies are placed in the same group and can run concurrently:
297
298
 
298
299
  ```json
299
300
  "parallelGroups": [
300
- ["setup-db", "setup-env"], // run in parallel
301
- ["create-schema"], // after group above
302
- ["seed-data", "run-tests"] // run in parallel
301
+ ["setup-db", "setup-env"],
302
+ ["create-schema"],
303
+ ["seed-data", "run-tests"]
303
304
  ]
304
305
  ```
305
306
 
306
- #### Resuming an interrupted execution
307
-
308
- Pick up where you left off when a session is interrupted:
307
+ #### Resuming an Interrupted Session
309
308
 
310
309
  ```bash
311
310
  ges_execute({ action: "resume", sessionId: "<id>" })
312
311
  ```
313
312
 
314
- Returns `ResumeContext`: completed task IDs, next task, and `progressPercent`. The `ges_status` response also includes `resumeContext` automatically for any executing session.
313
+ Returns `ResumeContext`: completed task IDs, next task, and `progressPercent`. The `ges_status` response also includes `resumeContext` automatically for any active session.
315
314
 
316
- #### Brownfield audit
315
+ #### Brownfield Audit
317
316
 
318
- When a codebase already exists, audit it against the Spec before executing new tasks:
317
+ When a codebase already exists, audit it against the Spec before running new tasks:
319
318
 
320
319
  ```bash
321
320
  # Step 1: request audit context
322
321
  ges_execute({ action: "audit", sessionId: "<id>" })
323
- → auditContext (systemPrompt, auditPrompt)
322
+ # returns auditContext (systemPrompt, auditPrompt)
324
323
 
325
324
  # Step 2: submit codebase snapshot + audit result
326
325
  ges_execute({
327
326
  action: "audit",
328
327
  sessionId: "<id>",
329
328
  codebaseSnapshot: "...",
330
- auditResult: { implementedACs: [0,2], partialACs: [1], missingACs: [3], gapAnalysis: "..." }
329
+ auditResult: {
330
+ implementedACs: [0, 2],
331
+ partialACs: [1],
332
+ missingACs: [3],
333
+ gapAnalysis: "..."
334
+ }
331
335
  })
332
336
  ```
333
337
 
334
- #### Real-time progress panel
335
-
336
- When using the `/execute` slash command, Gestalt displays live execution status in the Claude Code Task panel — showing completed/total tasks, current task name, failed task count, and parallel group progress. Updated automatically at each planning step, task completion, and evaluation stage.
337
-
338
- #### Sub-agent spawning
338
+ #### Sub-Agent Spawning
339
339
 
340
340
  Decompose a complex task into sub-tasks dynamically during execution:
341
341
 
@@ -351,31 +351,37 @@ ges_execute({
351
351
  })
352
352
  ```
353
353
 
354
+ #### Real-Time Progress Panel
355
+
356
+ The `/execute` slash command displays live execution status in the Claude Code Task panel — completed/total tasks, current task name, failed count, and parallel group progress. Updated automatically at each planning step, task completion, and evaluation stage.
357
+
354
358
  ---
355
359
 
356
- ### Step 4 Evaluate
360
+ ### 4. Evaluate
357
361
 
358
- Execution triggers a 2-stage evaluation:
362
+ Execution triggers a two-stage evaluation automatically:
359
363
 
360
364
  | Stage | Method | On failure |
361
365
  |:---:|-------|-----------|
362
- | 1 | **Structural** — runs lint → build → test | Short-circuits; skips Stage 2 |
363
- | 2 | **Contextual** — LLM validates each AC + goal alignment | Enters Evolution Loop |
366
+ | 1 | **Structural** — runs lint → build → test | Short-circuits; Stage 2 is skipped |
367
+ | 2 | **Contextual** — LLM validates each AC and goal alignment | Enters the Evolution Loop |
364
368
 
365
369
  **Success condition:** `score ≥ 0.85` AND `goalAlignment ≥ 0.80`
366
370
 
367
371
  ---
368
372
 
369
- ### Step 5 Evolve
373
+ ### 5. Evolve
370
374
 
371
375
  When evaluation fails, the Evolution Loop engages. Three recovery flows are available:
372
376
 
373
377
  **Flow A — Structural Fix** (when lint/build/test fails)
378
+
374
379
  ```
375
380
  evolve_fix → submit fix tasks → re-evaluate
376
381
  ```
377
382
 
378
383
  **Flow B — Contextual Evolution** (when AC score is too low)
384
+
379
385
  ```
380
386
  evolve → patch Spec (ACs/constraints) → re-execute impacted tasks → re-evaluate
381
387
  ```
@@ -388,12 +394,12 @@ Gestalt rotates through lateral thinking personas rather than terminating:
388
394
 
389
395
  | Stagnation Pattern | Persona | Strategy |
390
396
  |--------------------|---------|---------|
391
- | Hard cap hit | **Multistability** | See from a different angle |
397
+ | Hard cap hit | **Multistability** | View from a different angle |
392
398
  | Oscillating scores | **Simplicity** | Strip down and converge |
393
399
  | No progress (no drift) | **Reification** | Fill in what's missing |
394
400
  | Diminishing returns | **Invariance** | Replicate what worked |
395
401
 
396
- When all 4 personas are exhausted, the session terminates with **Human Escalation** — a structured list of actionable suggestions for manual resolution.
402
+ When all four personas are exhausted, the session ends with **Human Escalation** — a structured list of actionable suggestions for manual resolution.
397
403
 
398
404
  **Termination conditions:**
399
405
 
@@ -408,7 +414,7 @@ When all 4 personas are exhausted, the session terminates with **Human Escalatio
408
414
 
409
415
  ---
410
416
 
411
- ### Step 6 Code Review
417
+ ### 6. Code Review
412
418
 
413
419
  When evolution finishes, code review starts automatically:
414
420
 
@@ -416,7 +422,27 @@ When evolution finishes, code review starts automatically:
416
422
  review_start → agents submit perspectives → consensus → auto-fix
417
423
  ```
418
424
 
419
- 9 built-in **Role Agents** provide multi-perspective review:
425
+ See [Agents](#agents) for the full list of built-in reviewers.
426
+
427
+ ---
428
+
429
+ ## Agents
430
+
431
+ Use any agent directly, outside the pipeline:
432
+
433
+ ```bash
434
+ # List all available agents
435
+ /agent
436
+
437
+ # Run a specific agent on any task
438
+ /agent architect "review the module boundaries in this codebase"
439
+ /agent security-reviewer "check this authentication code for vulnerabilities"
440
+ /agent technical-writer "write a README for this module"
441
+ ```
442
+
443
+ ### Role Agents
444
+
445
+ Nine built-in role agents provide multi-perspective review:
420
446
 
421
447
  | Agent | Domain |
422
448
  |-------|--------|
@@ -430,7 +456,9 @@ review_start → agents submit perspectives → consensus → auto-fix
430
456
  | `researcher` | Analysis, data, benchmarks |
431
457
  | `technical-writer` | Documentation, API docs, guides, README |
432
458
 
433
- 3 built-in **Review Agents** run focused code analysis:
459
+ ### Review Agents
460
+
461
+ Three built-in review agents run focused code analysis:
434
462
 
435
463
  | Agent | Focus |
436
464
  |-------|-------|
@@ -438,44 +466,31 @@ review_start → agents submit perspectives → consensus → auto-fix
438
466
  | `performance-reviewer` | Memory leaks, N+1 queries, bundle size, async |
439
467
  | `quality-reviewer` | Readability, SOLID, error handling, DRY |
440
468
 
441
- Use any agent outside the pipeline with `/agent`:
442
-
443
- ```bash
444
- # List all available agents
445
- /agent
446
-
447
- # Run a specific agent on any task
448
- /agent architect "review the module boundaries in this codebase"
449
- /agent security-reviewer "check this authentication code for vulnerabilities"
450
- /agent technical-writer "write a README for this module"
451
- ```
469
+ ### Custom Agents
452
470
 
453
- Generate custom Role Agents from interview results:
471
+ Generate a custom Role Agent from interview results:
454
472
 
455
- ```
456
- # Step 1: Get agent creation context
457
- ges_create_agentaction: "start", sessionId: "<id>"
458
- returns agentContext (systemPrompt, creationPrompt, schema)
473
+ ```bash
474
+ # Step 1: get agent creation context
475
+ ges_create_agent({ action: "start", sessionId: "<id>" })
476
+ # returns agentContext (systemPrompt, creationPrompt, schema)
459
477
 
460
- # Step 2: Submit the generated AGENT.md content
461
- ges_create_agentaction: "submit", sessionId: "<id>", agentContent: "..."
462
- creates agents/{name}/AGENT.md
478
+ # Step 2: submit the generated AGENT.md content
479
+ ges_create_agent({ action: "submit", sessionId: "<id>", agentContent: "..." })
480
+ # creates agents/{name}/AGENT.md
463
481
  ```
464
482
 
465
483
  ---
466
484
 
467
- ### CLI Mode (without Claude Code)
485
+ ## CLI Mode
468
486
 
469
- Want to run Gestalt without Claude Code? CLI mode runs interviews directly in your terminal. **Requires `ANTHROPIC_API_KEY`.**
487
+ Run Gestalt without Claude Code. **Requires `ANTHROPIC_API_KEY`.**
470
488
 
471
489
  ```bash
472
490
  # Start an interactive interview
473
491
  npx @tienne/gestalt interview "my topic"
474
492
 
475
- # Record the session as a GIF
476
- npx @tienne/gestalt interview "my topic" --record
477
-
478
- # Generate Spec from a completed session
493
+ # Generate a Spec from a completed session
479
494
  npx @tienne/gestalt spec <session-id>
480
495
 
481
496
  # List all sessions
@@ -488,29 +503,33 @@ npx @tienne/gestalt setup
488
503
  npx @tienne/gestalt serve
489
504
  ```
490
505
 
491
- #### Recording an interview session
492
-
493
- Add `--record` (or `-r`) to capture the terminal session as a GIF:
506
+ ---
494
507
 
495
- ```bash
496
- npx @tienne/gestalt interview "my topic" --record
497
- ```
508
+ ## Project Memory
498
509
 
499
- When the interview completes, a GIF is written to the current directory:
510
+ Every spec and execution result is automatically recorded in `.gestalt/memory.json` at your repo root.
500
511
 
512
+ ```json
513
+ {
514
+ "specHistory": [
515
+ { "specId": "...", "goal": "Build a user auth system", "sourceType": "text" }
516
+ ],
517
+ "executionHistory": [],
518
+ "architectureDecisions": []
519
+ }
501
520
  ```
502
- user-auth-interview-20260327.gif
503
- ```
504
521
 
505
- The filename is generated by the LLM from the interview topic (kebab-case) plus a `YYYYMMDD` date stamp. No external binaries are required recording uses `gifencoder` and `jimp` only.
522
+ **Commit it.** `.gestalt/memory.json` is plain JSON. Teammates inherit all prior decisions on `git pull`.
523
+
524
+ **Context injection.** Prior goals and architecture decisions are automatically injected into the next spec prompt.
506
525
 
507
- **Resuming an interrupted session:** If a session is interrupted mid-recording, restarting the same session automatically detects the `.frames` file and continues where it left off. Temporary frame data is stored at `.gestalt/recordings/{sessionId}.frames` and deleted once the GIF is written.
526
+ **User profile.** Personal preferences are stored in `~/.gestalt/profile.json` and are never committed.
508
527
 
509
528
  ---
510
529
 
511
530
  ## Configuration
512
531
 
513
- Generate a `gestalt.json` with IDE autocompletion support:
532
+ Generate a `gestalt.json` with IDE autocomplete support:
514
533
 
515
534
  ```bash
516
535
  npx @tienne/gestalt setup
@@ -536,23 +555,22 @@ npx @tienne/gestalt setup
536
555
 
537
556
  **Config priority** (highest → lowest): code overrides → shell env vars → `.env` → `gestalt.json` → built-in defaults
538
557
 
539
- ### Multi-Provider Configuration (LLM Tiers)
558
+ ### Multi-Provider LLM Tiers
540
559
 
541
- Gestalt supports routing LLM calls by task complexity across three tiers: **frugal**, **standard**, and **frontier**.
560
+ Route LLM calls by task complexity across three tiers:
542
561
 
543
562
  | Tier | Purpose | Example models |
544
563
  |------|---------|---------------|
545
564
  | **frugal** | Lightweight tasks — scoring, classification, short responses | `llama3.2`, `claude-haiku` |
546
565
  | **standard** | General tasks — interviews, spec generation, execution | `claude-sonnet-4-20250514` |
547
- | **frontier** | High-complexity reasoning — architecture, code review, evolution loop | `claude-opus-4-20250514` |
566
+ | **frontier** | High-complexity reasoning — architecture, code review, evolution | `claude-opus-4-20250514` |
548
567
 
549
- Mix providers freely. The example below uses Anthropic for standard/frontier and a local Ollama model for frugal tasks:
568
+ Mix providers freely. This example uses Anthropic for standard/frontier and a local Ollama model for frugal tasks:
550
569
 
551
570
  ```json
552
571
  {
553
572
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
554
573
  "llm": {
555
- "apiKey": "",
556
574
  "model": "claude-sonnet-4-20250514",
557
575
  "frugal": {
558
576
  "provider": "openai",
@@ -572,16 +590,14 @@ Mix providers freely. The example below uses Anthropic for standard/frontier and
572
590
  }
573
591
  ```
574
592
 
575
- > If no tiers are configured, all tiers fall back to the top-level `llm.apiKey` + `llm.model` with the Anthropic adapter — fully backward-compatible.
576
-
577
- Invalid values emit a warning and fall back to defaults.
593
+ If no tiers are configured, all tiers fall back to the top-level `llm.model` with the Anthropic adapter — fully backward-compatible.
578
594
 
579
595
  ### Environment Variables
580
596
 
581
- | Variable | Config Path | Default | Description |
597
+ | Variable | Config path | Default | Description |
582
598
  |----------|-------------|---------|-------------|
583
599
  | `ANTHROPIC_API_KEY` | `llm.apiKey` | `""` | Required only for CLI direct mode |
584
- | `GESTALT_MODEL` | `llm.model` | `claude-sonnet-4-20250514` | LLM model (provider-backed mode) |
600
+ | `GESTALT_MODEL` | `llm.model` | `claude-sonnet-4-20250514` | LLM model |
585
601
  | `GESTALT_RESOLUTION_THRESHOLD` | `interview.resolutionThreshold` | `0.8` | Interview completion threshold |
586
602
  | `GESTALT_MAX_ROUNDS` | `interview.maxRounds` | `10` | Max interview rounds |
587
603
  | `GESTALT_DRIFT_THRESHOLD` | `execute.driftThreshold` | `0.3` | Task drift detection threshold |
@@ -608,9 +624,6 @@ Invalid values emit a warning and fall back to defaults.
608
624
 
609
625
  ## Architecture
610
626
 
611
- ![Gestalt Architecture](./docs/architecture.png)
612
- _(Diagram coming soon.)_
613
-
614
627
  ```
615
628
  Claude Code (you)
616
629
 
@@ -620,7 +633,7 @@ Claude Code (you)
620
633
  │ │
621
634
  │ Interview Engine │
622
635
  │ ├─ GestaltPrincipleSelector │
623
- │ ├─ ResolutionScorer
636
+ │ ├─ ResolutionScorer
624
637
  │ ├─ SessionManager │
625
638
  │ └─ ContextCompressor │
626
639
  │ │
@@ -650,6 +663,13 @@ Claude Code (you)
650
663
  └──────────────────────────────────┘
651
664
  ```
652
665
 
666
+ **Further reading:**
667
+
668
+ - [MCP Reference](./docs/mcp-reference.md) — all tools, parameters, and action schemas
669
+ - [Getting Started](./docs/getting-started.md) — 5-minute walkthrough
670
+ - [Configuration Reference](./docs/configuration.md) — full config options
671
+ - [Code Knowledge Graph](./docs/code-graph.md) — static analysis and blast-radius
672
+
653
673
  ---
654
674
 
655
675
  ## License