@tienne/gestalt 0.9.1 → 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 (115) hide show
  1. package/CLAUDE.md +75 -0
  2. package/dist/package.json +1 -1
  3. package/dist/skills/blast-radius/SKILL.md +134 -0
  4. package/dist/skills/build-graph/SKILL.md +100 -0
  5. package/dist/skills/diff-radius/SKILL.md +125 -0
  6. package/dist/src/cli/commands/init.d.ts +5 -0
  7. package/dist/src/cli/commands/init.d.ts.map +1 -0
  8. package/dist/src/cli/commands/init.js +79 -0
  9. package/dist/src/cli/commands/init.js.map +1 -0
  10. package/dist/src/cli/index.d.ts.map +1 -1
  11. package/dist/src/cli/index.js +9 -0
  12. package/dist/src/cli/index.js.map +1 -1
  13. package/dist/src/code-graph/blast-radius.d.ts +9 -0
  14. package/dist/src/code-graph/blast-radius.d.ts.map +1 -0
  15. package/dist/src/code-graph/blast-radius.js +139 -0
  16. package/dist/src/code-graph/blast-radius.js.map +1 -0
  17. package/dist/src/code-graph/engine.d.ts +46 -0
  18. package/dist/src/code-graph/engine.d.ts.map +1 -0
  19. package/dist/src/code-graph/engine.js +301 -0
  20. package/dist/src/code-graph/engine.js.map +1 -0
  21. package/dist/src/code-graph/git-hook.d.ts +22 -0
  22. package/dist/src/code-graph/git-hook.d.ts.map +1 -0
  23. package/dist/src/code-graph/git-hook.js +100 -0
  24. package/dist/src/code-graph/git-hook.js.map +1 -0
  25. package/dist/src/code-graph/index.d.ts +7 -0
  26. package/dist/src/code-graph/index.d.ts.map +1 -0
  27. package/dist/src/code-graph/index.js +6 -0
  28. package/dist/src/code-graph/index.js.map +1 -0
  29. package/dist/src/code-graph/plugins/go.d.ts +3 -0
  30. package/dist/src/code-graph/plugins/go.d.ts.map +1 -0
  31. package/dist/src/code-graph/plugins/go.js +126 -0
  32. package/dist/src/code-graph/plugins/go.js.map +1 -0
  33. package/dist/src/code-graph/plugins/index.d.ts +16 -0
  34. package/dist/src/code-graph/plugins/index.d.ts.map +1 -0
  35. package/dist/src/code-graph/plugins/index.js +36 -0
  36. package/dist/src/code-graph/plugins/index.js.map +1 -0
  37. package/dist/src/code-graph/plugins/java.d.ts +3 -0
  38. package/dist/src/code-graph/plugins/java.d.ts.map +1 -0
  39. package/dist/src/code-graph/plugins/java.js +108 -0
  40. package/dist/src/code-graph/plugins/java.js.map +1 -0
  41. package/dist/src/code-graph/plugins/kotlin.d.ts +3 -0
  42. package/dist/src/code-graph/plugins/kotlin.d.ts.map +1 -0
  43. package/dist/src/code-graph/plugins/kotlin.js +94 -0
  44. package/dist/src/code-graph/plugins/kotlin.js.map +1 -0
  45. package/dist/src/code-graph/plugins/objc.d.ts +3 -0
  46. package/dist/src/code-graph/plugins/objc.d.ts.map +1 -0
  47. package/dist/src/code-graph/plugins/objc.js +129 -0
  48. package/dist/src/code-graph/plugins/objc.js.map +1 -0
  49. package/dist/src/code-graph/plugins/python.d.ts +3 -0
  50. package/dist/src/code-graph/plugins/python.d.ts.map +1 -0
  51. package/dist/src/code-graph/plugins/python.js +116 -0
  52. package/dist/src/code-graph/plugins/python.js.map +1 -0
  53. package/dist/src/code-graph/plugins/rust.d.ts +3 -0
  54. package/dist/src/code-graph/plugins/rust.d.ts.map +1 -0
  55. package/dist/src/code-graph/plugins/rust.js +108 -0
  56. package/dist/src/code-graph/plugins/rust.js.map +1 -0
  57. package/dist/src/code-graph/plugins/swift.d.ts +3 -0
  58. package/dist/src/code-graph/plugins/swift.d.ts.map +1 -0
  59. package/dist/src/code-graph/plugins/swift.js +106 -0
  60. package/dist/src/code-graph/plugins/swift.js.map +1 -0
  61. package/dist/src/code-graph/plugins/typescript.d.ts +3 -0
  62. package/dist/src/code-graph/plugins/typescript.d.ts.map +1 -0
  63. package/dist/src/code-graph/plugins/typescript.js +209 -0
  64. package/dist/src/code-graph/plugins/typescript.js.map +1 -0
  65. package/dist/src/code-graph/storage.d.ts +18 -0
  66. package/dist/src/code-graph/storage.d.ts.map +1 -0
  67. package/dist/src/code-graph/storage.js +175 -0
  68. package/dist/src/code-graph/storage.js.map +1 -0
  69. package/dist/src/code-graph/types.d.ts +93 -0
  70. package/dist/src/code-graph/types.d.ts.map +1 -0
  71. package/dist/src/code-graph/types.js +17 -0
  72. package/dist/src/code-graph/types.js.map +1 -0
  73. package/dist/src/core/config.d.ts +1 -0
  74. package/dist/src/core/config.d.ts.map +1 -1
  75. package/dist/src/core/config.js +1 -1
  76. package/dist/src/core/config.js.map +1 -1
  77. package/dist/src/core/types.d.ts +1 -0
  78. package/dist/src/core/types.d.ts.map +1 -1
  79. package/dist/src/execute/passthrough-engine.d.ts +4 -1
  80. package/dist/src/execute/passthrough-engine.d.ts.map +1 -1
  81. package/dist/src/execute/passthrough-engine.js +54 -4
  82. package/dist/src/execute/passthrough-engine.js.map +1 -1
  83. package/dist/src/execute/prompts.d.ts +2 -2
  84. package/dist/src/execute/prompts.d.ts.map +1 -1
  85. package/dist/src/execute/prompts.js +7 -3
  86. package/dist/src/execute/prompts.js.map +1 -1
  87. package/dist/src/execute/repository.d.ts.map +1 -1
  88. package/dist/src/execute/repository.js +1 -0
  89. package/dist/src/execute/repository.js.map +1 -1
  90. package/dist/src/execute/session.d.ts +3 -1
  91. package/dist/src/execute/session.d.ts.map +1 -1
  92. package/dist/src/execute/session.js +3 -1
  93. package/dist/src/execute/session.js.map +1 -1
  94. package/dist/src/mcp/schemas.d.ts +46 -0
  95. package/dist/src/mcp/schemas.d.ts.map +1 -1
  96. package/dist/src/mcp/schemas.js +23 -0
  97. package/dist/src/mcp/schemas.js.map +1 -1
  98. package/dist/src/mcp/server.d.ts.map +1 -1
  99. package/dist/src/mcp/server.js +19 -1
  100. package/dist/src/mcp/server.js.map +1 -1
  101. package/dist/src/mcp/tools/code-graph-passthrough.d.ts +16 -0
  102. package/dist/src/mcp/tools/code-graph-passthrough.d.ts.map +1 -0
  103. package/dist/src/mcp/tools/code-graph-passthrough.js +65 -0
  104. package/dist/src/mcp/tools/code-graph-passthrough.js.map +1 -0
  105. package/dist/src/mcp/tools/execute-passthrough.d.ts.map +1 -1
  106. package/dist/src/mcp/tools/execute-passthrough.js +1 -1
  107. package/dist/src/mcp/tools/execute-passthrough.js.map +1 -1
  108. package/dist/src/mcp/tools/index.d.ts +1 -0
  109. package/dist/src/mcp/tools/index.d.ts.map +1 -1
  110. package/dist/src/mcp/tools/index.js +1 -0
  111. package/dist/src/mcp/tools/index.js.map +1 -1
  112. package/package.json +1 -1
  113. package/skills/blast-radius/SKILL.md +134 -0
  114. package/skills/build-graph/SKILL.md +100 -0
  115. package/skills/diff-radius/SKILL.md +125 -0
@@ -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. 변경된 파일이 없으면 "현재 미커밋 변경이 없습니다." 안내합니다.