@tienne/gestalt 0.5.0 → 0.6.0
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.backup.md +442 -0
- package/README.ko.md +466 -0
- package/README.md +315 -283
- package/dist/bin/gestalt.js +8 -0
- package/dist/bin/gestalt.js.map +1 -1
- package/dist/package.json +9 -3
- package/dist/review-agents/performance-reviewer/AGENT.md +31 -0
- package/dist/review-agents/quality-reviewer/AGENT.md +31 -0
- package/dist/review-agents/security-reviewer/AGENT.md +32 -0
- package/dist/role-agents/architect/AGENT.md +30 -0
- package/dist/role-agents/backend-developer/AGENT.md +30 -0
- package/dist/role-agents/designer/AGENT.md +30 -0
- package/dist/role-agents/devops-engineer/AGENT.md +30 -0
- package/dist/role-agents/frontend-developer/AGENT.md +30 -0
- package/dist/role-agents/product-planner/AGENT.md +30 -0
- package/dist/role-agents/qa-engineer/AGENT.md +30 -0
- package/dist/role-agents/researcher/AGENT.md +30 -0
- package/dist/role-agents/technical-writer/AGENT.md +212 -0
- package/dist/skills/agent/SKILL.md +102 -0
- package/dist/skills/execute/SKILL.md +274 -6
- package/dist/src/agent/role-agent-registry.d.ts +4 -2
- package/dist/src/agent/role-agent-registry.d.ts.map +1 -1
- package/dist/src/agent/role-agent-registry.js +12 -3
- package/dist/src/agent/role-agent-registry.js.map +1 -1
- package/dist/src/cli/commands/interview.d.ts +4 -1
- package/dist/src/cli/commands/interview.d.ts.map +1 -1
- package/dist/src/cli/commands/interview.js +55 -2
- package/dist/src/cli/commands/interview.js.map +1 -1
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +3 -2
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/core/config.d.ts +3 -0
- package/dist/src/core/config.d.ts.map +1 -1
- package/dist/src/core/config.js +4 -0
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/core/types.d.ts +28 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +12 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/agent-passthrough.d.ts +7 -0
- package/dist/src/mcp/tools/agent-passthrough.d.ts.map +1 -0
- package/dist/src/mcp/tools/agent-passthrough.js +49 -0
- package/dist/src/mcp/tools/agent-passthrough.js.map +1 -0
- package/dist/src/recording/filename-generator.d.ts +18 -0
- package/dist/src/recording/filename-generator.d.ts.map +1 -0
- package/dist/src/recording/filename-generator.js +60 -0
- package/dist/src/recording/filename-generator.js.map +1 -0
- package/dist/src/recording/gif-generator.d.ts +21 -0
- package/dist/src/recording/gif-generator.d.ts.map +1 -0
- package/dist/src/recording/gif-generator.js +121 -0
- package/dist/src/recording/gif-generator.js.map +1 -0
- package/dist/src/recording/recording-dir.d.ts +5 -0
- package/dist/src/recording/recording-dir.d.ts.map +1 -0
- package/dist/src/recording/recording-dir.js +13 -0
- package/dist/src/recording/recording-dir.js.map +1 -0
- package/dist/src/recording/resume-detector.d.ts +10 -0
- package/dist/src/recording/resume-detector.d.ts.map +1 -0
- package/dist/src/recording/resume-detector.js +14 -0
- package/dist/src/recording/resume-detector.js.map +1 -0
- package/dist/src/recording/segment-merger.d.ts +27 -0
- package/dist/src/recording/segment-merger.d.ts.map +1 -0
- package/dist/src/recording/segment-merger.js +65 -0
- package/dist/src/recording/segment-merger.js.map +1 -0
- package/dist/src/recording/terminal-recorder.d.ts +31 -0
- package/dist/src/recording/terminal-recorder.d.ts.map +1 -0
- package/dist/src/recording/terminal-recorder.js +111 -0
- package/dist/src/recording/terminal-recorder.js.map +1 -0
- package/package.json +9 -3
- package/review-agents/performance-reviewer/AGENT.md +31 -0
- package/review-agents/quality-reviewer/AGENT.md +31 -0
- package/review-agents/security-reviewer/AGENT.md +32 -0
- package/role-agents/architect/AGENT.md +30 -0
- package/role-agents/backend-developer/AGENT.md +30 -0
- package/role-agents/designer/AGENT.md +30 -0
- package/role-agents/devops-engineer/AGENT.md +30 -0
- package/role-agents/frontend-developer/AGENT.md +30 -0
- package/role-agents/product-planner/AGENT.md +30 -0
- package/role-agents/qa-engineer/AGENT.md +30 -0
- package/role-agents/researcher/AGENT.md +30 -0
- package/role-agents/technical-writer/AGENT.md +212 -0
- package/skills/agent/SKILL.md +102 -0
- package/skills/execute/SKILL.md +274 -6
package/README.md
CHANGED
|
@@ -3,334 +3,381 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>Gestalt
|
|
7
|
-
|
|
6
|
+
<strong>Gestalt — AI Development Harness</strong><br/>
|
|
7
|
+
Turn vague requirements into structured, executable plans — right inside Claude Code.
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
|
-
<a href="https://github.com/tienne/gestalt/actions/workflows/ci.yml"><img src="https://github.com/tienne/gestalt/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
12
11
|
<a href="https://www.npmjs.com/package/@tienne/gestalt"><img src="https://img.shields.io/npm/v/@tienne/gestalt" alt="npm version" /></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License" /></a>
|
|
13
|
+
<a href="https://github.com/tienne/gestalt/actions/workflows/ci.yml"><img src="https://github.com/tienne/gestalt/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="./README.ko.md">한국어</a>
|
|
13
18
|
</p>
|
|
14
19
|
|
|
15
20
|
---
|
|
16
21
|
|
|
17
|
-
##
|
|
22
|
+
## What is Gestalt?
|
|
18
23
|
|
|
19
|
-
|
|
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 — all without a separate API key.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
> **Prerequisites:** Node.js >= 20.0.0. Use `nvm install 22 && nvm use 22` if needed.
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
# 1. 마켓플레이스 등록 (최초 1회)
|
|
25
|
-
/plugin marketplace add tienne/gestalt
|
|
28
|
+
---
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
/plugin install gestalt@gestalt
|
|
29
|
-
```
|
|
30
|
+
## See it in action
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
> **30 seconds to a structured execution plan** — no API key needed.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| **Skills** | `/interview`, `/spec`, `/execute` (slash command) |
|
|
37
|
-
| **Agents** | 5개 Gestalt Agent + 8개 Role Agent |
|
|
38
|
-
| **CLAUDE.md** | 프로젝트 컨텍스트 및 MCP 사용 가이드 자동 주입 |
|
|
34
|
+
```bash
|
|
35
|
+
# Start a Gestalt-driven requirements interview
|
|
36
|
+
/interview "user authentication system"
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
# Once the interview is done, generate a structured Spec
|
|
39
|
+
/spec
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
/
|
|
44
|
-
/spec # 인터뷰 완료 후 Spec 생성
|
|
45
|
-
/execute # Spec 기반 실행 계획 수립 및 실행
|
|
41
|
+
# Transform the Spec into a validated execution plan and run it
|
|
42
|
+
/execute
|
|
46
43
|
```
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
_(Demo coming soon.)_
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
claude mcp add gestalt -- npx -y @tienne/gestalt
|
|
52
|
-
```
|
|
47
|
+
---
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
## Why Gestalt?
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
npx -y @tienne/gestalt
|
|
58
|
-
```
|
|
51
|
+
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.
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
Gestalt addresses this at the source. Before any code is written, it runs a structured interview guided by **Gestalt psychology principles** to reduce ambiguity to a measurable threshold (≤ 0.2). The result is a **Spec**: a validated JSON document that serves as the single source of truth for planning and execution.
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
npm install -g @tienne/gestalt
|
|
64
|
-
gestalt
|
|
65
|
-
```
|
|
55
|
+
### The Five Gestalt Principles
|
|
66
56
|
|
|
67
|
-
|
|
57
|
+
- **Closure** — Finds what's missing; fills in implicit requirements
|
|
58
|
+
- **Proximity** — Groups related features and tasks by domain
|
|
59
|
+
- **Similarity** — Identifies repeating patterns across requirements
|
|
60
|
+
- **Figure-Ground** — Separates MVP (figure) from nice-to-have (ground)
|
|
61
|
+
- **Continuity** — Validates dependency chains; detects contradictions
|
|
62
|
+
|
|
63
|
+
> "The whole is greater than the sum of its parts." — Aristotle
|
|
64
|
+
|
|
65
|
+
### How does Passthrough Mode work?
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
68
|
|
|
69
69
|
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
You (in Claude Code)
|
|
71
|
+
│
|
|
72
|
+
▼ /interview "topic"
|
|
73
|
+
Gestalt MCP Server
|
|
74
|
+
(returns context + prompts)
|
|
75
|
+
│
|
|
76
|
+
▼
|
|
77
|
+
Claude Code executes the prompts
|
|
78
|
+
(generates questions, scores, plans)
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
Gestalt MCP Server
|
|
82
|
+
(validates, stores state, advances)
|
|
83
|
+
│
|
|
84
|
+
▼ repeat until ambiguity ≤ 0.2
|
|
85
|
+
Final Spec → Execution Plan
|
|
75
86
|
```
|
|
76
87
|
|
|
77
|
-
|
|
88
|
+
`ANTHROPIC_API_KEY` is not required. All LLM work is handled by Claude Code.
|
|
78
89
|
|
|
79
|
-
|
|
90
|
+
---
|
|
80
91
|
|
|
81
|
-
|
|
82
|
-
- 5가지 Gestalt 원리 기반 동적 질문 선택 알고리즘
|
|
83
|
-
- 차원별 가중치 기반 모호성 점수 산출
|
|
84
|
-
- 모순 감지 시 Continuity 원리 자동 개입 + 페널티 부여
|
|
92
|
+
## Installation
|
|
85
93
|
|
|
86
|
-
###
|
|
94
|
+
### Option 1: Claude Code Plugin (Recommended)
|
|
87
95
|
|
|
88
|
-
|
|
96
|
+
Bundles the MCP server, slash-command skills, Gestalt agents, and project context — pre-configured in a single install.
|
|
89
97
|
|
|
98
|
+
```bash
|
|
99
|
+
# Step 1: Add to marketplace (one-time setup)
|
|
100
|
+
/plugin marketplace add tienne/gestalt
|
|
101
|
+
|
|
102
|
+
# Step 2: Install the plugin
|
|
103
|
+
/plugin install gestalt@gestalt
|
|
90
104
|
```
|
|
91
|
-
Call 1: specContext 요청 → systemPrompt + specPrompt + 전체 인터뷰 라운드 반환
|
|
92
|
-
Call 2: caller가 생성한 Spec JSON 제출 → Zod 검증 후 저장
|
|
93
|
-
```
|
|
94
105
|
|
|
95
|
-
|
|
106
|
+
What you get out of the box:
|
|
107
|
+
|
|
108
|
+
| Item | Details |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| **MCP Tools** | `ges_interview`, `ges_generate_spec`, `ges_execute`, `ges_create_agent`, `ges_agent`, `ges_status` |
|
|
111
|
+
| **Slash Commands** | `/interview`, `/spec`, `/execute`, `/agent` |
|
|
112
|
+
| **Agents** | 5 Gestalt pipeline agents + 9 Role agents + 3 Review agents |
|
|
113
|
+
| **CLAUDE.md** | Project context and MCP usage guide auto-injected |
|
|
114
|
+
|
|
115
|
+
> **Requires Node.js >= 20.0.0** — use [nvm](https://github.com/nvm-sh/nvm) if needed: `nvm install 22 && nvm use 22`
|
|
116
|
+
|
|
117
|
+
---
|
|
96
118
|
|
|
97
|
-
###
|
|
119
|
+
### Option 2: Claude Code Desktop
|
|
98
120
|
|
|
99
|
-
|
|
121
|
+
Open your Claude Code Desktop settings and add to `settings.json` (or `claude_desktop_config.json`):
|
|
100
122
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"mcpServers": {
|
|
126
|
+
"gestalt": {
|
|
127
|
+
"command": "npx",
|
|
128
|
+
"args": ["-y", "@tienne/gestalt"]
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
107
133
|
|
|
108
|
-
|
|
134
|
+
Restart Claude Code Desktop. The MCP tools become available immediately. Slash commands require the plugin or manual skills setup.
|
|
109
135
|
|
|
110
|
-
|
|
136
|
+
---
|
|
111
137
|
|
|
112
|
-
|
|
138
|
+
### Option 3: Claude Code CLI
|
|
113
139
|
|
|
114
|
-
|
|
140
|
+
```bash
|
|
141
|
+
# Via the claude CLI
|
|
142
|
+
claude mcp add gestalt -- npx -y @tienne/gestalt
|
|
143
|
+
```
|
|
115
144
|
|
|
116
|
-
|
|
117
|
-
- Jaccard 기반 키워드 유사도 측정
|
|
118
|
-
- Threshold(기본 0.3) 초과 시 `retrospectiveContext` 반환
|
|
145
|
+
Or edit `~/.claude/settings.json` directly:
|
|
119
146
|
|
|
120
|
-
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"mcpServers": {
|
|
150
|
+
"gestalt": {
|
|
151
|
+
"command": "npx",
|
|
152
|
+
"args": ["-y", "@tienne/gestalt"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
121
157
|
|
|
122
|
-
|
|
123
|
-
|:---:|---|---|---|
|
|
124
|
-
| 1 | **Structural** | lint → build → test 자동 검증 | Contextual 스킵 (short-circuit) |
|
|
125
|
-
| 2 | **Contextual** | LLM 기반 완료 조건(AC) 검증 + goalAlignment | Evolution Loop 진입 |
|
|
158
|
+
---
|
|
126
159
|
|
|
127
|
-
|
|
160
|
+
## Usage: Full Pipeline
|
|
128
161
|
|
|
129
|
-
###
|
|
162
|
+
### Step 1 — Interview
|
|
130
163
|
|
|
131
|
-
|
|
164
|
+
Start with any topic. A single rough sentence is enough.
|
|
132
165
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
evolve_fix → fixTasks 제출 → re-evaluate
|
|
166
|
+
```bash
|
|
167
|
+
/interview "I want to build a checkout flow with Stripe"
|
|
136
168
|
```
|
|
137
169
|
|
|
138
|
-
|
|
170
|
+
Gestalt conducts a multi-round interview. Each round targets a specific ambiguity dimension:
|
|
171
|
+
|
|
172
|
+
- **Closure** — What's missing? What did you assume but not say?
|
|
173
|
+
- **Proximity** — Which features belong together?
|
|
174
|
+
- **Similarity** — Are there repeating patterns across requirements?
|
|
175
|
+
- **Figure-Ground** — What's the core MVP vs. what's optional?
|
|
176
|
+
- **Continuity** — Any contradictions or conflicts?
|
|
177
|
+
|
|
178
|
+
The interview continues until the **ambiguity score reaches ≤ 0.2**:
|
|
179
|
+
|
|
139
180
|
```
|
|
140
|
-
|
|
181
|
+
Round 1 → ambiguity: 0.72 (lots of unknowns)
|
|
182
|
+
Round 4 → ambiguity: 0.45 (getting clearer)
|
|
183
|
+
Round 8 → ambiguity: 0.19 ✓ ready for Spec
|
|
141
184
|
```
|
|
142
185
|
|
|
143
|
-
|
|
186
|
+
---
|
|
144
187
|
|
|
145
|
-
|
|
188
|
+
### Step 2 — Spec Generation
|
|
146
189
|
|
|
147
|
-
|
|
190
|
+
When the ambiguity score reaches ≤ 0.2, run:
|
|
148
191
|
|
|
149
|
-
|
|
192
|
+
```bash
|
|
193
|
+
/spec
|
|
194
|
+
```
|
|
150
195
|
|
|
151
|
-
|
|
152
|
-
|---|---|
|
|
153
|
-
| `success` | score ≥ 0.85, goalAlignment ≥ 0.80 |
|
|
154
|
-
| `stagnation` | 2회 연속 delta < 0.05 |
|
|
155
|
-
| `oscillation` | 2회 연속 점수 진동 (up↔down) |
|
|
156
|
-
| `hard_cap` | structural 3회 + contextual 3회 실패 |
|
|
157
|
-
| `caller` | 사용자 수동 종료 |
|
|
158
|
-
| `human_escalation` | Lateral Thinking 4개 persona 모두 실패 |
|
|
196
|
+
Generates a structured **Spec** — a validated JSON document that drives the rest of the pipeline:
|
|
159
197
|
|
|
160
|
-
|
|
198
|
+
```
|
|
199
|
+
goal → Clear, unambiguous project objective
|
|
200
|
+
constraints → Technical and business constraints
|
|
201
|
+
acceptanceCriteria → Measurable, verifiable success conditions
|
|
202
|
+
ontologySchema → Entity-relationship model (entities + relations)
|
|
203
|
+
gestaltAnalysis → Key findings per Gestalt principle
|
|
204
|
+
```
|
|
161
205
|
|
|
162
|
-
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### Step 3 — Execute (Planning + Execution)
|
|
163
209
|
|
|
164
|
-
|
|
165
|
-
|-----------|----------------|
|
|
166
|
-
| **Closure** | Finds implicit requirements that aren't explicitly stated |
|
|
167
|
-
| **Proximity** | Groups related requirements and tasks by domain |
|
|
168
|
-
| **Continuation** | Validates dependency chains and execution order (DAG) |
|
|
169
|
-
| **Similarity** | Identifies repeating patterns across requirements |
|
|
170
|
-
| **Figure & Ground** | Separates core (figure) from supporting (ground) requirements |
|
|
210
|
+
Transforms the Spec into a dependency-aware execution plan and runs it:
|
|
171
211
|
|
|
172
|
-
|
|
212
|
+
```bash
|
|
213
|
+
/execute
|
|
214
|
+
```
|
|
173
215
|
|
|
174
|
-
|
|
216
|
+
**Planning phase** applies 4 Gestalt principles in a fixed sequence:
|
|
175
217
|
|
|
176
|
-
|
|
218
|
+
| Step | Principle | What it does |
|
|
219
|
+
|:---:|-----------|-------------|
|
|
220
|
+
| 1 | **Figure-Ground** | Classifies acceptance criteria (ACs) as critical (figure) vs. supplementary (ground) |
|
|
221
|
+
| 2 | **Closure** | Decomposes ACs into atomic tasks, including implicit ones |
|
|
222
|
+
| 3 | **Proximity** | Groups related tasks by domain into logical task groups |
|
|
223
|
+
| 4 | **Continuity** | Validates the dependency DAG — no cycles, clear topological order |
|
|
177
224
|
|
|
178
|
-
|
|
179
|
-
|--------------------|---------|----------|
|
|
180
|
-
| Spinning (hard cap) | **Multistability** | See from a different angle |
|
|
181
|
-
| Oscillation | **Simplicity** | Simplify and converge |
|
|
182
|
-
| No drift | **Reification** | Fill in missing pieces |
|
|
183
|
-
| Diminishing returns | **Invariance** | Replicate success patterns |
|
|
225
|
+
**Execution phase** runs tasks in topological order. After each task, **drift detection** checks alignment with the Spec:
|
|
184
226
|
|
|
185
|
-
|
|
227
|
+
- 3-dimensional score: Goal (50%) + Constraint (30%) + Ontology (20%)
|
|
228
|
+
- Jaccard similarity-based measurement
|
|
229
|
+
- Auto-triggers a retrospective when drift exceeds threshold
|
|
186
230
|
|
|
187
|
-
|
|
231
|
+
---
|
|
188
232
|
|
|
189
|
-
|
|
233
|
+
### Step 4 — Evaluate
|
|
190
234
|
|
|
191
|
-
|
|
192
|
-
|---|---|---|
|
|
193
|
-
| `architect` | system design, scalability | 시스템 아키텍처 전문가 |
|
|
194
|
-
| `backend-developer` | api, database, server | 백엔드 개발 전문가 |
|
|
195
|
-
| `frontend-developer` | ui, react, css, accessibility | 프론트엔드 개발 전문가 |
|
|
196
|
-
| `designer` | ux, ui, design system | UX/UI 디자인 전문가 |
|
|
197
|
-
| `devops-engineer` | ci/cd, infra, monitoring | DevOps/인프라 전문가 |
|
|
198
|
-
| `product-planner` | roadmap, user story, metrics | 제품 기획 전문가 |
|
|
199
|
-
| `qa-engineer` | testing, quality, automation | QA/테스트 전문가 |
|
|
200
|
-
| `researcher` | analysis, data, benchmarks | 리서치 및 분석 전문가 |
|
|
235
|
+
Execution triggers a 2-stage evaluation:
|
|
201
236
|
|
|
202
|
-
|
|
237
|
+
| Stage | Method | On failure |
|
|
238
|
+
|:---:|-------|-----------|
|
|
239
|
+
| 1 | **Structural** — runs lint → build → test | Short-circuits; skips Stage 2 |
|
|
240
|
+
| 2 | **Contextual** — LLM validates each AC + goal alignment | Enters Evolution Loop |
|
|
203
241
|
|
|
204
|
-
|
|
242
|
+
**Success condition:** `score ≥ 0.85` AND `goalAlignment ≥ 0.80`
|
|
205
243
|
|
|
206
|
-
|
|
207
|
-
2. **Role Consensus** — 선택된 Agent들의 관점을 수집하고, 충돌을 해소하여 통합 가이던스 생성
|
|
244
|
+
---
|
|
208
245
|
|
|
209
|
-
###
|
|
246
|
+
### Step 5 — Evolve
|
|
210
247
|
|
|
211
|
-
|
|
248
|
+
When evaluation fails, the Evolution Loop engages. Three recovery flows are available:
|
|
212
249
|
|
|
250
|
+
**Flow A — Structural Fix** (when lint/build/test fails)
|
|
251
|
+
```
|
|
252
|
+
evolve_fix → submit fix tasks → re-evaluate
|
|
213
253
|
```
|
|
214
|
-
# 1. 인터뷰 완료 후 agent creation context 요청
|
|
215
|
-
ges_create_agent({ action: "start", sessionId: "<id>" })
|
|
216
|
-
→ systemPrompt + creationPrompt + agentMdSchema 반환
|
|
217
254
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
→
|
|
255
|
+
**Flow B — Contextual Evolution** (when AC score is too low)
|
|
256
|
+
```
|
|
257
|
+
evolve → patch Spec (ACs/constraints) → re-execute impacted tasks → re-evaluate
|
|
221
258
|
```
|
|
222
259
|
|
|
223
|
-
|
|
260
|
+
Spec patch scope: ACs and constraints are freely editable; ontology can be extended; **goal is immutable**.
|
|
224
261
|
|
|
225
|
-
|
|
262
|
+
**Flow C — Lateral Thinking** (when stagnation is detected)
|
|
226
263
|
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
name: security-expert # 에이전트 이름 (kebab-case)
|
|
230
|
-
tier: standard # frugal | standard | frontier
|
|
231
|
-
pipeline: execute # interview | spec | execute | evaluate
|
|
232
|
-
role: true # Role Agent 필수
|
|
233
|
-
domain: ["oauth", "jwt"] # 도메인 키워드 목록
|
|
234
|
-
description: "보안 전문가" # 한줄 설명
|
|
235
|
-
---
|
|
264
|
+
Gestalt rotates through lateral thinking personas rather than terminating:
|
|
236
265
|
|
|
237
|
-
|
|
238
|
-
|
|
266
|
+
| Stagnation Pattern | Persona | Strategy |
|
|
267
|
+
|--------------------|---------|---------|
|
|
268
|
+
| Hard cap hit | **Multistability** | See from a different angle |
|
|
269
|
+
| Oscillating scores | **Simplicity** | Strip down and converge |
|
|
270
|
+
| No progress (no drift) | **Reification** | Fill in what's missing |
|
|
271
|
+
| Diminishing returns | **Invariance** | Replicate what worked |
|
|
239
272
|
|
|
240
|
-
|
|
273
|
+
When all 4 personas are exhausted, the session terminates with **Human Escalation** — a structured list of actionable suggestions for manual resolution.
|
|
241
274
|
|
|
242
|
-
|
|
275
|
+
**Termination conditions:**
|
|
243
276
|
|
|
244
|
-
|
|
|
245
|
-
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
277
|
+
| Condition | Trigger |
|
|
278
|
+
|-----------|---------|
|
|
279
|
+
| `success` | score ≥ 0.85 AND goalAlignment ≥ 0.80 |
|
|
280
|
+
| `stagnation` | 2 consecutive rounds with delta < 0.05 |
|
|
281
|
+
| `oscillation` | 2 consecutive score reversals |
|
|
282
|
+
| `hard_cap` | 3 structural + 3 contextual failures |
|
|
283
|
+
| `caller` | Manual termination |
|
|
284
|
+
| `human_escalation` | All 4 lateral personas exhausted |
|
|
251
285
|
|
|
252
|
-
|
|
286
|
+
---
|
|
253
287
|
|
|
254
|
-
|
|
288
|
+
### Step 6 — Code Review
|
|
255
289
|
|
|
256
|
-
|
|
257
|
-
|---|---|
|
|
258
|
-
| `interview` | 인터뷰 프로세스 — 4단계 (start → iterate → score → complete) |
|
|
259
|
-
| `spec` | Spec 생성 프로세스 — 2-Call Passthrough 패턴 |
|
|
260
|
-
| `execute` | 실행 계획 수립 — 4단계 Planning + Execution + Evaluation |
|
|
290
|
+
When evolution finishes, code review starts automatically:
|
|
261
291
|
|
|
262
|
-
|
|
292
|
+
```
|
|
293
|
+
review_start → agents submit perspectives → consensus → auto-fix
|
|
294
|
+
```
|
|
263
295
|
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
name: interview
|
|
267
|
-
version: "1.0.0"
|
|
268
|
-
description: "Gestalt-driven interview"
|
|
269
|
-
triggers: ["interview", "clarify requirements"]
|
|
270
|
-
inputs:
|
|
271
|
-
topic: { type: string, required: true }
|
|
272
|
-
outputs: [session, ambiguityScore]
|
|
273
|
-
---
|
|
296
|
+
9 built-in **Role Agents** provide multi-perspective review:
|
|
274
297
|
|
|
275
|
-
|
|
276
|
-
|
|
298
|
+
| Agent | Domain |
|
|
299
|
+
|-------|--------|
|
|
300
|
+
| `architect` | System design, scalability |
|
|
301
|
+
| `frontend-developer` | UI, React, accessibility |
|
|
302
|
+
| `backend-developer` | API, database, server |
|
|
303
|
+
| `devops-engineer` | CI/CD, infrastructure, monitoring |
|
|
304
|
+
| `qa-engineer` | Testing, quality, automation |
|
|
305
|
+
| `designer` | UX/UI, design systems |
|
|
306
|
+
| `product-planner` | Roadmap, user stories, metrics |
|
|
307
|
+
| `researcher` | Analysis, data, benchmarks |
|
|
308
|
+
| `technical-writer` | Documentation, API docs, guides, README |
|
|
277
309
|
|
|
278
|
-
|
|
310
|
+
3 built-in **Review Agents** run focused code analysis:
|
|
279
311
|
|
|
280
|
-
|
|
312
|
+
| Agent | Focus |
|
|
313
|
+
|-------|-------|
|
|
314
|
+
| `security-reviewer` | Injection, XSS, auth vulnerabilities, secrets |
|
|
315
|
+
| `performance-reviewer` | Memory leaks, N+1 queries, bundle size, async |
|
|
316
|
+
| `quality-reviewer` | Readability, SOLID, error handling, DRY |
|
|
281
317
|
|
|
282
|
-
|
|
318
|
+
Use any agent outside the pipeline with `/agent`:
|
|
283
319
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
| `standard` | Anthropic | claude-sonnet | 일반 태스크 (closure-completer, ground-mapper) |
|
|
288
|
-
| `frontier` | Anthropic | claude-opus | 고품질 판단 (continuity-judge) |
|
|
320
|
+
```bash
|
|
321
|
+
# List all available agents
|
|
322
|
+
/agent
|
|
289
323
|
|
|
290
|
-
|
|
324
|
+
# Run a specific agent on any task
|
|
325
|
+
/agent architect "review the module boundaries in this codebase"
|
|
326
|
+
/agent security-reviewer "check this authentication code for vulnerabilities"
|
|
327
|
+
/agent technical-writer "write a README for this module"
|
|
328
|
+
```
|
|
291
329
|
|
|
292
|
-
|
|
330
|
+
Generate custom Role Agents from interview results:
|
|
293
331
|
|
|
294
|
-
|
|
332
|
+
```
|
|
333
|
+
# Step 1: Get agent creation context
|
|
334
|
+
ges_create_agent → action: "start", sessionId: "<id>"
|
|
335
|
+
→ returns agentContext (systemPrompt, creationPrompt, schema)
|
|
295
336
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
- Agent 이벤트: role match/consensus, agent created
|
|
337
|
+
# Step 2: Submit the generated AGENT.md content
|
|
338
|
+
ges_create_agent → action: "submit", sessionId: "<id>", agentContent: "..."
|
|
339
|
+
→ creates agents/{name}/AGENT.md
|
|
340
|
+
```
|
|
301
341
|
|
|
302
|
-
|
|
342
|
+
---
|
|
303
343
|
|
|
304
|
-
|
|
344
|
+
### Alternative: CLI Direct Mode
|
|
345
|
+
|
|
346
|
+
Requires `ANTHROPIC_API_KEY`. Runs Gestalt directly from the terminal without Claude Code:
|
|
305
347
|
|
|
306
348
|
```bash
|
|
307
|
-
|
|
308
|
-
gestalt
|
|
309
|
-
gestalt interview "topic" # Interactive interview
|
|
310
|
-
gestalt spec <session-id> # Generate Spec from interview
|
|
311
|
-
gestalt status # List all sessions
|
|
312
|
-
gestalt setup # Generate gestalt.json config file
|
|
313
|
-
gestalt monitor # TUI dashboard (real-time session monitoring)
|
|
314
|
-
```
|
|
349
|
+
# Start an interactive interview
|
|
350
|
+
npx @tienne/gestalt interview "my topic"
|
|
315
351
|
|
|
316
|
-
|
|
352
|
+
# Generate Spec from a completed session
|
|
353
|
+
npx @tienne/gestalt spec <session-id>
|
|
317
354
|
|
|
318
|
-
|
|
355
|
+
# List all sessions
|
|
356
|
+
npx @tienne/gestalt status
|
|
319
357
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
358
|
+
# Generate gestalt.json config
|
|
359
|
+
npx @tienne/gestalt setup
|
|
360
|
+
|
|
361
|
+
# Start the MCP server manually
|
|
362
|
+
npx @tienne/gestalt serve
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
---
|
|
326
366
|
|
|
327
367
|
## Configuration
|
|
328
368
|
|
|
329
|
-
|
|
369
|
+
Generate a `gestalt.json` with IDE autocompletion support:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
npx @tienne/gestalt setup
|
|
373
|
+
```
|
|
330
374
|
|
|
331
375
|
```json
|
|
332
376
|
{
|
|
333
377
|
"$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
|
|
378
|
+
"llm": {
|
|
379
|
+
"model": "claude-sonnet-4-20250514"
|
|
380
|
+
},
|
|
334
381
|
"interview": {
|
|
335
382
|
"ambiguityThreshold": 0.2,
|
|
336
383
|
"maxRounds": 10
|
|
@@ -343,85 +390,70 @@ Run `gestalt setup` to generate a `gestalt.json` configuration file with IDE aut
|
|
|
343
390
|
}
|
|
344
391
|
```
|
|
345
392
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
1. Code overrides (`loadConfig(overrides)`)
|
|
349
|
-
2. Shell environment variables (`GESTALT_*`)
|
|
350
|
-
3. `.env` file
|
|
351
|
-
4. `gestalt.json`
|
|
352
|
-
5. Built-in defaults
|
|
393
|
+
**Config priority** (highest → lowest): code overrides → shell env vars → `.env` → `gestalt.json` → built-in defaults
|
|
353
394
|
|
|
354
|
-
Invalid values
|
|
395
|
+
Invalid values emit a warning and fall back to defaults.
|
|
355
396
|
|
|
356
397
|
### Environment Variables
|
|
357
398
|
|
|
358
|
-
| Variable | Config Path | Default |
|
|
359
|
-
|
|
360
|
-
| `ANTHROPIC_API_KEY` | `llm.apiKey` | `""` |
|
|
361
|
-
| `GESTALT_MODEL` | `llm.model` | `claude-sonnet-4-20250514` |
|
|
362
|
-
| `GESTALT_AMBIGUITY_THRESHOLD` | `interview.ambiguityThreshold` | `0.2` |
|
|
363
|
-
| `GESTALT_MAX_ROUNDS` | `interview.maxRounds` | `10` |
|
|
364
|
-
| `GESTALT_DRIFT_THRESHOLD` | `execute.driftThreshold` | `0.3` |
|
|
365
|
-
| `GESTALT_EVOLVE_SUCCESS_THRESHOLD` | `execute.successThreshold` | `0.85` |
|
|
366
|
-
| `GESTALT_EVOLVE_GOAL_ALIGNMENT_THRESHOLD` | `execute.goalAlignmentThreshold` | `0.80` |
|
|
367
|
-
| `GESTALT_DB_PATH` | `dbPath` | `~/.gestalt/events.db` |
|
|
368
|
-
| `GESTALT_SKILLS_DIR` | `skillsDir` | `skills` |
|
|
369
|
-
| `GESTALT_AGENTS_DIR` | `agentsDir` | `agents` |
|
|
370
|
-
| `GESTALT_LOG_LEVEL` | `logLevel` | `info` |
|
|
371
|
-
|
|
372
|
-
## Operating Modes
|
|
373
|
-
|
|
374
|
-
Gestalt supports two operating modes:
|
|
375
|
-
|
|
376
|
-
| Mode | API Key | LLM Calls | Use Case |
|
|
377
|
-
|---|---|---|---|
|
|
378
|
-
| **Passthrough** (default) | Not needed | Caller (e.g., Claude Code) | MCP 통합 환경에서 권장 |
|
|
379
|
-
| **Provider-backed** | `ANTHROPIC_API_KEY` 필요 | Gestalt가 직접 호출 | 독립 실행 (CLI 등) |
|
|
399
|
+
| Variable | Config Path | Default | Description |
|
|
400
|
+
|----------|-------------|---------|-------------|
|
|
401
|
+
| `ANTHROPIC_API_KEY` | `llm.apiKey` | `""` | Required only for CLI direct mode |
|
|
402
|
+
| `GESTALT_MODEL` | `llm.model` | `claude-sonnet-4-20250514` | LLM model (provider-backed mode) |
|
|
403
|
+
| `GESTALT_AMBIGUITY_THRESHOLD` | `interview.ambiguityThreshold` | `0.2` | Interview completion threshold |
|
|
404
|
+
| `GESTALT_MAX_ROUNDS` | `interview.maxRounds` | `10` | Max interview rounds |
|
|
405
|
+
| `GESTALT_DRIFT_THRESHOLD` | `execute.driftThreshold` | `0.3` | Task drift detection threshold |
|
|
406
|
+
| `GESTALT_EVOLVE_SUCCESS_THRESHOLD` | `execute.successThreshold` | `0.85` | Evolution success score |
|
|
407
|
+
| `GESTALT_EVOLVE_GOAL_ALIGNMENT_THRESHOLD` | `execute.goalAlignmentThreshold` | `0.80` | Goal alignment threshold |
|
|
408
|
+
| `GESTALT_DB_PATH` | `dbPath` | `~/.gestalt/events.db` | SQLite event store path |
|
|
409
|
+
| `GESTALT_SKILLS_DIR` | `skillsDir` | `skills` | Custom skills directory |
|
|
410
|
+
| `GESTALT_AGENTS_DIR` | `agentsDir` | `agents` | Custom agents directory |
|
|
411
|
+
| `GESTALT_LOG_LEVEL` | `logLevel` | `info` | Log level (`debug`/`info`/`warn`/`error`) |
|
|
380
412
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
Gestalt runs in passthrough mode by default: it returns prompts and context to the calling LLM (e.g., Claude Code) instead of making its own API calls. No `ANTHROPIC_API_KEY` needed.
|
|
384
|
-
|
|
385
|
-
### Provider-backed Mode
|
|
386
|
-
|
|
387
|
-
`ANTHROPIC_API_KEY`를 설정하면 Gestalt가 직접 LLM 호출을 수행한다. CLI 명령어(`gestalt interview`, `gestalt spec`)는 이 모드에서 동작한다.
|
|
413
|
+
---
|
|
388
414
|
|
|
389
|
-
|
|
415
|
+
## Architecture
|
|
390
416
|
|
|
391
|
-
|
|
417
|
+

|
|
418
|
+
_(Diagram coming soon.)_
|
|
392
419
|
|
|
393
420
|
```
|
|
394
|
-
|
|
395
|
-
|
|
421
|
+
Claude Code (you)
|
|
422
|
+
│
|
|
423
|
+
▼ MCP / stdio transport
|
|
424
|
+
┌──────────────────────────────────┐
|
|
425
|
+
│ Gestalt MCP Server │
|
|
426
|
+
│ │
|
|
427
|
+
│ Interview Engine │
|
|
428
|
+
│ ├─ GestaltPrincipleSelector │
|
|
429
|
+
│ ├─ AmbiguityScorer │
|
|
430
|
+
│ └─ SessionManager │
|
|
431
|
+
│ │
|
|
432
|
+
│ Spec Generator │
|
|
433
|
+
│ └─ PassthroughSpecGenerator │
|
|
434
|
+
│ │
|
|
435
|
+
│ Execute Engine │
|
|
436
|
+
│ ├─ DAG Validator │
|
|
437
|
+
│ ├─ DriftDetector │
|
|
438
|
+
│ ├─ EvaluationEngine │
|
|
439
|
+
│ └─ ExecuteSessionManager │
|
|
440
|
+
│ │
|
|
441
|
+
│ Resilience Engine │
|
|
442
|
+
│ ├─ StagnationDetector │
|
|
443
|
+
│ ├─ LateralThinkingPersonas │
|
|
444
|
+
│ └─ HumanEscalation │
|
|
445
|
+
│ │
|
|
446
|
+
│ Agent System │
|
|
447
|
+
│ ├─ RoleAgentRegistry │
|
|
448
|
+
│ ├─ RoleMatchEngine │
|
|
449
|
+
│ └─ RoleConsensusEngine │
|
|
450
|
+
│ │
|
|
451
|
+
│ EventStore (SQLite WAL) │
|
|
452
|
+
└──────────────────────────────────┘
|
|
396
453
|
```
|
|
397
454
|
|
|
398
|
-
|
|
399
|
-
|---|---|---|
|
|
400
|
-
| `ges_interview` | Multi-Call | start → (respond + score) × N → complete |
|
|
401
|
-
| `ges_generate_spec` | 2-Call | specContext 요청 → spec JSON 제출 |
|
|
402
|
-
| `ges_execute` | Multi-Call | plan (4-step) → execute → evaluate (2-stage) → evolve |
|
|
403
|
-
| `ges_create_agent` | 2-Call | agentContext 요청 → agentContent 제출 |
|
|
404
|
-
|
|
405
|
-
## Benchmarks
|
|
406
|
-
|
|
407
|
-
`pnpm bench`로 파이프라인 벤치마크를 실행할 수 있다. 3개의 시나리오가 Interview → Spec → Execute → Evaluate 전체 파이프라인을 통과한다.
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
pnpm bench # 전체 시나리오 실행
|
|
411
|
-
pnpm bench -s auth-system # 특정 시나리오만 실행
|
|
412
|
-
pnpm bench -o benchmarks/results # 결과 출력 디렉토리 지정
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
### Latest Results
|
|
416
|
-
|
|
417
|
-
| Scenario | Tasks | Completion | Score | Goal Alignment | ACs |
|
|
418
|
-
|----------|-------|------------|-------|----------------|-----|
|
|
419
|
-
| auth-system | 7 | 100% | 0.92 | 0.90 | 5/5 |
|
|
420
|
-
| dashboard | 6 | 100% | 0.88 | 0.85 | 4/4 |
|
|
421
|
-
| api-gateway | 8 | 100% | 0.95 | 0.92 | 5/5 |
|
|
422
|
-
|
|
423
|
-
**Average Score: 0.92 | Average Goal Alignment: 0.89**
|
|
455
|
+
---
|
|
424
456
|
|
|
425
457
|
## License
|
|
426
458
|
|
|
427
|
-
MIT
|
|
459
|
+
MIT © [tienne](https://github.com/tienne)
|