@tienne/gestalt 0.9.0 → 0.9.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 (136) hide show
  1. package/CLAUDE.md +78 -1
  2. package/dist/package.json +3 -1
  3. package/dist/schemas/gestalt.schema.json +5 -0
  4. package/dist/skills/blast-radius/SKILL.md +134 -0
  5. package/dist/skills/build-graph/SKILL.md +100 -0
  6. package/dist/skills/diff-radius/SKILL.md +125 -0
  7. package/dist/skills/execute/SKILL.md +90 -8
  8. package/dist/skills/interview/SKILL.md +5 -4
  9. package/dist/skills/spec/SKILL.md +7 -1
  10. package/dist/src/cli/commands/init.d.ts +5 -0
  11. package/dist/src/cli/commands/init.d.ts.map +1 -0
  12. package/dist/src/cli/commands/init.js +79 -0
  13. package/dist/src/cli/commands/init.js.map +1 -0
  14. package/dist/src/cli/commands/setup.d.ts.map +1 -1
  15. package/dist/src/cli/commands/setup.js +1 -0
  16. package/dist/src/cli/commands/setup.js.map +1 -1
  17. package/dist/src/cli/index.d.ts.map +1 -1
  18. package/dist/src/cli/index.js +9 -0
  19. package/dist/src/cli/index.js.map +1 -1
  20. package/dist/src/code-graph/blast-radius.d.ts +9 -0
  21. package/dist/src/code-graph/blast-radius.d.ts.map +1 -0
  22. package/dist/src/code-graph/blast-radius.js +139 -0
  23. package/dist/src/code-graph/blast-radius.js.map +1 -0
  24. package/dist/src/code-graph/engine.d.ts +46 -0
  25. package/dist/src/code-graph/engine.d.ts.map +1 -0
  26. package/dist/src/code-graph/engine.js +301 -0
  27. package/dist/src/code-graph/engine.js.map +1 -0
  28. package/dist/src/code-graph/git-hook.d.ts +22 -0
  29. package/dist/src/code-graph/git-hook.d.ts.map +1 -0
  30. package/dist/src/code-graph/git-hook.js +100 -0
  31. package/dist/src/code-graph/git-hook.js.map +1 -0
  32. package/dist/src/code-graph/index.d.ts +7 -0
  33. package/dist/src/code-graph/index.d.ts.map +1 -0
  34. package/dist/src/code-graph/index.js +6 -0
  35. package/dist/src/code-graph/index.js.map +1 -0
  36. package/dist/src/code-graph/plugins/go.d.ts +3 -0
  37. package/dist/src/code-graph/plugins/go.d.ts.map +1 -0
  38. package/dist/src/code-graph/plugins/go.js +126 -0
  39. package/dist/src/code-graph/plugins/go.js.map +1 -0
  40. package/dist/src/code-graph/plugins/index.d.ts +16 -0
  41. package/dist/src/code-graph/plugins/index.d.ts.map +1 -0
  42. package/dist/src/code-graph/plugins/index.js +36 -0
  43. package/dist/src/code-graph/plugins/index.js.map +1 -0
  44. package/dist/src/code-graph/plugins/java.d.ts +3 -0
  45. package/dist/src/code-graph/plugins/java.d.ts.map +1 -0
  46. package/dist/src/code-graph/plugins/java.js +108 -0
  47. package/dist/src/code-graph/plugins/java.js.map +1 -0
  48. package/dist/src/code-graph/plugins/kotlin.d.ts +3 -0
  49. package/dist/src/code-graph/plugins/kotlin.d.ts.map +1 -0
  50. package/dist/src/code-graph/plugins/kotlin.js +94 -0
  51. package/dist/src/code-graph/plugins/kotlin.js.map +1 -0
  52. package/dist/src/code-graph/plugins/objc.d.ts +3 -0
  53. package/dist/src/code-graph/plugins/objc.d.ts.map +1 -0
  54. package/dist/src/code-graph/plugins/objc.js +129 -0
  55. package/dist/src/code-graph/plugins/objc.js.map +1 -0
  56. package/dist/src/code-graph/plugins/python.d.ts +3 -0
  57. package/dist/src/code-graph/plugins/python.d.ts.map +1 -0
  58. package/dist/src/code-graph/plugins/python.js +116 -0
  59. package/dist/src/code-graph/plugins/python.js.map +1 -0
  60. package/dist/src/code-graph/plugins/rust.d.ts +3 -0
  61. package/dist/src/code-graph/plugins/rust.d.ts.map +1 -0
  62. package/dist/src/code-graph/plugins/rust.js +108 -0
  63. package/dist/src/code-graph/plugins/rust.js.map +1 -0
  64. package/dist/src/code-graph/plugins/swift.d.ts +3 -0
  65. package/dist/src/code-graph/plugins/swift.d.ts.map +1 -0
  66. package/dist/src/code-graph/plugins/swift.js +106 -0
  67. package/dist/src/code-graph/plugins/swift.js.map +1 -0
  68. package/dist/src/code-graph/plugins/typescript.d.ts +3 -0
  69. package/dist/src/code-graph/plugins/typescript.d.ts.map +1 -0
  70. package/dist/src/code-graph/plugins/typescript.js +209 -0
  71. package/dist/src/code-graph/plugins/typescript.js.map +1 -0
  72. package/dist/src/code-graph/storage.d.ts +18 -0
  73. package/dist/src/code-graph/storage.d.ts.map +1 -0
  74. package/dist/src/code-graph/storage.js +175 -0
  75. package/dist/src/code-graph/storage.js.map +1 -0
  76. package/dist/src/code-graph/types.d.ts +93 -0
  77. package/dist/src/code-graph/types.d.ts.map +1 -0
  78. package/dist/src/code-graph/types.js +17 -0
  79. package/dist/src/code-graph/types.js.map +1 -0
  80. package/dist/src/core/config.d.ts +4 -0
  81. package/dist/src/core/config.d.ts.map +1 -1
  82. package/dist/src/core/config.js +6 -1
  83. package/dist/src/core/config.js.map +1 -1
  84. package/dist/src/core/types.d.ts +1 -0
  85. package/dist/src/core/types.d.ts.map +1 -1
  86. package/dist/src/execute/passthrough-engine.d.ts +4 -1
  87. package/dist/src/execute/passthrough-engine.d.ts.map +1 -1
  88. package/dist/src/execute/passthrough-engine.js +54 -4
  89. package/dist/src/execute/passthrough-engine.js.map +1 -1
  90. package/dist/src/execute/prompts.d.ts +2 -2
  91. package/dist/src/execute/prompts.d.ts.map +1 -1
  92. package/dist/src/execute/prompts.js +7 -3
  93. package/dist/src/execute/prompts.js.map +1 -1
  94. package/dist/src/execute/repository.d.ts.map +1 -1
  95. package/dist/src/execute/repository.js +1 -0
  96. package/dist/src/execute/repository.js.map +1 -1
  97. package/dist/src/execute/session.d.ts +3 -1
  98. package/dist/src/execute/session.d.ts.map +1 -1
  99. package/dist/src/execute/session.js +3 -1
  100. package/dist/src/execute/session.js.map +1 -1
  101. package/dist/src/mcp/schemas.d.ts +46 -0
  102. package/dist/src/mcp/schemas.d.ts.map +1 -1
  103. package/dist/src/mcp/schemas.js +23 -0
  104. package/dist/src/mcp/schemas.js.map +1 -1
  105. package/dist/src/mcp/server.d.ts.map +1 -1
  106. package/dist/src/mcp/server.js +21 -1
  107. package/dist/src/mcp/server.js.map +1 -1
  108. package/dist/src/mcp/tools/code-graph-passthrough.d.ts +16 -0
  109. package/dist/src/mcp/tools/code-graph-passthrough.d.ts.map +1 -0
  110. package/dist/src/mcp/tools/code-graph-passthrough.js +65 -0
  111. package/dist/src/mcp/tools/code-graph-passthrough.js.map +1 -0
  112. package/dist/src/mcp/tools/execute-passthrough.d.ts.map +1 -1
  113. package/dist/src/mcp/tools/execute-passthrough.js +28 -2
  114. package/dist/src/mcp/tools/execute-passthrough.js.map +1 -1
  115. package/dist/src/mcp/tools/index.d.ts +1 -0
  116. package/dist/src/mcp/tools/index.d.ts.map +1 -1
  117. package/dist/src/mcp/tools/index.js +1 -0
  118. package/dist/src/mcp/tools/index.js.map +1 -1
  119. package/dist/src/mcp/tools/interview-passthrough.d.ts.map +1 -1
  120. package/dist/src/mcp/tools/interview-passthrough.js +5 -0
  121. package/dist/src/mcp/tools/interview-passthrough.js.map +1 -1
  122. package/dist/src/mcp/tools/spec-passthrough.d.ts.map +1 -1
  123. package/dist/src/mcp/tools/spec-passthrough.js +9 -0
  124. package/dist/src/mcp/tools/spec-passthrough.js.map +1 -1
  125. package/dist/src/utils/notifier.d.ts +10 -0
  126. package/dist/src/utils/notifier.d.ts.map +1 -0
  127. package/dist/src/utils/notifier.js +21 -0
  128. package/dist/src/utils/notifier.js.map +1 -0
  129. package/package.json +3 -1
  130. package/schemas/gestalt.schema.json +5 -0
  131. package/skills/blast-radius/SKILL.md +134 -0
  132. package/skills/build-graph/SKILL.md +100 -0
  133. package/skills/diff-radius/SKILL.md +125 -0
  134. package/skills/execute/SKILL.md +90 -8
  135. package/skills/interview/SKILL.md +5 -4
  136. package/skills/spec/SKILL.md +7 -1
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Gestalt — AI Development Harness
2
2
 
3
3
  ## Overview
4
- 게슈탈트 심리학 원리를 요구사항 명확화 프로세스에 매핑한 TypeScript 기반 AI 개발 하네스.
4
+ 게슈탈트 지각이론을 요구사항 명확화 프로세스에 매핑한 TypeScript 기반 AI 개발 하네스.
5
5
  "전체는 부분의 합보다 크다" — 흩어진 요구사항 조각들을 모아 완전한 스펙(Spec)으로 결정화.
6
6
 
7
7
  ## Architecture
@@ -11,6 +11,7 @@
11
11
  - **Resilience Engine**: Stagnation 감지 → Lateral Thinking Personas → Human Escalation
12
12
  - **MCP Server**: stdio transport로 Claude Code 등 AI 에이전트와 통합
13
13
  - **Skill System**: SKILL.md 기반 확장, chokidar hot-reload 지원. 각 스킬(`/interview`, `/spec`, `/execute`)은 실행 중 Claude Code Task 패널에 진행 상태를 `TaskCreate`/`TaskUpdate`로 실시간 표시 (공통 진행 패널)
14
+ - **Code Knowledge Graph**: 코드베이스 정적 분석 → 의존성 그래프화 → Blast-Radius로 영향 파일 추림. Execute 파이프라인 태스크 실행 시 `suggestedFiles`로 자동 컨텍스트 주입해 불필요한 파일 읽기를 줄임
14
15
  - **Event Store**: better-sqlite3 WAL 모드 이벤트 소싱
15
16
 
16
17
  ## Tech Stack
@@ -25,6 +26,9 @@ pnpm tsx bin/gestalt.ts interview "topic" # Interactive interview
25
26
  pnpm tsx bin/gestalt.ts spec <session-id> # Generate spec
26
27
  pnpm tsx bin/gestalt.ts status # Check sessions
27
28
  pnpm tsx bin/gestalt.ts setup # Generate gestalt.json config
29
+ pnpm tsx bin/gestalt.ts init # One-step onboarding: gestalt.json + code graph + post-commit hook
30
+ pnpm tsx bin/gestalt.ts init --skip-graph # Skip code graph build
31
+ pnpm tsx bin/gestalt.ts init --skip-hook # Skip post-commit hook installation
28
32
  ```
29
33
 
30
34
  ## Configuration
@@ -57,6 +61,7 @@ interface GestaltConfig {
57
61
  llm: { apiKey: string; model: string };
58
62
  interview: { ambiguityThreshold: number; maxRounds: number };
59
63
  execute: { driftThreshold: number; successThreshold: number; goalAlignmentThreshold: number };
64
+ notifications: boolean;
60
65
  dbPath: string;
61
66
  skillsDir: string;
62
67
  agentsDir: string;
@@ -75,6 +80,7 @@ interface GestaltConfig {
75
80
  | `GESTALT_DRIFT_THRESHOLD` | `execute.driftThreshold` | `0.3` |
76
81
  | `GESTALT_EVOLVE_SUCCESS_THRESHOLD` | `execute.successThreshold` | `0.85` |
77
82
  | `GESTALT_EVOLVE_GOAL_ALIGNMENT_THRESHOLD` | `execute.goalAlignmentThreshold` | `0.80` |
83
+ | `GESTALT_NOTIFICATIONS` | `notifications` | `false` |
78
84
  | `GESTALT_DB_PATH` | `dbPath` | `"~/.gestalt/events.db"` |
79
85
  | `GESTALT_SKILLS_DIR` | `skillsDir` | `"skills"` |
80
86
  | `GESTALT_AGENTS_DIR` | `agentsDir` | `"agents"` |
@@ -87,6 +93,7 @@ interface GestaltConfig {
87
93
  - `ges_generate_spec`: sessionId? (optional), text? (optional), force?, spec? (passthrough)
88
94
  - `ges_execute`: action=[start|plan_step|plan_complete|execute_start|execute_task|evaluate|status|evolve_fix|evolve|evolve_patch|evolve_re_execute|evolve_lateral|evolve_lateral_result|role_match|role_consensus]
89
95
  - `ges_create_agent`: action=[start|submit] — 인터뷰 기반 커스텀 Role Agent 생성
96
+ - `ges_code_graph`: action=[build|blast_radius|query|stats|db_exists] — 코드 지식 그래프 관리
90
97
  - `ges_status`: sessionId?
91
98
 
92
99
  ## MCP Passthrough Mode
@@ -365,6 +372,7 @@ ges_execute({ action: "role_consensus", sessionId: "<id>", consensus: {...} })
365
372
  - `src/spec/` — SpecGenerator, SpecExtractor
366
373
  - `src/execute/` — ExecuteEngine, DAG Validator, ExecuteSessionManager
367
374
  - `src/resilience/` — Stagnation Detector, Lateral Thinking Personas, Human Escalation
375
+ - `src/code-graph/` — CodeGraphEngine, CodeGraphStore, BlastRadius, 언어 플러그인 8개
368
376
  - `src/skills/` — SkillRegistry, parser
369
377
  - `src/agent/` — AgentRegistry, FiguralRouter, multi-provider LLM, RoleAgentRegistry, PassthroughAgentGenerator
370
378
  - `src/registry/` — BaseRegistry 추상 클래스
@@ -374,6 +382,75 @@ ges_execute({ action: "role_consensus", sessionId: "<id>", consensus: {...} })
374
382
  - `src/cli/` — commander 기반 CLI (interview, spec, status, setup)
375
383
  - `schemas/` — JSON Schema (gestalt.schema.json)
376
384
  - `role-agents/` — 내장 Role Agent 정의 (architect, frontend-developer 등 8개)
385
+ - `skills/` — 외부 스킬 정의 (`build-graph`, `blast-radius`)
386
+
387
+ ## Code Knowledge Graph
388
+
389
+ 코드베이스를 정적 분석해 의존성 그래프를 빌드하고, 변경 영향 파일을 빠르게 추려 AI 컨텍스트를 절약한다.
390
+
391
+ ### ges_code_graph MCP 툴
392
+
393
+ ```
394
+ // 그래프 빌드 (최초 또는 full rebuild)
395
+ ges_code_graph({ action: "build", repoRoot: "<절대경로>" })
396
+ → { nodesBuilt, edgesBuilt, timeTakenMs, installedHook }
397
+
398
+ // Blast-Radius 분석 (커밋 기준 영향범위)
399
+ ges_code_graph({ action: "blast_radius", repoRoot: "<경로>", base?: "HEAD~1", changedFiles?: [...], maxDepth?: 2 })
400
+ → { changedFiles, impactedFiles, riskScore, summary }
401
+
402
+ // Diff-Radius 분석 (미커밋 변경 기준 영향범위)
403
+ ges_code_graph({ action: "diff_radius", repoRoot: "<경로>", diffMode?: "staged"|"unstaged"|"all", maxDepth?: 2 })
404
+ → { changedFiles, impactedFiles, riskScore, summary }
405
+
406
+ // 키워드 기반 관련 파일 검색
407
+ ges_code_graph({ action: "query", repoRoot: "<경로>", pattern: "callers_of"|"callees_of"|"tests_for"|"imports_of", target: "<노드명>" })
408
+ → { nodes, edges }
409
+
410
+ // 그래프 통계
411
+ ges_code_graph({ action: "stats", repoRoot: "<경로>" })
412
+ → { totalFiles, totalNodes, totalEdges, lastBuiltAt, dbSizeBytes }
413
+
414
+ // DB 존재 여부 확인
415
+ ges_code_graph({ action: "db_exists", repoRoot: "<경로>" })
416
+ → { exists: boolean }
417
+ ```
418
+
419
+ 저장소: `.gestalt/code-graph.db` (WAL SQLite, EventStore DB와 별도)
420
+
421
+ ### 자동 컨텍스트 주입 (Execute 파이프라인 통합)
422
+
423
+ `ges_execute { action: "start", spec: {...}, codeGraphRepoRoot: "/path" }` 호출 시 활성화.
424
+
425
+ 태스크 실행 시 `buildNextTaskContext()`가 자동으로:
426
+ 1. 태스크 title + description에서 키워드를 추출 (`extractKeywords()`)
427
+ 2. `codeGraphEngine.searchByKeywords()`로 관련 파일 최대 10개 검색
428
+ 3. `execute_task` 응답의 `suggestedFiles` 필드로 반환
429
+
430
+ Claude Code가 `suggestedFiles`를 받으면 해당 파일을 먼저 Read한 뒤 태스크를 수행한다 (`EXECUTE_EXECUTION_SYSTEM_PROMPT` 지시).
431
+
432
+ code-graph.db가 없거나 검색 실패 시 `suggestedFiles`는 undefined — 기존 동작 그대로 유지 (graceful fallback).
433
+
434
+ ### 스킬
435
+
436
+ | 스킬 | 파일 | 설명 |
437
+ |------|------|------|
438
+ | `/build-graph` | `skills/build-graph/SKILL.md` | 코드 그래프 빌드 및 증분 갱신 |
439
+ | `/blast-radius` | `skills/blast-radius/SKILL.md` (v1.1.0) | 영향범위 분석 (커밋 기준), 23개 트리거 |
440
+ | `/diff-radius` | `skills/diff-radius/SKILL.md` (v1.0.0) | 영향범위 분석 (미커밋 기준), staged/unstaged/all 지원 |
441
+
442
+ blast-radius 스킬은 "영향범위", "어디까지 영향받아", "사이드 이펙트", "리팩토링" 등 자연스러운 한국어 표현으로 자동 발동한다. CLAUDE.md나 훅과 달리 호출 시에만 토큰이 발생한다.
443
+
444
+ ### 언어 플러그인 (8개)
445
+
446
+ TypeScript/JavaScript, Python, Go, Java, Kotlin, Rust, Swift, Objective-C
447
+
448
+ 각 플러그인: `{ language, extensions[], parse(filePath) → {nodes, edges} }`
449
+ TypeScript 플러그인은 TypeScript Compiler API 사용 (Tree-sitter 불필요).
450
+
451
+ ### 주의사항
452
+ - `glob` 패키지 미사용 → `readdirSync({ recursive: true })`로 파일 수집, `Dirent.parentPath` 활용
453
+ - `noUncheckedIndexedAccess` 환경 → 배열 인덱스·regex 캡처그룹에 `!` 단언 필수
377
454
 
378
455
  ## Conventions
379
456
  - MCP 서버에서 `console.log` 사용 금지 → stderr(`log()` 유틸)
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tienne/gestalt",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "TypeScript AI Development Harness - Gestalt psychology-driven requirement clarification",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -46,6 +46,7 @@
46
46
  "gray-matter": "^4.0.3",
47
47
  "ink": "^6.8.0",
48
48
  "jimp": "^1.6.0",
49
+ "node-notifier": "^10.0.1",
49
50
  "node-pty": "^1.1.0",
50
51
  "openai": "^6.27.0",
51
52
  "react": "^19.2.4",
@@ -54,6 +55,7 @@
54
55
  "devDependencies": {
55
56
  "@types/better-sqlite3": "^7.6.13",
56
57
  "@types/node": "^22.13.10",
58
+ "@types/node-notifier": "^8.0.5",
57
59
  "tsx": "^4.19.3",
58
60
  "typescript": "^5.8.2",
59
61
  "vitest": "^3.0.9"
@@ -87,6 +87,11 @@
87
87
  "description": "Directory containing agent definitions (env: GESTALT_AGENTS_DIR)",
88
88
  "default": "agents"
89
89
  },
90
+ "notifications": {
91
+ "type": "boolean",
92
+ "description": "Enable OS desktop notifications for pipeline events (env: GESTALT_NOTIFICATIONS)",
93
+ "default": false
94
+ },
90
95
  "logLevel": {
91
96
  "type": "string",
92
97
  "enum": ["debug", "info", "warn", "error"],
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: blast-radius
3
+ version: "1.1.0"
4
+ description: "코드 변경 전 영향 범위를 파악해 읽어야 할 파일만 컨텍스트에 제공한다. 변경 범위가 불확실하거나 사이드 이펙트가 걱정될 때 자동 발동한다."
5
+ triggers:
6
+ # 영향범위 확인 의도
7
+ - "영향범위"
8
+ - "영향범위 확인"
9
+ - "영향범위 얼마나 돼"
10
+ - "어디까지 영향받아"
11
+ - "어디 영향받아"
12
+ - "뭐가 깨질 수 있어"
13
+ - "어떤 파일 같이 봐야 해"
14
+ - "관련 파일 뭐 있어"
15
+ - "어디 의존하고 있어"
16
+ - "어디서 쓰이고 있어"
17
+ # 변경 전 안전 확인 의도
18
+ - "건드리기 전에"
19
+ - "수정 전에 확인"
20
+ - "수정 범위"
21
+ - "사이드 이펙트"
22
+ # 범위가 큰 변경 작업
23
+ - "시그니처 바꿔"
24
+ - "인터페이스 변경"
25
+ - "타입 바꿔"
26
+ - "리팩토링"
27
+ # 기존 영어 표현 유지
28
+ - "blast radius"
29
+ - "blast-radius"
30
+ - "impact analysis"
31
+ inputs:
32
+ repoRoot:
33
+ type: string
34
+ required: false
35
+ description: "Repository root path (defaults to current working directory)"
36
+ changedFiles:
37
+ type: string[]
38
+ required: false
39
+ description: "Changed file paths (auto-detected from git diff HEAD~1 if omitted)"
40
+ base:
41
+ type: string
42
+ required: false
43
+ description: "Git base ref for diff detection (default: HEAD~1)"
44
+ maxDepth:
45
+ type: number
46
+ required: false
47
+ description: "BFS traversal depth (default: 2)"
48
+ outputs:
49
+ - changedFiles
50
+ - impactedFiles
51
+ - riskScore
52
+ - summary
53
+ ---
54
+
55
+ # Blast Radius Skill
56
+
57
+ 최근 코드 변경의 영향 범위를 분석해 **읽어야 할 파일만** 컨텍스트에 제공합니다. 불필요한 파일 읽기를 줄여 LLM 토큰 사용을 최소화합니다.
58
+
59
+ ## 전제 조건
60
+
61
+ 코드 지식 그래프가 먼저 빌드되어 있어야 합니다:
62
+ ```
63
+ /build-graph
64
+ ```
65
+
66
+ ## 실행 방법
67
+
68
+ ### 기본 (마지막 커밋 변경 파일 자동 감지)
69
+
70
+ ```
71
+ ges_code_graph {
72
+ action: "blast_radius",
73
+ repoRoot: "<현재 디렉토리 절대 경로>"
74
+ }
75
+ ```
76
+
77
+ ### 변경 파일 직접 지정
78
+
79
+ ```
80
+ ges_code_graph {
81
+ action: "blast_radius",
82
+ repoRoot: "<경로>",
83
+ changedFiles: ["src/auth.ts", "src/middleware.ts"]
84
+ }
85
+ ```
86
+
87
+ ### Git base ref 지정
88
+
89
+ ```
90
+ ges_code_graph {
91
+ action: "blast_radius",
92
+ repoRoot: "<경로>",
93
+ base: "main"
94
+ }
95
+ ```
96
+
97
+ ## 결과 해석
98
+
99
+ | 필드 | 설명 |
100
+ |------|------|
101
+ | `changedFiles` | 변경된 파일 목록 |
102
+ | `impactedFiles` | 영향받는 파일 목록 (테스트 파일 우선 정렬) |
103
+ | `riskScore` | 위험도 점수 0~1 (전체 대비 영향 노드 비율) |
104
+ | `summary` | 한 줄 요약 |
105
+
106
+ ## Skill Instructions
107
+
108
+ 1. `repoRoot`가 주어지지 않으면 현재 작업 디렉토리를 절대 경로로 사용합니다.
109
+ 2. 코드 그래프 DB가 없으면 먼저 `/build-graph`를 실행하도록 안내합니다:
110
+ - `ges_code_graph { action: "db_exists", repoRoot: "<repoRoot>" }` 호출
111
+ - `exists: false`이면 빌드 먼저 안내
112
+ 3. `ges_code_graph { action: "blast_radius", repoRoot: "<repoRoot>", changedFiles?: [...], base?: "...", maxDepth?: 2 }` 호출합니다.
113
+ 4. 결과를 다음 형식으로 표시합니다:
114
+
115
+ ```
116
+ ## 영향범위 분석 결과
117
+
118
+ **변경된 파일** (N개):
119
+ - src/auth.ts
120
+ - src/middleware.ts
121
+
122
+ **영향받는 파일** (M개):
123
+ - src/auth.test.ts ← 테스트 파일 우선
124
+ - src/api/routes.ts
125
+ - src/api/middleware.ts
126
+
127
+ **위험도**: 0.23 (낮음)
128
+ **요약**: {summary}
129
+ ```
130
+
131
+ 5. `impactedFiles` 목록을 컨텍스트로 활용합니다:
132
+ - "아래 파일들이 영향을 받을 수 있습니다. 관련 작업 전 이 파일들을 먼저 읽어보겠습니다:" 형식으로 안내
133
+ - 파일이 많으면 (10개 이상) 가장 중요한 파일(테스트 파일, 핵심 모듈)을 우선 읽도록 제안
134
+ 6. 빌드된 그래프가 오래된 경우 `/build-graph --incremental` 실행을 권장합니다.
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: build-graph
3
+ version: "1.0.0"
4
+ description: "Build a code knowledge graph for the current repository to enable blast-radius analysis"
5
+ triggers:
6
+ - "build graph"
7
+ - "build-graph"
8
+ - "index codebase"
9
+ - "build code graph"
10
+ inputs:
11
+ repoRoot:
12
+ type: string
13
+ required: false
14
+ description: "Repository root path (defaults to current working directory)"
15
+ include:
16
+ type: string[]
17
+ required: false
18
+ description: "Glob patterns to include (default: **/*)"
19
+ exclude:
20
+ type: string[]
21
+ required: false
22
+ description: "Glob patterns to exclude"
23
+ mode:
24
+ type: string
25
+ required: false
26
+ description: "Build mode: 'full' (default) or 'incremental' (hash-based, skip unchanged files)"
27
+ outputs:
28
+ - nodesBuilt
29
+ - edgesBuilt
30
+ - timeTakenMs
31
+ ---
32
+
33
+ # Build Graph Skill
34
+
35
+ 코드베이스를 정적 분석해 코드 지식 그래프를 빌드합니다. 이 그래프를 바탕으로 `/blast-radius` 스킬을 사용할 수 있습니다.
36
+
37
+ ## 목적
38
+
39
+ 코드 지식 그래프는 파일·함수·클래스 사이의 의존 관계를 SQLite DB(`.gestalt/code-graph.db`)에 저장합니다. 한 번 빌드해두면 `blast-radius` 분석으로 변경 영향 파일만 빠르게 조회할 수 있어 불필요한 파일 읽기를 크게 줄일 수 있습니다.
40
+
41
+ ## 지원 언어
42
+
43
+ TypeScript / JavaScript, Python, Go, Java, Kotlin, Rust, Swift, Objective-C
44
+
45
+ ## 실행 방법
46
+
47
+ ### 기본 (전체 빌드)
48
+
49
+ ```
50
+ ges_code_graph {
51
+ action: "build",
52
+ repoRoot: "<현재 디렉토리 절대 경로>"
53
+ }
54
+ ```
55
+
56
+ ### 증분 빌드 (변경 파일만 재파싱)
57
+
58
+ ```
59
+ ges_code_graph {
60
+ action: "build",
61
+ repoRoot: "<현재 디렉토리 절대 경로>",
62
+ mode: "incremental"
63
+ }
64
+ ```
65
+
66
+ ### 특정 디렉토리만 포함
67
+
68
+ ```
69
+ ges_code_graph {
70
+ action: "build",
71
+ repoRoot: "<경로>",
72
+ include: ["src/**", "lib/**"],
73
+ exclude: ["**/*.test.ts", "dist/**"]
74
+ }
75
+ ```
76
+
77
+ ## 빌드 후 통계 확인
78
+
79
+ ```
80
+ ges_code_graph {
81
+ action: "stats",
82
+ repoRoot: "<경로>"
83
+ }
84
+ ```
85
+
86
+ ## 결과 해석
87
+
88
+ | 필드 | 설명 |
89
+ |------|------|
90
+ | `nodesBuilt` | 인덱싱된 노드 수 (파일·함수·클래스·타입) |
91
+ | `edgesBuilt` | 인덱싱된 엣지 수 (호출·임포트·상속·포함 관계) |
92
+ | `timeTakenMs` | 소요 시간 (밀리초) |
93
+
94
+ ## Skill Instructions
95
+
96
+ 1. `repoRoot`가 주어지지 않으면 현재 작업 디렉토리(`cwd`)를 절대 경로로 사용합니다.
97
+ 2. `ges_code_graph { action: "build", repoRoot: "<repoRoot>", mode: "<mode>" }`를 호출합니다.
98
+ 3. 빌드 결과를 사용자에게 표시합니다.
99
+ 4. "그래프 빌드 완료! 이제 `/blast-radius`로 변경 영향 파일을 분석할 수 있습니다." 안내를 포함합니다.
100
+ 5. 오류가 발생하면 오류 내용을 표시하고 지원 언어인지 확인하도록 안내합니다.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: diff-radius
3
+ version: "1.0.0"
4
+ description: "커밋 전 미저장·스테이징 변경의 영향범위를 분석한다. 작업 중인 코드가 어디까지 영향 주는지 바로 확인할 때 자동 발동한다."
5
+ triggers:
6
+ # 작업 중 변경 확인
7
+ - "지금 바꾼 거 영향범위"
8
+ - "작업 중인 거 영향범위"
9
+ - "저장한 거 영향범위"
10
+ - "수정 중인 거 영향범위"
11
+ - "아직 커밋 안 한 거 영향범위"
12
+ - "미커밋 영향범위"
13
+ # 스테이징 확인
14
+ - "스테이징된 거 영향범위"
15
+ - "staged 영향범위"
16
+ - "git add 한 거 영향범위"
17
+ # 커밋 전 안전 확인
18
+ - "커밋 전에 영향범위"
19
+ - "올리기 전에 영향범위"
20
+ - "푸시 전에 영향범위"
21
+ inputs:
22
+ repoRoot:
23
+ type: string
24
+ required: false
25
+ description: "Repository root path (defaults to current working directory)"
26
+ diffMode:
27
+ type: string
28
+ required: false
29
+ description: "staged: git diff --cached, unstaged: git diff, all: staged+unstaged (default)"
30
+ maxDepth:
31
+ type: number
32
+ required: false
33
+ description: "BFS traversal depth (default: 2)"
34
+ outputs:
35
+ - changedFiles
36
+ - impactedFiles
37
+ - riskScore
38
+ - summary
39
+ ---
40
+
41
+ # Diff Radius Skill
42
+
43
+ 커밋하지 않은 변경의 영향범위를 분석합니다. `/blast-radius`가 커밋 기준이라면, 이 스킬은 **지금 작업 중인 변경** 기준으로 동작합니다.
44
+
45
+ ## 전제 조건
46
+
47
+ 코드 지식 그래프가 먼저 빌드되어 있어야 합니다:
48
+ ```
49
+ /build-graph
50
+ ```
51
+
52
+ ## 실행 방법
53
+
54
+ ### 기본 (staged + unstaged 전체)
55
+
56
+ ```
57
+ ges_code_graph {
58
+ action: "diff_radius",
59
+ repoRoot: "<현재 디렉토리 절대 경로>"
60
+ }
61
+ ```
62
+
63
+ ### 스테이징된 변경만 (git add 한 것)
64
+
65
+ ```
66
+ ges_code_graph {
67
+ action: "diff_radius",
68
+ repoRoot: "<경로>",
69
+ diffMode: "staged"
70
+ }
71
+ ```
72
+
73
+ ### 아직 스테이징 안 된 변경만
74
+
75
+ ```
76
+ ges_code_graph {
77
+ action: "diff_radius",
78
+ repoRoot: "<경로>",
79
+ diffMode: "unstaged"
80
+ }
81
+ ```
82
+
83
+ ## blast-radius와 차이
84
+
85
+ | | `/blast-radius` | `/diff-radius` |
86
+ |---|---|---|
87
+ | 기준 | 마지막 커밋 (`HEAD~1`) | 현재 작업 중인 변경 |
88
+ | git 명령 | `git diff HEAD~1` | `git diff HEAD` / `git diff --cached` |
89
+ | 용도 | 배포된 변경 영향 확인 | 커밋 전 영향범위 사전 확인 |
90
+
91
+ ## 결과 해석
92
+
93
+ | 필드 | 설명 |
94
+ |------|------|
95
+ | `changedFiles` | 변경된 파일 목록 |
96
+ | `impactedFiles` | 영향받는 파일 목록 (테스트 파일 우선 정렬) |
97
+ | `riskScore` | 위험도 점수 0~1 |
98
+ | `summary` | 한 줄 요약 |
99
+
100
+ ## Skill Instructions
101
+
102
+ 1. `repoRoot`가 주어지지 않으면 현재 작업 디렉토리를 절대 경로로 사용합니다.
103
+ 2. 코드 그래프 DB가 없으면 먼저 `/build-graph`를 실행하도록 안내합니다:
104
+ - `ges_code_graph { action: "db_exists", repoRoot: "<repoRoot>" }` 호출
105
+ - `exists: false`이면 빌드 먼저 안내
106
+ 3. `ges_code_graph { action: "diff_radius", repoRoot: "<repoRoot>", diffMode?: "staged"|"unstaged"|"all", maxDepth?: 2 }` 호출합니다.
107
+ 4. 결과를 다음 형식으로 표시합니다:
108
+
109
+ ```
110
+ ## 영향범위 분석 결과 (미커밋 변경)
111
+
112
+ **변경된 파일** (N개):
113
+ - src/auth.ts
114
+ - src/middleware.ts
115
+
116
+ **영향받는 파일** (M개):
117
+ - src/auth.test.ts ← 테스트 파일 우선
118
+ - src/api/routes.ts
119
+
120
+ **위험도**: 0.23 (낮음)
121
+ **요약**: {summary}
122
+ ```
123
+
124
+ 5. `impactedFiles` 목록을 컨텍스트로 활용합니다.
125
+ 6. 변경된 파일이 없으면 "현재 미커밋 변경이 없습니다." 안내합니다.
@@ -183,6 +183,67 @@ API 키 없이 MCP 서버 실행 시 자동 활성화. LLM 작업을 caller가
183
183
 
184
184
  ---
185
185
 
186
+ ### 병렬 그룹 실행 (parallelGroups 활용)
187
+
188
+ `plan_complete` 응답에 `parallelGroups: string[][]`가 포함되어 있으면 병렬 실행을 사용한다. 각 내부 배열은 동시에 실행할 수 있는 태스크 ID 묶음이다.
189
+
190
+ **병렬 그룹 실행 흐름:**
191
+
192
+ 1. `parallelGroups[groupIndex]`의 taskId 목록을 확인한다.
193
+ 2. **단일 메시지에서** 각 taskId마다 Agent 툴을 하나씩, 동시에 호출한다 (여러 Agent 툴 호출을 같은 메시지에 담는다).
194
+ 3. 각 Agent는 독립적으로 해당 태스크를 수행하고, 완료되면 `execute_task`를 호출해 결과를 제출한다.
195
+ 4. 그룹 내 일부 Agent가 실패해도 나머지는 계속 실행한다. 실패한 태스크는 `status: "failed"`로 제출한다.
196
+ 5. 그룹 내 모든 Agent가 완료되면 다음 그룹으로 넘어간다.
197
+ 6. 모든 그룹이 완료된 후 실패한 태스크가 있으면 기존 evolve 파이프라인으로 재처리한다.
198
+
199
+ **Agent 툴 호출 예시 (parallelGroups[0] = ["task-0", "task-1", "task-2"] 인 경우):**
200
+
201
+ 단일 메시지에서 세 Agent를 동시에 실행한다.
202
+
203
+ ```
204
+ // 같은 메시지에서 동시 호출 — Agent 1
205
+ Agent(task: "task-0 실행: {task-0 title}\n컨텍스트: {taskContext}\n완료 후 execute_task로 결과 제출")
206
+
207
+ // 같은 메시지에서 동시 호출 — Agent 2
208
+ Agent(task: "task-1 실행: {task-1 title}\n컨텍스트: {taskContext}\n완료 후 execute_task로 결과 제출")
209
+
210
+ // 같은 메시지에서 동시 호출 — Agent 3
211
+ Agent(task: "task-2 실행: {task-2 title}\n컨텍스트: {taskContext}\n완료 후 execute_task로 결과 제출")
212
+ ```
213
+
214
+ **각 Agent의 execute_task 제출:**
215
+
216
+ ```json
217
+ {
218
+ "action": "execute_task",
219
+ "sessionId": "...",
220
+ "taskResult": {
221
+ "taskId": "task-0",
222
+ "status": "completed",
223
+ "output": "태스크 수행 결과 요약",
224
+ "artifacts": ["path/to/file.ts"]
225
+ }
226
+ }
227
+ ```
228
+
229
+ 실패 시:
230
+ ```json
231
+ {
232
+ "action": "execute_task",
233
+ "sessionId": "...",
234
+ "taskResult": {
235
+ "taskId": "task-1",
236
+ "status": "failed",
237
+ "output": "실패 원인 설명",
238
+ "artifacts": []
239
+ }
240
+ }
241
+ ```
242
+
243
+ **parallelGroups가 없는 경우:** 기존 순차 실행 방식을 사용한다.
244
+
245
+ ---
246
+
186
247
  ### `execute_task` — 태스크 실행 결과 제출
187
248
 
188
249
  role_match/role_consensus로 얻은 `roleGuidance`를 참조해 태스크를 수행한 후 결과 제출.
@@ -381,26 +442,47 @@ Planning 패널 태스크를 완료하고, 새 Execution 패널 태스크를 생
381
442
 
382
443
  ```
383
444
  subject: "Gestalt Execute: {spec.goal 앞 40자}"
384
- description: "0/{totalTasks} 완료 | 현재: 시작 대기 중 | 실패: 0개 | 그룹 0/{parallelGroupCount}"
385
- activeForm: "태스크 실행 "
445
+ description: "0/{totalTasks} 완료 | 실패: 0개 | 그룹 0/{parallelGroupCount}"
446
+ activeForm: "실행 중: {taskContext.currentTask.title}"
386
447
  ```
387
448
 
388
449
  `plan_complete` 응답의 `planSummary.totalTasks`와 `planSummary.parallelGroupCount`를 활용한다.
450
+ `taskContext.currentTask.title`은 `execute_start` 응답에서 바로 꺼내 쓴다.
451
+
452
+ ### 병렬 그룹 실행 시작 시 (Agent 툴 동시 호출 직전)
453
+
454
+ 각 병렬 그룹 실행을 시작하기 전에 `TaskUpdate`로 병렬 실행 상태를 표시한다.
455
+
456
+ ```
457
+ activeForm: "병렬 실행 중: 그룹 {groupIndex}/{totalGroups} — {agentCount}개 Agent 실행 중"
458
+ ```
459
+
460
+ - `groupIndex`: 현재 병렬 그룹 번호 (1부터 시작)
461
+ - `totalGroups`: 전체 병렬 그룹 수 (`parallelGroups.length`)
462
+ - `agentCount`: 현재 그룹의 태스크 수 (`parallelGroups[groupIndex].length`)
389
463
 
390
464
  ### 각 태스크 완료 후 (`execute_task` 응답 수신 시마다)
391
465
 
392
- `TaskUpdate`로 진행 상황을 업데이트한다.
466
+ `TaskUpdate`로 진행 상황과 현재 실행 태스크명을 업데이트한다.
467
+
468
+ 순차 실행 중:
469
+ ```
470
+ description: "{completedCount}/{totalTasks} 완료 | 실패: {failedCount}개 | 그룹 {groupIndex}/{totalGroups}"
471
+ activeForm: "실행 중: {taskContext.currentTask.title}"
472
+ ```
393
473
 
474
+ 병렬 그룹 실행 중 (각 Agent의 execute_task 완료 시):
394
475
  ```
395
- description: "{completedCount}/{totalTasks} 완료 | 현재: {nextTask.title or '완료'} | 실패: {failedCount}개 | 그룹 {groupIndex}/{totalGroups}"
476
+ description: "{completedCount}/{totalTasks} 완료 | 실패: {failedCount}개 | 그룹 {groupIndex}/{totalGroups}"
477
+ activeForm: "병렬 실행 중: 그룹 {groupIndex}/{totalGroups} — {agentCount}개 Agent 실행 중"
396
478
  ```
397
479
 
398
- - `completedCount`: 지금까지 제출한 taskResult 수
399
- - `nextTask`: 응답의 `nextTaskId`로 다음 태스크 이름 추론
480
+ - `completedCount`: 지금까지 제출한 taskResult 수 (`response.completedTasks`)
400
481
  - `failedCount`: status가 `failed`인 taskResult 수
401
- - `groupIndex/totalGroups`: `plan_complete` 응답의 `parallelGroups` 기준
482
+ - `groupIndex/totalGroups`: 현재 처리 중인 병렬 그룹 번호 / 전체 그룹 수
483
+ - `agentCount`: 해당 그룹에서 아직 실행 중인 Agent 수
402
484
 
403
- `allTasksCompleted === true` 이면 description "전체 완료" 표시 후 `TaskUpdate`로 status를 completed로 변경한다.
485
+ `allTasksCompleted === true` 이면 `TaskUpdate({ status: "completed", activeForm: undefined, description: "전체 완료 ({totalTasks}개)" })`로 변경한다.
404
486
 
405
487
  ### 평가/진화 단계
406
488
 
@@ -93,16 +93,17 @@ API 키 없이 MCP 서버 실행 시 자동 활성화. LLM 작업을 caller가
93
93
 
94
94
  ```
95
95
  subject: "Gestalt 인터뷰: {topic}"
96
- description: "라운드 1/{maxRounds} | 원리: {currentPrinciple} | 모호성: 측정 전"
97
- activeForm: "인터뷰 진행 "
96
+ description: "라운드 1/{maxRounds} | 모호성: 측정 전"
97
+ activeForm: "라운드 1 — {currentPrinciple}"
98
98
  ```
99
99
 
100
100
  ### 각 라운드 후 (`respond` 응답 수신 시마다)
101
101
 
102
- `TaskUpdate`로 description을 최신 상태로 갱신한다. 모호성 점수는 추이 형식으로 표시한다.
102
+ `TaskUpdate`로 description과 activeForm을 최신 상태로 갱신한다. 모호성 점수는 추이 형식으로 표시한다.
103
103
 
104
104
  ```
105
- description: "라운드 {roundNumber}/{maxRounds} | 원리: {currentPrinciple} | 모호성: {score1} → {score2} → {latestScore}"
105
+ description: "라운드 {roundNumber}/{maxRounds} | 모호성: {score1} → {score2} → {latestScore}"
106
+ activeForm: "라운드 {roundNumber} — {currentPrinciple}"
106
107
  ```
107
108
 
108
109
  ambiguityScore.isReady === true 이면 description에 "✓ 준비 완료" 표시를 추가한다.