@tienne/gestalt 0.15.0 → 0.15.1

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.
package/README.ko.md CHANGED
@@ -77,7 +77,7 @@ Gestalt는 코드를 작성하기 전에 요구사항을 함께 구체화해줘
77
77
 
78
78
  ### Passthrough 모드는 어떻게 작동하나요?
79
79
 
80
- Gestalt는 **MCP 서버**로 실행돼요. Claude Code를 통해 사용할 경우 Claude Code가 LLM 역할을 담당해요 — Gestalt는 프롬프트와 컨텍스트를 반환하고, 실제 추론은 Claude Code가 수행해요. 서버 자체는 별도 API 호출을 하지 않아요.
80
+ Gestalt는 **MCP 서버**로 실행돼요. Claude Code를 통해 사용할 경우 Claude Code가 LLM 역할을 담당해요 — Gestalt는 프롬프트와 컨텍스트를 반환하고, 실제 추론은 Claude Code가 해요. 서버 자체는 별도 API 호출을 하지 않아요.
81
81
 
82
82
  ```
83
83
  Claude Code
@@ -116,7 +116,7 @@ Spec과 실행 결과는 레포 루트의 `.gestalt/memory.json`에 자동으로
116
116
  }
117
117
  ```
118
118
 
119
- - **커밋하세요** — `.gestalt/memory.json`은 일반 JSON 파일이에요. 커밋하면 팀원도 `git pull` 후 이전 결정 사항을 그대로 이어받을 수 있어요.
119
+ - **커밋하세요** — `.gestalt/memory.json`은 일반 JSON 파일이에요. 커밋해두면 팀원도 `git pull` 후 이전 결정 사항을 그대로 이어받을 수 있어요.
120
120
  - **컨텍스트 반영** — 다음 Spec을 생성할 때 이전 목표와 아키텍처 결정 사항이 프롬프트에 자동으로 반영돼요.
121
121
  - **User Profile** — 개인 설정은 `~/.gestalt/profile.json`에 저장돼요. git에는 올라가지 않아요.
122
122
 
@@ -126,7 +126,7 @@ Spec과 실행 결과는 레포 루트의 `.gestalt/memory.json`에 자동으로
126
126
 
127
127
  ### 옵션 1: Claude Code 플러그인 (권장)
128
128
 
129
- 설치 한 번에 MCP 서버, 슬래시 커맨드, Gestalt 에이전트, 프로젝트 컨텍스트를 모두 사용할 수 있어요.
129
+ 설치 한 번에 MCP 서버, 슬래시 커맨드, Gestalt 에이전트, 프로젝트 컨텍스트를 모두 수 있어요.
130
130
 
131
131
  **터미널에서:**
132
132
 
@@ -208,7 +208,7 @@ claude mcp add gestalt -- npx -y @tienne/gestalt
208
208
  /interview "Stripe로 결제 플로우를 만들고 싶어"
209
209
  ```
210
210
 
211
- 각 라운드는 모호한 부분을 집중해서 파악해요:
211
+ 각 라운드는 모호한 부분을 집중적으로 파악해요:
212
212
 
213
213
  - **Closure** — 빠진 요구사항과 말하지 않고 가정한 것을 찾아요
214
214
  - **Proximity** — 함께 묶여야 할 기능을 식별해요
@@ -226,7 +226,7 @@ claude mcp add gestalt -- npx -y @tienne/gestalt
226
226
 
227
227
  #### 인터뷰가 길어질 때 (Context Compression)
228
228
 
229
- 라운드가 5개를 초과하면 Gestalt가 자동으로 압축을 제안해요. `compress` action을 사용하면 이전 대화를 요약해 컨텍스트를 줄일 수 있어요:
229
+ 라운드가 5개를 초과하면 Gestalt가 자동으로 압축을 제안해요. `compress` action을 쓰면 이전 대화를 요약해 컨텍스트를 줄일 수 있어요:
230
230
 
231
231
  ```
232
232
  1. respond 응답에 needsCompression: true + compressionContext 포함
@@ -343,7 +343,7 @@ ges_execute({
343
343
 
344
344
  #### 실행 진행 패널
345
345
 
346
- `/execute` 실행 중 Claude Code Task 패널에 진행 상태가 실시간으로 표시돼요. Planning 단계부터 Evaluate까지 완료 태스크 수, 현재 태스크 이름, 실패 수, 병렬 그룹 구조가 자동으로 갱신돼요.
346
+ `/execute` 실행 중 Claude Code Task 패널에 진행 상태가 실시간으로 표시돼요. Planning 단계부터 Evaluate까지 완료 태스크 수, 현재 태스크 이름, 실패 수, 병렬 그룹 구조가 자동으로 갱신돼요.
347
347
 
348
348
  #### 하위 에이전트 생성 (Spawn)
349
349
 
@@ -390,7 +390,7 @@ evolve_fix → 수정 태스크 제출 → 재평가
390
390
  evolve → Spec 패치 (AC/constraints) → 영향받은 태스크 재실행 → 재평가
391
391
  ```
392
392
 
393
- Spec 패치 범위: AC와 constraints는 자유 수정; ontology는 추가/변경만; **goal은 변경 불가**.
393
+ Spec 패치 범위: AC와 constraints는 자유롭게 수정할 수 있어요. ontology는 추가/변경만 가능하고, **goal은 변경할 수 없어요**.
394
394
 
395
395
  **Flow C — Lateral Thinking** (답보 상태 감지 시)
396
396
 
@@ -403,7 +403,7 @@ Spec 패치 범위: AC와 constraints는 자유 수정; ontology는 추가/변
403
403
  | 진전 없음 (no drift) | **Reification** | 빠진 것 채우기 |
404
404
  | 효과 감소 | **Invariance** | 성공한 패턴 복제 |
405
405
 
406
- 4개 Persona를 모두 소진하면 세션이 **Human Escalation**으로 종료돼요. 직접 해결할 수 있도록 구체적인 제안도 함께 제공해요.
406
+ 4개 Persona를 모두 소진하면 세션이 **Human Escalation**으로 종료돼요. 직접 해결할 수 있도록 구체적인 제안도 함께 알려줘요.
407
407
 
408
408
  **종료 조건:**
409
409
 
@@ -448,7 +448,7 @@ review_start → 에이전트 관점 제출 → 합의 → 자동 수정
448
448
  | `performance-reviewer` | 메모리 누수, N+1 쿼리, 번들 크기, 비동기 |
449
449
  | `quality-reviewer` | 가독성, SOLID, 에러 핸들링, DRY |
450
450
 
451
- 파이프라인 밖에서도 `/agent`로 언제든 에이전트를 사용할 수 있어요:
451
+ 파이프라인 밖에서도 `/agent`로 언제든 에이전트를 수 있어요:
452
452
 
453
453
  ```bash
454
454
  # 사용 가능한 에이전트 목록 조회
@@ -460,7 +460,7 @@ review_start → 에이전트 관점 제출 → 합의 → 자동 수정
460
460
  /agent technical-writer "이 모듈의 README를 작성해줘"
461
461
  ```
462
462
 
463
- 인터뷰 결과에서 커스텀 Role 에이전트를 생성할 수도 있어요:
463
+ 인터뷰 결과에서 커스텀 Role 에이전트를 만들 수도 있어요:
464
464
 
465
465
  ```
466
466
  # 인터뷰 완료 후 커스텀 에이전트 생성
@@ -478,15 +478,12 @@ ges_create_agent → action: "submit", sessionId: "<id>", agentContent: "..."
478
478
 
479
479
  ### CLI 모드 (Claude Code 없이 사용하기)
480
480
 
481
- Claude Code 없이 터미널에서 바로 사용하고 싶다면 CLI 모드를 이용할 수 있어요. **`ANTHROPIC_API_KEY`가 필요해요.**
481
+ Claude Code 없이 터미널에서 바로 쓰고 싶다면 CLI 모드를 이용할 수 있어요. **`ANTHROPIC_API_KEY`가 필요해요.**
482
482
 
483
483
  ```bash
484
484
  # 인터랙티브 인터뷰 시작
485
485
  npx @tienne/gestalt interview "주제"
486
486
 
487
- # 터미널 세션을 GIF로 녹화
488
- npx @tienne/gestalt interview "주제" --record
489
-
490
487
  # 완료된 세션에서 Spec 생성
491
488
  npx @tienne/gestalt spec <session-id>
492
489
 
@@ -500,24 +497,6 @@ npx @tienne/gestalt setup
500
497
  npx @tienne/gestalt serve
501
498
  ```
502
499
 
503
- #### 인터뷰 세션 녹화
504
-
505
- `--record` (또는 `-r`) 플래그를 추가하면 터미널 세션을 GIF로 녹화할 수 있어요:
506
-
507
- ```bash
508
- npx @tienne/gestalt interview "주제" --record
509
- ```
510
-
511
- 인터뷰가 완료되면 현재 디렉토리에 GIF 파일이 생성돼요:
512
-
513
- ```
514
- user-auth-interview-20260327.gif
515
- ```
516
-
517
- 파일명은 LLM이 인터뷰 주제를 기반으로 kebab-case로 생성하고, `YYYYMMDD` 날짜를 붙여요. 외부 바이너리는 필요하지 않아요 — `gifencoder`와 `jimp` npm 패키지만 사용해요.
518
-
519
- **중단된 세션 이어 녹화:** 녹화 중 세션이 중단되더라도 걱정하지 않아도 돼요. 동일 세션을 다시 실행하면 `.frames` 파일을 자동으로 감지해 이어서 녹화해요. 임시 프레임 데이터는 `.gestalt/recordings/{sessionId}.frames`에 저장되고, GIF 생성이 완료되면 자동으로 삭제돼요.
520
-
521
500
  ---
522
501
 
523
502
  ## 설정
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,34 @@ 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
67
-
68
- > "The whole is greater than the sum of its parts." — Aristotle
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 |
69
94
 
70
- ### How does Passthrough Mode work?
95
+ ### Passthrough Mode
71
96
 
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.
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.
73
98
 
74
99
  ```
75
100
  You (in Claude Code)
76
101
 
77
- /interview "topic"
102
+ /interview "topic"
78
103
  Gestalt MCP Server
79
104
  (returns context + prompts)
80
105
 
@@ -86,32 +111,12 @@ You (in Claude Code)
86
111
  Gestalt MCP Server
87
112
  (validates, stores state, advances)
88
113
 
89
- repeat until resolution ≥ 0.8
114
+ repeat until resolution ≥ 0.8
90
115
  Final Spec → Execution Plan
91
116
  ```
92
117
 
93
118
  ---
94
119
 
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
120
  ## Installation
116
121
 
117
122
  ### Option 1: Claude Code Plugin (Recommended)
@@ -127,29 +132,24 @@ claude plugin install gestalt@gestalt
127
132
  **Inside a Claude Code session:**
128
133
 
129
134
  ```bash
130
- # Step 1: Add to marketplace (one-time setup)
131
135
  /plugin marketplace add tienne/gestalt
132
-
133
- # Step 2: Install the plugin
134
136
  /plugin install gestalt@gestalt
135
137
  ```
136
138
 
137
- What you get out of the box:
139
+ What you get:
138
140
 
139
141
  | Item | Details |
140
142
  |------|---------|
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` |
143
+ | **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
144
  | **Slash Commands** | `/interview`, `/spec`, `/execute`, `/agent` |
143
- | **Agents** | 5 Gestalt pipeline agents + 9 Role agents + 3 Review agents |
145
+ | **Agents** | 5 pipeline agents + 9 Role agents + 3 Review agents |
144
146
  | **CLAUDE.md** | Project context and MCP usage guide auto-injected |
145
147
 
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
148
  ---
149
149
 
150
150
  ### Option 2: Claude Code Desktop
151
151
 
152
- Open your Claude Code Desktop settings and add to `settings.json` (or `claude_desktop_config.json`):
152
+ Add this to your `settings.json` (or `claude_desktop_config.json`) and restart:
153
153
 
154
154
  ```json
155
155
  {
@@ -162,18 +162,17 @@ Open your Claude Code Desktop settings and add to `settings.json` (or `claude_de
162
162
  }
163
163
  ```
164
164
 
165
- Restart Claude Code Desktop. The MCP tools become available immediately. Slash commands require the plugin or manual skills setup.
165
+ MCP tools are available immediately after restart. Slash commands require the plugin or manual skills setup.
166
166
 
167
167
  ---
168
168
 
169
169
  ### Option 3: Claude Code CLI
170
170
 
171
171
  ```bash
172
- # Via the claude CLI
173
172
  claude mcp add gestalt -- npx -y @tienne/gestalt
174
173
  ```
175
174
 
176
- Or edit `~/.claude/settings.json` directly:
175
+ Or add directly to `~/.claude/settings.json`:
177
176
 
178
177
  ```json
179
178
  {
@@ -188,11 +187,11 @@ Or edit `~/.claude/settings.json` directly:
188
187
 
189
188
  ---
190
189
 
191
- ## Usage: Full Pipeline
190
+ ## The Pipeline
192
191
 
193
- ### Step 1 Interview
192
+ ### 1. Interview
194
193
 
195
- Start with any topic. A single rough sentence is enough.
194
+ Start with any topic. A rough sentence is enough.
196
195
 
197
196
  ```bash
198
197
  /interview "I want to build a checkout flow with Stripe"
@@ -206,7 +205,7 @@ Gestalt conducts a multi-round interview. Each round targets a specific resoluti
206
205
  - **Figure-Ground** — What's the core MVP vs. what's optional?
207
206
  - **Continuity** — Any contradictions or conflicts?
208
207
 
209
- The interview continues until the **resolution score reaches ≥ 0.8**:
208
+ The interview continues until the resolution score reaches ≥ 0.8:
210
209
 
211
210
  ```
212
211
  Round 1 → resolution: 0.28 (lots of unknowns)
@@ -214,9 +213,9 @@ Round 4 → resolution: 0.55 (getting clearer)
214
213
  Round 8 → resolution: 0.81 ✓ ready for Spec
215
214
  ```
216
215
 
217
- #### Long interviews: Context Compression
216
+ #### Context Compression
218
217
 
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:
218
+ 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
219
 
221
220
  ```
222
221
  1. respond returns needsCompression: true + compressionContext
@@ -228,114 +227,111 @@ The compressed summary is automatically injected into all subsequent rounds.
228
227
 
229
228
  ---
230
229
 
231
- ### Step 2 Spec Generation
230
+ ### 2. Spec Generation
232
231
 
233
- **Option A — From text (no interview required):**
232
+ **From a completed interview:**
234
233
 
235
234
  ```bash
236
- ges_generate_spec({ text: "Build a checkout flow with Stripe" })
235
+ /spec
237
236
  ```
238
237
 
239
- **Option A-2 With a built-in template:**
238
+ **From text (no interview required):**
239
+
240
+ ```bash
241
+ ges_generate_spec({ text: "Build a checkout flow with Stripe" })
242
+ ```
240
243
 
241
- Three starter templates pre-fill common constraints and acceptance criteria:
244
+ **With a built-in template:**
242
245
 
243
246
  | Template ID | Description |
244
247
  |-------------|-------------|
245
- | `rest-api` | REST API server with auth, CRUD, and OpenAPI |
248
+ | `rest-api` | REST API with auth, CRUD, and OpenAPI |
246
249
  | `react-dashboard` | React dashboard with charts, filters, and responsive layout |
247
- | `cli-tool` | CLI tool with subcommands, config, and distribution |
250
+ | `cli-tool` | CLI with subcommands, config file, and distribution |
248
251
 
249
252
  ```bash
250
253
  ges_generate_spec({ text: "API with JWT authentication", template: "rest-api" })
251
254
  ```
252
255
 
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:
256
+ The generated Spec includes:
260
257
 
261
258
  ```
262
259
  goal → Clear, precise project objective
263
260
  constraints → Technical and business constraints
264
261
  acceptanceCriteria → Measurable, verifiable success conditions
265
- ontologySchema → Entity-relationship model (entities + relations)
262
+ ontologySchema → Entity-relationship model
266
263
  gestaltAnalysis → Key findings per Gestalt principle
267
264
  ```
268
265
 
269
266
  ---
270
267
 
271
- ### Step 3 Execute (Planning + Execution)
268
+ ### 3. Execute
272
269
 
273
- Transforms the Spec into a dependency-aware execution plan and runs it:
270
+ Transform the Spec into a dependency-aware execution plan and run it:
274
271
 
275
272
  ```bash
276
273
  /execute
277
274
  ```
278
275
 
279
- **Planning phase** applies 4 Gestalt principles in a fixed sequence:
276
+ **Planning** applies four Gestalt principles in a fixed sequence:
280
277
 
281
278
  | Step | Principle | What it does |
282
279
  |:---:|-----------|-------------|
283
- | 1 | **Figure-Ground** | Classifies acceptance criteria (ACs) as critical (figure) vs. supplementary (ground) |
280
+ | 1 | **Figure-Ground** | Classifies acceptance criteria as critical vs. supplementary |
284
281
  | 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 |
282
+ | 3 | **Proximity** | Groups related tasks by domain |
283
+ | 4 | **Continuity** | Validates the dependency DAG — no cycles, topological order confirmed |
287
284
 
288
- **Execution phase** runs tasks in topological order. After each task, **drift detection** checks alignment with the Spec:
285
+ **Execution** runs tasks in topological order. After each task, drift detection checks alignment with the Spec:
289
286
 
290
287
  - 3-dimensional score: Goal (50%) + Constraint (30%) + Ontology (20%)
291
- - Jaccard similarity-based measurement
292
- - Auto-triggers a retrospective when drift exceeds threshold
288
+ - Jaccard similarity measurement
289
+ - Auto-triggers a retrospective when drift exceeds the threshold
293
290
 
294
- #### Parallel execution groups
291
+ #### Parallel Execution
295
292
 
296
- The `plan_complete` response includes `parallelGroups: string[][]`. Tasks with no mutual dependencies land in the same group and can be executed concurrently:
293
+ The `plan_complete` response includes `parallelGroups: string[][]`. Tasks with no mutual dependencies are placed in the same group and can run concurrently:
297
294
 
298
295
  ```json
299
296
  "parallelGroups": [
300
- ["setup-db", "setup-env"], // run in parallel
301
- ["create-schema"], // after group above
302
- ["seed-data", "run-tests"] // run in parallel
297
+ ["setup-db", "setup-env"],
298
+ ["create-schema"],
299
+ ["seed-data", "run-tests"]
303
300
  ]
304
301
  ```
305
302
 
306
- #### Resuming an interrupted execution
307
-
308
- Pick up where you left off when a session is interrupted:
303
+ #### Resuming an Interrupted Session
309
304
 
310
305
  ```bash
311
306
  ges_execute({ action: "resume", sessionId: "<id>" })
312
307
  ```
313
308
 
314
- Returns `ResumeContext`: completed task IDs, next task, and `progressPercent`. The `ges_status` response also includes `resumeContext` automatically for any executing session.
309
+ Returns `ResumeContext`: completed task IDs, next task, and `progressPercent`. The `ges_status` response also includes `resumeContext` automatically for any active session.
315
310
 
316
- #### Brownfield audit
311
+ #### Brownfield Audit
317
312
 
318
- When a codebase already exists, audit it against the Spec before executing new tasks:
313
+ When a codebase already exists, audit it against the Spec before running new tasks:
319
314
 
320
315
  ```bash
321
316
  # Step 1: request audit context
322
317
  ges_execute({ action: "audit", sessionId: "<id>" })
323
- → auditContext (systemPrompt, auditPrompt)
318
+ # returns auditContext (systemPrompt, auditPrompt)
324
319
 
325
320
  # Step 2: submit codebase snapshot + audit result
326
321
  ges_execute({
327
322
  action: "audit",
328
323
  sessionId: "<id>",
329
324
  codebaseSnapshot: "...",
330
- auditResult: { implementedACs: [0,2], partialACs: [1], missingACs: [3], gapAnalysis: "..." }
325
+ auditResult: {
326
+ implementedACs: [0, 2],
327
+ partialACs: [1],
328
+ missingACs: [3],
329
+ gapAnalysis: "..."
330
+ }
331
331
  })
332
332
  ```
333
333
 
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
334
+ #### Sub-Agent Spawning
339
335
 
340
336
  Decompose a complex task into sub-tasks dynamically during execution:
341
337
 
@@ -351,31 +347,37 @@ ges_execute({
351
347
  })
352
348
  ```
353
349
 
350
+ #### Real-Time Progress Panel
351
+
352
+ 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.
353
+
354
354
  ---
355
355
 
356
- ### Step 4 Evaluate
356
+ ### 4. Evaluate
357
357
 
358
- Execution triggers a 2-stage evaluation:
358
+ Execution triggers a two-stage evaluation automatically:
359
359
 
360
360
  | Stage | Method | On failure |
361
361
  |:---:|-------|-----------|
362
- | 1 | **Structural** — runs lint → build → test | Short-circuits; skips Stage 2 |
363
- | 2 | **Contextual** — LLM validates each AC + goal alignment | Enters Evolution Loop |
362
+ | 1 | **Structural** — runs lint → build → test | Short-circuits; Stage 2 is skipped |
363
+ | 2 | **Contextual** — LLM validates each AC and goal alignment | Enters the Evolution Loop |
364
364
 
365
365
  **Success condition:** `score ≥ 0.85` AND `goalAlignment ≥ 0.80`
366
366
 
367
367
  ---
368
368
 
369
- ### Step 5 Evolve
369
+ ### 5. Evolve
370
370
 
371
371
  When evaluation fails, the Evolution Loop engages. Three recovery flows are available:
372
372
 
373
373
  **Flow A — Structural Fix** (when lint/build/test fails)
374
+
374
375
  ```
375
376
  evolve_fix → submit fix tasks → re-evaluate
376
377
  ```
377
378
 
378
379
  **Flow B — Contextual Evolution** (when AC score is too low)
380
+
379
381
  ```
380
382
  evolve → patch Spec (ACs/constraints) → re-execute impacted tasks → re-evaluate
381
383
  ```
@@ -388,12 +390,12 @@ Gestalt rotates through lateral thinking personas rather than terminating:
388
390
 
389
391
  | Stagnation Pattern | Persona | Strategy |
390
392
  |--------------------|---------|---------|
391
- | Hard cap hit | **Multistability** | See from a different angle |
393
+ | Hard cap hit | **Multistability** | View from a different angle |
392
394
  | Oscillating scores | **Simplicity** | Strip down and converge |
393
395
  | No progress (no drift) | **Reification** | Fill in what's missing |
394
396
  | Diminishing returns | **Invariance** | Replicate what worked |
395
397
 
396
- When all 4 personas are exhausted, the session terminates with **Human Escalation** — a structured list of actionable suggestions for manual resolution.
398
+ When all four personas are exhausted, the session ends with **Human Escalation** — a structured list of actionable suggestions for manual resolution.
397
399
 
398
400
  **Termination conditions:**
399
401
 
@@ -408,7 +410,7 @@ When all 4 personas are exhausted, the session terminates with **Human Escalatio
408
410
 
409
411
  ---
410
412
 
411
- ### Step 6 Code Review
413
+ ### 6. Code Review
412
414
 
413
415
  When evolution finishes, code review starts automatically:
414
416
 
@@ -416,7 +418,27 @@ When evolution finishes, code review starts automatically:
416
418
  review_start → agents submit perspectives → consensus → auto-fix
417
419
  ```
418
420
 
419
- 9 built-in **Role Agents** provide multi-perspective review:
421
+ See [Agents](#agents) for the full list of built-in reviewers.
422
+
423
+ ---
424
+
425
+ ## Agents
426
+
427
+ Use any agent directly, outside the pipeline:
428
+
429
+ ```bash
430
+ # List all available agents
431
+ /agent
432
+
433
+ # Run a specific agent on any task
434
+ /agent architect "review the module boundaries in this codebase"
435
+ /agent security-reviewer "check this authentication code for vulnerabilities"
436
+ /agent technical-writer "write a README for this module"
437
+ ```
438
+
439
+ ### Role Agents
440
+
441
+ Nine built-in role agents provide multi-perspective review:
420
442
 
421
443
  | Agent | Domain |
422
444
  |-------|--------|
@@ -430,7 +452,9 @@ review_start → agents submit perspectives → consensus → auto-fix
430
452
  | `researcher` | Analysis, data, benchmarks |
431
453
  | `technical-writer` | Documentation, API docs, guides, README |
432
454
 
433
- 3 built-in **Review Agents** run focused code analysis:
455
+ ### Review Agents
456
+
457
+ Three built-in review agents run focused code analysis:
434
458
 
435
459
  | Agent | Focus |
436
460
  |-------|-------|
@@ -438,44 +462,31 @@ review_start → agents submit perspectives → consensus → auto-fix
438
462
  | `performance-reviewer` | Memory leaks, N+1 queries, bundle size, async |
439
463
  | `quality-reviewer` | Readability, SOLID, error handling, DRY |
440
464
 
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
- ```
465
+ ### Custom Agents
452
466
 
453
- Generate custom Role Agents from interview results:
467
+ Generate a custom Role Agent from interview results:
454
468
 
455
- ```
456
- # Step 1: Get agent creation context
457
- ges_create_agentaction: "start", sessionId: "<id>"
458
- returns agentContext (systemPrompt, creationPrompt, schema)
469
+ ```bash
470
+ # Step 1: get agent creation context
471
+ ges_create_agent({ action: "start", sessionId: "<id>" })
472
+ # returns agentContext (systemPrompt, creationPrompt, schema)
459
473
 
460
- # Step 2: Submit the generated AGENT.md content
461
- ges_create_agentaction: "submit", sessionId: "<id>", agentContent: "..."
462
- creates agents/{name}/AGENT.md
474
+ # Step 2: submit the generated AGENT.md content
475
+ ges_create_agent({ action: "submit", sessionId: "<id>", agentContent: "..." })
476
+ # creates agents/{name}/AGENT.md
463
477
  ```
464
478
 
465
479
  ---
466
480
 
467
- ### CLI Mode (without Claude Code)
481
+ ## CLI Mode
468
482
 
469
- Want to run Gestalt without Claude Code? CLI mode runs interviews directly in your terminal. **Requires `ANTHROPIC_API_KEY`.**
483
+ Run Gestalt without Claude Code. **Requires `ANTHROPIC_API_KEY`.**
470
484
 
471
485
  ```bash
472
486
  # Start an interactive interview
473
487
  npx @tienne/gestalt interview "my topic"
474
488
 
475
- # Record the session as a GIF
476
- npx @tienne/gestalt interview "my topic" --record
477
-
478
- # Generate Spec from a completed session
489
+ # Generate a Spec from a completed session
479
490
  npx @tienne/gestalt spec <session-id>
480
491
 
481
492
  # List all sessions
@@ -488,29 +499,33 @@ npx @tienne/gestalt setup
488
499
  npx @tienne/gestalt serve
489
500
  ```
490
501
 
491
- #### Recording an interview session
492
-
493
- Add `--record` (or `-r`) to capture the terminal session as a GIF:
502
+ ---
494
503
 
495
- ```bash
496
- npx @tienne/gestalt interview "my topic" --record
497
- ```
504
+ ## Project Memory
498
505
 
499
- When the interview completes, a GIF is written to the current directory:
506
+ Every spec and execution result is automatically recorded in `.gestalt/memory.json` at your repo root.
500
507
 
508
+ ```json
509
+ {
510
+ "specHistory": [
511
+ { "specId": "...", "goal": "Build a user auth system", "sourceType": "text" }
512
+ ],
513
+ "executionHistory": [],
514
+ "architectureDecisions": []
515
+ }
501
516
  ```
502
- user-auth-interview-20260327.gif
503
- ```
504
517
 
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.
518
+ **Commit it.** `.gestalt/memory.json` is plain JSON. Teammates inherit all prior decisions on `git pull`.
519
+
520
+ **Context injection.** Prior goals and architecture decisions are automatically injected into the next spec prompt.
506
521
 
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.
522
+ **User profile.** Personal preferences are stored in `~/.gestalt/profile.json` and are never committed.
508
523
 
509
524
  ---
510
525
 
511
526
  ## Configuration
512
527
 
513
- Generate a `gestalt.json` with IDE autocompletion support:
528
+ Generate a `gestalt.json` with IDE autocomplete support:
514
529
 
515
530
  ```bash
516
531
  npx @tienne/gestalt setup
@@ -536,23 +551,22 @@ npx @tienne/gestalt setup
536
551
 
537
552
  **Config priority** (highest → lowest): code overrides → shell env vars → `.env` → `gestalt.json` → built-in defaults
538
553
 
539
- ### Multi-Provider Configuration (LLM Tiers)
554
+ ### Multi-Provider LLM Tiers
540
555
 
541
- Gestalt supports routing LLM calls by task complexity across three tiers: **frugal**, **standard**, and **frontier**.
556
+ Route LLM calls by task complexity across three tiers:
542
557
 
543
558
  | Tier | Purpose | Example models |
544
559
  |------|---------|---------------|
545
560
  | **frugal** | Lightweight tasks — scoring, classification, short responses | `llama3.2`, `claude-haiku` |
546
561
  | **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` |
562
+ | **frontier** | High-complexity reasoning — architecture, code review, evolution | `claude-opus-4-20250514` |
548
563
 
549
- Mix providers freely. The example below uses Anthropic for standard/frontier and a local Ollama model for frugal tasks:
564
+ Mix providers freely. This example uses Anthropic for standard/frontier and a local Ollama model for frugal tasks:
550
565
 
551
566
  ```json
552
567
  {
553
568
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
554
569
  "llm": {
555
- "apiKey": "",
556
570
  "model": "claude-sonnet-4-20250514",
557
571
  "frugal": {
558
572
  "provider": "openai",
@@ -572,16 +586,14 @@ Mix providers freely. The example below uses Anthropic for standard/frontier and
572
586
  }
573
587
  ```
574
588
 
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.
589
+ If no tiers are configured, all tiers fall back to the top-level `llm.model` with the Anthropic adapter — fully backward-compatible.
578
590
 
579
591
  ### Environment Variables
580
592
 
581
- | Variable | Config Path | Default | Description |
593
+ | Variable | Config path | Default | Description |
582
594
  |----------|-------------|---------|-------------|
583
595
  | `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) |
596
+ | `GESTALT_MODEL` | `llm.model` | `claude-sonnet-4-20250514` | LLM model |
585
597
  | `GESTALT_RESOLUTION_THRESHOLD` | `interview.resolutionThreshold` | `0.8` | Interview completion threshold |
586
598
  | `GESTALT_MAX_ROUNDS` | `interview.maxRounds` | `10` | Max interview rounds |
587
599
  | `GESTALT_DRIFT_THRESHOLD` | `execute.driftThreshold` | `0.3` | Task drift detection threshold |
@@ -608,9 +620,6 @@ Invalid values emit a warning and fall back to defaults.
608
620
 
609
621
  ## Architecture
610
622
 
611
- ![Gestalt Architecture](./docs/architecture.png)
612
- _(Diagram coming soon.)_
613
-
614
623
  ```
615
624
  Claude Code (you)
616
625
 
@@ -620,7 +629,7 @@ Claude Code (you)
620
629
  │ │
621
630
  │ Interview Engine │
622
631
  │ ├─ GestaltPrincipleSelector │
623
- │ ├─ ResolutionScorer
632
+ │ ├─ ResolutionScorer
624
633
  │ ├─ SessionManager │
625
634
  │ └─ ContextCompressor │
626
635
  │ │
@@ -650,6 +659,13 @@ Claude Code (you)
650
659
  └──────────────────────────────────┘
651
660
  ```
652
661
 
662
+ **Further reading:**
663
+
664
+ - [MCP Reference](./docs/mcp-reference.md) — all tools, parameters, and action schemas
665
+ - [Getting Started](./docs/getting-started.md) — 5-minute walkthrough
666
+ - [Configuration Reference](./docs/configuration.md) — full config options
667
+ - [Code Knowledge Graph](./docs/code-graph.md) — static analysis and blast-radius
668
+
653
669
  ---
654
670
 
655
671
  ## License
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tienne/gestalt",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "TypeScript AI Development Harness - Gestalt psychology-driven requirement clarification",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tienne/gestalt",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "TypeScript AI Development Harness - Gestalt psychology-driven requirement clarification",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",