@wooojin/forgen 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +20 -0
- package/CHANGELOG.md +353 -0
- package/CONTRIBUTING.md +98 -0
- package/LICENSE +21 -0
- package/README.ja.md +469 -0
- package/README.ko.md +469 -0
- package/README.md +483 -0
- package/README.zh.md +469 -0
- package/agents/analyst.md +98 -0
- package/agents/architect.md +62 -0
- package/agents/code-reviewer.md +120 -0
- package/agents/code-simplifier.md +197 -0
- package/agents/critic.md +70 -0
- package/agents/debugger.md +117 -0
- package/agents/designer.md +131 -0
- package/agents/executor.md +54 -0
- package/agents/explore.md +145 -0
- package/agents/git-master.md +212 -0
- package/agents/performance-reviewer.md +172 -0
- package/agents/planner.md +29 -0
- package/agents/qa-tester.md +158 -0
- package/agents/refactoring-expert.md +168 -0
- package/agents/scientist.md +144 -0
- package/agents/security-reviewer.md +137 -0
- package/agents/test-engineer.md +153 -0
- package/agents/verifier.md +133 -0
- package/agents/writer.md +184 -0
- package/commands/api-design.md +268 -0
- package/commands/architecture-decision.md +314 -0
- package/commands/ci-cd.md +270 -0
- package/commands/code-review.md +233 -0
- package/commands/compound.md +117 -0
- package/commands/database.md +263 -0
- package/commands/debug-detective.md +99 -0
- package/commands/docker.md +274 -0
- package/commands/documentation.md +276 -0
- package/commands/ecomode.md +51 -0
- package/commands/frontend.md +271 -0
- package/commands/git-master.md +90 -0
- package/commands/incident-response.md +292 -0
- package/commands/migrate.md +101 -0
- package/commands/performance.md +288 -0
- package/commands/refactor.md +105 -0
- package/commands/security-review.md +288 -0
- package/commands/tdd.md +183 -0
- package/commands/testing-strategy.md +265 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +295 -0
- package/dist/core/auto-compound-runner.d.ts +12 -0
- package/dist/core/auto-compound-runner.js +460 -0
- package/dist/core/config-hooks.d.ts +10 -0
- package/dist/core/config-hooks.js +112 -0
- package/dist/core/config-injector.d.ts +50 -0
- package/dist/core/config-injector.js +455 -0
- package/dist/core/doctor.d.ts +1 -0
- package/dist/core/doctor.js +163 -0
- package/dist/core/errors.d.ts +81 -0
- package/dist/core/errors.js +133 -0
- package/dist/core/global-config.d.ts +43 -0
- package/dist/core/global-config.js +25 -0
- package/dist/core/harness.d.ts +24 -0
- package/dist/core/harness.js +621 -0
- package/dist/core/init.d.ts +7 -0
- package/dist/core/init.js +37 -0
- package/dist/core/inspect-cli.d.ts +7 -0
- package/dist/core/inspect-cli.js +47 -0
- package/dist/core/legacy-detector.d.ts +33 -0
- package/dist/core/legacy-detector.js +66 -0
- package/dist/core/logger.d.ts +34 -0
- package/dist/core/logger.js +121 -0
- package/dist/core/mcp-config.d.ts +44 -0
- package/dist/core/mcp-config.js +177 -0
- package/dist/core/notepad.d.ts +31 -0
- package/dist/core/notepad.js +88 -0
- package/dist/core/paths.d.ts +85 -0
- package/dist/core/paths.js +101 -0
- package/dist/core/plugin-detector.d.ts +44 -0
- package/dist/core/plugin-detector.js +226 -0
- package/dist/core/runtime-detector.d.ts +8 -0
- package/dist/core/runtime-detector.js +49 -0
- package/dist/core/scope-resolver.d.ts +8 -0
- package/dist/core/scope-resolver.js +45 -0
- package/dist/core/session-logger.d.ts +6 -0
- package/dist/core/session-logger.js +111 -0
- package/dist/core/session-store.d.ts +28 -0
- package/dist/core/session-store.js +218 -0
- package/dist/core/settings-lock.d.ts +18 -0
- package/dist/core/settings-lock.js +125 -0
- package/dist/core/spawn.d.ts +3 -0
- package/dist/core/spawn.js +135 -0
- package/dist/core/types.d.ts +108 -0
- package/dist/core/types.js +1 -0
- package/dist/core/uninstall.d.ts +4 -0
- package/dist/core/uninstall.js +307 -0
- package/dist/core/v1-bootstrap.d.ts +26 -0
- package/dist/core/v1-bootstrap.js +155 -0
- package/dist/engine/compound-cli.d.ts +24 -0
- package/dist/engine/compound-cli.js +250 -0
- package/dist/engine/compound-extractor.d.ts +68 -0
- package/dist/engine/compound-extractor.js +860 -0
- package/dist/engine/compound-lifecycle.d.ts +32 -0
- package/dist/engine/compound-lifecycle.js +305 -0
- package/dist/engine/compound-loop.d.ts +32 -0
- package/dist/engine/compound-loop.js +511 -0
- package/dist/engine/match-eval-log.d.ts +139 -0
- package/dist/engine/match-eval-log.js +270 -0
- package/dist/engine/phrase-blocklist.d.ts +119 -0
- package/dist/engine/phrase-blocklist.js +208 -0
- package/dist/engine/skill-promoter.d.ts +20 -0
- package/dist/engine/skill-promoter.js +115 -0
- package/dist/engine/solution-format.d.ts +160 -0
- package/dist/engine/solution-format.js +432 -0
- package/dist/engine/solution-index.d.ts +13 -0
- package/dist/engine/solution-index.js +252 -0
- package/dist/engine/solution-matcher.d.ts +364 -0
- package/dist/engine/solution-matcher.js +656 -0
- package/dist/engine/solution-writer.d.ts +76 -0
- package/dist/engine/solution-writer.js +157 -0
- package/dist/engine/term-matcher.d.ts +81 -0
- package/dist/engine/term-matcher.js +268 -0
- package/dist/engine/term-normalizer.d.ts +116 -0
- package/dist/engine/term-normalizer.js +171 -0
- package/dist/fgx.d.ts +6 -0
- package/dist/fgx.js +42 -0
- package/dist/forge/cli.d.ts +11 -0
- package/dist/forge/cli.js +100 -0
- package/dist/forge/evidence-processor.d.ts +21 -0
- package/dist/forge/evidence-processor.js +87 -0
- package/dist/forge/mismatch-detector.d.ts +44 -0
- package/dist/forge/mismatch-detector.js +83 -0
- package/dist/forge/onboarding-cli.d.ts +6 -0
- package/dist/forge/onboarding-cli.js +89 -0
- package/dist/forge/onboarding.d.ts +25 -0
- package/dist/forge/onboarding.js +122 -0
- package/dist/hooks/compound-reflection.d.ts +45 -0
- package/dist/hooks/compound-reflection.js +82 -0
- package/dist/hooks/context-guard.d.ts +24 -0
- package/dist/hooks/context-guard.js +156 -0
- package/dist/hooks/dangerous-patterns.json +18 -0
- package/dist/hooks/db-guard.d.ts +17 -0
- package/dist/hooks/db-guard.js +105 -0
- package/dist/hooks/hook-config.d.ts +29 -0
- package/dist/hooks/hook-config.js +92 -0
- package/dist/hooks/hook-registry.d.ts +43 -0
- package/dist/hooks/hook-registry.js +31 -0
- package/dist/hooks/hooks-generator.d.ts +49 -0
- package/dist/hooks/hooks-generator.js +99 -0
- package/dist/hooks/intent-classifier.d.ts +12 -0
- package/dist/hooks/intent-classifier.js +62 -0
- package/dist/hooks/keyword-detector.d.ts +25 -0
- package/dist/hooks/keyword-detector.js +389 -0
- package/dist/hooks/notepad-injector.d.ts +18 -0
- package/dist/hooks/notepad-injector.js +51 -0
- package/dist/hooks/permission-handler.d.ts +14 -0
- package/dist/hooks/permission-handler.js +114 -0
- package/dist/hooks/post-tool-failure.d.ts +11 -0
- package/dist/hooks/post-tool-failure.js +118 -0
- package/dist/hooks/post-tool-handlers.d.ts +17 -0
- package/dist/hooks/post-tool-handlers.js +115 -0
- package/dist/hooks/post-tool-use.d.ts +29 -0
- package/dist/hooks/post-tool-use.js +151 -0
- package/dist/hooks/pre-compact.d.ts +10 -0
- package/dist/hooks/pre-compact.js +165 -0
- package/dist/hooks/pre-tool-use.d.ts +31 -0
- package/dist/hooks/pre-tool-use.js +325 -0
- package/dist/hooks/prompt-injection-filter.d.ts +56 -0
- package/dist/hooks/prompt-injection-filter.js +287 -0
- package/dist/hooks/rate-limiter.d.ts +21 -0
- package/dist/hooks/rate-limiter.js +86 -0
- package/dist/hooks/secret-filter.d.ts +14 -0
- package/dist/hooks/secret-filter.js +65 -0
- package/dist/hooks/session-recovery.d.ts +27 -0
- package/dist/hooks/session-recovery.js +406 -0
- package/dist/hooks/shared/atomic-write.d.ts +41 -0
- package/dist/hooks/shared/atomic-write.js +148 -0
- package/dist/hooks/shared/context-budget.d.ts +37 -0
- package/dist/hooks/shared/context-budget.js +45 -0
- package/dist/hooks/shared/file-lock.d.ts +56 -0
- package/dist/hooks/shared/file-lock.js +253 -0
- package/dist/hooks/shared/hook-response.d.ts +33 -0
- package/dist/hooks/shared/hook-response.js +62 -0
- package/dist/hooks/shared/injection-caps.d.ts +39 -0
- package/dist/hooks/shared/injection-caps.js +52 -0
- package/dist/hooks/shared/plugin-signal.d.ts +23 -0
- package/dist/hooks/shared/plugin-signal.js +104 -0
- package/dist/hooks/shared/read-stdin.d.ts +8 -0
- package/dist/hooks/shared/read-stdin.js +63 -0
- package/dist/hooks/shared/sanitize-id.d.ts +7 -0
- package/dist/hooks/shared/sanitize-id.js +9 -0
- package/dist/hooks/shared/sanitize.d.ts +7 -0
- package/dist/hooks/shared/sanitize.js +22 -0
- package/dist/hooks/skill-injector.d.ts +38 -0
- package/dist/hooks/skill-injector.js +285 -0
- package/dist/hooks/slop-detector.d.ts +18 -0
- package/dist/hooks/slop-detector.js +93 -0
- package/dist/hooks/solution-injector.d.ts +58 -0
- package/dist/hooks/solution-injector.js +436 -0
- package/dist/hooks/subagent-tracker.d.ts +10 -0
- package/dist/hooks/subagent-tracker.js +90 -0
- package/dist/i18n/index.d.ts +43 -0
- package/dist/i18n/index.js +224 -0
- package/dist/lib.d.ts +14 -0
- package/dist/lib.js +14 -0
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +40 -0
- package/dist/mcp/solution-reader.d.ts +90 -0
- package/dist/mcp/solution-reader.js +273 -0
- package/dist/mcp/tools.d.ts +16 -0
- package/dist/mcp/tools.js +302 -0
- package/dist/preset/facet-catalog.d.ts +17 -0
- package/dist/preset/facet-catalog.js +46 -0
- package/dist/preset/preset-manager.d.ts +31 -0
- package/dist/preset/preset-manager.js +111 -0
- package/dist/renderer/inspect-renderer.d.ts +11 -0
- package/dist/renderer/inspect-renderer.js +123 -0
- package/dist/renderer/rule-renderer.d.ts +18 -0
- package/dist/renderer/rule-renderer.js +159 -0
- package/dist/store/evidence-store.d.ts +23 -0
- package/dist/store/evidence-store.js +58 -0
- package/dist/store/profile-store.d.ts +12 -0
- package/dist/store/profile-store.js +53 -0
- package/dist/store/recommendation-store.d.ts +22 -0
- package/dist/store/recommendation-store.js +64 -0
- package/dist/store/rule-store.d.ts +22 -0
- package/dist/store/rule-store.js +62 -0
- package/dist/store/session-state-store.d.ts +11 -0
- package/dist/store/session-state-store.js +44 -0
- package/dist/store/types.d.ts +159 -0
- package/dist/store/types.js +7 -0
- package/hooks/hook-registry.json +21 -0
- package/hooks/hooks.json +185 -0
- package/package.json +89 -0
- package/plugin.json +20 -0
- package/scripts/postinstall.js +826 -0
- package/skills/api-design/SKILL.md +262 -0
- package/skills/architecture-decision/SKILL.md +309 -0
- package/skills/ci-cd/SKILL.md +264 -0
- package/skills/code-review/SKILL.md +228 -0
- package/skills/compound/SKILL.md +101 -0
- package/skills/database/SKILL.md +257 -0
- package/skills/debug-detective/SKILL.md +95 -0
- package/skills/docker/SKILL.md +268 -0
- package/skills/documentation/SKILL.md +270 -0
- package/skills/ecomode/SKILL.md +46 -0
- package/skills/frontend/SKILL.md +265 -0
- package/skills/git-master/SKILL.md +86 -0
- package/skills/incident-response/SKILL.md +286 -0
- package/skills/migrate/SKILL.md +96 -0
- package/skills/performance/SKILL.md +282 -0
- package/skills/refactor/SKILL.md +100 -0
- package/skills/security-review/SKILL.md +282 -0
- package/skills/tdd/SKILL.md +178 -0
- package/skills/testing-strategy/SKILL.md +260 -0
- package/starter-pack/solutions/starter-api-error-responses.md +37 -0
- package/starter-pack/solutions/starter-async-patterns.md +40 -0
- package/starter-pack/solutions/starter-caching-strategy.md +40 -0
- package/starter-pack/solutions/starter-code-review-checklist.md +39 -0
- package/starter-pack/solutions/starter-debugging-systematic.md +40 -0
- package/starter-pack/solutions/starter-dependency-injection.md +40 -0
- package/starter-pack/solutions/starter-error-handling-patterns.md +38 -0
- package/starter-pack/solutions/starter-git-atomic-commits.md +36 -0
- package/starter-pack/solutions/starter-input-validation.md +40 -0
- package/starter-pack/solutions/starter-n-plus-one-queries.md +37 -0
- package/starter-pack/solutions/starter-refactor-safely.md +38 -0
- package/starter-pack/solutions/starter-secret-management.md +37 -0
- package/starter-pack/solutions/starter-separation-of-concerns.md +36 -0
- package/starter-pack/solutions/starter-tdd-red-green-refactor.md +40 -0
- package/starter-pack/solutions/starter-typescript-strict-types.md +39 -0
package/README.ja.md
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/wooo-jin/forgen/main/assets/banner.png" alt="Forgen" width="100%"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Claude Code パーソナライゼーション ハーネス。</strong><br/>
|
|
7
|
+
<strong>使えば使うほど、あなたを理解する Claude。</strong>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://www.npmjs.com/package//forgen"><img src="https://img.shields.io/npm/v//forgen.svg" alt="npm version"/></a>
|
|
12
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"/></a>
|
|
13
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="Node.js >= 20"/></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="#forgen-を使うと起こること">動作フロー</a> ·
|
|
18
|
+
<a href="#クイックスタート">クイックスタート</a> ·
|
|
19
|
+
<a href="#仕組み">仕組み</a> ·
|
|
20
|
+
<a href="#4軸パーソナライゼーション">4軸</a> ·
|
|
21
|
+
<a href="#コマンド">コマンド</a> ·
|
|
22
|
+
<a href="#アーキテクチャ">アーキテクチャ</a> ·
|
|
23
|
+
<a href="#セーフティ">セーフティ</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="README.md">English</a> ·
|
|
28
|
+
<a href="README.ko.md">한국어</a> ·
|
|
29
|
+
日本語 ·
|
|
30
|
+
<a href="README.zh.md">简体中文</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 2人の開発者。同じ Claude。まったく異なる振る舞い。
|
|
36
|
+
|
|
37
|
+
開発者 A は慎重派です。Claude にすべてのテストを実行させ、理由を説明させ、現在のファイル以外を変更する前に必ず確認を求めます。
|
|
38
|
+
|
|
39
|
+
開発者 B はスピード重視です。Claude に前提を置いて判断させ、関連ファイルも直接修正させ、結果を2行で報告させます。
|
|
40
|
+
|
|
41
|
+
forgen なしでは、両者とも同じ汎用的な Claude を使うことになります。forgen を使えば、それぞれが自分のやり方に合った Claude を手に入れます。
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
開発者 A の Claude: 開発者 B の Claude:
|
|
45
|
+
「関連する問題を3件発見しました。 「ログイン + 関連ファイル2件を修正。
|
|
46
|
+
進める前にセッションハンドラも テスト通過。リスク1件: セッション
|
|
47
|
+
修正しますか? 各問題の分析は タイムアウト未カバー。完了。」
|
|
48
|
+
以下の通りです...」
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
forgen がこれを実現します。作業スタイルをプロファイリングし、修正から学習し、Claude が毎セッション従うパーソナライズされたルールをレンダリングします。
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## forgen を使うと起こること
|
|
56
|
+
|
|
57
|
+
### 初回実行(1回のみ、約1分)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g /forgen
|
|
61
|
+
forgen
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
初回実行を検出すると、4問のオンボーディングが始まります。各質問は具体的なシナリオです:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Q1: Ambiguous implementation request
|
|
68
|
+
|
|
69
|
+
You receive "improve the login feature." Requirements are
|
|
70
|
+
unclear and adjacent modules may be affected.
|
|
71
|
+
|
|
72
|
+
A) Clarify requirements/scope first. Ask if scope expansion is possible.
|
|
73
|
+
B) Proceed if within same flow. Check when major scope expansion appears.
|
|
74
|
+
C) Make reasonable assumptions and fix adjacent files directly.
|
|
75
|
+
|
|
76
|
+
Choice (A/B/C):
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
4つの質問。4つの軸を測定。各軸にパックときめ細かなファセットを含むプロファイルが作成されます。パーソナライズされたルールファイルがレンダリングされ、Claude が読み取る場所に配置されます。
|
|
80
|
+
|
|
81
|
+
### 毎セッション(日常使用)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
forgen # `claude` の代わりに使用
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
内部の動作:
|
|
88
|
+
|
|
89
|
+
1. ハーネスが `~/.forgen/me/forge-profile.json` からプロファイルをロード
|
|
90
|
+
2. プリセットマネージャがセッションを合成: グローバル安全ルール + パック基本ルール + 個人オーバーレイ + セッションオーバーレイ
|
|
91
|
+
3. ルールレンダラがすべてを自然言語に変換し、`~/.claude/rules/v1-rules.md` に書き込み
|
|
92
|
+
4. Claude Code が起動し、それらのルールを行動指針として読み取る
|
|
93
|
+
5. セーフティフックが有効化: 危険なコマンドのブロック、シークレットのフィルタリング、プロンプトインジェクションの検出
|
|
94
|
+
|
|
95
|
+
### Claude を修正するとき
|
|
96
|
+
|
|
97
|
+
あなたが言います: 「頼んでいないファイルをリファクタリングしないで。」
|
|
98
|
+
|
|
99
|
+
Claude が `correction-record` MCP ツールを呼び出します。修正は、軸分類(`judgment_philosophy`)、種類(`avoid-this`)、信頼度スコアを含む構造化されたエビデンスとして保存されます。現在のセッションに即座に効果を持つ一時ルールが作成されます。
|
|
100
|
+
|
|
101
|
+
### セッション間(自動)
|
|
102
|
+
|
|
103
|
+
セッション終了時に auto-compound が抽出します:
|
|
104
|
+
- ソリューション(コンテキスト付きの再利用可能なパターン)
|
|
105
|
+
- 行動観察(あなたの作業の仕方)
|
|
106
|
+
- セッション学習サマリー
|
|
107
|
+
|
|
108
|
+
蓄積されたエビデンスに基づいてファセットが微調整されます。修正が継続的に現在のパックと異なる方向を指している場合、3セッション後にミスマッチ検出がトリガーされ、パック変更を提案します。
|
|
109
|
+
|
|
110
|
+
### 次のセッション
|
|
111
|
+
|
|
112
|
+
修正が反映された更新ルールがレンダリングされます。Compound 知識が MCP 経由で検索可能になります。Claude が「あなたの」Claude になっていきます。
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## クイックスタート
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# 1. インストール
|
|
120
|
+
npm install -g /forgen
|
|
121
|
+
|
|
122
|
+
# 2. 初回実行 — 4問オンボーディング(英語/韓国語選択)
|
|
123
|
+
forgen
|
|
124
|
+
|
|
125
|
+
# 3. 以降毎日
|
|
126
|
+
forgen
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 前提条件
|
|
130
|
+
|
|
131
|
+
- **Node.js** >= 20(SQLite セッション検索には >= 22 を推奨)
|
|
132
|
+
- **Claude Code** インストール・認証済み(`npm i -g @anthropic-ai/claude-code`)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 仕組み
|
|
137
|
+
|
|
138
|
+
### 学習ループ
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
+-------------------+
|
|
142
|
+
| オンボーディング |
|
|
143
|
+
| (4問) |
|
|
144
|
+
+--------+----------+
|
|
145
|
+
|
|
|
146
|
+
v
|
|
147
|
+
+-------------------------------+
|
|
148
|
+
| プロファイル作成 |
|
|
149
|
+
| 4軸 x パック + ファセット + trust |
|
|
150
|
+
+-------------------------------+
|
|
151
|
+
|
|
|
152
|
+
+-----------------------+------------------------+
|
|
153
|
+
| |
|
|
154
|
+
v |
|
|
155
|
+
+------------------+ |
|
|
156
|
+
| ルールレンダリング | ~/.claude/rules/v1-rules.md |
|
|
157
|
+
| Claude 形式に変換 | |
|
|
158
|
+
+--------+---------+ |
|
|
159
|
+
| |
|
|
160
|
+
v |
|
|
161
|
+
+------------------+ |
|
|
162
|
+
| セッション実行 | Claude がパーソナライズルールに従う |
|
|
163
|
+
| 修正すると | ---> correction-record MCP |
|
|
164
|
+
| Claude が学習 | エビデンス保存 |
|
|
165
|
+
+--------+---------+ 一時ルール作成 |
|
|
166
|
+
| |
|
|
167
|
+
v |
|
|
168
|
+
+------------------+ |
|
|
169
|
+
| セッション終了 | auto-compound 抽出: |
|
|
170
|
+
| | ソリューション + 観察 + サマリー |
|
|
171
|
+
+--------+---------+ |
|
|
172
|
+
| |
|
|
173
|
+
v |
|
|
174
|
+
+------------------+ |
|
|
175
|
+
| ファセット調整 | プロファイル微調整 |
|
|
176
|
+
| ミスマッチ確認 | 直近3セッション rolling 分析 |
|
|
177
|
+
+--------+---------+ |
|
|
178
|
+
| |
|
|
179
|
+
+------------------------------------------------+
|
|
180
|
+
(次のセッション: 更新されたルール)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Compound 知識
|
|
184
|
+
|
|
185
|
+
知識はセッションを跨いで蓄積され、検索可能になります:
|
|
186
|
+
|
|
187
|
+
| 種類 | ソース | Claude の活用方法 |
|
|
188
|
+
|------|--------|------------------|
|
|
189
|
+
| **ソリューション** | セッションから抽出 | MCP 経由の `compound-search` |
|
|
190
|
+
| **スキル** | 検証済みソリューションから昇格 | スラッシュコマンドとして自動ロード |
|
|
191
|
+
| **行動パターン** | 3回以上の観察で自動検出 | `forge-behavioral.md` に適用 |
|
|
192
|
+
| **エビデンス** | 修正 + 観察 | ファセット調整の根拠 |
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 4軸パーソナライゼーション
|
|
197
|
+
|
|
198
|
+
各軸には3つのパックがあります。各パックにはきめ細かなファセット(0-1の数値)が含まれ、修正に応じて時間とともに微調整されます。
|
|
199
|
+
|
|
200
|
+
### 品質/安全性
|
|
201
|
+
|
|
202
|
+
| パック | Claude の振る舞い |
|
|
203
|
+
|--------|-----------------|
|
|
204
|
+
| **堅実型** | 完了報告前にすべてのテストを実行。型チェック。エッジケース検証。すべてのチェックが通過するまで「完了」と言わない。 |
|
|
205
|
+
| **バランス型** | 主要な検証を実行し、残りのリスクを要約。徹底さと速度のバランス。 |
|
|
206
|
+
| **スピード型** | クイックスモークテスト。結果とリスクを即座に報告。納品を優先。 |
|
|
207
|
+
|
|
208
|
+
### 自律性
|
|
209
|
+
|
|
210
|
+
| パック | Claude の振る舞い |
|
|
211
|
+
|--------|-----------------|
|
|
212
|
+
| **確認優先型** | 隣接ファイルの変更前に確認。あいまいな要件を明確化。スコープ拡大に承認を要求。 |
|
|
213
|
+
| **バランス型** | 同じフロー内なら進行。大きなスコープ拡大が見えたら確認。 |
|
|
214
|
+
| **自律実行型** | 合理的に仮定。関連ファイルを直接修正。完了後に何をしたか報告。 |
|
|
215
|
+
|
|
216
|
+
### 判断哲学
|
|
217
|
+
|
|
218
|
+
| パック | Claude の振る舞い |
|
|
219
|
+
|--------|-----------------|
|
|
220
|
+
| **最小変更型** | 既存構造を維持。動作するコードをリファクタリングしない。修正範囲を最小限に保つ。 |
|
|
221
|
+
| **バランス型** | 現在のタスクに集中。明確な改善機会が見えたら提案。 |
|
|
222
|
+
| **構造的アプローチ型** | 繰り返しパターンや技術的負債を発見したら積極的に構造改善を提案。抽象化と再利用設計を好む。アーキテクチャの一貫性を維持。 |
|
|
223
|
+
|
|
224
|
+
### コミュニケーション
|
|
225
|
+
|
|
226
|
+
| パック | Claude の振る舞い |
|
|
227
|
+
|--------|-----------------|
|
|
228
|
+
| **簡潔型** | コードと結果のみ。先回りして説明しない。聞かれた時だけ補足。 |
|
|
229
|
+
| **バランス型** | 主要な変更と理由を要約。必要に応じてフォローアップを促す。 |
|
|
230
|
+
| **詳細型** | 何を、なぜ、影響範囲、代替案まで説明。教育的コンテキストを提供。レポートをセクション構造で整理。 |
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## レンダリングされたルールの実際の様子
|
|
235
|
+
|
|
236
|
+
forgen がセッションを合成すると、Claude が読む `v1-rules.md` ファイルをレンダリングします。異なるプロファイルがまったく異なる Claude の振る舞いを生み出す2つの実例です。
|
|
237
|
+
|
|
238
|
+
### 例1: 堅実型 + 確認優先型 + 構造的アプローチ型 + 詳細型
|
|
239
|
+
|
|
240
|
+
```markdown
|
|
241
|
+
[Conservative quality / Confirm-first autonomy / Structural judgment / Detailed communication]
|
|
242
|
+
|
|
243
|
+
## Must Not
|
|
244
|
+
- Never commit or expose .env, credentials, or API keys.
|
|
245
|
+
- Never execute destructive commands (rm -rf, DROP, force-push) without user confirmation.
|
|
246
|
+
|
|
247
|
+
## Working Defaults
|
|
248
|
+
- Trust: Dangerous bypass disabled. Always confirm before destructive commands or sensitive path access.
|
|
249
|
+
- Proactively suggest structural improvements when you spot repeated patterns or tech debt.
|
|
250
|
+
- Prefer abstraction and reusable design, but avoid over-abstraction.
|
|
251
|
+
- Maintain architectural consistency across changes.
|
|
252
|
+
|
|
253
|
+
## When To Ask
|
|
254
|
+
- Clarify requirements before starting ambiguous tasks.
|
|
255
|
+
- Ask before modifying files outside the explicitly requested scope.
|
|
256
|
+
|
|
257
|
+
## How To Validate
|
|
258
|
+
- Run all related tests, type checks, and key verifications before reporting completion.
|
|
259
|
+
- Do not say "done" until all checks pass.
|
|
260
|
+
|
|
261
|
+
## How To Report
|
|
262
|
+
- Explain what changed, why, impact scope, and alternatives considered.
|
|
263
|
+
- Provide educational context — why this approach is better, compare with alternatives.
|
|
264
|
+
- Structure reports: changes, reasoning, impact, next steps.
|
|
265
|
+
|
|
266
|
+
## Evidence Collection
|
|
267
|
+
- When the user corrects your behavior ("don't do that", "always do X", "stop doing Y"), call the correction-record MCP tool to record it as evidence.
|
|
268
|
+
- kind: fix-now (immediate fix), prefer-from-now (going forward), avoid-this (never do this)
|
|
269
|
+
- axis_hint: quality_safety, autonomy, judgment_philosophy, communication_style
|
|
270
|
+
- Do not record general feedback — only explicit behavioral corrections.
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### 例2: スピード型 + 自律実行型 + 最小変更型 + 簡潔型
|
|
274
|
+
|
|
275
|
+
```markdown
|
|
276
|
+
[Speed-first quality / Autonomous autonomy / Minimal-change judgment / Concise communication]
|
|
277
|
+
|
|
278
|
+
## Must Not
|
|
279
|
+
- Never commit or expose .env, credentials, or API keys.
|
|
280
|
+
- Never execute destructive commands (rm -rf, DROP, force-push) without user confirmation.
|
|
281
|
+
|
|
282
|
+
## Working Defaults
|
|
283
|
+
- Trust: Minimal runtime friction. Free execution except explicit bans and destructive commands.
|
|
284
|
+
- Preserve existing code structure. Do not refactor working code unnecessarily.
|
|
285
|
+
- Keep modification scope minimal. Change adjacent files only when strictly necessary.
|
|
286
|
+
- Secure evidence (tests, error logs) before making changes.
|
|
287
|
+
|
|
288
|
+
## How To Validate
|
|
289
|
+
- Quick smoke test. Report results and risks immediately.
|
|
290
|
+
|
|
291
|
+
## How To Report
|
|
292
|
+
- Keep responses short and to the point. Focus on code and results.
|
|
293
|
+
- Only elaborate when asked. Do not proactively write long explanations.
|
|
294
|
+
|
|
295
|
+
## Evidence Collection
|
|
296
|
+
- When the user corrects your behavior ("don't do that", "always do X", "stop doing Y"), call the correction-record MCP tool to record it as evidence.
|
|
297
|
+
- kind: fix-now (immediate fix), prefer-from-now (going forward), avoid-this (never do this)
|
|
298
|
+
- axis_hint: quality_safety, autonomy, judgment_philosophy, communication_style
|
|
299
|
+
- Do not record general feedback — only explicit behavioral corrections.
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
同じ Claude。同じコードベース。まったく異なる作業スタイル。1分間のオンボーディングが生み出す違いです。
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## コマンド
|
|
307
|
+
|
|
308
|
+
### コア
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
forgen # パーソナライズされた Claude Code を起動
|
|
312
|
+
forgen "ログインのバグを修正して" # プロンプト付きで起動
|
|
313
|
+
forgen --resume # 前回のセッションを再開
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### パーソナライゼーション
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
forgen onboarding # 4問オンボーディングを実行
|
|
320
|
+
forgen forge --profile # 現在のプロファイルを表示
|
|
321
|
+
forgen forge --reset soft # プロファイルをリセット (soft / learning / full)
|
|
322
|
+
forgen forge --export # プロファイルをエクスポート
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### 状態確認
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
forgen inspect profile # 4軸プロファイル + パック + ファセット
|
|
329
|
+
forgen inspect rules # アクティブ/抑制されたルール
|
|
330
|
+
forgen inspect evidence # 修正履歴
|
|
331
|
+
forgen inspect session # 現在のセッション状態
|
|
332
|
+
forgen me # パーソナルダッシュボード(inspect profile のショートカット)
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### 知識管理
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
forgen compound # 蓄積された知識をプレビュー
|
|
339
|
+
forgen compound --save # 自動分析されたパターンを保存
|
|
340
|
+
forgen skill promote <名前> # 検証済みソリューションをスキルに昇格
|
|
341
|
+
forgen skill list # 昇格されたスキルの一覧
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### システム
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
forgen init # プロジェクトを初期化
|
|
348
|
+
forgen doctor # システム診断
|
|
349
|
+
forgen config hooks # フック状態を確認
|
|
350
|
+
forgen config hooks --regenerate # フックを再生成
|
|
351
|
+
forgen mcp # MCP サーバー管理
|
|
352
|
+
forgen uninstall # forgen をきれいに削除
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### MCP ツール(セッション中に Claude が使用可能)
|
|
356
|
+
|
|
357
|
+
| ツール | 目的 |
|
|
358
|
+
|--------|------|
|
|
359
|
+
| `compound-search` | クエリで蓄積された知識を検索 |
|
|
360
|
+
| `compound-read` | ソリューション全文を読む |
|
|
361
|
+
| `compound-list` | フィルタ付きソリューション一覧 |
|
|
362
|
+
| `compound-stats` | 概要統計 |
|
|
363
|
+
| `session-search` | 過去のセッション会話を検索(SQLite FTS5、Node.js 22+) |
|
|
364
|
+
| `correction-record` | ユーザー修正を構造化されたエビデンスとして記録 |
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## アーキテクチャ
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
~/.forgen/ パーソナライゼーションホーム
|
|
372
|
+
|-- me/
|
|
373
|
+
| |-- forge-profile.json 4軸プロファイル (パック + ファセット + trust)
|
|
374
|
+
| |-- rules/ ルールストア (ルールごとの JSON ファイル)
|
|
375
|
+
| |-- behavior/ エビデンスストア (修正 + 観察)
|
|
376
|
+
| |-- recommendations/ パック推薦 (オンボーディング + ミスマッチ)
|
|
377
|
+
| +-- solutions/ Compound 知識
|
|
378
|
+
|-- state/
|
|
379
|
+
| |-- sessions/ セッション状態スナップショット
|
|
380
|
+
| +-- raw-logs/ Raw セッションログ (7日 TTL 自動クリーンアップ)
|
|
381
|
+
+-- config.json グローバル設定 (locale, trust, packs)
|
|
382
|
+
|
|
383
|
+
~/.claude/
|
|
384
|
+
|-- settings.json フック + 環境変数 (ハーネスが注入)
|
|
385
|
+
|-- rules/
|
|
386
|
+
| |-- forge-behavioral.md 学習された行動パターン (自動生成)
|
|
387
|
+
| +-- v1-rules.md レンダリングされたパーソナライゼーションルール (セッションごと)
|
|
388
|
+
|-- commands/forgen/ スラッシュコマンド (昇格されたスキル)
|
|
389
|
+
+-- .claude.json MCP サーバー登録
|
|
390
|
+
|
|
391
|
+
~/.compound/ レガシー compound ホーム (フック/MCP がまだ参照)
|
|
392
|
+
|-- me/
|
|
393
|
+
| |-- solutions/ 蓄積された compound 知識
|
|
394
|
+
| |-- behavior/ 行動パターン
|
|
395
|
+
| +-- skills/ 昇格されたスキル
|
|
396
|
+
+-- sessions.db SQLite セッション履歴 (Node.js 22+)
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### データフロー
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
forge-profile.json パーソナライゼーションの単一真実源
|
|
403
|
+
|
|
|
404
|
+
v
|
|
405
|
+
preset-manager.ts セッション状態を合成:
|
|
406
|
+
グローバル安全ルール hard constraint (常にアクティブ)
|
|
407
|
+
+ ベースパックルール プロファイルパックから
|
|
408
|
+
+ 個人オーバーレイ 修正生成ルールから
|
|
409
|
+
+ セッションオーバーレイ 現在セッションの一時ルール
|
|
410
|
+
+ ランタイム能力検出 trust ポリシー調整
|
|
411
|
+
|
|
|
412
|
+
v
|
|
413
|
+
rule-renderer.ts Rule[] を自然言語に変換:
|
|
414
|
+
フィルタ (active のみ) パイプライン: filter -> dedupe -> group ->
|
|
415
|
+
dedupe (render_key) order -> template -> budget (4000文字)
|
|
416
|
+
カテゴリ別グループ
|
|
417
|
+
順序: Must Not -> Working Defaults -> When To Ask -> How To Validate -> How To Report
|
|
418
|
+
|
|
|
419
|
+
v
|
|
420
|
+
~/.claude/rules/v1-rules.md Claude が実際に読むファイル
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## セーフティ
|
|
426
|
+
|
|
427
|
+
セーフティフックは `settings.json` に自動登録され、Claude のすべてのツール呼び出し時に実行されます。
|
|
428
|
+
|
|
429
|
+
| フック | トリガー | 機能 |
|
|
430
|
+
|--------|---------|------|
|
|
431
|
+
| **pre-tool-use** | すべてのツール実行前 | `rm -rf`、`curl\|sh`、`--force` push、危険なパターンをブロック |
|
|
432
|
+
| **db-guard** | SQL 操作 | `DROP TABLE`、`WHERE` なし `DELETE`、`TRUNCATE` をブロック |
|
|
433
|
+
| **secret-filter** | ファイル書き込み、出力 | API キー、トークン、認証情報の露出時に警告 |
|
|
434
|
+
| **slop-detector** | コード生成後 | TODO 残骸、`eslint-disable`、`as any`、`@ts-ignore` を検出 |
|
|
435
|
+
| **prompt-injection-filter** | すべての入力 | パターン + ヒューリスティックによるプロンプトインジェクションのブロック |
|
|
436
|
+
| **context-guard** | セッション中 | コンテキストウィンドウの上限に近づいた時に警告 |
|
|
437
|
+
| **rate-limiter** | MCP ツール呼び出し | 過度な MCP ツール呼び出しを防止 |
|
|
438
|
+
|
|
439
|
+
安全ルールは**ハード制約**です -- パック選択や修正で上書きできません。レンダリングされたルールの「Must Not」セクションは、プロファイルに関係なく常に存在します。
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## 主要な設計判断
|
|
444
|
+
|
|
445
|
+
- **4軸プロファイル、設定トグルではない。** 各軸にはパック(大分類)とファセット(0-1の数値によるきめ細かな調整)があります。パックは安定した振る舞いを提供し、ファセットは完全な再分類なしで微調整を可能にします。
|
|
446
|
+
|
|
447
|
+
- **エビデンスベースの学習、正規表現マッチングではない。** 修正は構造化されたデータ(`CorrectionRequest`: kind, axis_hint, message)です。Claude が分類し、アルゴリズムが適用します。ユーザー入力に対するパターンマッチングはありません。
|
|
448
|
+
|
|
449
|
+
- **パック + オーバーレイモデル。** ベースパックが安定したデフォルトを提供。修正から生成された個人オーバーレイがその上に重なります。セッションオーバーレイは一時ルール用。競合解決: セッション > 個人 > パック(グローバル安全は常にハード制約)。
|
|
450
|
+
|
|
451
|
+
- **自然言語でレンダリングされたルール。** `v1-rules.md` ファイルには設定ではなく英語(または韓国語)の文章が含まれます。Claude は「動作するコードを不必要にリファクタリングするな」のような指示を読みます -- 人間のメンターがガイダンスを与えるのと同じ方法です。
|
|
452
|
+
|
|
453
|
+
- **ミスマッチ検出。** 直近3セッションのローリング分析で、修正が継続的に現在のパックと異なる方向を指しているかを確認します。検出された場合、静かにドリフトするのではなく、パックの再推薦を提案します。
|
|
454
|
+
|
|
455
|
+
- **ランタイム trust 計算。** 希望する trust ポリシーが Claude Code の実際のランタイム権限モードと調整されます。Claude Code が `--dangerously-skip-permissions` で実行される場合、forgen は effective trust レベルをそれに応じて調整します。
|
|
456
|
+
|
|
457
|
+
- **国際化。** 英語と韓国語を完全サポート。オンボーディング時に言語を選択すると、オンボーディングの質問、レンダリングされたルール、CLI 出力全体に適用されます。
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## 共存
|
|
462
|
+
|
|
463
|
+
forgen はインストール時に他の Claude Code プラグイン(oh-my-claudecode、superpowers、claude-mem)を検出し、重複するフックを無効化します。コアのセーフティフックと compound フックは常にアクティブを維持します。
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## ライセンス
|
|
468
|
+
|
|
469
|
+
MIT
|