@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,260 @@
1
+ ---
2
+ name: testing-strategy
3
+ description: This skill should be used when the user asks to "testing strategy,테스트 전략,test plan,테스트 계획,coverage plan". Test strategy design, coverage analysis, and quality planning
4
+ ---
5
+
6
+ <!-- forgen-managed -->
7
+
8
+ <Purpose>
9
+ 테스트 전략을 수립하고 커버리지 계획을 설계합니다.
10
+ TDD 스킬이 Red-Green-Refactor 워크플로우를 다루는 반면,
11
+ 이 스킬은 "무엇을 어떻게 테스트할 것인가"의 전략적 관점을 다룹니다.
12
+ 테스트 피라미드, 커버리지 갭 분석, 우선순위 결정을 수행합니다.
13
+ </Purpose>
14
+
15
+ <Steps>
16
+ 1. **현재 커버리지 평가**: 기존 테스트 상태를 분석합니다
17
+ - 라인/브랜치/함수 커버리지 측정
18
+ - 테스트 피라미드 비율 분석 (unit : integration : e2e)
19
+ - 테스트 실행 시간 측정
20
+ - 불안정(flaky) 테스트 식별
21
+ - 테스트 없는 핵심 경로 식별
22
+ - 최근 버그의 테스트 커버리지 분석 (커버 되었는가?)
23
+
24
+ 2. **갭 분석**: 테스트가 부족한 영역을 식별합니다
25
+ - 비즈니스 로직의 테스트 커버리지 확인
26
+ - 에러 핸들링 경로의 테스트 존재 여부
27
+ - 엣지 케이스 누락 식별
28
+ * 빈 입력, null/undefined
29
+ * 경계값 (최소/최대)
30
+ * 동시성/경쟁 조건
31
+ * 타임아웃/네트워크 에러
32
+ - 보안 관련 로직의 테스트 확인 (인증, 인가, 입력 검증)
33
+ - 통합 테스트 누락 (모듈 간 상호작용)
34
+ - 외부 의존성 모킹의 적절성
35
+
36
+ 3. **우선순위 결정**: 테스트 작성 순서를 결정합니다
37
+ - 위험도 기반 우선순위 매트릭스:
38
+ * [P0] 결제, 인증, 데이터 무결성 -- 반드시 테스트
39
+ * [P1] 핵심 비즈니스 로직 -- 높은 우선순위
40
+ * [P2] 일반 CRUD 작업 -- 중간 우선순위
41
+ * [P3] 유틸리티, 헬퍼 -- 낮은 우선순위
42
+ - 변경 빈도가 높은 코드 우선
43
+ - 최근 버그가 발생한 모듈 우선
44
+ - 복잡도가 높은 함수 우선
45
+
46
+ 4. **테스트 전략 수립**: 테스트 유형별 전략을 설계합니다
47
+ - Unit Test 전략:
48
+ * 순수 함수: 입력/출력 테스트
49
+ * 사이드 이펙트: 모킹/스터빙
50
+ * 커버리지 목표: 85%+ (브랜치 기준)
51
+ - Integration Test 전략:
52
+ * 모듈 간 상호작용 검증
53
+ * 외부 서비스 모킹 범위
54
+ * 데이터베이스 테스트 (인메모리 vs 컨테이너)
55
+ - E2E Test 전략:
56
+ * 핵심 사용자 시나리오 선정
57
+ * 테스트 환경 구성
58
+ * 데이터 시딩 전략
59
+ - 성능 Test 전략:
60
+ * 부하 테스트 시나리오
61
+ * 성능 기준값 설정
62
+
63
+ 5. **구현 및 추적**: 테스트를 점진적으로 구현합니다
64
+ - 테스트 작성 태스크 목록 생성
65
+ - 커버리지 추적 대시보드 설정
66
+ - CI 파이프라인에 커버리지 게이트 추가
67
+ - 정기적인 커버리지 리뷰 일정 설정
68
+ - 뮤테이션 테스트 도입 계획 (핵심 비즈니스 로직)
69
+ </Steps>
70
+
71
+ ## 에이전트 위임
72
+
73
+ `test-engineer` 에이전트(Opus 모델)에 위임하여 테스트 전략을 수립합니다:
74
+
75
+ ```
76
+ Agent(
77
+ subagent_type="test-engineer",
78
+ model="opus",
79
+ prompt="TESTING STRATEGY TASK
80
+
81
+ 테스트 전략을 수립하고 커버리지 계획을 설계하세요.
82
+
83
+ Project: [프로젝트 설명]
84
+ Current Coverage: [현재 커버리지 또는 '미측정']
85
+
86
+ Strategy Checklist:
87
+ 1. 현재 커버리지 측정 및 분석
88
+ 2. 테스트 갭 식별 (에러 경로, 엣지 케이스)
89
+ 3. 위험도 기반 우선순위 결정
90
+ 4. 테스트 유형별 전략 (unit/integration/e2e)
91
+ 5. 구현 로드맵 및 커버리지 목표
92
+
93
+ Output: 테스트 전략 문서:
94
+ - 현재 커버리지 분석
95
+ - 갭 분석 결과
96
+ - 우선순위 목록
97
+ - 유형별 전략
98
+ - 커버리지 목표 및 로드맵"
99
+ )
100
+ ```
101
+
102
+ ## External Consultation (Optional)
103
+
104
+ test-engineer 에이전트는 교차 검증을 위해 Claude Task 에이전트에 자문할 수 있습니다.
105
+
106
+ ### Protocol
107
+ 1. **자체 전략을 먼저 수립** -- 독립적으로 분석 수행
108
+ 2. **검증을 위한 자문** -- Claude Task 에이전트를 통해 전략 교차 확인
109
+ 3. **비판적 평가** -- 외부 제안을 맹목적으로 수용하지 않음
110
+ 4. **우아한 폴백** -- 위임이 불가능할 경우 절대 차단하지 않음
111
+
112
+ ### 자문이 필요한 경우
113
+ - 복잡한 도메인의 테스트 커버리지 전략
114
+ - 마이크로서비스 간 통합 테스트 설계
115
+ - 성능/부하 테스트 시나리오 설계
116
+ - 뮤테이션 테스트 도입 전략
117
+
118
+ ### 자문을 생략하는 경우
119
+ - 단순 유닛 테스트 계획
120
+ - 명확한 CRUD 테스트
121
+ - 기존 패턴 반복
122
+ - 소규모 모듈의 테스트
123
+
124
+ ## 테스트 피라미드 기준
125
+
126
+ ```
127
+ / E2E \ 5~10% (핵심 시나리오만)
128
+ /----------\
129
+ / Integration \ 15~25% (모듈 간 상호작용)
130
+ /----------------\
131
+ / Unit Tests \ 70~80% (모든 비즈니스 로직)
132
+ /--------------------\
133
+ ```
134
+
135
+ ## 커버리지 목표 가이드
136
+
137
+ | 코드 유형 | 라인 | 브랜치 | 뮤테이션 |
138
+ |-----------|------|--------|----------|
139
+ | 결제/인증 | 95%+ | 90%+ | 80%+ |
140
+ | 비즈니스 로직 | 85%+ | 80%+ | 70%+ |
141
+ | 유틸리티 | 80%+ | 75%+ | -- |
142
+ | UI 컴포넌트 | 70%+ | 60%+ | -- |
143
+ | 설정/부트스트랩 | 60%+ | -- | -- |
144
+
145
+ ## 테스트 품질 지표
146
+
147
+ | 지표 | 건강 | 주의 | 위험 |
148
+ |------|------|------|------|
149
+ | 브랜치 커버리지 | > 80% | 60~80% | < 60% |
150
+ | 테스트 실행 시간 | < 30s | 30s~2m | > 2m |
151
+ | Flaky 테스트 비율 | 0% | < 2% | > 2% |
152
+ | 뮤테이션 점수 | > 70% | 50~70% | < 50% |
153
+
154
+ <Output>
155
+ ```
156
+ TESTING STRATEGY / 테스트 전략 문서
157
+ =====================================
158
+
159
+ Project: [프로젝트명]
160
+ Date: YYYY-MM-DD
161
+ Test Framework: [vitest / jest / playwright]
162
+
163
+ CURRENT STATE / 현재 상태
164
+ ---------------------------
165
+ Line Coverage: 72% (target: 85%)
166
+ Branch Coverage: 58% (target: 80%)
167
+ Test Count: 142 (unit: 120, integration: 18, e2e: 4)
168
+ Execution Time: 24s
169
+ Flaky Tests: 2 (src/api/order.test.ts, src/utils/date.test.ts)
170
+
171
+ GAP ANALYSIS / 갭 분석
172
+ ------------------------
173
+ [P0] CRITICAL GAPS (테스트 없는 핵심 경로):
174
+ - src/services/payment.ts -- 결제 처리 로직 (0% coverage)
175
+ - src/middleware/auth.ts -- 인증 미들웨어 에러 경로 (30% branch)
176
+
177
+ [P1] HIGH GAPS (불충분한 커버리지):
178
+ - src/services/order.ts -- 할인 계산 엣지 케이스 미테스트
179
+ - src/utils/validation.ts -- 경계값 테스트 부재
180
+
181
+ [P2] MEDIUM GAPS:
182
+ - src/api/users.ts -- 통합 테스트 부재
183
+ - src/components/Cart.tsx -- 상태 변경 테스트 부족
184
+
185
+ IMPLEMENTATION ROADMAP / 구현 로드맵
186
+ --------------------------------------
187
+ Week 1: P0 갭 해소 (결제, 인증)
188
+ - [ ] payment.ts 유닛 테스트 (15개)
189
+ - [ ] auth.ts 에러 경로 테스트 (8개)
190
+
191
+ Week 2: P1 갭 해소 (비즈니스 로직)
192
+ - [ ] order.ts 엣지 케이스 테스트 (10개)
193
+ - [ ] validation.ts 경계값 테스트 (12개)
194
+
195
+ Week 3: 통합 테스트 보강
196
+ - [ ] API 엔드포인트 통합 테스트 (20개)
197
+ - [ ] E2E 핵심 시나리오 (3개)
198
+
199
+ TARGET / 목표
200
+ --------------
201
+ Line Coverage: 72% → 85%
202
+ Branch Coverage: 58% → 80%
203
+ Test Count: 142 → 210
204
+ Flaky Tests: 2 → 0
205
+ ```
206
+ </Output>
207
+
208
+ <Policy>
209
+ - 커버리지 숫자보다 테스트 품질을 우선합니다
210
+ - 브랜치 커버리지를 라인 커버리지보다 중요하게 봅니다
211
+ - 핵심 비즈니스 로직에 뮤테이션 테스트를 권장합니다
212
+ - Flaky 테스트는 즉시 수정하거나 격리합니다
213
+ - 테스트는 빠르게 실행되어야 합니다 (전체 30초 이내 목표)
214
+ - 테스트 작성 계획은 스프린트에 통합하여 추적합니다
215
+ </Policy>
216
+
217
+ ## 다른 스킬과의 연동
218
+
219
+ **TDD 연동:**
220
+ ```
221
+ /forgen:tdd 전략에서 식별된 갭 구현
222
+ ```
223
+ 전략에서 식별된 테스트 갭을 TDD로 구현
224
+
225
+ **코드 리뷰 연동:**
226
+ ```
227
+ /forgen:code-review 테스트 코드 품질 확인
228
+ ```
229
+ 작성된 테스트 코드의 품질 검증
230
+
231
+ **CI/CD 연동:**
232
+ ```
233
+ /forgen:ci-cd 커버리지 게이트 설정
234
+ ```
235
+ CI에서 커버리지 임계값 강제
236
+
237
+ ## Best Practices
238
+
239
+ - **전략 먼저** -- 무작정 테스트를 쓰기 전에 어디가 중요한지 파악
240
+ - **위험 기반** -- 모든 코드를 균일하게 테스트하지 않음
241
+ - **피라미드 유지** -- E2E에 의존하지 않고 유닛 테스트 기반 구축
242
+ - **Flaky 제로** -- 불안정한 테스트는 신뢰를 해침
243
+ - **지속 추적** -- 커버리지 트렌드를 모니터링
244
+
245
+ <Arguments>
246
+ ## 사용법
247
+ `/forgen:testing-strategy {대상}`
248
+
249
+ ### 예시
250
+ - `/forgen:testing-strategy 전체 프로젝트 커버리지 분석`
251
+ - `/forgen:testing-strategy 결제 모듈 테스트 계획`
252
+ - `/forgen:testing-strategy E2E 테스트 전략 수립`
253
+ - `/forgen:testing-strategy 현재 테스트의 갭 분석`
254
+
255
+ ### 인자
256
+ - 분석 대상 모듈, 테스트 유형, 목표 등을 설명
257
+ - 인자 없으면 프로젝트 전체의 테스트 전략을 수립
258
+ </Arguments>
259
+
260
+ $ARGUMENTS
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: starter-api-error-responses
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - api
10
+ - error
11
+ - response
12
+ - rest
13
+ - format
14
+ - API에러
15
+ - 응답형식
16
+ identifiers: []
17
+ evidence:
18
+ injected: 0
19
+ reflected: 0
20
+ negative: 0
21
+ sessions: 0
22
+ reExtracted: 0
23
+ created: "2026-04-03"
24
+ updated: "2026-04-03"
25
+ supersedes: null
26
+ extractedBy: manual
27
+ ---
28
+
29
+ ## Context
30
+ Inconsistent error responses force API consumers to write special-case handling per endpoint.
31
+
32
+ ## Content
33
+ Every error uses the **same envelope**: `{ error: { code, message, details?, requestId } }`.
34
+
35
+ Use a centralized error handler that catches `AppError` subclasses and maps them to HTTP responses. Unknown errors return 500 with no internal details exposed.
36
+
37
+ Rules: (1) Machine-readable `code` for client switching — never match on `message`. (2) Never expose stack traces in production. (3) Include `requestId` for log correlation. (4) Correct HTTP status codes — never 200 for failures.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: starter-async-patterns
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - async
10
+ - promise
11
+ - parallel
12
+ - sequential
13
+ - 비동기
14
+ - 병렬처리
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Misusing async/await causes silent bugs, performance problems (accidental sequential execution), and memory leaks (unbounded concurrency).
30
+
31
+ ## Content
32
+ **Parallel** — `Promise.all` when operations are independent. **Sequential** — `for...of` when order matters. **Never `async` in `forEach`** — fires all callbacks simultaneously, returns void, silently drops errors.
33
+
34
+ **Bounded concurrency** with `p-limit`:
35
+ ```typescript
36
+ const limit = pLimit(5);
37
+ await Promise.all(urls.map(url => limit(() => fetch(url))));
38
+ ```
39
+
40
+ Use `Promise.allSettled` when partial failure is acceptable and you need all results.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: starter-caching-strategy
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - performance
10
+ - cache
11
+ - ttl
12
+ - invalidation
13
+ - 성능
14
+ - 캐싱
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Caching is powerful but incorrect invalidation causes stale data bugs that are hard to reproduce.
30
+
31
+ ## Content
32
+ **When to cache**: Read-heavy, rarely changing, expensive to compute. Never cache real-time data (balances, inventory at checkout).
33
+
34
+ **TTL-based**: Set time-to-live, accept temporary staleness. Simplest strategy.
35
+ **Event-based**: Explicitly clear cache on mutations. No staleness but more complex.
36
+ **Hybrid (recommended)**: Event-based for known mutations + TTL as safety net.
37
+
38
+ **Cache key design**: Include all result-affecting params: `user:${id}:orders:page=${p}`.
39
+
40
+ **Anti-patterns**: (1) No invalidation strategy. (2) Long TTLs on mutable data. (3) Cache stampede on TTL expiry — fix with stale-while-revalidate or mutex.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: starter-code-review-checklist
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - review
10
+ - code-review
11
+ - checklist
12
+ - quality
13
+ - 코드리뷰
14
+ - 품질
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Unstructured reviews catch surface-level issues while missing critical bugs. Reviewing in priority order ensures high-severity problems are found before reviewer fatigue sets in.
30
+
31
+ ## Content
32
+ Review in this order — stop and fix before moving to the next layer:
33
+
34
+ 1. **Correctness**: Does it do what the requirement says? Edge cases handled? Error paths tested?
35
+ 2. **Security**: Input validation at trust boundaries? Injection risks? Secrets exposed? Auth checks?
36
+ 3. **Performance**: N+1 queries? Unbounded loops? Missing pagination or indexes?
37
+ 4. **Readability**: Understandable in 5 minutes by a newcomer? Names descriptive? DRY?
38
+
39
+ Never approve with open items in layers 1-2. Layers 3-4 can be tracked as follow-ups. Re-review after fixes — never assume corrections are correct.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: starter-debugging-systematic
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - debug
10
+ - debugging
11
+ - systematic
12
+ - reproduce
13
+ - 디버깅
14
+ - 체계적
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Randomly changing code hoping the bug disappears wastes hours and introduces new bugs. Systematic debugging converges on the root cause in predictable time.
30
+
31
+ ## Content
32
+ Four-step cycle: **Reproduce -> Isolate -> Fix -> Verify**.
33
+
34
+ 1. **Reproduce**: Write a failing test or minimal reproduction. If you can't reproduce it, you can't confirm the fix.
35
+ 2. **Isolate**: Binary search the problem space — comment out half the code path, use `git bisect` for regressions.
36
+ ```bash
37
+ git bisect start HEAD v1.2.0 && git bisect bad && git bisect good
38
+ ```
39
+ 3. **Fix**: Change the minimum code necessary. If the fix is large, the root cause analysis may be wrong.
40
+ 4. **Verify**: The reproduction test must pass. Run full suite for regressions. Keep the test permanently as a regression guard.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: starter-dependency-injection
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - di
10
+ - dependency
11
+ - injection
12
+ - testing
13
+ - mock
14
+ identifiers: []
15
+ evidence:
16
+ injected: 0
17
+ reflected: 0
18
+ negative: 0
19
+ sessions: 0
20
+ reExtracted: 0
21
+ created: "2026-04-03"
22
+ updated: "2026-04-03"
23
+ supersedes: null
24
+ extractedBy: manual
25
+ ---
26
+
27
+ ## Context
28
+ Direct imports prevent substituting dependencies in tests, forcing integration tests for everything.
29
+
30
+ ## Content
31
+ Pass dependencies as parameters — function arguments are the simplest DI, no framework needed.
32
+ ```typescript
33
+ interface Deps { db: Database; mailer: Mailer; }
34
+ export const createUserService = ({ db, mailer }: Deps) => async (data: CreateUserInput) => {
35
+ const user = await db.insert('users', data);
36
+ await mailer.send(user.email, 'Welcome!');
37
+ return user;
38
+ };
39
+ ```
40
+ In tests, inject fakes via `vi.fn()` and assert on calls. Production wires real implementations.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: starter-error-handling-patterns
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - error
10
+ - handling
11
+ - validation
12
+ - boundary
13
+ - 에러
14
+ - 에러처리
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Catching `Error` everywhere and logging "something went wrong" makes debugging impossible. Untyped errors propagate silently until they crash in production.
30
+
31
+ ## Content
32
+ **Custom error classes** — make errors machine-readable with `code` and `statusCode` fields. Extend a base `AppError` class for consistent handling.
33
+
34
+ **Validate at boundaries, trust internally**: Parse external input at the edge (controller/handler). Internal functions receive already-validated types — no defensive checks needed deep inside.
35
+
36
+ **Early returns** reduce nesting: error paths are explicit at the top, happy path at lowest indentation.
37
+
38
+ **Never swallow errors**: Empty catch blocks hide bugs. At minimum, log the error and re-throw.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: starter-git-atomic-commits
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - git
10
+ - commit
11
+ - workflow
12
+ - atomic
13
+ - 커밋
14
+ - 버전관리
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Large commits bundling unrelated changes make debugging, reverting, and reviewing painful. `git bisect` becomes useless with multi-feature commits.
30
+
31
+ ## Content
32
+ Each commit = one logical change. Revertable independently, reviewable in isolation. Use `git add -p` to stage specific hunks.
33
+
34
+ **Checklist**: Does this commit do exactly one thing? Can it be reverted without breaking unrelated code? Does the message explain WHY?
35
+
36
+ **Anti-patterns**: "WIP", "misc fixes", "updates" as messages. Mixing formatting with logic. Accumulating uncommitted work — ship after every meaningful chunk.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: starter-input-validation
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - security
10
+ - validation
11
+ - input
12
+ - zod
13
+ - boundary
14
+ - 보안
15
+ - 입력검증
16
+ identifiers: []
17
+ evidence:
18
+ injected: 0
19
+ reflected: 0
20
+ negative: 0
21
+ sessions: 0
22
+ reExtracted: 0
23
+ created: "2026-04-03"
24
+ updated: "2026-04-03"
25
+ supersedes: null
26
+ extractedBy: manual
27
+ ---
28
+
29
+ ## Context
30
+ Every security vulnerability starts with trusting external input. SQL injection, XSS, and path traversal exploit unvalidated input passed to sensitive operations.
31
+
32
+ ## Content
33
+ **Validate at system boundaries** (HTTP requests, file uploads, CLI args, env vars) using schema validation:
34
+
35
+ ```typescript
36
+ const Schema = z.object({ email: z.string().email(), name: z.string().min(1).max(100) });
37
+ const input = Schema.parse(req.body); // throws if invalid
38
+ ```
39
+
40
+ **Principle**: Parse, don't validate. Transform `unknown` into a typed shape at the boundary, then work with trusted types internally. Never rely on client-side validation alone. Never cast `req.body as T` without runtime validation.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: starter-n-plus-one-queries
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - performance
10
+ - database
11
+ - n+1
12
+ - query
13
+ - batch
14
+ - 성능
15
+ - 데이터베이스
16
+ identifiers: []
17
+ evidence:
18
+ injected: 0
19
+ reflected: 0
20
+ negative: 0
21
+ sessions: 0
22
+ reExtracted: 0
23
+ created: "2026-04-03"
24
+ updated: "2026-04-03"
25
+ supersedes: null
26
+ extractedBy: manual
27
+ ---
28
+
29
+ ## Context
30
+ N+1 is the most common performance killer. Invisible in dev (10 rows), catastrophic in production (10,000 rows = 10,001 queries).
31
+
32
+ ## Content
33
+ **The problem**: 1 query for a list, then N queries for related data per item.
34
+
35
+ **Fixes**: (1) **JOIN** — fetch everything in one query. (2) **Batch load** — collect all IDs, fetch with `WHERE id IN (...)`, map back. Result: 2 queries regardless of N. (3) **DataLoader** — automatic batching and per-request caching.
36
+
37
+ **Detection**: Enable query logging in dev. Same query template repeated N times = N+1 problem.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: starter-refactor-safely
3
+ version: 1
4
+ status: verified
5
+ confidence: 0.70
6
+ type: pattern
7
+ scope: me
8
+ tags:
9
+ - refactor
10
+ - safe
11
+ - incremental
12
+ - testing
13
+ - 리팩토링
14
+ - 안전
15
+ identifiers: []
16
+ evidence:
17
+ injected: 0
18
+ reflected: 0
19
+ negative: 0
20
+ sessions: 0
21
+ reExtracted: 0
22
+ created: "2026-04-03"
23
+ updated: "2026-04-03"
24
+ supersedes: null
25
+ extractedBy: manual
26
+ ---
27
+
28
+ ## Context
29
+ Refactoring without tests is just editing code and hoping. Large refactors touching many files are impossible to review and frequently introduce regressions.
30
+
31
+ ## Content
32
+ Three invariants: **tests exist before starting**, **each step is small**, **tests pass after every step**.
33
+
34
+ **Before**: Write characterization tests for uncovered code. Commit tests separately.
35
+
36
+ **During**: One mechanical step at a time. `Rename -> test -> commit. Extract -> test -> commit.` Never combine behavior changes with refactoring.
37
+
38
+ **Safe moves**: extract method, rename, inline variable, move function, replace magic number. **Anti-pattern**: "Refactor everything, test at the end" — 15 interleaved changes, no way to isolate the break.