@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.
Files changed (268) hide show
  1. package/.claude-plugin/plugin.json +20 -0
  2. package/CHANGELOG.md +353 -0
  3. package/CONTRIBUTING.md +98 -0
  4. package/LICENSE +21 -0
  5. package/README.ja.md +469 -0
  6. package/README.ko.md +469 -0
  7. package/README.md +483 -0
  8. package/README.zh.md +469 -0
  9. package/agents/analyst.md +98 -0
  10. package/agents/architect.md +62 -0
  11. package/agents/code-reviewer.md +120 -0
  12. package/agents/code-simplifier.md +197 -0
  13. package/agents/critic.md +70 -0
  14. package/agents/debugger.md +117 -0
  15. package/agents/designer.md +131 -0
  16. package/agents/executor.md +54 -0
  17. package/agents/explore.md +145 -0
  18. package/agents/git-master.md +212 -0
  19. package/agents/performance-reviewer.md +172 -0
  20. package/agents/planner.md +29 -0
  21. package/agents/qa-tester.md +158 -0
  22. package/agents/refactoring-expert.md +168 -0
  23. package/agents/scientist.md +144 -0
  24. package/agents/security-reviewer.md +137 -0
  25. package/agents/test-engineer.md +153 -0
  26. package/agents/verifier.md +133 -0
  27. package/agents/writer.md +184 -0
  28. package/commands/api-design.md +268 -0
  29. package/commands/architecture-decision.md +314 -0
  30. package/commands/ci-cd.md +270 -0
  31. package/commands/code-review.md +233 -0
  32. package/commands/compound.md +117 -0
  33. package/commands/database.md +263 -0
  34. package/commands/debug-detective.md +99 -0
  35. package/commands/docker.md +274 -0
  36. package/commands/documentation.md +276 -0
  37. package/commands/ecomode.md +51 -0
  38. package/commands/frontend.md +271 -0
  39. package/commands/git-master.md +90 -0
  40. package/commands/incident-response.md +292 -0
  41. package/commands/migrate.md +101 -0
  42. package/commands/performance.md +288 -0
  43. package/commands/refactor.md +105 -0
  44. package/commands/security-review.md +288 -0
  45. package/commands/tdd.md +183 -0
  46. package/commands/testing-strategy.md +265 -0
  47. package/dist/cli.d.ts +2 -0
  48. package/dist/cli.js +295 -0
  49. package/dist/core/auto-compound-runner.d.ts +12 -0
  50. package/dist/core/auto-compound-runner.js +460 -0
  51. package/dist/core/config-hooks.d.ts +10 -0
  52. package/dist/core/config-hooks.js +112 -0
  53. package/dist/core/config-injector.d.ts +50 -0
  54. package/dist/core/config-injector.js +455 -0
  55. package/dist/core/doctor.d.ts +1 -0
  56. package/dist/core/doctor.js +163 -0
  57. package/dist/core/errors.d.ts +81 -0
  58. package/dist/core/errors.js +133 -0
  59. package/dist/core/global-config.d.ts +43 -0
  60. package/dist/core/global-config.js +25 -0
  61. package/dist/core/harness.d.ts +24 -0
  62. package/dist/core/harness.js +621 -0
  63. package/dist/core/init.d.ts +7 -0
  64. package/dist/core/init.js +37 -0
  65. package/dist/core/inspect-cli.d.ts +7 -0
  66. package/dist/core/inspect-cli.js +47 -0
  67. package/dist/core/legacy-detector.d.ts +33 -0
  68. package/dist/core/legacy-detector.js +66 -0
  69. package/dist/core/logger.d.ts +34 -0
  70. package/dist/core/logger.js +121 -0
  71. package/dist/core/mcp-config.d.ts +44 -0
  72. package/dist/core/mcp-config.js +177 -0
  73. package/dist/core/notepad.d.ts +31 -0
  74. package/dist/core/notepad.js +88 -0
  75. package/dist/core/paths.d.ts +85 -0
  76. package/dist/core/paths.js +101 -0
  77. package/dist/core/plugin-detector.d.ts +44 -0
  78. package/dist/core/plugin-detector.js +226 -0
  79. package/dist/core/runtime-detector.d.ts +8 -0
  80. package/dist/core/runtime-detector.js +49 -0
  81. package/dist/core/scope-resolver.d.ts +8 -0
  82. package/dist/core/scope-resolver.js +45 -0
  83. package/dist/core/session-logger.d.ts +6 -0
  84. package/dist/core/session-logger.js +111 -0
  85. package/dist/core/session-store.d.ts +28 -0
  86. package/dist/core/session-store.js +218 -0
  87. package/dist/core/settings-lock.d.ts +18 -0
  88. package/dist/core/settings-lock.js +125 -0
  89. package/dist/core/spawn.d.ts +3 -0
  90. package/dist/core/spawn.js +135 -0
  91. package/dist/core/types.d.ts +108 -0
  92. package/dist/core/types.js +1 -0
  93. package/dist/core/uninstall.d.ts +4 -0
  94. package/dist/core/uninstall.js +307 -0
  95. package/dist/core/v1-bootstrap.d.ts +26 -0
  96. package/dist/core/v1-bootstrap.js +155 -0
  97. package/dist/engine/compound-cli.d.ts +24 -0
  98. package/dist/engine/compound-cli.js +250 -0
  99. package/dist/engine/compound-extractor.d.ts +68 -0
  100. package/dist/engine/compound-extractor.js +860 -0
  101. package/dist/engine/compound-lifecycle.d.ts +32 -0
  102. package/dist/engine/compound-lifecycle.js +305 -0
  103. package/dist/engine/compound-loop.d.ts +32 -0
  104. package/dist/engine/compound-loop.js +511 -0
  105. package/dist/engine/match-eval-log.d.ts +139 -0
  106. package/dist/engine/match-eval-log.js +270 -0
  107. package/dist/engine/phrase-blocklist.d.ts +119 -0
  108. package/dist/engine/phrase-blocklist.js +208 -0
  109. package/dist/engine/skill-promoter.d.ts +20 -0
  110. package/dist/engine/skill-promoter.js +115 -0
  111. package/dist/engine/solution-format.d.ts +160 -0
  112. package/dist/engine/solution-format.js +432 -0
  113. package/dist/engine/solution-index.d.ts +13 -0
  114. package/dist/engine/solution-index.js +252 -0
  115. package/dist/engine/solution-matcher.d.ts +364 -0
  116. package/dist/engine/solution-matcher.js +656 -0
  117. package/dist/engine/solution-writer.d.ts +76 -0
  118. package/dist/engine/solution-writer.js +157 -0
  119. package/dist/engine/term-matcher.d.ts +81 -0
  120. package/dist/engine/term-matcher.js +268 -0
  121. package/dist/engine/term-normalizer.d.ts +116 -0
  122. package/dist/engine/term-normalizer.js +171 -0
  123. package/dist/fgx.d.ts +6 -0
  124. package/dist/fgx.js +42 -0
  125. package/dist/forge/cli.d.ts +11 -0
  126. package/dist/forge/cli.js +100 -0
  127. package/dist/forge/evidence-processor.d.ts +21 -0
  128. package/dist/forge/evidence-processor.js +87 -0
  129. package/dist/forge/mismatch-detector.d.ts +44 -0
  130. package/dist/forge/mismatch-detector.js +83 -0
  131. package/dist/forge/onboarding-cli.d.ts +6 -0
  132. package/dist/forge/onboarding-cli.js +89 -0
  133. package/dist/forge/onboarding.d.ts +25 -0
  134. package/dist/forge/onboarding.js +122 -0
  135. package/dist/hooks/compound-reflection.d.ts +45 -0
  136. package/dist/hooks/compound-reflection.js +82 -0
  137. package/dist/hooks/context-guard.d.ts +24 -0
  138. package/dist/hooks/context-guard.js +156 -0
  139. package/dist/hooks/dangerous-patterns.json +18 -0
  140. package/dist/hooks/db-guard.d.ts +17 -0
  141. package/dist/hooks/db-guard.js +105 -0
  142. package/dist/hooks/hook-config.d.ts +29 -0
  143. package/dist/hooks/hook-config.js +92 -0
  144. package/dist/hooks/hook-registry.d.ts +43 -0
  145. package/dist/hooks/hook-registry.js +31 -0
  146. package/dist/hooks/hooks-generator.d.ts +49 -0
  147. package/dist/hooks/hooks-generator.js +99 -0
  148. package/dist/hooks/intent-classifier.d.ts +12 -0
  149. package/dist/hooks/intent-classifier.js +62 -0
  150. package/dist/hooks/keyword-detector.d.ts +25 -0
  151. package/dist/hooks/keyword-detector.js +389 -0
  152. package/dist/hooks/notepad-injector.d.ts +18 -0
  153. package/dist/hooks/notepad-injector.js +51 -0
  154. package/dist/hooks/permission-handler.d.ts +14 -0
  155. package/dist/hooks/permission-handler.js +114 -0
  156. package/dist/hooks/post-tool-failure.d.ts +11 -0
  157. package/dist/hooks/post-tool-failure.js +118 -0
  158. package/dist/hooks/post-tool-handlers.d.ts +17 -0
  159. package/dist/hooks/post-tool-handlers.js +115 -0
  160. package/dist/hooks/post-tool-use.d.ts +29 -0
  161. package/dist/hooks/post-tool-use.js +151 -0
  162. package/dist/hooks/pre-compact.d.ts +10 -0
  163. package/dist/hooks/pre-compact.js +165 -0
  164. package/dist/hooks/pre-tool-use.d.ts +31 -0
  165. package/dist/hooks/pre-tool-use.js +325 -0
  166. package/dist/hooks/prompt-injection-filter.d.ts +56 -0
  167. package/dist/hooks/prompt-injection-filter.js +287 -0
  168. package/dist/hooks/rate-limiter.d.ts +21 -0
  169. package/dist/hooks/rate-limiter.js +86 -0
  170. package/dist/hooks/secret-filter.d.ts +14 -0
  171. package/dist/hooks/secret-filter.js +65 -0
  172. package/dist/hooks/session-recovery.d.ts +27 -0
  173. package/dist/hooks/session-recovery.js +406 -0
  174. package/dist/hooks/shared/atomic-write.d.ts +41 -0
  175. package/dist/hooks/shared/atomic-write.js +148 -0
  176. package/dist/hooks/shared/context-budget.d.ts +37 -0
  177. package/dist/hooks/shared/context-budget.js +45 -0
  178. package/dist/hooks/shared/file-lock.d.ts +56 -0
  179. package/dist/hooks/shared/file-lock.js +253 -0
  180. package/dist/hooks/shared/hook-response.d.ts +33 -0
  181. package/dist/hooks/shared/hook-response.js +62 -0
  182. package/dist/hooks/shared/injection-caps.d.ts +39 -0
  183. package/dist/hooks/shared/injection-caps.js +52 -0
  184. package/dist/hooks/shared/plugin-signal.d.ts +23 -0
  185. package/dist/hooks/shared/plugin-signal.js +104 -0
  186. package/dist/hooks/shared/read-stdin.d.ts +8 -0
  187. package/dist/hooks/shared/read-stdin.js +63 -0
  188. package/dist/hooks/shared/sanitize-id.d.ts +7 -0
  189. package/dist/hooks/shared/sanitize-id.js +9 -0
  190. package/dist/hooks/shared/sanitize.d.ts +7 -0
  191. package/dist/hooks/shared/sanitize.js +22 -0
  192. package/dist/hooks/skill-injector.d.ts +38 -0
  193. package/dist/hooks/skill-injector.js +285 -0
  194. package/dist/hooks/slop-detector.d.ts +18 -0
  195. package/dist/hooks/slop-detector.js +93 -0
  196. package/dist/hooks/solution-injector.d.ts +58 -0
  197. package/dist/hooks/solution-injector.js +436 -0
  198. package/dist/hooks/subagent-tracker.d.ts +10 -0
  199. package/dist/hooks/subagent-tracker.js +90 -0
  200. package/dist/i18n/index.d.ts +43 -0
  201. package/dist/i18n/index.js +224 -0
  202. package/dist/lib.d.ts +14 -0
  203. package/dist/lib.js +14 -0
  204. package/dist/mcp/server.d.ts +8 -0
  205. package/dist/mcp/server.js +40 -0
  206. package/dist/mcp/solution-reader.d.ts +90 -0
  207. package/dist/mcp/solution-reader.js +273 -0
  208. package/dist/mcp/tools.d.ts +16 -0
  209. package/dist/mcp/tools.js +302 -0
  210. package/dist/preset/facet-catalog.d.ts +17 -0
  211. package/dist/preset/facet-catalog.js +46 -0
  212. package/dist/preset/preset-manager.d.ts +31 -0
  213. package/dist/preset/preset-manager.js +111 -0
  214. package/dist/renderer/inspect-renderer.d.ts +11 -0
  215. package/dist/renderer/inspect-renderer.js +123 -0
  216. package/dist/renderer/rule-renderer.d.ts +18 -0
  217. package/dist/renderer/rule-renderer.js +159 -0
  218. package/dist/store/evidence-store.d.ts +23 -0
  219. package/dist/store/evidence-store.js +58 -0
  220. package/dist/store/profile-store.d.ts +12 -0
  221. package/dist/store/profile-store.js +53 -0
  222. package/dist/store/recommendation-store.d.ts +22 -0
  223. package/dist/store/recommendation-store.js +64 -0
  224. package/dist/store/rule-store.d.ts +22 -0
  225. package/dist/store/rule-store.js +62 -0
  226. package/dist/store/session-state-store.d.ts +11 -0
  227. package/dist/store/session-state-store.js +44 -0
  228. package/dist/store/types.d.ts +159 -0
  229. package/dist/store/types.js +7 -0
  230. package/hooks/hook-registry.json +21 -0
  231. package/hooks/hooks.json +185 -0
  232. package/package.json +89 -0
  233. package/plugin.json +20 -0
  234. package/scripts/postinstall.js +826 -0
  235. package/skills/api-design/SKILL.md +262 -0
  236. package/skills/architecture-decision/SKILL.md +309 -0
  237. package/skills/ci-cd/SKILL.md +264 -0
  238. package/skills/code-review/SKILL.md +228 -0
  239. package/skills/compound/SKILL.md +101 -0
  240. package/skills/database/SKILL.md +257 -0
  241. package/skills/debug-detective/SKILL.md +95 -0
  242. package/skills/docker/SKILL.md +268 -0
  243. package/skills/documentation/SKILL.md +270 -0
  244. package/skills/ecomode/SKILL.md +46 -0
  245. package/skills/frontend/SKILL.md +265 -0
  246. package/skills/git-master/SKILL.md +86 -0
  247. package/skills/incident-response/SKILL.md +286 -0
  248. package/skills/migrate/SKILL.md +96 -0
  249. package/skills/performance/SKILL.md +282 -0
  250. package/skills/refactor/SKILL.md +100 -0
  251. package/skills/security-review/SKILL.md +282 -0
  252. package/skills/tdd/SKILL.md +178 -0
  253. package/skills/testing-strategy/SKILL.md +260 -0
  254. package/starter-pack/solutions/starter-api-error-responses.md +37 -0
  255. package/starter-pack/solutions/starter-async-patterns.md +40 -0
  256. package/starter-pack/solutions/starter-caching-strategy.md +40 -0
  257. package/starter-pack/solutions/starter-code-review-checklist.md +39 -0
  258. package/starter-pack/solutions/starter-debugging-systematic.md +40 -0
  259. package/starter-pack/solutions/starter-dependency-injection.md +40 -0
  260. package/starter-pack/solutions/starter-error-handling-patterns.md +38 -0
  261. package/starter-pack/solutions/starter-git-atomic-commits.md +36 -0
  262. package/starter-pack/solutions/starter-input-validation.md +40 -0
  263. package/starter-pack/solutions/starter-n-plus-one-queries.md +37 -0
  264. package/starter-pack/solutions/starter-refactor-safely.md +38 -0
  265. package/starter-pack/solutions/starter-secret-management.md +37 -0
  266. package/starter-pack/solutions/starter-separation-of-concerns.md +36 -0
  267. package/starter-pack/solutions/starter-tdd-red-green-refactor.md +40 -0
  268. package/starter-pack/solutions/starter-typescript-strict-types.md +39 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://claude.ai/schemas/claude-plugin.json",
3
+ "name": "forgen",
4
+ "version": "5.1.2",
5
+ "description": "Claude Code harness — the more you use Claude, the better it gets",
6
+ "author": {
7
+ "name": "jang-ujin",
8
+ "url": "https://github.com/wooo-jin"
9
+ },
10
+ "repository": "https://github.com/wooo-jin/forgen",
11
+ "homepage": "https://github.com/wooo-jin/forgen",
12
+ "license": "MIT",
13
+ "keywords": ["claude-code", "harness", "personalization", "forge"],
14
+ "skills": "./skills/",
15
+ "agents": "agents/",
16
+ "statusLine": {
17
+ "type": "command",
18
+ "command": "forgen me"
19
+ }
20
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,353 @@
1
+ # Changelog
2
+
3
+ All notable changes to forgen will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [5.1.0] - 2026-04-06
9
+
10
+ ### Fixed
11
+ - **Reflection 메커니즘 수리**: compound-read MCP 호출 시 `reflected += 1` 기록 — lifecycle 프로모션 루프 해제 (injected 30회인데 reflected 0이던 문제 해결)
12
+ - **훅 주입 누락 (W0)**: harness가 hooks.json을 settings.json에 직접 주입 — 플러그인 캐시 없이도 17개 훅 런타임 작동
13
+ - **태그 노이즈**: 한국어 조사 strip (`stripKoSuffix`), 영어 스톱워드 6개 추가, MAX_TAGS 10→8
14
+
15
+ ### Added
16
+ - `forgen compound retag` CLI 서브커맨드 — 기존 솔루션 태그 일괄 재생성
17
+ - `readSolution()` `skipEvidence` 옵션 — compound-search snippet에서 evidence 오염 방지
18
+ - `migrateToForgen()` — `~/.compound/` → `~/.forgen/` 자동 마이그레이션 + symlink
19
+
20
+ ### Changed
21
+ - 모든 `ME_*` 경로를 `~/.forgen/` 기반으로 통합 (스토리지 이원화 해소)
22
+ - `V1_*` 상수 deprecated 처리 (ME_*와 동일 경로)
23
+ - 완료/폐기된 계획 21개를 `docs/history/`로 이관
24
+
25
+ ## [5.0.0] - 2026-04-03
26
+
27
+ ### Breaking Changes
28
+ - v1 personalization engine: 4-axis profile (quality_safety, autonomy, judgment_philosophy, communication_style)
29
+ - 60% 코드 제거 (pack, remix, dashboard, loops, constraints, knowledge 등)
30
+
31
+ ### Added
32
+ - Evidence-based learning: correction-record MCP → facet delta → profile auto-update
33
+ - Mismatch detection: rolling 3-session behavioral divergence alert
34
+ - Starter solutions: 15개 Day 0 value pack + postinstall seed
35
+ - Session store: SQLite FTS5 full-text session search
36
+
37
+ ## [3.1.0] - 2026-04-01
38
+
39
+ ### Added
40
+ - **Understanding layer (Phase 1)**: HTML dashboard (`forgen me --html`), Knowledge Map (`forgen compound map`), Evolution Timeline (sparkline), Session Retrospective (5-rule pattern engine)
41
+ - **Personalized orchestration (Phase 2)**: Pipeline Recommender (`forgen pipeline`), Agent Overlay Injection (PreToolUse approve(message)), Contextual Bandit (Factored Beta-TS)
42
+ - **Forge auto-init (Phase 0)**: Auto-creates forge-profile via project scan when missing, session endTime backfill, experiment cleanup (`doctor --clean-experiments`)
43
+ - **Surprise Detection**: z-score 1.5σ deviation from reward baseline (activates after 30+ observations)
44
+ - **Preference Stability**: BKT P(known) stability bars for dimension convergence tracking
45
+
46
+ ### Fixed
47
+ - compound-search returned 0 results (tag noise + matchedTags<2 threshold + cross-language gap)
48
+ - compound-lifecycle timeout (grep scanned node_modules/dist/.git)
49
+ - pattern-detector ignored user-rejection events (only checked user-override)
50
+ - 4 HIGH issues from v3 code review (MCP readOnly, gate1 mutation, test homedir, empty assertion)
51
+
52
+ ### Changed
53
+ - Korean stopwords expanded (+50 words for 조사/어미/접속사)
54
+ - Solution search: name-based matching boost for cross-language queries
55
+ - README: honest Day 1 timeline, "50+ pattern detectors" clarification, test stats updated
56
+
57
+ ## [3.0.0] - 2026-03-31
58
+
59
+ ### Breaking Changes
60
+ - **Public API**: Removed `readCodexOAuthToken`, `loadProviderConfigs`, `ProviderConfig`, `ProviderName`, `ProviderError`, `PackError`, `PackMeta`, `PackRequirement` exports from lib.ts
61
+ - **CLI**: 37 commands → 12 (removed pack, remix, dashboard, setup, status, worktree, ask, codex-spawn, synth, wait, notify, governance, gateway, worker, proposals, scan, verify, stats, rules, marketplace, session, philosophy)
62
+ - **Dependencies**: Removed `ink`, `react`. Added `zod` as direct dependency
63
+
64
+ ### Added
65
+ - **MCP compound server**: 4 tools (compound-search, compound-list, compound-read, compound-stats) for on-demand knowledge access
66
+ - **Behavioral learning**: 10 thinking patterns (verify-first, quality-over-speed, understand-why, pragmatic, systematic, evidence-based, risk-aware, autonomous, collaborative, incremental)
67
+ - **Pre-compact Claude analysis**: Claude analyzes conversation for thinking patterns at context compaction (0 API cost)
68
+ - **Session feedback**: "[forgen] 학습된 패턴 N개 활성 중" shown at session start
69
+ - **forge-behavioral.md**: Auto-generated rules from learned preferences
70
+ - **Progressive Disclosure**: Push summaries (~200 tokens), pull full content via MCP (89% token reduction)
71
+ - **Hook response utilities**: Shared approve/deny/failOpen functions (Plugin SDK format)
72
+ - **Tool-specific matchers**: db-guard→Bash, secret-filter→Write|Edit|Bash, slop-detector→Write|Edit
73
+
74
+ ### Changed
75
+ - **Codebase**: 36,977 → ~26,000 lines (30% reduction, Phase 1/2 added ~2,300 lines)
76
+ - **Hook protocol**: Migrated all 17 hooks from `result/message` to `continue/systemMessage` (Plugin SDK format)
77
+ - **Tag extraction**: Korean stopwords filter (80 words), MAX_TAGS=10, frequency-based ranking
78
+ - **Solution matching**: Identifier-based boost (+0.15), threshold relaxed (2 tags → 1 tag or 1 identifier)
79
+ - **Context budget**: Conservative fallback (factor=0.7 on detection failure)
80
+ - **Rules**: Conditional loading via paths frontmatter, RULE_FILE_CAPS enforced (3000/file, 15000/total)
81
+ - **Skill descriptions**: Updated to 3rd-person format per Claude Code Plugin SDK best practices
82
+ - **Build**: `rm -rf dist` before tsc (clean tarball guaranteed)
83
+
84
+ ### Removed
85
+ - Pack system (src/pack/, packs/, forgen pack commands)
86
+ - Remix system (src/remix/)
87
+ - Dashboard TUI (src/dashboard/, ink/react dependencies)
88
+ - 27 unused modules (synthesizer, marketplace, worktree, etc.)
89
+ - 12 workflow mode commands (ralph, autopilot, team, etc.)
90
+ - Philosophy generator/CLI
91
+ - Templates directory
92
+ - Dead INJECTION_CAPS (keywordInjectMax, perPromptTotal)
93
+
94
+ ### Fixed
95
+ - **compound-lifecycle.ts**: confidence subtraction -20 → -0.20 (was zeroing on 0-1 scale)
96
+ - **compound-lifecycle.ts**: Promotion now runs before staleness check (was blocking upgrades)
97
+ - **compound-lifecycle.ts**: Identifier staleness aligned to 6+ chars (was 4+, mismatched with Code Reflection)
98
+ - **session-recovery.ts**: runExtraction fire-and-forget (3056ms → 151ms)
99
+ - **Security**: Symlink protection at 8 locations, SUDO_USER execFileSync, settings.json single-write
100
+ - **postinstall**: Matcher field from hook-registry.json (was hardcoded '*')
101
+ - **uninstall**: Now cleans mcpServers['forgen-compound']
102
+ - **Dead paths**: forgen status→me, dashboard deleted, tmux binding fixed, REMIX_DIR removed
103
+ - **Docs**: All 4 language READMEs rewritten, SECURITY.md updated to 2.5.x→3.0.0
104
+
105
+ ### Security
106
+ - 46 issues fixed across 6 review iterations
107
+ - All hooks fail-open with Plugin SDK format
108
+ - Prompt injection defense: 13 patterns + Unicode NFKC + XML escaping
109
+ - YAML bomb protection (5KB frontmatter cap, 3 anchor limit)
110
+
111
+ ## [2.1.0] - 2026-03-25
112
+
113
+ ### Added
114
+ - **Compound Engine integrity improvements**
115
+ - **Code Reflection false positive prevention** — identifier minimum length raised from 4 to 6 characters, reducing false `reflected++` from common words
116
+ - **"Why" context in auto-extraction** — extracted solutions now include git commit messages, addressing the "git diff only shows what, not why" gap
117
+ - **Staleness detection** — `checkIdentifierStaleness()` verifies solution identifiers still exist in codebase via grep
118
+ - **Extraction precision metrics** — `compound-precision` lab event emitted during lifecycle checks for tracking promotion/retirement rates
119
+ - **Token injection guardrail** — `MAX_INJECTED_CHARS_PER_SESSION = 8000` (~2K tokens) caps per-session injection cost, tracked in session cache
120
+ - **E2E hook pipeline tests** — 7 integration tests verifying actual hook stdin→stdout JSON protocol (solution-injector, keyword-detector, pre-tool-use, slop-detector, db-guard)
121
+ - **fgx security warning** — CLI now emits 3-line warning on startup when permissions are skipped
122
+ - **Documentation**
123
+ - Open source readiness review feedback (P0/P1/P2 prioritized)
124
+ - Action plan v2.1 (7 phases, 33 items, 18 success criteria)
125
+ - ADR-001: large file decomposition plan
126
+ - ADR-002: EMA learning rate parameter rationale
127
+ - Auto vs manual extraction tradeoff guide
128
+ - oh-my-claudecode coexistence guide
129
+ - Case study template for dogfooding data
130
+ - Good first issues list (6 issues)
131
+
132
+ ### Fixed
133
+ - **3 failing tests** — slop-detector-main.test.ts depended on local `~/.compound/hook-config.json` (now mocked)
134
+ - **106 empty catch blocks → 0** — all replaced with `debugLog()` or descriptive comments explaining why safe to ignore
135
+ - **70 biome lint warnings → 5** — `noAssignInExpressions`, non-null assertions, array index keys, etc. (remaining: `useTemplate`, `useLiteralKeys`)
136
+ - **CI coverage double-run** — merged `npm test` + `--coverage` into single vitest invocation to prevent mock state corruption
137
+
138
+ ### Changed
139
+ - **Coverage thresholds** — aligned vitest.config.ts with actual coverage (35% lines) instead of unrealistic 85%. CI now enforces thresholds.
140
+ - **Node.js requirement** — 18 → 20 (vitest v4/rolldown requires `node:util.styleText`)
141
+ - **CI matrix** — removed Node 18, kept Node 20 + 22
142
+ - **CONTRIBUTING.md** — replaced "No linter yet" with Biome instructions, added architecture diagram
143
+ - **README** — added vendor lock-in notice, "When to Use" table, fgx warning section
144
+ - **Multi-language READMEs** — synced KO/ZH/JA with all English changes
145
+ - **GitHub Actions** — checkout v4→v6, setup-node v4→v6
146
+
147
+ ### Dependencies
148
+ - `@types/node` ^22.19.15 → ^25.5.0
149
+ - `@vitest/coverage-v8` ^4.1.0 → ^4.1.1
150
+
151
+ ## [2.0.0] - 2026-03-24
152
+
153
+ ### Added
154
+ - **Compound Engine v3** — evidence-based cross-session learning system
155
+ - **Solution Format v3** — YAML frontmatter with version, status, confidence, tags, identifiers, evidence counters
156
+ - **Code Reflection** — PreToolUse hook detects when injected solution identifiers appear in Edit/Write code
157
+ - **Negative Signal Detection** — PostToolUse hook detects build/test failures and attributes to experiment solutions
158
+ - **Extraction Engine** — git-diff-based automatic pattern extraction with 4-stage quality gates (structure, toxicity, dedup, re-extraction)
159
+ - **Lifecycle Management** — experiment → candidate → verified → mature with evidence-driven promotion and confidence-based demotion
160
+ - **Circuit Breaker** — experiment solutions with 2+ negative signals auto-retired
161
+ - **Contradiction Detection** — flags solutions with 70%+ tag overlap but disjoint identifiers
162
+ - **Prompt Injection Defense** — 13 injection patterns, Unicode NFKC normalization, XML tag escaping
163
+ - **Solution Index Cache** — in-memory mtime-based cache for matching performance
164
+ - **V1→V3 Migration** — automatic format upgrade on first access with symlink protection
165
+ - **CLI** — `compound list`, `inspect`, `remove`, `rollback`, `--verify`, `--lifecycle`, `pause-auto`, `resume-auto`
166
+ - **Pack Marketplace** — GitHub-based community pack sharing
167
+ - `forgen pack publish <name>` — publish verified solutions to GitHub + registry PR
168
+ - `forgen pack search <query>` — search community registry
169
+ - Registry: [wooo-jin/forgen-registry](https://github.com/wooo-jin/forgen-registry)
170
+ - **Lab compound events** — 6 new event types (compound-injected, compound-reflected, compound-negative, compound-extracted, compound-promoted, compound-demoted)
171
+ - 83 new tests (solution-format, prompt-injection-filter, solution-index, compound-lifecycle, compound-extractor)
172
+
173
+ ### Changed
174
+ - `solution-matcher.ts` — tags-based matching replaces keyword substring matching
175
+ - `solution-injector.ts` — v3 format with status/confidence/type in XML output, experiment 1/prompt limit, cumulative injection-cache
176
+ - `compound-loop.ts` — v3 YAML frontmatter output, `inferIdentifiers()` for manual solutions, `slugify` deduplicated
177
+ - `pre-tool-use.ts` — Code Reflection + evidence update via parse-modify-serialize
178
+ - `post-tool-use.ts` — negative signal detection + evidence update
179
+ - `session-recovery.ts` — SessionStart triggers extraction + daily lifecycle check
180
+ - `state-gc.ts` — injection-cache pattern added for GC
181
+
182
+ ### Dependencies
183
+ - Added `js-yaml` ^4.1.0 (YAML frontmatter parsing with JSON_SCHEMA safety)
184
+
185
+ ## [1.7.0] - 2026-03-23
186
+
187
+ ### Added
188
+ - **Forge** — signal-based personalization engine: project scanning, 10-question interview, 5 continuous dimensions (qualityFocus, autonomyPreference, riskTolerance, abstractionLevel, communicationStyle), generates agent overlays, skill tuning, rules, hook parameters, philosophy, and routing config
189
+ - **Lab** — adaptive optimization engine: JSONL event tracking, 8 behavioral pattern detectors, auto-learning closed loop (Lab → Forge, EMA 0.25, daily), component effectiveness scoring, A/B experiments, session cost tracking with HUD integration
190
+ - **Remix** — harness composition: browse/search published harnesses, cherry-pick individual components (agent/skill/hook/rule/principle), conflict detection (hash-based), provenance tracking
191
+ - **Multi-model Synthesizer** — heuristic response evaluation (4-axis scoring), agreement analysis, task-type-weighted provider synthesis, provider performance tracking
192
+ - **AST-grep integration** — real AST parsing via `sg` CLI with regex fallback, pre-built patterns for TypeScript/Python/Go/Rust, `forgen ast` CLI
193
+ - **LSP integration** — JSON-RPC 2.0 over stdio client, auto-detects tsserver/pylsp/gopls/rust-analyzer/jdtls, hover/definition/references/diagnostics, `forgen lsp` CLI
194
+ - **`forgen me`** — personal dashboard showing profile, evolution history, detected patterns, agent tuning, session cost
195
+ - **`forgen forge`** — onboarding UX with live dimension visualization after each interview answer
196
+ - **`forgen lab evolve`** — manual/auto learning cycle with dry-run support
197
+ - **`forgen lab cost`** / **`forgen cost`** — session cost tracking and reporting
198
+ - **`forgen synth`** — multi-model synthesis status, weights, and history
199
+ - **hookTuning pipeline** — forge generates hook parameters → hook-config.json → actual hooks (slop-detector, context-guard, secret-filter) read and apply them
200
+ - **Skill-tuner** — 6 skills (autopilot, ralph, team, ultrawork, code-review, tdd) respond to forge dimensions
201
+ - **Auto-learn notification** — profile evolution changes displayed on harness startup
202
+ - **Setup → Forge integration** — `forgen setup` offers forge personalization at the end
203
+ - 257 new tests (14 files) covering forge, lab, remix, evaluator, synthesizer, LSP
204
+
205
+ ### Changed
206
+ - README rewritten for all 4 languages (EN/KO/ZH/JA) with new positioning: "The AI coding tool that adapts to you"
207
+ - package.json and plugin.json description updated to new positioning
208
+ - Interview deltas increased (±0.10~0.30) for meaningful profile divergence
209
+ - Auto-learn constants tuned: LEARNING_RATE 0.15→0.25, MAX_DELTA 0.1→0.15, MIN_EVENTS 50→30
210
+ - Agent overlays enriched from 1-3 line fragments to 3-5 sentence behavioral briefings
211
+ - LSP request timeout increased to 30s for large project indexing
212
+
213
+ ## [1.6.3] - 2026-03-23
214
+
215
+ ### Fixed
216
+ - **CRITICAL**: Fix ESM import side-effect causing double JSON output in `skill-injector` and `post-tool-use` hooks — root cause of Stop hook errors across environments
217
+ - **CRITICAL**: Fix "cancel ralph" activating ralph mode instead of canceling — keyword pattern priority conflict
218
+ - **CRITICAL**: Fix path traversal vulnerability via unsanitized `session_id` in file paths (7 hooks affected)
219
+ - Fix Stop hook timeout race condition — 0ms margin between plugin timeout and stdin read timeout
220
+ - Fix non-atomic file writes causing state corruption under concurrent sessions (9 hooks)
221
+ - Fix `readStdinJSON` missing `process.stdin.resume()` causing silent timeout in some Node.js environments
222
+ - Fix `readStdinJSON` having no input size limit (potential memory exhaustion)
223
+ - Fix user-supplied regex patterns in `dangerous-patterns.json` vulnerable to ReDoS
224
+ - Fix `ralph` keyword false positive matching on casual mentions
225
+ - Fix `pipeline` keyword requiring "pipeline mode" suffix — standalone "pipeline" now works
226
+ - Fix `migrate` and `refactor` keywords triggering on casual mentions — now require explicit mode invocation
227
+ - Fix inject-type keywords (`tdd`, `code-review`, etc.) causing double injection via both keyword-detector and skill-injector
228
+ - Fix `plugin.json` version stuck at `0.2.0` — now synced with `package.json`
229
+
230
+ ### Added
231
+ - `--version` / `-V` CLI flag
232
+ - `sanitize-id.ts` shared utility for safe file path construction
233
+ - `atomic-write.ts` shared utility for corruption-resistant state writes
234
+ - `isSafeRegex()` validation for user-supplied regex patterns
235
+ - Ecomode entry in CLI help text and magic keywords section
236
+ - `cancel-ralph` keyword pattern for targeted ralph cancellation
237
+
238
+ ## [1.6.2] - 2026-03-20
239
+
240
+ ### Fixed
241
+ - Fix `.npmignore` excluding `templates/` from npm package
242
+ - Fix README coverage badge showing 60% instead of actual 41%
243
+ - Fix `@types/node` version mismatch (`^25` → `^18`) to match `engines: >=18`
244
+ - Fix type error in `session-recovery.ts` from `@types/node` downgrade
245
+ - Fix CHANGELOG duplicate entries in `[1.6.0]`
246
+ - Fix README banner image using relative path (breaks on npm)
247
+ - Adjust vitest coverage thresholds to match actual coverage
248
+
249
+ ## [1.6.1] - 2026-03-20
250
+
251
+ ### Fixed
252
+ - Resolve remaining audit warnings — rate-limiter timeout, governance try-catch
253
+ - Resolve 4 critical runtime issues from previous audit
254
+ - Resolve all skill/agent audit issues — 2 CRITICAL, 4 HIGH, 4 MEDIUM
255
+ - Correct README statistics — skills 11→19, hooks 14/18→17, tests 654→1204
256
+ - Complete i18n — convert all remaining Korean to English
257
+
258
+ ### Added
259
+ - `cancel-ralph` skill for Ralph loop cancellation via `/forgen:cancel-ralph`
260
+ - `ralph-craft` skill for interactive Ralph prompt building
261
+
262
+ ## [1.6.0] - 2026-03-20
263
+
264
+ ### Added
265
+ - Ecomode for token-saving with Haiku priority and minimal responses
266
+ - Intent classifier for automatic task routing
267
+ - Slop detector to identify low-quality outputs
268
+ - 7 new skills for expanded workflow coverage
269
+ - Crash recovery support
270
+ - 47 scenario tests for comprehensive coverage
271
+ - Ralph mode integration with ralph-loop plugin for auto-iteration
272
+
273
+ ### Changed
274
+ - Upgraded all 10 skills to OMC-level depth and completeness
275
+
276
+ ### Fixed
277
+ - Comprehensive security, stability, and system design overhaul
278
+ - Replaced non-existent OMC references with forgen/Claude Code native APIs
279
+ - Resolved 13 cross-reference inconsistencies across skills, hooks, and modes
280
+
281
+ ## [1.4.0] - 2025-12-01
282
+
283
+ ### Added
284
+ - Gemini provider support
285
+ - Codex CLI integration
286
+ - Codex tmux team spawning with auto task routing
287
+ - `$ARGUMENTS` usage guide to all 12 forgen skills
288
+
289
+ ### Fixed
290
+ - Cross-platform OAuth token for status-line usage display
291
+
292
+ ## [1.3.0] - 2025-10-01
293
+
294
+ ### Added
295
+ - Update notification when newer forgen version is available
296
+ - Skills installable as Claude Code slash commands (`/forgen:xxx`)
297
+ - Accumulated solutions injected into Claude context in compound flow
298
+
299
+ ### Fixed
300
+ - Rules viewer skips empty dirs and finds pack rules correctly
301
+ - Connected pack info shown in startup message and HUD
302
+ - 7 CLI bugs: arg parsing, pack display, extends docs
303
+ - Project detection, pack init, and pack-builder skill
304
+ - Pack setup records `lastSync` for lock
305
+
306
+ ## [1.1.0] - 2025-08-01
307
+
308
+ ### Added
309
+ - Pack diagnostics to `doctor` command
310
+ - Extended pack schema: skills, agents, workflows, requires fields
311
+ - `pack add` / `pack remove` / `pack connected` CLI commands
312
+ - Pack assets integration into harness pipeline
313
+ - AI-guided pack building (`--from-project`, pack-builder skill)
314
+ - `pack.lock` for version pinning and update notifications
315
+ - Pack authoring guide
316
+
317
+ ### Changed
318
+ - Migrated consumers to multi-pack API
319
+
320
+ ### Fixed
321
+ - Consistency guards (P1/P2)
322
+ - 7 gaps from completeness verification
323
+
324
+ ## [1.0.1] - 2025-06-15
325
+
326
+ ### Fixed
327
+ - Resolved Codex-flagged blockers for npm publish
328
+ - Fixed command injection: `execSync` → `execFileSync`
329
+ - Fixed cross-platform compatibility (Windows/Linux/macOS)
330
+
331
+ ## [1.0.0] - 2025-06-01
332
+
333
+ ### Added
334
+ - Initial public release as **forgen** (renamed from tenet)
335
+ - Philosophy-driven Claude Code harness with 5-system workflow
336
+ - Multi-pack support
337
+ - Bilingual documentation (EN/KO)
338
+ - Core CLI commands: `fgx` entrypoint
339
+
340
+ [Unreleased]: https://github.com/wooo-jin/forgen/compare/v3.0.0...HEAD
341
+ [3.0.0]: https://github.com/wooo-jin/forgen/compare/v2.1.0...v3.0.0
342
+ [2.1.0]: https://github.com/wooo-jin/forgen/compare/v2.0.0...v2.1.0
343
+ [2.0.0]: https://github.com/wooo-jin/forgen/compare/v1.7.0...v2.0.0
344
+ [1.7.0]: https://github.com/wooo-jin/forgen/compare/v1.6.3...v1.7.0
345
+ [1.6.3]: https://github.com/wooo-jin/forgen/compare/v1.6.2...v1.6.3
346
+ [1.6.2]: https://github.com/wooo-jin/forgen/compare/v1.6.1...v1.6.2
347
+ [1.6.1]: https://github.com/wooo-jin/forgen/compare/v1.6.0...v1.6.1
348
+ [1.6.0]: https://github.com/wooo-jin/forgen/compare/v1.4.0...v1.6.0
349
+ [1.4.0]: https://github.com/wooo-jin/forgen/compare/v1.3.0...v1.4.0
350
+ [1.3.0]: https://github.com/wooo-jin/forgen/compare/v1.1.0...v1.3.0
351
+ [1.1.0]: https://github.com/wooo-jin/forgen/compare/v1.0.1...v1.1.0
352
+ [1.0.1]: https://github.com/wooo-jin/forgen/compare/v1.0.0...v1.0.1
353
+ [1.0.0]: https://github.com/wooo-jin/forgen/releases/tag/v1.0.0
@@ -0,0 +1,98 @@
1
+ # Contributing to forgen
2
+
3
+ Thank you for your interest in contributing! forgen is a philosophy-driven Claude Code harness built for individual developers who value intentional, compound-growth workflows.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ git clone https://github.com/wooo-jin/forgen.git
9
+ cd forgen
10
+ npm install
11
+ npm run build
12
+ npm test
13
+ ```
14
+
15
+ ## Code Style
16
+
17
+ - **Language**: TypeScript with strict mode enabled
18
+ - **Linter**: [Biome](https://biomejs.dev/) — run `npm run lint` before committing. Fix all warnings on files you touch.
19
+ - **Formatter**: `npm run format` (Biome)
20
+ - Keep functions under 50 lines; split if larger
21
+ - No nested depth beyond 4 levels — use early returns
22
+ - No unnecessary abstractions — implement only what's needed now
23
+ - No empty catch blocks — at minimum add a descriptive comment or `debugLog()`
24
+ - Adding new runtime dependencies requires justification in the PR description (current: 3 deps)
25
+
26
+ ## Making Changes
27
+
28
+ 1. Fork the repository
29
+ 2. Create a feature branch: `git checkout -b feat/your-feature`
30
+ 3. Make your changes and ensure tests pass: `npm test`
31
+ 4. Commit using [Conventional Commits](#commit-convention)
32
+ 5. Open a Pull Request against `main`
33
+
34
+ ## Commit Convention
35
+
36
+ Follow [Conventional Commits](https://www.conventionalcommits.org/):
37
+
38
+ ```
39
+ feat: add new skill for X
40
+ fix: resolve Y when Z
41
+ docs: update contributing guide
42
+ chore: bump version to 1.x.0
43
+ test: add scenario tests for X
44
+ refactor: extract helper from Y
45
+ ```
46
+
47
+ ## PR Guidelines
48
+
49
+ - Keep PRs focused — one concern per PR
50
+ - Include a brief description of what changed and why
51
+ - If fixing a bug, describe how to reproduce it
52
+ - Tests are expected for new features and bug fixes
53
+
54
+ ## Architecture Overview
55
+
56
+ ```
57
+ ┌─────────────────────────────────────────────────────┐
58
+ │ forgen CLI │
59
+ │ (src/cli.ts) │
60
+ ├──────────┬──────────┬───────────┬───────────────────┤
61
+ │ Forge │ Lab │ Compound │ Pack │
62
+ │ (forge/) │ (lab/) │ (engine/) │ (pack/) │
63
+ │ │ │ │ │
64
+ │ Profile │ Pattern │ Extract │ Marketplace │
65
+ │ Scan │ Detect │ Inject │ Publish/Install │
66
+ │ Interview│ Auto- │ Lifecycle │ Search │
67
+ │ Tune │ Learn │ Reflect │ │
68
+ ├──────────┴──────────┴───────────┴───────────────────┤
69
+ │ Core (core/) │
70
+ │ harness.ts — init, settings injection │
71
+ │ spawn.ts — Claude Code process launch │
72
+ │ config-injector.ts — settings.json generation │
73
+ ├─────────────────────────────────────────────────────┤
74
+ │ Hooks (hooks/) │
75
+ │ UserPromptSubmit: keyword-detector, skill-injector, │
76
+ │ solution-injector, context-guard │
77
+ │ PreToolUse: pre-tool-use (reflection), db-guard │
78
+ │ PostToolUse: post-tool-use (negative signals) │
79
+ │ SessionStart: session-recovery │
80
+ ├─────────────────────────────────────────────────────┤
81
+ │ Agents (agents/) + Skills (skills/) │
82
+ │ 19 agents, 21 skills (Markdown) │
83
+ └─────────────────────────────────────────────────────┘
84
+ ```
85
+
86
+ **Key entry points**:
87
+ - `src/cli.ts` — All CLI commands
88
+ - `src/core/harness.ts` — Harness initialization (large file, decomposition planned — see docs/adr/001)
89
+ - `src/hooks/` — Claude Code hook scripts (each runs as standalone Node process)
90
+ - `plugin.json` — Hook registration manifest
91
+
92
+ ## Philosophy
93
+
94
+ forgen is built around five principles: `understand-before-act`, `decompose-to-control`, `capitalize-on-failure`, `focus-resources-on-judgment`, and `knowledge-comes-to-you`. Contributions that align with these principles are more likely to be accepted.
95
+
96
+ ## Questions
97
+
98
+ Open a [GitHub Issue](https://github.com/wooo-jin/forgen/issues) for questions, bug reports, or feature proposals.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jang-ujin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.