@wooojin/forgen 0.2.0 → 0.3.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.ja.md +79 -14
  3. package/README.ko.md +100 -14
  4. package/README.md +124 -17
  5. package/README.zh.md +79 -14
  6. package/agents/analyst.md +48 -4
  7. package/agents/architect.md +39 -4
  8. package/agents/code-reviewer.md +107 -77
  9. package/agents/critic.md +47 -4
  10. package/agents/debugger.md +46 -4
  11. package/agents/designer.md +40 -4
  12. package/agents/executor.md +112 -30
  13. package/agents/explore.md +45 -5
  14. package/agents/git-master.md +48 -4
  15. package/agents/planner.md +121 -18
  16. package/agents/test-engineer.md +58 -4
  17. package/agents/verifier.md +92 -77
  18. package/commands/architecture-decision.md +127 -258
  19. package/commands/calibrate.md +225 -0
  20. package/commands/code-review.md +163 -178
  21. package/commands/compound.md +127 -68
  22. package/commands/deep-interview.md +273 -0
  23. package/commands/docker.md +68 -178
  24. package/commands/forge-loop.md +215 -0
  25. package/commands/learn.md +231 -0
  26. package/commands/retro.md +215 -0
  27. package/commands/ship.md +277 -0
  28. package/dist/cli.js +26 -9
  29. package/dist/core/auto-compound-runner.js +14 -0
  30. package/dist/core/config-injector.d.ts +2 -1
  31. package/dist/core/config-injector.js +2 -1
  32. package/dist/core/dashboard.d.ts +108 -0
  33. package/dist/core/dashboard.js +495 -0
  34. package/dist/core/doctor.js +151 -21
  35. package/dist/core/drift-score.d.ts +49 -0
  36. package/dist/core/drift-score.js +87 -0
  37. package/dist/core/harness.d.ts +6 -1
  38. package/dist/core/harness.js +75 -19
  39. package/dist/core/mcp-config.d.ts +2 -0
  40. package/dist/core/mcp-config.js +6 -1
  41. package/dist/core/paths.d.ts +6 -1
  42. package/dist/core/paths.js +18 -2
  43. package/dist/core/spawn.d.ts +3 -2
  44. package/dist/core/spawn.js +27 -8
  45. package/dist/core/types.d.ts +34 -0
  46. package/dist/engine/compound-export.d.ts +41 -0
  47. package/dist/engine/compound-export.js +169 -0
  48. package/dist/engine/compound-lifecycle.d.ts +4 -3
  49. package/dist/engine/compound-lifecycle.js +91 -46
  50. package/dist/engine/compound-loop.js +18 -0
  51. package/dist/engine/meta-learning/adaptive-thresholds.d.ts +20 -0
  52. package/dist/engine/meta-learning/adaptive-thresholds.js +126 -0
  53. package/dist/engine/meta-learning/extraction-tuner.d.ts +15 -0
  54. package/dist/engine/meta-learning/extraction-tuner.js +99 -0
  55. package/dist/engine/meta-learning/matcher-weight-tuner.d.ts +21 -0
  56. package/dist/engine/meta-learning/matcher-weight-tuner.js +151 -0
  57. package/dist/engine/meta-learning/runner.d.ts +14 -0
  58. package/dist/engine/meta-learning/runner.js +90 -0
  59. package/dist/engine/meta-learning/scope-promoter.d.ts +21 -0
  60. package/dist/engine/meta-learning/scope-promoter.js +84 -0
  61. package/dist/engine/meta-learning/session-quality-scorer.d.ts +61 -0
  62. package/dist/engine/meta-learning/session-quality-scorer.js +166 -0
  63. package/dist/engine/meta-learning/types.d.ts +114 -0
  64. package/dist/engine/meta-learning/types.js +43 -0
  65. package/dist/engine/solution-format.d.ts +2 -2
  66. package/dist/engine/solution-format.js +249 -34
  67. package/dist/engine/solution-index.d.ts +1 -1
  68. package/dist/engine/solution-matcher.d.ts +30 -1
  69. package/dist/engine/solution-matcher.js +235 -45
  70. package/dist/fgx.js +12 -8
  71. package/dist/hooks/context-guard.d.ts +15 -0
  72. package/dist/hooks/context-guard.js +218 -56
  73. package/dist/hooks/db-guard.js +2 -2
  74. package/dist/hooks/hook-config.d.ts +27 -1
  75. package/dist/hooks/hook-config.js +72 -12
  76. package/dist/hooks/hooks-generator.d.ts +3 -0
  77. package/dist/hooks/hooks-generator.js +23 -6
  78. package/dist/hooks/intent-classifier.d.ts +0 -2
  79. package/dist/hooks/intent-classifier.js +32 -18
  80. package/dist/hooks/keyword-detector.js +126 -204
  81. package/dist/hooks/notepad-injector.js +2 -2
  82. package/dist/hooks/permission-handler.js +2 -2
  83. package/dist/hooks/post-tool-failure.js +12 -6
  84. package/dist/hooks/post-tool-handlers.d.ts +1 -1
  85. package/dist/hooks/post-tool-handlers.js +14 -11
  86. package/dist/hooks/post-tool-use.d.ts +11 -0
  87. package/dist/hooks/post-tool-use.js +184 -71
  88. package/dist/hooks/pre-compact.d.ts +11 -1
  89. package/dist/hooks/pre-compact.js +112 -37
  90. package/dist/hooks/pre-tool-use.js +86 -56
  91. package/dist/hooks/rate-limiter.js +3 -3
  92. package/dist/hooks/secret-filter.js +2 -2
  93. package/dist/hooks/session-recovery.js +256 -236
  94. package/dist/hooks/shared/hook-response.d.ts +4 -4
  95. package/dist/hooks/shared/hook-response.js +13 -24
  96. package/dist/hooks/shared/hook-timing.d.ts +15 -0
  97. package/dist/hooks/shared/hook-timing.js +64 -0
  98. package/dist/hooks/skill-injector.d.ts +4 -3
  99. package/dist/hooks/skill-injector.js +47 -16
  100. package/dist/hooks/slop-detector.js +3 -3
  101. package/dist/hooks/solution-injector.js +224 -197
  102. package/dist/hooks/subagent-tracker.js +2 -2
  103. package/dist/host/codex-adapter.d.ts +10 -0
  104. package/dist/host/codex-adapter.js +154 -0
  105. package/dist/mcp/solution-reader.d.ts +5 -5
  106. package/dist/mcp/solution-reader.js +34 -24
  107. package/dist/renderer/rule-renderer.js +9 -11
  108. package/dist/services/session.d.ts +19 -0
  109. package/dist/services/session.js +62 -0
  110. package/hooks/hooks.json +2 -2
  111. package/package.json +2 -1
  112. package/skills/architecture-decision/SKILL.md +113 -257
  113. package/skills/calibrate/SKILL.md +207 -0
  114. package/skills/code-review/SKILL.md +151 -178
  115. package/skills/compound/SKILL.md +126 -68
  116. package/skills/deep-interview/SKILL.md +266 -0
  117. package/skills/docker/SKILL.md +57 -179
  118. package/skills/forge-loop/SKILL.md +198 -0
  119. package/skills/learn/SKILL.md +216 -0
  120. package/skills/retro/SKILL.md +199 -0
  121. package/skills/ship/SKILL.md +259 -0
  122. package/agents/code-simplifier.md +0 -197
  123. package/agents/performance-reviewer.md +0 -172
  124. package/agents/qa-tester.md +0 -158
  125. package/agents/refactoring-expert.md +0 -168
  126. package/agents/scientist.md +0 -144
  127. package/agents/security-reviewer.md +0 -137
  128. package/agents/writer.md +0 -184
  129. package/commands/api-design.md +0 -268
  130. package/commands/ci-cd.md +0 -270
  131. package/commands/database.md +0 -263
  132. package/commands/debug-detective.md +0 -99
  133. package/commands/documentation.md +0 -276
  134. package/commands/ecomode.md +0 -51
  135. package/commands/frontend.md +0 -271
  136. package/commands/git-master.md +0 -90
  137. package/commands/incident-response.md +0 -292
  138. package/commands/migrate.md +0 -101
  139. package/commands/performance.md +0 -288
  140. package/commands/refactor.md +0 -105
  141. package/commands/security-review.md +0 -288
  142. package/commands/tdd.md +0 -183
  143. package/commands/testing-strategy.md +0 -265
  144. package/skills/api-design/SKILL.md +0 -262
  145. package/skills/ci-cd/SKILL.md +0 -264
  146. package/skills/database/SKILL.md +0 -257
  147. package/skills/debug-detective/SKILL.md +0 -95
  148. package/skills/documentation/SKILL.md +0 -270
  149. package/skills/ecomode/SKILL.md +0 -46
  150. package/skills/frontend/SKILL.md +0 -265
  151. package/skills/git-master/SKILL.md +0 -86
  152. package/skills/incident-response/SKILL.md +0 -286
  153. package/skills/migrate/SKILL.md +0 -96
  154. package/skills/performance/SKILL.md +0 -282
  155. package/skills/refactor/SKILL.md +0 -100
  156. package/skills/security-review/SKILL.md +0 -282
  157. package/skills/tdd/SKILL.md +0 -178
  158. package/skills/testing-strategy/SKILL.md +0 -260
@@ -0,0 +1,277 @@
1
+ ---
2
+ name: ship
3
+ description: This skill should be used when the user asks to "ship, 배포, 릴리스, release". 비대화형 자동 릴리스 파이프라인 — 테스트, 리뷰, 버전, CHANGELOG, PR을 원커맨드로.
4
+ argument-hint: "[patch|minor|major]"
5
+ model: inherit
6
+ disable-model-invocation: true
7
+ allowed-tools:
8
+ - Read
9
+ - Grep
10
+ - Glob
11
+ - Bash
12
+ - Agent
13
+ - Edit
14
+ - Write
15
+ triggers:
16
+ - "ship"
17
+ - "배포"
18
+ - "릴리스"
19
+ - "release"
20
+ - "릴리즈"
21
+ - "배포해줘"
22
+ ---
23
+
24
+ <Purpose>
25
+ "사용자가 /ship이라고 했으면 실행하라."
26
+
27
+ 테스트 -> 리뷰 -> 버전 범프 -> CHANGELOG -> 커밋 -> PR 생성까지의 릴리스 파이프라인을 완전 자동화합니다.
28
+ 사용자에게 묻지 않습니다. 중단 사유가 아닌 한 끝까지 진행합니다.
29
+
30
+ ### 중단 사유 (이것만 멈춘다)
31
+ - main/master 브랜치에서 직접 실행 (abort)
32
+ - 해결 불가능한 머지 충돌
33
+ - 테스트 실패
34
+ - CRITICAL 리뷰 발견
35
+ - MAJOR 버전 범프 결정 (사용자 확인 필요)
36
+
37
+ 이 외의 모든 상황은 자동 판단하여 진행합니다.
38
+ </Purpose>
39
+
40
+ <Compound_Integration>
41
+ ## Compound-In: 이전 릴리스 이슈 로드
42
+
43
+ Step 1.5에서 실행합니다.
44
+
45
+ ```
46
+ compound-search("ship release 이슈 배포 실패")
47
+ ```
48
+
49
+ 이전 릴리스에서 발생한 문제 패턴을 확인합니다.
50
+ 결과가 있으면 해당 체크포인트를 강화합니다.
51
+
52
+ ## Compound-Out: 릴리스 이슈 기록
53
+
54
+ Step 10에서 실행합니다.
55
+ 릴리스 중 발생한 이슈가 있었으면 compound troubleshoot로 기록을 제안합니다.
56
+ </Compound_Integration>
57
+
58
+ <Steps>
59
+ ## Step 0: 플랫폼 감지 + 베이스 브랜치 감지
60
+
61
+ ```bash
62
+ # 플랫폼 감지
63
+ if command -v gh &>/dev/null && gh repo view &>/dev/null; then
64
+ PLATFORM="github"
65
+ elif command -v glab &>/dev/null; then
66
+ PLATFORM="gitlab"
67
+ else
68
+ PLATFORM="unknown"
69
+ fi
70
+
71
+ # 베이스 브랜치 감지
72
+ BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
73
+ if [ -z "$BASE" ]; then
74
+ BASE=$(git branch -r | grep -E 'origin/(main|master)' | head -1 | sed 's@.*origin/@@' | tr -d ' ')
75
+ fi
76
+ ```
77
+
78
+ ## Step 1: Pre-flight 체크
79
+
80
+ ```bash
81
+ BRANCH=$(git branch --show-current)
82
+
83
+ # main/master -> ABORT
84
+ if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
85
+ echo "ABORT: main/master 브랜치에서 직접 릴리스할 수 없습니다."
86
+ exit 1
87
+ fi
88
+
89
+ git status --porcelain
90
+ git diff --stat
91
+ git diff --staged --stat
92
+ ```
93
+
94
+ - main/master -> ABORT (새 브랜치 제안하지 않음. 그냥 중단.)
95
+ - 미커밋 변경 -> 자동 커밋 ("chore: stage uncommitted changes before release")
96
+
97
+ ## Step 1.5: Compound-In
98
+
99
+ ```
100
+ compound-search("ship release 배포 이슈")
101
+ ```
102
+
103
+ 이전 문제 패턴이 있으면 체크포인트 강화. 없으면 조용히 진행.
104
+
105
+ ## Step 2: 베이스 브랜치 머지
106
+
107
+ ```bash
108
+ git fetch origin $BASE
109
+ git merge origin/$BASE --no-edit
110
+ ```
111
+
112
+ - 충돌 -> ABORT ("머지 충돌 발생. 수동 해결 후 다시 /ship하세요.")
113
+
114
+ ## Step 3: 테스트 실행
115
+
116
+ ```bash
117
+ # 자동 감지: package.json -> vitest/jest -> pytest -> cargo test -> go test
118
+ if [ -f package.json ]; then
119
+ if grep -q '"test"' package.json; then npm test
120
+ elif command -v vitest &>/dev/null; then npx vitest run
121
+ fi
122
+ elif [ -f pytest.ini ] || [ -f pyproject.toml ]; then pytest
123
+ elif [ -f Cargo.toml ]; then cargo test
124
+ elif [ -f go.mod ]; then go test ./...
125
+ fi
126
+ ```
127
+
128
+ - 전체 통과 -> Step 3.5
129
+ - 1개라도 실패 -> ABORT
130
+
131
+ ## Step 3.5: 테스트 커버리지 감사 (선택)
132
+
133
+ ```bash
134
+ npx vitest run --coverage 2>/dev/null || true
135
+ ```
136
+
137
+ 커버리지는 정보 제공용. 미달로 중단하지 않음.
138
+
139
+ ## Step 4: Pre-landing 리뷰
140
+
141
+ ch-code-reviewer 에이전트(READ-ONLY) 위임.
142
+
143
+ ```bash
144
+ git diff $BASE...HEAD
145
+ ```
146
+
147
+ - CRITICAL -> ABORT
148
+ - AUTO-FIX (데드 코드, 미사용 import, stale 주석) -> 직접 수정 + 커밋
149
+ - 판단 필요 -> 사용자에게 질문
150
+ - APPROVED -> Step 5
151
+
152
+ ## Step 5: 버전 범프
153
+
154
+ ### 인수가 있으면: 인수 그대로 사용
155
+ ### 없으면 자동 판단:
156
+ - < 50줄 -> PATCH (자동)
157
+ - 50줄+ 기능 없음 -> PATCH (자동)
158
+ - 기능 신호 (feat/, 새 라우트) -> MINOR (확인)
159
+ - Breaking change -> MAJOR (확인)
160
+
161
+ ```bash
162
+ npm version {patch|minor|major} --no-git-tag-version
163
+ ```
164
+
165
+ ## Step 6: CHANGELOG 생성
166
+
167
+ 커밋을 주제별 그룹핑 -> CHANGELOG.md 상단에 추가.
168
+
169
+ ## Step 7: 릴리스 커밋
170
+
171
+ ```bash
172
+ git add package.json CHANGELOG.md
173
+ git commit -m "release: v{version}"
174
+ ```
175
+
176
+ ## Step 8: Push
177
+
178
+ ```bash
179
+ git push -u origin $(git branch --show-current)
180
+ ```
181
+
182
+ force push 절대 안 함.
183
+
184
+ ## Step 9: PR 생성
185
+
186
+ ```bash
187
+ gh pr create --title "release: v{version}" --body "..."
188
+ ```
189
+
190
+ ## Step 10: Compound-Out
191
+
192
+ 이슈가 있었으면 compound troubleshoot로 기록 제안.
193
+ </Steps>
194
+
195
+ <Review_Readiness_Dashboard>
196
+ ```
197
+ +============================================+
198
+ | REVIEW READINESS |
199
+ +============================================+
200
+ | Check | Status | Required |
201
+ |--------------------|-----------|-----------|
202
+ | Tests | {N} PASS | YES |
203
+ | Code Review | {result} | YES |
204
+ | Build | {result} | YES |
205
+ | Coverage | {N}% | no |
206
+ | Base Merge | CLEAN | YES |
207
+ +============================================+
208
+ | VERDICT: {READY TO SHIP / BLOCKED} |
209
+ +============================================+
210
+ ```
211
+ </Review_Readiness_Dashboard>
212
+
213
+ <Verification_Gate>
214
+ ## 검증의 철칙 (IRON LAW)
215
+
216
+ ```
217
+ "아마 될 거야" -> 실행해라.
218
+ "확신이 있다" -> 확신은 증거가 아니다.
219
+ "아까 테스트했는데" -> 코드가 바뀌었다. 다시 테스트해라.
220
+ "사소한 변경이라" -> 사소한 변경이 프로덕션을 깨뜨린다.
221
+ "이건 리뷰 안 해도" -> 모든 diff는 리뷰한다.
222
+ ```
223
+
224
+ 실행 결과가 곧 증거입니다. 실행하지 않은 검증은 존재하지 않습니다.
225
+ </Verification_Gate>
226
+
227
+ <Failure_Modes>
228
+ **테스트 실패 상태에서 진행**: 0 failures만 통과.
229
+ **main 브랜치에서 직접 실행**: ABORT. 새 브랜치 제안도 안 함.
230
+ **머지 충돌 자동 해결**: 충돌은 사용자가 수동 해결.
231
+ **CRITICAL 리뷰 이슈 무시**: CRITICAL 1개라도 있으면 ABORT.
232
+ **force push**: 어떤 상황에서도 사용하지 않음.
233
+ **불필요한 질문**: /ship은 비대화형. 중단 사유만 보고.
234
+ </Failure_Modes>
235
+
236
+ <Output>
237
+ ## 성공 시
238
+
239
+ ```
240
+ SHIP COMPLETE / 배포 완료
241
+ =========================
242
+ Version: {old} -> {new} ({type})
243
+ Tests: {N} passed, 0 failed
244
+ Review: APPROVED ({N} auto-fixed)
245
+ PR: #{number}
246
+ URL: {url}
247
+ ```
248
+
249
+ ## 실패 시
250
+
251
+ ```
252
+ SHIP ABORTED / 배포 중단
253
+ =========================
254
+ Step: {실패한 Step}
255
+ Reason: {중단 사유}
256
+ Action: {다음 행동}
257
+ ```
258
+ </Output>
259
+
260
+ <Policy>
261
+ - 테스트 통과는 필수. 예외 없음.
262
+ - CRITICAL 리뷰 이슈 -> 사용자 동의 없이 진행하지 않음.
263
+ - main 브랜치 직접 릴리스 = ABORT.
264
+ - 중단 사유가 아닌 한 묻지 않고 끝까지 진행.
265
+ - 실행 결과 = 증거. 추측 != 검증.
266
+ - force push 금지.
267
+ - AUTO-FIX는 데드 코드/미사용 import/stale 주석에만 적용.
268
+ </Policy>
269
+
270
+ <Arguments>
271
+ - `patch`: 버그 수정 릴리스 (0.0.X)
272
+ - `minor`: 하위 호환 새 기능 릴리스 (0.X.0)
273
+ - `major`: 하위 비호환 변경 릴리스 (X.0.0)
274
+ - 생략 시: 변경 내용 자동 분석하여 결정 (major만 사용자 확인)
275
+ </Arguments>
276
+
277
+ $ARGUMENTS
package/dist/cli.js CHANGED
@@ -9,11 +9,14 @@ import * as path from 'node:path';
9
9
  import { fileURLToPath } from 'node:url';
10
10
  import { prepareHarness, isFirstRun } from './core/harness.js';
11
11
  import { spawnClaudeWithResume } from './core/spawn.js';
12
+ import { resolveLaunchContext } from './services/session.js';
12
13
  // global-config is used by harness internally
13
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
15
  const pkgJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf-8'));
15
16
  const PKG_VERSION = pkgJson.version ?? '0.0.0';
16
- const args = process.argv.slice(2);
17
+ const launchContext = resolveLaunchContext(process.argv.slice(2));
18
+ const args = launchContext.args;
19
+ const runtime = launchContext.runtime;
17
20
  const commands = [
18
21
  {
19
22
  name: 'forge',
@@ -68,6 +71,14 @@ const commands = [
68
71
  }
69
72
  },
70
73
  },
74
+ {
75
+ name: 'dashboard',
76
+ description: 'Compound system dashboard with rich overview',
77
+ handler: async (_args) => {
78
+ const { handleDashboard } = await import('./core/dashboard.js');
79
+ await handleDashboard();
80
+ },
81
+ },
71
82
  {
72
83
  name: 'me',
73
84
  description: 'Personal dashboard (→ inspect profile)',
@@ -85,7 +96,7 @@ const commands = [
85
96
  if (args.includes('--regenerate')) {
86
97
  const { writeHooksJson } = await import('./hooks/hooks-generator.js');
87
98
  const hooksDir = path.join(process.cwd(), 'hooks');
88
- const result = writeHooksJson(hooksDir, { cwd: process.cwd() });
99
+ const result = writeHooksJson(hooksDir, { cwd: process.cwd(), runtime });
89
100
  console.log(`[forgen] hooks.json regenerated: ${result.active} active, ${result.disabled} disabled`);
90
101
  }
91
102
  else {
@@ -219,14 +230,14 @@ async function main() {
219
230
 
220
231
  Setting up...`);
221
232
  }
222
- let context = await prepareHarness(process.cwd());
233
+ let context = await prepareHarness(process.cwd(), { runtime });
223
234
  // 첫 실행 또는 프로필 없음 → 자동 온보딩 (interactive 환경)
224
235
  if (context.v1.needsOnboarding && process.stdin.isTTY) {
225
236
  console.log('\n 프로필이 없습니다. 온보딩을 시작합니다.\n');
226
237
  const { runOnboarding } = await import('./forge/onboarding-cli.js');
227
238
  await runOnboarding();
228
239
  // 온보딩 후 harness 재실행 (프로필 반영)
229
- context = await prepareHarness(process.cwd());
240
+ context = await prepareHarness(process.cwd(), { runtime });
230
241
  }
231
242
  if (firstRun && !context.v1.needsOnboarding) {
232
243
  console.log(`
@@ -244,12 +255,16 @@ async function main() {
244
255
  ${dim}Code, forged for you.${reset}
245
256
  ${dim}Scope: v1(${context.v1.session?.quality_pack ?? 'onboarding needed'})${reset}
246
257
  `);
247
- console.log('[forgen] Starting Claude Code...\n');
248
- await spawnClaudeWithResume(args, context, () => prepareHarness(process.cwd()));
258
+ const runtimeLabel = runtime === 'codex' ? 'Codex' : 'Claude';
259
+ console.log(`[forgen] Starting ${runtimeLabel}...\n`);
260
+ await spawnClaudeWithResume(args, context, () => prepareHarness(process.cwd(), { runtime }), runtime);
249
261
  }
250
262
  catch (err) {
251
263
  const msg = err instanceof Error ? err.message : String(err);
252
- if (msg.includes('ENOENT') && msg.includes('claude')) {
264
+ if (msg.includes('Codex is not installed')) {
265
+ console.error('[forgen] Codex is not installed.');
266
+ }
267
+ else if (msg.includes('Claude Code is not installed')) {
253
268
  console.error('[forgen] Claude Code not found. Install: npm install -g @anthropic-ai/claude-code');
254
269
  }
255
270
  else {
@@ -267,9 +282,10 @@ function printHelp() {
267
282
  The more you use Claude, the better it knows you.
268
283
 
269
284
  Usage:
270
- forgen Start Claude Code (harness mode)
285
+ forgen Start runtime launcher (harness mode)
271
286
  forgen "prompt" Start with a prompt
272
287
  forgen --resume Resume previous session
288
+ forgen --runtime claude|codex Select launch runtime
273
289
 
274
290
  Commands:
275
291
  forgen forge Personalize your coding profile
@@ -277,6 +293,7 @@ function printHelp() {
277
293
  forgen inspect [profile|rules|evidence|session]
278
294
  Inspect v1 state
279
295
  forgen compound Manage accumulated knowledge
296
+ forgen dashboard Compound system dashboard
280
297
  forgen me Personal dashboard
281
298
  forgen init Initialize project
282
299
  forgen config hooks Hook management
@@ -287,7 +304,7 @@ function printHelp() {
287
304
  forgen uninstall Remove forgen
288
305
 
289
306
  Harness mode (default):
290
- Wraps Claude Code with personalization, auto-compound, and safety hooks.
307
+ Wraps Claude (or Codex) with personalization, auto-compound, and safety hooks.
291
308
  `);
292
309
  }
293
310
  main().catch(() => {
@@ -483,6 +483,20 @@ ${sanitizedSummary.slice(0, 4000)}
483
483
  catch (e) {
484
484
  process.stderr.write(`[forgen-auto-compound] rule promotion: ${e instanceof Error ? e.message : String(e)}\n`);
485
485
  }
486
+ // Step 5: meta-learning (HyperAgents-inspired self-tuning)
487
+ try {
488
+ const { runMetaLearning } = await import('../engine/meta-learning/runner.js');
489
+ const metaResult = runMetaLearning(sessionId, cwd);
490
+ if (metaResult.qualityScore) {
491
+ process.stderr.write(`[forgen-meta] session quality: ${metaResult.qualityScore.overallScore}/100\n`);
492
+ }
493
+ if (metaResult.scopePromotions && metaResult.scopePromotions.length > 0) {
494
+ process.stderr.write(`[forgen-meta] promoted ${metaResult.scopePromotions.length} solution(s) to universal scope\n`);
495
+ }
496
+ }
497
+ catch (e) {
498
+ process.stderr.write(`[forgen-meta] ${e instanceof Error ? e.message : String(e)}\n`);
499
+ }
486
500
  // 완료 기록
487
501
  const statePath = path.join(FORGEN_HOME, 'state', 'last-auto-compound.json');
488
502
  fs.mkdirSync(path.dirname(statePath), { recursive: true });
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * Authoritative: docs/plans/2026-04-03-forgen-rule-renderer-spec.md
8
8
  */
9
+ import type { RuntimeHost } from './types.js';
9
10
  /** 보안 규칙 (정적 — v1 GLOBAL_SAFETY_RULES와 동일 맥락) */
10
11
  export declare function generateSecurityRules(): string;
11
12
  /** 안티패턴 감지 규칙 (정적) */
@@ -36,7 +37,7 @@ export declare function registerTmuxBindings(): Promise<void>;
36
37
  * or user scripts may still read them). When all consumers have been
37
38
  * migrated and a major version ships, remove the `COMPOUND_*` lines.
38
39
  */
39
- export declare function buildEnv(cwd: string, v1SessionId?: string): Record<string, string>;
40
+ export declare function buildEnv(cwd: string, v1SessionId?: string, runtime?: RuntimeHost): Record<string, string>;
40
41
  /**
41
42
  * Test-only exports for the C5 rendering pipeline. The ergonomic choice
42
43
  * over `export function normalizeDescription` is intentional: anything
@@ -428,12 +428,13 @@ export async function registerTmuxBindings() {
428
428
  * or user scripts may still read them). When all consumers have been
429
429
  * migrated and a major version ships, remove the `COMPOUND_*` lines.
430
430
  */
431
- export function buildEnv(cwd, v1SessionId) {
431
+ export function buildEnv(cwd, v1SessionId, runtime = 'claude') {
432
432
  const env = {
433
433
  // New canonical names
434
434
  FORGEN_HARNESS: '1',
435
435
  FORGEN_CWD: cwd,
436
436
  FORGEN_V1: '1',
437
+ FORGEN_RUNTIME: runtime,
437
438
  // Legacy compat (remove in next major)
438
439
  COMPOUND_HARNESS: '1',
439
440
  COMPOUND_CWD: cwd,
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Forgen — Compound Dashboard
3
+ *
4
+ * Provides a rich terminal overview of the compound knowledge system:
5
+ * knowledge inventory, injection activity, lifecycle transitions,
6
+ * session history, and hook health.
7
+ *
8
+ * Data is collected from:
9
+ * - ME_SOLUTIONS, ME_RULES, ME_BEHAVIOR (knowledge files)
10
+ * - MATCH_EVAL_LOG_PATH (injection/matching decisions)
11
+ * - STATE_DIR (hook-errors.json, last-extraction.json)
12
+ * - Solution frontmatter (lifecycle evidence fields)
13
+ */
14
+ import type { SolutionStatus } from '../engine/solution-format.js';
15
+ export interface KnowledgeOverview {
16
+ solutions: {
17
+ total: number;
18
+ byStatus: Record<SolutionStatus, number>;
19
+ };
20
+ rules: {
21
+ total: number;
22
+ categories: Record<string, number>;
23
+ };
24
+ behavior: {
25
+ total: number;
26
+ };
27
+ dateRange: {
28
+ oldest: string | null;
29
+ newest: string | null;
30
+ };
31
+ }
32
+ export interface InjectionActivity {
33
+ totalRecords: number;
34
+ recentInjections: Array<{
35
+ name: string;
36
+ ts: string;
37
+ source: string;
38
+ }>;
39
+ topSolutions: Array<{
40
+ name: string;
41
+ count: number;
42
+ }>;
43
+ hookCount: number;
44
+ mcpCount: number;
45
+ }
46
+ export interface ReflectionData {
47
+ totalSolutions: number;
48
+ reflectedCount: number;
49
+ unreflectedCount: number;
50
+ reflectionRate: number;
51
+ }
52
+ export interface LifecycleActivity {
53
+ recentPromotionCandidates: Array<{
54
+ name: string;
55
+ status: SolutionStatus;
56
+ evidence: {
57
+ reflected: number;
58
+ sessions: number;
59
+ negative: number;
60
+ };
61
+ }>;
62
+ statusDistribution: Record<SolutionStatus, number>;
63
+ }
64
+ export interface SessionHistory {
65
+ lastExtraction: {
66
+ date: string;
67
+ extractionsToday: number;
68
+ } | null;
69
+ }
70
+ export interface HookHealth {
71
+ errors: Array<{
72
+ hookName: string;
73
+ count: number;
74
+ lastAt: string;
75
+ }>;
76
+ }
77
+ /** Collect knowledge overview data. */
78
+ export declare function collectKnowledgeOverview(): KnowledgeOverview;
79
+ /** Collect injection activity from match-eval-log. */
80
+ export declare function collectInjectionActivity(): InjectionActivity;
81
+ /** Collect code reflection data from solution evidence. */
82
+ export declare function collectReflectionData(): ReflectionData;
83
+ /** Collect lifecycle activity data. */
84
+ export declare function collectLifecycleActivity(): LifecycleActivity;
85
+ /** Collect session extraction history. */
86
+ export declare function collectSessionHistory(): SessionHistory;
87
+ /** Collect hook error data. */
88
+ export declare function collectHookHealth(): HookHealth;
89
+ export interface LearningCurve {
90
+ correctionsLast7d: number;
91
+ correctionsPrev7d: number;
92
+ correctionTrend: 'improving' | 'stable' | 'worsening';
93
+ evidenceTotalDays: number;
94
+ sessionsAnalyzed: number;
95
+ estimatedMinutesSaved: number;
96
+ topCorrectionAxes: Array<{
97
+ axis: string;
98
+ count: number;
99
+ }>;
100
+ }
101
+ /**
102
+ * Learning Curve 수집.
103
+ * evidence 파일(교정 기록)과 compound 활용률을 교차 분석하여 "쓸수록 나아진다"를 정량화.
104
+ */
105
+ export declare function collectLearningCurve(): LearningCurve;
106
+ export declare function renderDashboard(): string;
107
+ /** CLI handler: forgen dashboard */
108
+ export declare function handleDashboard(): Promise<void>;