@wooojin/forgen 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.ja.md +79 -14
  3. package/README.ko.md +89 -14
  4. package/README.md +77 -14
  5. package/README.zh.md +79 -14
  6. package/commands/deep-interview.md +171 -0
  7. package/commands/specify.md +128 -0
  8. package/dist/cli.js +9 -0
  9. package/dist/core/dashboard.d.ts +91 -0
  10. package/dist/core/dashboard.js +385 -0
  11. package/dist/core/doctor.js +151 -21
  12. package/dist/core/drift-score.d.ts +49 -0
  13. package/dist/core/drift-score.js +87 -0
  14. package/dist/core/mcp-config.d.ts +2 -0
  15. package/dist/core/mcp-config.js +6 -1
  16. package/dist/core/paths.d.ts +1 -1
  17. package/dist/core/paths.js +1 -1
  18. package/dist/engine/compound-export.d.ts +41 -0
  19. package/dist/engine/compound-export.js +169 -0
  20. package/dist/engine/compound-loop.js +18 -0
  21. package/dist/engine/solution-matcher.d.ts +23 -0
  22. package/dist/engine/solution-matcher.js +124 -11
  23. package/dist/hooks/context-guard.d.ts +10 -0
  24. package/dist/hooks/context-guard.js +104 -58
  25. package/dist/hooks/db-guard.js +2 -2
  26. package/dist/hooks/hook-config.d.ts +27 -1
  27. package/dist/hooks/hook-config.js +72 -12
  28. package/dist/hooks/intent-classifier.d.ts +0 -2
  29. package/dist/hooks/intent-classifier.js +32 -18
  30. package/dist/hooks/keyword-detector.js +117 -111
  31. package/dist/hooks/notepad-injector.js +2 -2
  32. package/dist/hooks/permission-handler.js +2 -2
  33. package/dist/hooks/post-tool-failure.js +12 -6
  34. package/dist/hooks/post-tool-handlers.d.ts +1 -1
  35. package/dist/hooks/post-tool-handlers.js +14 -11
  36. package/dist/hooks/post-tool-use.d.ts +11 -0
  37. package/dist/hooks/post-tool-use.js +184 -71
  38. package/dist/hooks/pre-compact.d.ts +11 -1
  39. package/dist/hooks/pre-compact.js +112 -37
  40. package/dist/hooks/pre-tool-use.js +86 -56
  41. package/dist/hooks/rate-limiter.js +3 -3
  42. package/dist/hooks/secret-filter.js +2 -2
  43. package/dist/hooks/session-recovery.js +256 -236
  44. package/dist/hooks/shared/hook-response.d.ts +4 -4
  45. package/dist/hooks/shared/hook-response.js +13 -24
  46. package/dist/hooks/shared/hook-timing.d.ts +15 -0
  47. package/dist/hooks/shared/hook-timing.js +64 -0
  48. package/dist/hooks/skill-injector.js +41 -12
  49. package/dist/hooks/slop-detector.js +3 -3
  50. package/dist/hooks/solution-injector.js +224 -197
  51. package/dist/hooks/subagent-tracker.js +2 -2
  52. package/dist/renderer/rule-renderer.js +9 -11
  53. package/package.json +1 -1
  54. package/skills/deep-interview/SKILL.md +166 -0
  55. package/skills/specify/SKILL.md +122 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,34 @@ All notable changes to forgen will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.1] - 2026-04-13
9
+
10
+ ### Added
11
+ - **specify skill**: Structured requirement specification with Resolved/Provisional/Unresolved 3-level evaluation and readiness percentage
12
+ - **deep-interview skill**: Deep requirement interview with Ambiguity Score (0-10) quantification across 5 axes (What/Who/How/When/Why)
13
+ - **Agent output validation** (Tier 2-F): PostToolUse hook validates sub-agent output for empty/failed/timeout/context overflow
14
+ - **BM25 ensemble scoring** (2-C): 3-way ensemble (TF-IDF 0.5 + BM25 0.3 + bigram 0.2) for solution matching
15
+ - **Intent-based context injection** (2-B): implement/debug/refactor/review intents inject domain-specific rules
16
+ - **Harness maturity diagnosis**: `forgen doctor` shows 5-axis L0-L3 maturity score with Quick Wins
17
+ - **Session brief handoff**: Structured brief saved before compact, restored on next session start
18
+ - **Output overflow prevention**: Solution injection footer includes head_limit guidance
19
+
20
+ ### Fixed
21
+ - **Korean `\b` boundary**: Fixed 7 regex patterns where `\b` failed with Korean text (intent-classifier, keyword-detector)
22
+ - **Revert→drift connection**: `isRevert` was always false (checked messages array instead of boolean flag)
23
+ - **ALL_MODES missing specify**: `cancelforgen` didn't clear specify state
24
+ - **MCP list TypeError**: Crashed on url-format servers without `args` field
25
+ - **Agent empty string**: Empty string (`""`) was falsy, skipping validation
26
+ - **Solution content regex**: `\Z` is not valid in JavaScript (literal Z), changed to `$`
27
+ - **`severity: 'info' as 'warning'`**: Removed forced type assertion
28
+
29
+ ### Changed
30
+ - **Rule renderer AI optimization** (2-A): `[category|strength]` tag prefix format, `include_pack_summary` defaults to false (token reduction)
31
+ - **Recovery messages** (1-A): ENOENT suggests Glob search, EACCES suggests chmod
32
+ - **skill-injector lock**: Session cache protected with `withFileLockSync` (race condition fix)
33
+ - **incrementFailureCounter lock**: Context signals protected with `withFileLockSync`
34
+ - Docker E2E expanded to 68 checks (Phase 8: Hoyeon analysis verification)
35
+
8
36
  ## [5.1.0] - 2026-04-06
9
37
 
10
38
  ### Fixed
package/README.ja.md CHANGED
@@ -182,14 +182,63 @@ forgen
182
182
 
183
183
  ### Compound 知識
184
184
 
185
- 知識はセッションを跨いで蓄積され、検索可能になります:
185
+ 知識はセッションを跨いで、信頼度ベースのライフサイクルで蓄積されます:
186
+
187
+ ```
188
+ experiment (0.30) → candidate (0.55) → verified (0.75) → mature (0.90)
189
+ ```
190
+
191
+ 各ソリューションは `experiment` として始まります。セッションをまたいでコードに反映されるにつれ、自動的に昇格されます。ネガティブなエビデンスはサーキットブレーカーを発動させ(自動リタイア)、実際に機能するパターンだけが残ります。
186
192
 
187
193
  | 種類 | ソース | Claude の活用方法 |
188
194
  |------|--------|------------------|
189
- | **ソリューション** | セッションから抽出 | MCP 経由の `compound-search` |
190
- | **スキル** | 検証済みソリューションから昇格 | スラッシュコマンドとして自動ロード |
195
+ | **ソリューション** | セッションから抽出 | プロンプトに関連するものを自動注入(TF-IDF + BM25 + bigram アンサンブル) |
196
+ | **スキル** | 21個の組み込み + 検証済みソリューションから昇格 | キーワードで有効化(`specify`、`deep-interview`、`tdd` など) |
191
197
  | **行動パターン** | 3回以上の観察で自動検出 | `forge-behavioral.md` に適用 |
192
- | **エビデンス** | 修正 + 観察 | ファセット調整の根拠 |
198
+ | **エビデンス** | 修正 + 観察 | ファセット調整 + ルール作成を促進 |
199
+
200
+ ### ソリューション自動注入
201
+
202
+ 入力したプロンプトはすべて、蓄積されたソリューションと照合されます。関連するものはClaudeのコンテキストに自動注入されます — 手動検索は不要です。
203
+
204
+ ```
205
+ 入力: "API のエラーハンドリングを修正して"
206
+
207
+ solution-injector がマッチ: starter-error-handling-patterns (0.70)
208
+
209
+ Claude が見るもの: "Matched solutions: error-handling-patterns [pattern|0.70]
210
+ Use try/catch with specific error types. Always log original error..."
211
+
212
+ Claude が蓄積されたパターンを参照して、より良いエラーハンドリングコードを書く。
213
+ ```
214
+
215
+ ### 21個の組み込みスキル
216
+
217
+ プロンプトにキーワードを含めることで有効化:
218
+
219
+ | スキル | トリガー | 機能 |
220
+ |-------|---------|------|
221
+ | `specify` | "specify", "명세" | 要件を Resolved/Provisional/Unresolved で整理、準備度 % 付き |
222
+ | `deep-interview` | "deep-interview" | Ambiguity Score (0-10) 付きの深い要件インタビュー |
223
+ | `code-review` | "code review 해줘" | 重大度評価付き20項目チェックリストレビュー |
224
+ | `tdd` | "tdd 해줘" | Red-Green-Refactor テスト駆動開発 |
225
+ | `debug-detective` | "debug-detective" | 再現 → 分離 → 修正 → 検証のループ |
226
+ | `refactor` | "refactor 시작" | テストファーストの安全なリファクタリング |
227
+ | `git-master` | "git-master" | アトミックコミット + クリーンな履歴管理 |
228
+ | `security-review` | "security review" | OWASP Top 10 脆弱性チェック |
229
+ | `ecomode` | "ecomode", "에코 모드" | トークン節約モード |
230
+ | `migrate` | "migrate 해줘", "마이그레이션 시작" | 5フェーズの安全なマイグレーションワークフロー |
231
+ | ... | | 残り11個(api-design, architecture-decision, ci-cd, database, docker, documentation, frontend, incident-response, performance, testing-strategy, compound) |
232
+
233
+ ### セッション管理
234
+
235
+ | 機能 | 動作 |
236
+ |------|------|
237
+ | **セッションブリーフ** | コンテキスト圧縮前に構造化されたブリーフを保存し、次のセッションで復元 |
238
+ | **ドリフト検出** | EWMA ベースの編集レート追跡 → 15編集で警告、30で危機的、50でハードストップ |
239
+ | **エージェント出力検証** | Claude がサブエージェントを生成すると、その出力品質が自動検証される |
240
+ | **自動コンパクト** | 累積12万文字でコンテキスト圧縮の指示 |
241
+ | **ペンディング compound** | 20回以上のプロンプトセッション後、次のセッションで compound 抽出が自動トリガー |
193
242
 
194
243
  ---
195
244
 
@@ -337,6 +386,12 @@ forgen me # パーソナルダッシュボード(inspect
337
386
  ```bash
338
387
  forgen compound # 蓄積された知識をプレビュー
339
388
  forgen compound --save # 自動分析されたパターンを保存
389
+ forgen compound list # ステータス付きで全ソリューションを一覧表示
390
+ forgen compound inspect <名前> # ソリューションの詳細を表示
391
+ forgen compound --lifecycle # 昇格/降格チェックを実行
392
+ forgen compound --verify <名前> # 手動で verified に昇格
393
+ forgen compound export # 知識を tar.gz でエクスポート
394
+ forgen compound import <パス> # 知識アーカイブをインポート
340
395
  forgen skill promote <名前> # 検証済みソリューションをスキルに昇格
341
396
  forgen skill list # 昇格されたスキルの一覧
342
397
  ```
@@ -345,10 +400,14 @@ forgen skill list # 昇格されたスキルの一覧
345
400
 
346
401
  ```bash
347
402
  forgen init # プロジェクトを初期化
348
- forgen doctor # システム診断
349
- forgen config hooks # フック状態を確認
403
+ forgen doctor # システム診断(10カテゴリ + ハーネス成熟度)
404
+ forgen dashboard # 知識概要(6セクション)
405
+ forgen config hooks # フック状態 + コンテキストバジェットを確認
350
406
  forgen config hooks --regenerate # フックを再生成
351
- forgen mcp # MCP サーバー管理
407
+ forgen mcp list # インストール済み MCP サーバーを一覧
408
+ forgen mcp add <名前> # テンプレートから MCP サーバーを追加
409
+ forgen mcp templates # 利用可能なテンプレートを表示
410
+ forgen notepad show # セッションノートパッドを表示
352
411
  forgen uninstall # forgen をきれいに削除
353
412
  ```
354
413
 
@@ -356,12 +415,14 @@ forgen uninstall # forgen をきれいに削除
356
415
 
357
416
  | ツール | 目的 |
358
417
  |--------|------|
359
- | `compound-search` | クエリで蓄積された知識を検索 |
360
- | `compound-read` | ソリューション全文を読む |
361
- | `compound-list` | フィルタ付きソリューション一覧 |
362
- | `compound-stats` | 概要統計 |
418
+ | `compound-search` | クエリで蓄積された知識を検索(TF-IDF + BM25 + bigram アンサンブル) |
419
+ | `compound-read` | ソリューション全文を読む(Progressive Disclosure Tier 3) |
420
+ | `compound-list` | ステータス/タイプ/スコープフィルタ付きソリューション一覧 |
421
+ | `compound-stats` | ステータス・タイプ・スコープ別の概要統計 |
363
422
  | `session-search` | 過去のセッション会話を検索(SQLite FTS5、Node.js 22+) |
364
423
  | `correction-record` | ユーザー修正を構造化されたエビデンスとして記録 |
424
+ | `profile-read` | 現在のパーソナライゼーションプロファイルを読む |
425
+ | `rule-list` | カテゴリ別のアクティブなパーソナライゼーションルールを一覧 |
365
426
 
366
427
  ---
367
428
 
@@ -431,10 +492,12 @@ rule-renderer.ts Rule[] を自然言語に変換:
431
492
  | **pre-tool-use** | すべてのツール実行前 | `rm -rf`、`curl\|sh`、`--force` push、危険なパターンをブロック |
432
493
  | **db-guard** | SQL 操作 | `DROP TABLE`、`WHERE` なし `DELETE`、`TRUNCATE` をブロック |
433
494
  | **secret-filter** | ファイル書き込み、出力 | API キー、トークン、認証情報の露出時に警告 |
434
- | **slop-detector** | コード生成後 | TODO 残骸、`eslint-disable`、`as any`、`@ts-ignore` を検出 |
495
+ | **slop-detector** | コード生成後 | TODO 残骸、`eslint-disable`、`as any`、`@ts-ignore`、空の catch を検出 |
435
496
  | **prompt-injection-filter** | すべての入力 | パターン + ヒューリスティックによるプロンプトインジェクションのブロック |
436
- | **context-guard** | セッション中 | コンテキストウィンドウの上限に近づいた時に警告 |
497
+ | **context-guard** | セッション中 | 50プロンプト/20万文字で警告、12万文字で自動コンパクト、セッションハンドオフ |
437
498
  | **rate-limiter** | MCP ツール呼び出し | 過度な MCP ツール呼び出しを防止 |
499
+ | **drift-detector** | ファイル編集 | EWMA ベースのドリフトスコア: 警告 → 危機的 → 50編集でハードストップ |
500
+ | **agent-validator** | エージェントツール出力 | 空/失敗/切り捨てられたサブエージェント出力を警告 |
438
501
 
439
502
  安全ルールは**ハード制約**です -- パック選択や修正で上書きできません。レンダリングされたルールの「Must Not」セクションは、プロファイルに関係なく常に存在します。
440
503
 
@@ -460,7 +523,9 @@ rule-renderer.ts Rule[] を自然言語に変換:
460
523
 
461
524
  ## 共存
462
525
 
463
- forgen はインストール時に他の Claude Code プラグイン(oh-my-claudecode、superpowers、claude-mem)を検出し、重複するフックを無効化します。コアのセーフティフックと compound フックは常にアクティブを維持します。
526
+ forgen はインストール時に他の Claude Code プラグイン(oh-my-claudecode、superpowers、claude-mem)を検出し、コンテキスト注入を自動的に50%削減します(「譲歩原則」)。コアのセーフティフックと compound フックは常にアクティブを維持します。他のプラグインがすでに提供しているスキルは競合を避けるためスキップされます。
527
+
528
+ 詳細は [共存ガイド](docs/guides/with-omc.md) を参照してください。
464
529
 
465
530
  ---
466
531
 
package/README.ko.md CHANGED
@@ -182,14 +182,63 @@ forgen
182
182
 
183
183
  ### Compound 지식
184
184
 
185
- 지식은 세션을 거치며 축적되고, 검색 가능해집니다:
185
+ 지식은 세션을 거치며 신뢰도 기반 라이프사이클로 축적됩니다:
186
+
187
+ ```
188
+ experiment (0.30) → candidate (0.55) → verified (0.75) → mature (0.90)
189
+ ```
190
+
191
+ 각 솔루션은 `experiment`로 시작합니다. 세션을 거치며 코드에 반영될수록 자동 승격됩니다. 부정적 evidence는 서킷 브레이커를 작동시켜 자동 은퇴시킵니다. 실제로 당신에게 맞는 패턴만 살아남습니다.
186
192
 
187
193
  | 유형 | 출처 | Claude 활용 방법 |
188
194
  |------|------|-----------------|
189
- | **솔루션** | 세션에서 추출 | MCP를 통한 `compound-search` |
190
- | **스킬** | 검증된 솔루션에서 승격 | 슬래시 커맨드로 자동 로드 |
195
+ | **솔루션** | 세션에서 추출 | 프롬프트와 관련 있을 때 자동 주입 (TF-IDF + BM25 + bigram 앙상블) |
196
+ | **스킬** | 21개 내장 + 검증된 솔루션에서 승격 | 키워드로 활성화 (`specify`, `deep-interview`, `tdd` 등) |
191
197
  | **행동 패턴** | 3회 이상 관찰 시 자동 감지 | `forge-behavioral.md`에 적용 |
192
- | **Evidence** | 교정 + 관찰 | facet 조정의 근거 |
198
+ | **Evidence** | 교정 + 관찰 | facet 조정 및 규칙 생성의 근거 |
199
+
200
+ ### Solution 자동 주입
201
+
202
+ 입력하는 모든 프롬프트가 축적된 솔루션과 매칭됩니다. 관련 솔루션은 Claude의 컨텍스트에 자동 주입됩니다 — 직접 찾아볼 필요가 없습니다.
203
+
204
+ ```
205
+ 입력: "API의 에러 핸들링을 고쳐줘"
206
+
207
+ solution-injector 매칭: starter-error-handling-patterns (0.70)
208
+
209
+ Claude에게 전달: "매칭된 솔루션: error-handling-patterns [pattern|0.70]
210
+ 특정 에러 타입으로 try/catch 사용. 원본 에러는 반드시 로깅..."
211
+
212
+ Claude가 축적된 패턴을 바탕으로 더 나은 에러 핸들링 코드를 작성합니다.
213
+ ```
214
+
215
+ ### 21개 내장 스킬
216
+
217
+ 프롬프트에 키워드를 입력하면 활성화됩니다:
218
+
219
+ | 스킬 | 트리거 | 기능 |
220
+ |------|--------|------|
221
+ | `specify` | "specify", "명세" | 요구사항을 Resolved/Provisional/Unresolved로 구조화, 준비도 % 산출 |
222
+ | `deep-interview` | "deep-interview" | 주제별 Ambiguity Score (0-10)를 사용한 심층 요구사항 인터뷰 |
223
+ | `code-review` | "code review 해줘" | 심각도 등급이 포함된 20개 항목 체크리스트 리뷰 |
224
+ | `tdd` | "tdd 해줘" | Red-Green-Refactor 테스트 주도 개발 |
225
+ | `debug-detective` | "debug-detective" | 재현 → 격리 → 수정 → 검증 루프 |
226
+ | `refactor` | "refactor 시작" | 테스트 우선 안전한 리팩토링 |
227
+ | `git-master` | "git-master" | 원자적 커밋 + 클린 히스토리 관리 |
228
+ | `security-review` | "security review" | OWASP Top 10 취약점 점검 |
229
+ | `ecomode` | "ecomode", "에코 모드" | 토큰 절약 모드 |
230
+ | `migrate` | "migrate 해줘", "마이그레이션 시작" | 5단계 안전 마이그레이션 워크플로우 |
231
+ | ... | | 11개 추가 (api-design, architecture-decision, ci-cd, database, docker, documentation, frontend, incident-response, performance, testing-strategy, compound) |
232
+
233
+ ### 세션 관리
234
+
235
+ | 기능 | 동작 |
236
+ |------|------|
237
+ | **세션 브리프** | 컨텍스트 압축 전 구조화된 브리프 저장 → 다음 세션에서 복원 |
238
+ | **drift 감지** | EWMA 기반 편집 속도 추적 → 15회 편집 시 경고, 30회 위험, 50회 강제 정지 |
239
+ | **에이전트 출력 검증** | Claude가 서브 에이전트를 실행할 때 출력 품질 자동 검증 |
240
+ | **자동 압축** | 누적 12만 자 초과 시 Claude에게 컨텍스트 압축 지시 |
241
+ | **pending compound** | 20회 이상 프롬프트 세션 후 다음 세션에서 compound 추출 자동 트리거 |
193
242
 
194
243
  ---
195
244
 
@@ -337,6 +386,12 @@ forgen me # 개인 대시보드 (inspect profile 단축키
337
386
  ```bash
338
387
  forgen compound # 축적된 지식 미리보기
339
388
  forgen compound --save # 자동 분석된 패턴 저장
389
+ forgen compound list # 상태가 포함된 솔루션 전체 목록
390
+ forgen compound inspect <이름> # 솔루션 전체 내용 확인
391
+ forgen compound --lifecycle # 승격/강등 검사 실행
392
+ forgen compound --verify <이름> # 수동으로 verified 승격
393
+ forgen compound export # 지식을 tar.gz로 내보내기
394
+ forgen compound import <경로> # 지식 아카이브 가져오기
340
395
  forgen skill promote <이름> # 검증된 솔루션을 스킬로 승격
341
396
  forgen skill list # 승격된 스킬 목록
342
397
  ```
@@ -345,10 +400,14 @@ forgen skill list # 승격된 스킬 목록
345
400
 
346
401
  ```bash
347
402
  forgen init # 프로젝트 초기화
348
- forgen doctor # 시스템 진단
349
- forgen config hooks # 상태 확인
403
+ forgen doctor # 시스템 진단 (10개 항목 + 하네스 성숙도)
404
+ forgen dashboard # 지식 현황 대시보드 (6개 섹션)
405
+ forgen config hooks # 훅 상태 + 컨텍스트 예산 확인
350
406
  forgen config hooks --regenerate # 훅 재생성
351
- forgen mcp # MCP 서버 관리
407
+ forgen mcp list # 설치된 MCP 서버 목록
408
+ forgen mcp add <이름> # 템플릿에서 MCP 서버 추가
409
+ forgen mcp templates # 사용 가능한 템플릿 목록
410
+ forgen notepad show # 세션 노트패드 보기
352
411
  forgen uninstall # forgen 깔끔하게 제거
353
412
  ```
354
413
 
@@ -356,12 +415,14 @@ forgen uninstall # forgen 깔끔하게 제거
356
415
 
357
416
  | 도구 | 용도 |
358
417
  |------|------|
359
- | `compound-search` | 축적된 지식을 쿼리로 검색 |
360
- | `compound-read` | 솔루션 전문 읽기 |
361
- | `compound-list` | 필터가 있는 솔루션 목록 |
362
- | `compound-stats` | 통계 요약 |
418
+ | `compound-search` | 축적된 지식을 쿼리로 검색 (TF-IDF + BM25 + bigram 앙상블) |
419
+ | `compound-read` | 솔루션 전문 읽기 (Progressive Disclosure Tier 3) |
420
+ | `compound-list` | 상태/유형/범위 필터가 있는 솔루션 목록 |
421
+ | `compound-stats` | 상태, 유형, 범위별 통계 현황 |
363
422
  | `session-search` | 이전 세션 대화 검색 (SQLite FTS5, Node.js 22+) |
364
423
  | `correction-record` | 사용자 교정을 구조화된 evidence로 기록 |
424
+ | `profile-read` | 현재 개인화 프로필 읽기 |
425
+ | `rule-list` | 카테고리별 활성 개인화 규칙 목록 |
365
426
 
366
427
  ---
367
428
 
@@ -431,10 +492,12 @@ rule-renderer.ts Rule[]을 자연어로 변환:
431
492
  | **pre-tool-use** | 모든 도구 실행 전 | `rm -rf`, `curl\|sh`, `--force` push, 위험 패턴 차단 |
432
493
  | **db-guard** | SQL 연산 | `DROP TABLE`, `WHERE` 없는 `DELETE`, `TRUNCATE` 차단 |
433
494
  | **secret-filter** | 파일 쓰기, 출력 | API 키, 토큰, 자격 증명 노출 시 경고 |
434
- | **slop-detector** | 코드 생성 후 | TODO 잔재, `eslint-disable`, `as any`, `@ts-ignore` 감지 |
495
+ | **slop-detector** | 코드 생성 후 | TODO 잔재, `eslint-disable`, `as any`, `@ts-ignore`, 빈 catch 감지 |
435
496
  | **prompt-injection-filter** | 모든 입력 | 패턴 + 휴리스틱 기반 프롬프트 인젝션 차단 |
436
- | **context-guard** | 세션 중 | 컨텍스트 윈도우 한계 접근 경고 |
497
+ | **context-guard** | 세션 중 | 50 프롬프트/20만 경고, 12만 자 자동 압축, 세션 인계 |
437
498
  | **rate-limiter** | MCP 도구 호출 | 과도한 MCP 도구 호출 방지 |
499
+ | **drift-detector** | 파일 편집 | EWMA 기반 drift 점수: 경고 → 위험 → 50회 편집 시 강제 정지 |
500
+ | **agent-validator** | 에이전트 도구 출력 | 서브 에이전트 출력이 비어있거나 실패/잘린 경우 경고 |
438
501
 
439
502
  안전 규칙은 **hard constraint**입니다 -- 팩 선택이나 교정으로 재정의할 수 없습니다. 렌더링된 규칙의 "Must Not" 섹션은 프로필과 무관하게 항상 존재합니다.
440
503
 
@@ -460,7 +523,19 @@ rule-renderer.ts Rule[]을 자연어로 변환:
460
523
 
461
524
  ## 공존
462
525
 
463
- forgen는 설치 시 다른 Claude Code 플러그인(oh-my-claudecode, superpowers, claude-mem)을 감지하고 겹치는 훅을 비활성화합니다. 핵심 안전 훅과 compound 훅은 항상 활성 상태를 유지합니다.
526
+ forgen는 설치 시 다른 Claude Code 플러그인(oh-my-claudecode, superpowers, claude-mem)을 감지하고 컨텍스트 주입을 50% 자동 축소합니다 (양보 원칙). 핵심 안전 훅과 compound 훅은 항상 활성 상태를 유지합니다. 다른 플러그인이 이미 제공하는 스킬은 충돌을 피하기 위해 건너뜁니다.
527
+
528
+ 자세한 내용은 [공존 가이드](docs/guides/with-omc.md)를 참고하세요.
529
+
530
+ ---
531
+
532
+ ## 문서
533
+
534
+ | 문서 | 설명 |
535
+ |------|------|
536
+ | [훅 레퍼런스](docs/reference/hooks-reference.md) | 3개 계층의 19개 훅 — 이벤트, 타임아웃, 동작 |
537
+ | [공존 가이드](docs/guides/with-omc.md) | oh-my-claudecode와 forgen 함께 사용하기 |
538
+ | [CHANGELOG](CHANGELOG.md) | 버전 히스토리 및 릴리즈 노트 |
464
539
 
465
540
  ---
466
541
 
package/README.md CHANGED
@@ -182,14 +182,63 @@ forgen
182
182
 
183
183
  ### Compound knowledge
184
184
 
185
- Knowledge accumulates across sessions and becomes searchable:
185
+ Knowledge accumulates across sessions with a trust-based lifecycle:
186
+
187
+ ```
188
+ experiment (0.30) → candidate (0.55) → verified (0.75) → mature (0.90)
189
+ ```
190
+
191
+ Each solution starts as an `experiment`. As it gets reflected in your code across sessions, it's automatically promoted. Negative evidence triggers a circuit breaker (auto-retire). This means only patterns that actually work for you survive.
186
192
 
187
193
  | Type | Source | How Claude uses it |
188
194
  |------|--------|--------------------|
189
- | **Solutions** | Extracted from sessions | `compound-search` via MCP |
190
- | **Skills** | Promoted from verified solutions | Auto-loaded as slash commands |
195
+ | **Solutions** | Extracted from sessions | Auto-injected when relevant to your prompt (TF-IDF + BM25 + bigram ensemble) |
196
+ | **Skills** | 21 built-in + promoted from verified solutions | Activated by keyword (`specify`, `deep-interview`, `tdd`, etc.) |
191
197
  | **Behavioral patterns** | Auto-detected at 3+ observations | Applied to `forge-behavioral.md` |
192
- | **Evidence** | Corrections + observations | Drives facet adjustments |
198
+ | **Evidence** | Corrections + observations | Drives facet adjustments + rule creation |
199
+
200
+ ### Solution auto-injection
201
+
202
+ Every prompt you type is matched against your accumulated solutions. Relevant ones are automatically injected into Claude's context — no manual lookup needed.
203
+
204
+ ```
205
+ You type: "fix the error handling in the API"
206
+
207
+ solution-injector matches: starter-error-handling-patterns (0.70)
208
+
209
+ Claude sees: "Matched solutions: error-handling-patterns [pattern|0.70]
210
+ Use try/catch with specific error types. Always log original error..."
211
+
212
+ Claude writes better error handling code, informed by your accumulated patterns.
213
+ ```
214
+
215
+ ### 21 built-in skills
216
+
217
+ Activate with a keyword in your prompt:
218
+
219
+ | Skill | Trigger | What it does |
220
+ |-------|---------|-------------|
221
+ | `specify` | "specify", "명세" | Structures requirements as Resolved/Provisional/Unresolved with readiness % |
222
+ | `deep-interview` | "deep-interview" | Deep requirement interview with Ambiguity Score (0-10) per topic |
223
+ | `code-review` | "code review 해줘" | 20-item checklist review with severity ratings |
224
+ | `tdd` | "tdd 해줘" | Red-Green-Refactor test-driven development |
225
+ | `debug-detective` | "debug-detective" | Reproduce → Isolate → Fix → Verify loop |
226
+ | `refactor` | "refactor 시작" | Test-first safe refactoring |
227
+ | `git-master` | "git-master" | Atomic commits + clean history management |
228
+ | `security-review` | "security review" | OWASP Top 10 vulnerability check |
229
+ | `ecomode` | "ecomode", "에코 모드" | Token-saving mode |
230
+ | `migrate` | "migrate 해줘", "마이그레이션 시작" | 5-phase safe migration workflow |
231
+ | ... | | 11 more (api-design, architecture-decision, ci-cd, database, docker, documentation, frontend, incident-response, performance, testing-strategy, compound) |
232
+
233
+ ### Session management
234
+
235
+ | Feature | What happens |
236
+ |---------|-------------|
237
+ | **Session brief** | Before context compaction, a structured brief is saved and restored in the next session |
238
+ | **Drift detection** | EWMA-based edit rate tracking → warning at 15 edits, critical at 30, hard stop at 50 |
239
+ | **Agent output validation** | When Claude spawns sub-agents, their output quality is automatically verified |
240
+ | **Auto-compact** | At 120K chars accumulated, Claude is instructed to compact context |
241
+ | **Pending compound** | After 20+ prompt sessions, a compound extraction is auto-triggered next session |
193
242
 
194
243
  ---
195
244
 
@@ -337,6 +386,12 @@ forgen me # Personal dashboard (shortcut for inspect profi
337
386
  ```bash
338
387
  forgen compound # Preview accumulated knowledge
339
388
  forgen compound --save # Save auto-analyzed patterns
389
+ forgen compound list # List all solutions with status
390
+ forgen compound inspect <name> # Show full solution details
391
+ forgen compound --lifecycle # Run promotion/demotion check
392
+ forgen compound --verify <name> # Manually promote to verified
393
+ forgen compound export # Export knowledge as tar.gz
394
+ forgen compound import <path> # Import knowledge archive
340
395
  forgen skill promote <name> # Promote a verified solution to a skill
341
396
  forgen skill list # List promoted skills
342
397
  ```
@@ -345,10 +400,14 @@ forgen skill list # List promoted skills
345
400
 
346
401
  ```bash
347
402
  forgen init # Initialize project
348
- forgen doctor # System diagnostics
349
- forgen config hooks # View hook status
403
+ forgen doctor # System diagnostics (10 categories + harness maturity)
404
+ forgen dashboard # Knowledge overview (6 sections)
405
+ forgen config hooks # View hook status + context budget
350
406
  forgen config hooks --regenerate # Regenerate hooks
351
- forgen mcp # MCP server management
407
+ forgen mcp list # List installed MCP servers
408
+ forgen mcp add <name> # Add MCP server from template
409
+ forgen mcp templates # Show available templates
410
+ forgen notepad show # View session notepad
352
411
  forgen uninstall # Remove forgen cleanly
353
412
  ```
354
413
 
@@ -356,12 +415,14 @@ forgen uninstall # Remove forgen cleanly
356
415
 
357
416
  | Tool | Purpose |
358
417
  |------|---------|
359
- | `compound-search` | Search accumulated knowledge by query |
360
- | `compound-read` | Read full solution content |
361
- | `compound-list` | List solutions with filters |
362
- | `compound-stats` | Overview statistics |
418
+ | `compound-search` | Search accumulated knowledge by query (TF-IDF + BM25 + bigram ensemble) |
419
+ | `compound-read` | Read full solution content (Progressive Disclosure Tier 3) |
420
+ | `compound-list` | List solutions with status/type/scope filters |
421
+ | `compound-stats` | Overview statistics by status, type, scope |
363
422
  | `session-search` | Search past session conversations (SQLite FTS5, Node.js 22+) |
364
423
  | `correction-record` | Record user corrections as structured evidence |
424
+ | `profile-read` | Read current personalization profile |
425
+ | `rule-list` | List active personalization rules by category |
365
426
 
366
427
  ---
367
428
 
@@ -433,10 +494,12 @@ Safety hooks are automatically registered in `settings.json` and run on every to
433
494
  | **pre-tool-use** | Before any tool execution | Blocks `rm -rf`, `curl\|sh`, `--force` push, dangerous patterns |
434
495
  | **db-guard** | SQL operations | Blocks `DROP TABLE`, `WHERE`-less `DELETE`, `TRUNCATE` |
435
496
  | **secret-filter** | File writes and outputs | Warns when API keys, tokens, or credentials are about to be exposed |
436
- | **slop-detector** | After code generation | Detects TODO remnants, `eslint-disable`, `as any`, `@ts-ignore` |
497
+ | **slop-detector** | After code generation | Detects TODO remnants, `eslint-disable`, `as any`, `@ts-ignore`, empty catch |
437
498
  | **prompt-injection-filter** | All inputs | Blocks prompt injection attempts with pattern + heuristic detection |
438
- | **context-guard** | During session | Warns when approaching context window limit |
499
+ | **context-guard** | During session | Warns at 50 prompts/200K chars, auto-compact at 120K, session handoff |
439
500
  | **rate-limiter** | MCP tool calls | Prevents excessive MCP tool invocations |
501
+ | **drift-detector** | File edits | EWMA-based drift score: warning → critical → hard stop at 50 edits |
502
+ | **agent-validator** | Agent tool output | Warns on empty/failed/truncated sub-agent output |
440
503
 
441
504
  Safety rules are **hard constraints** -- they cannot be overridden by pack selection or corrections. The "Must Not" section in rendered rules is always present regardless of profile.
442
505
 
@@ -462,7 +525,7 @@ Safety rules are **hard constraints** -- they cannot be overridden by pack selec
462
525
 
463
526
  ## Coexistence
464
527
 
465
- Forgen detects other Claude Code plugins (oh-my-claudecode, superpowers, claude-mem) at install time and disables overlapping hooks. Core safety and compound hooks always remain active.
528
+ Forgen detects other Claude Code plugins (oh-my-claudecode, superpowers, claude-mem) at install time and automatically reduces its context injection by 50% ("yielding principle"). Core safety and compound hooks always remain active. Conflicting skills are skipped when another plugin already provides them.
466
529
 
467
530
  See [Coexistence Guide](docs/guides/with-omc.md) for details.
468
531
 
package/README.zh.md CHANGED
@@ -182,14 +182,63 @@ forgen
182
182
 
183
183
  ### Compound 知识
184
184
 
185
- 知识跨会话累积,变为可搜索的:
185
+ 知识跨会话累积,遵循基于信任度的生命周期:
186
+
187
+ ```
188
+ experiment (0.30) → candidate (0.55) → verified (0.75) → mature (0.90)
189
+ ```
190
+
191
+ 每个解决方案从 `experiment` 开始。随着它在多个会话中被反映到你的代码里,会自动晋升。负面证据触发熔断机制(自动退役)。这意味着只有真正适合你的模式才能留存。
186
192
 
187
193
  | 类型 | 来源 | Claude 如何使用 |
188
194
  |------|------|----------------|
189
- | **解决方案** | 从会话中提取 | 通过 MCP `compound-search` |
190
- | **技能** | 从已验证的解决方案晋升 | 作为斜杠命令自动加载 |
195
+ | **解决方案** | 从会话中提取 | 与提示相关时自动注入(TF-IDF + BM25 + bigram 集成) |
196
+ | **技能** | 21个内置 + 从已验证解决方案晋升 | 关键词激活(`specify`、`deep-interview`、`tdd` 等) |
191
197
  | **行为模式** | 3次以上观察时自动检测 | 应用到 `forge-behavioral.md` |
192
- | **证据** | 纠正 + 观察 | 驱动 facet 调整 |
198
+ | **证据** | 纠正 + 观察 | 驱动 facet 调整 + 规则创建 |
199
+
200
+ ### 解决方案自动注入
201
+
202
+ 你输入的每个提示都会与你积累的解决方案进行匹配。相关的解决方案会自动注入 Claude 的上下文 — 无需手动查找。
203
+
204
+ ```
205
+ 你输入: "修复 API 中的错误处理"
206
+
207
+ solution-injector 匹配: starter-error-handling-patterns (0.70)
208
+
209
+ Claude 看到: "Matched solutions: error-handling-patterns [pattern|0.70]
210
+ Use try/catch with specific error types. Always log original error..."
211
+
212
+ Claude 参考你积累的模式,写出更好的错误处理代码。
213
+ ```
214
+
215
+ ### 21个内置技能
216
+
217
+ 在提示中包含关键词即可激活:
218
+
219
+ | 技能 | 触发词 | 功能 |
220
+ |------|--------|------|
221
+ | `specify` | "specify", "명세" | 将需求整理为 Resolved/Provisional/Unresolved,附就绪度 % |
222
+ | `deep-interview` | "deep-interview" | 深度需求访谈,每个主题附 Ambiguity Score (0-10) |
223
+ | `code-review` | "code review 해줘" | 附严重度评级的20条清单审查 |
224
+ | `tdd` | "tdd 해줘" | Red-Green-Refactor 测试驱动开发 |
225
+ | `debug-detective` | "debug-detective" | 复现 → 隔离 → 修复 → 验证循环 |
226
+ | `refactor` | "refactor 시작" | 测试优先的安全重构 |
227
+ | `git-master` | "git-master" | 原子提交 + 清晰历史管理 |
228
+ | `security-review` | "security review" | OWASP Top 10 漏洞检查 |
229
+ | `ecomode` | "ecomode", "에코 모드" | Token 节省模式 |
230
+ | `migrate` | "migrate 해줘", "마이그레이션 시작" | 5阶段安全迁移工作流 |
231
+ | ... | | 另外11个(api-design, architecture-decision, ci-cd, database, docker, documentation, frontend, incident-response, performance, testing-strategy, compound) |
232
+
233
+ ### 会话管理
234
+
235
+ | 功能 | 发生了什么 |
236
+ |------|-----------|
237
+ | **会话摘要** | 上下文压缩前保存结构化摘要,在下一个会话中恢复 |
238
+ | **漂移检测** | 基于 EWMA 的编辑速率追踪 → 15次编辑警告,30次危急,50次硬停止 |
239
+ | **智能体输出验证** | 当 Claude 生成子智能体时,自动验证其输出质量 |
240
+ | **自动压缩** | 累积12万字符时,指示 Claude 压缩上下文 |
241
+ | **待处理 compound** | 超过20个提示会话后,下一个会话自动触发 compound 提取 |
193
242
 
194
243
  ---
195
244
 
@@ -337,6 +386,12 @@ forgen me # 个人仪表盘(inspect profile 的快捷方
337
386
  ```bash
338
387
  forgen compound # 预览累积的知识
339
388
  forgen compound --save # 保存自动分析的模式
389
+ forgen compound list # 列出所有解决方案及状态
390
+ forgen compound inspect <名称> # 查看解决方案完整详情
391
+ forgen compound --lifecycle # 运行晋升/降级检查
392
+ forgen compound --verify <名称> # 手动晋升为 verified
393
+ forgen compound export # 将知识导出为 tar.gz
394
+ forgen compound import <路径> # 导入知识归档
340
395
  forgen skill promote <名称> # 将已验证的解决方案晋升为技能
341
396
  forgen skill list # 列出已晋升的技能
342
397
  ```
@@ -345,10 +400,14 @@ forgen skill list # 列出已晋升的技能
345
400
 
346
401
  ```bash
347
402
  forgen init # 初始化项目
348
- forgen doctor # 系统诊断
349
- forgen config hooks # 查看钩子状态
403
+ forgen doctor # 系统诊断(10个类别 + 引擎成熟度)
404
+ forgen dashboard # 知识概览(6个板块)
405
+ forgen config hooks # 查看钩子状态 + 上下文预算
350
406
  forgen config hooks --regenerate # 重新生成钩子
351
- forgen mcp # MCP 服务器管理
407
+ forgen mcp list # 列出已安装的 MCP 服务器
408
+ forgen mcp add <名称> # 从模板添加 MCP 服务器
409
+ forgen mcp templates # 显示可用模板
410
+ forgen notepad show # 查看会话记事本
352
411
  forgen uninstall # 干净地卸载 forgen
353
412
  ```
354
413
 
@@ -356,12 +415,14 @@ forgen uninstall # 干净地卸载 forgen
356
415
 
357
416
  | 工具 | 用途 |
358
417
  |------|------|
359
- | `compound-search` | 按查询搜索累积的知识 |
360
- | `compound-read` | 读取解决方案全文 |
361
- | `compound-list` | 带过滤器的解决方案列表 |
362
- | `compound-stats` | 概览统计 |
418
+ | `compound-search` | 按查询搜索累积的知识(TF-IDF + BM25 + bigram 集成) |
419
+ | `compound-read` | 读取解决方案全文(Progressive Disclosure Tier 3) |
420
+ | `compound-list` | 带状态/类型/范围过滤器的解决方案列表 |
421
+ | `compound-stats` | 按状态、类型、范围的概览统计 |
363
422
  | `session-search` | 搜索过去的会话对话(SQLite FTS5,Node.js 22+) |
364
423
  | `correction-record` | 将用户纠正记录为结构化证据 |
424
+ | `profile-read` | 读取当前个性化档案 |
425
+ | `rule-list` | 按类别列出活跃的个性化规则 |
365
426
 
366
427
  ---
367
428
 
@@ -431,10 +492,12 @@ rule-renderer.ts 将 Rule[] 转换为自然语言:
431
492
  | **pre-tool-use** | 所有工具执行前 | 拦截 `rm -rf`、`curl\|sh`、`--force` push、危险模式 |
432
493
  | **db-guard** | SQL 操作 | 拦截 `DROP TABLE`、无 `WHERE` 的 `DELETE`、`TRUNCATE` |
433
494
  | **secret-filter** | 文件写入和输出 | API 密钥、令牌、凭据即将暴露时发出警告 |
434
- | **slop-detector** | 代码生成后 | 检测 TODO 残留、`eslint-disable`、`as any`、`@ts-ignore` |
495
+ | **slop-detector** | 代码生成后 | 检测 TODO 残留、`eslint-disable`、`as any`、`@ts-ignore`、空 catch 块 |
435
496
  | **prompt-injection-filter** | 所有输入 | 基于模式 + 启发式的 prompt 注入拦截 |
436
- | **context-guard** | 会话中 | 接近上下文窗口限制时发出警告 |
497
+ | **context-guard** | 会话中 | 50个提示/20万字符时警告,12万字符自动压缩,会话交接 |
437
498
  | **rate-limiter** | MCP 工具调用 | 防止过度的 MCP 工具调用 |
499
+ | **drift-detector** | 文件编辑 | 基于 EWMA 的漂移评分: 警告 → 危急 → 50次编辑硬停止 |
500
+ | **agent-validator** | 智能体工具输出 | 对空/失败/截断的子智能体输出发出警告 |
438
501
 
439
502
  安全规则是**硬约束** -- 不能被 pack 选择或纠正覆盖。渲染规则中的 "Must Not" 部分无论档案如何始终存在。
440
503
 
@@ -460,7 +523,9 @@ rule-renderer.ts 将 Rule[] 转换为自然语言:
460
523
 
461
524
  ## 共存
462
525
 
463
- forgen 在安装时检测其他 Claude Code 插件(oh-my-claudecode、superpowers、claude-mem),并禁用重叠的钩子。核心安全钩子和 compound 钩子始终保持活跃。
526
+ forgen 在安装时检测其他 Claude Code 插件(oh-my-claudecode、superpowers、claude-mem),并自动将上下文注入量减少 50%("让步原则")。核心安全钩子和 compound 钩子始终保持活跃。当其他插件已提供相同技能时,forgen 会跳过该技能以避免冲突。
527
+
528
+ 详情请参阅 [共存指南](docs/guides/with-omc.md)。
464
529
 
465
530
  ---
466
531