@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,288 @@
1
+ ---
2
+ name: security-review
3
+ description: This skill should be used when the user asks to "security review,보안 리뷰,보안 검토,security audit,취약점 점검". Security-focused code audit with OWASP Top 10 and supply chain checks
4
+ triggers:
5
+ - "security review"
6
+ - "보안 리뷰"
7
+ - "보안 검토"
8
+ - "security audit"
9
+ - "취약점 점검"
10
+ ---
11
+
12
+ <Purpose>
13
+ 보안 중심 코드 감사를 수행합니다. OWASP Top 10, 공급망 보안,
14
+ 시크릿 노출, 안전하지 않은 패턴을 체계적으로 점검합니다.
15
+ </Purpose>
16
+
17
+ <Steps>
18
+ 1. **OWASP Top 10 전체 스캔**
19
+ - A01: Broken Access Control — 접근 제어 우회, 권한 에스컬레이션
20
+ - A02: Cryptographic Failures — 약한 해싱(MD5/SHA1), 평문 전송, 키 노출
21
+ - A03: Injection — SQL, NoSQL, Command, XSS, LDAP 인젝션
22
+ - A04: Insecure Design — 보안이 고려되지 않은 설계, 위협 모델링 부재
23
+ - A05: Security Misconfiguration — 기본 설정 미변경, 불필요한 기능 활성화, 에러 정보 노출
24
+ - A06: Vulnerable and Outdated Components — 알려진 CVE가 있는 의존성 사용
25
+ - A07: Identification and Authentication Failures — 약한 인증, 세션 고정, 크리덴셜 스터핑
26
+ - A08: Software and Data Integrity Failures — 서명 미검증, 안전하지 않은 역직렬화
27
+ - A09: Security Logging and Monitoring Failures — 로깅 부재, 침입 탐지 미흡
28
+ - A10: Server-Side Request Forgery (SSRF) — 서버에서 외부 URL 요청 시 검증 부재
29
+
30
+ 2. **시크릿 탐지**
31
+ - 하드코딩된 API 키, 비밀번호, 토큰
32
+ - 개인 키(private key)가 레포에 포함되었는지
33
+ - 커넥션 스트링에 시크릿 포함 여부
34
+ - .env, credentials 파일 커밋 여부
35
+ - 로그에 민감 정보 출력
36
+
37
+ 3. **입력 검증**
38
+ - 모든 외부 입력의 살균/검증 확인
39
+ - SQL/NoSQL Injection 방지 (파라미터화 쿼리)
40
+ - Command Injection 방지
41
+ - XSS 방지 (출력 이스케이핑)
42
+ - Path Traversal 방지
43
+ - SSRF 방지 (URL 화이트리스트)
44
+
45
+ 4. **인증/인가**
46
+ - 비밀번호 해싱 (bcrypt, argon2 등 강력한 알고리즘)
47
+ - 세션 관리 보안 (토큰 암호학적 난수 생성)
48
+ - JWT 구현 보안 (서명 검증, 만료 설정)
49
+ - 접근 제어가 모든 보호 리소스에 적용되는지
50
+
51
+ 5. **암호화**
52
+ - 강력한 알고리즘 사용 (AES-256, RSA-2048+)
53
+ - 적절한 키 관리
54
+ - 암호학적으로 안전한 난수 생성
55
+ - TLS/HTTPS 강제 적용
56
+
57
+ 6. **의존성 보안**
58
+ - `npm audit` 실행하여 알려진 취약점 검사
59
+ - 오래된 의존성 확인
60
+ - CRITICAL/HIGH CVE 식별
61
+ - 의존성 출처 검증
62
+ - 의심스러운 패키지, 과도한 권한 요구 점검
63
+ </Steps>
64
+
65
+ ## 에이전트 위임
66
+
67
+ `security-reviewer` 에이전트(Opus 모델)에 위임하여 심층 보안 분석을 수행합니다:
68
+
69
+ ```
70
+ Agent(
71
+ subagent_type="security-reviewer",
72
+ model="opus",
73
+ prompt="SECURITY REVIEW TASK
74
+
75
+ 보안 감사를 수행하세요.
76
+
77
+ Scope: [특정 파일 또는 전체 코드베이스]
78
+
79
+ Security Checklist:
80
+ 1. OWASP Top 10 전체 스캔 (A01~A10)
81
+ 2. 하드코딩된 시크릿 탐지
82
+ 3. 입력 검증 검토
83
+ 4. 인증/인가 검토
84
+ 5. 의존성 취약점 스캔 (npm audit)
85
+
86
+ Output: 보안 리뷰 리포트:
87
+ - 심각도별 발견 사항 요약 (CRITICAL, HIGH, MEDIUM, LOW)
88
+ - 구체적인 파일:라인 위치
89
+ - CVE 참조 (해당 시)
90
+ - 각 이슈별 수정 방안
91
+ - 전체 보안 상태 평가"
92
+ )
93
+ ```
94
+
95
+ ## External Consultation (Optional)
96
+
97
+ security-reviewer 에이전트는 교차 검증을 위해 Claude Task 에이전트에 자문할 수 있습니다.
98
+
99
+ ### Protocol
100
+ 1. **자체 보안 분석을 먼저 완료** — 독립적으로 리뷰 수행
101
+ 2. **검증을 위한 자문** — Claude Task 에이전트를 통해 발견 사항 교차 확인
102
+ 3. **비판적 평가** — 외부 발견 사항을 맹목적으로 수용하지 않음
103
+ 4. **우아한 폴백** — 위임이 불가능할 경우 절대 차단하지 않음
104
+
105
+ ### 자문이 필요한 경우
106
+ - 인증/인가 코드
107
+ - 암호화 구현
108
+ - 신뢰할 수 없는 데이터의 입력 검증
109
+ - 고위험 취약점 패턴
110
+ - 프로덕션 배포 코드
111
+
112
+ ### 자문을 생략하는 경우
113
+ - 저위험 유틸리티 코드
114
+ - 이미 감사된 패턴
115
+ - 시간이 촉박한 보안 평가
116
+ - 기존 보안 테스트가 있는 코드
117
+
118
+ **참고:** 보안 세컨드 오피니언은 높은 가치를 가집니다. CRITICAL/HIGH 발견 시 자문을 고려하세요.
119
+
120
+ ## 보안 체크리스트
121
+
122
+ ### 인증 및 인가
123
+ - [ ] 비밀번호가 강력한 알고리즘으로 해싱 (bcrypt/argon2)
124
+ - [ ] 세션 토큰이 암호학적으로 무작위
125
+ - [ ] JWT 토큰이 적절히 서명 및 검증됨
126
+ - [ ] 모든 보호 리소스에 접근 제어 적용
127
+ - [ ] 인증 우회 취약점 없음
128
+
129
+ ### 입력 검증
130
+ - [ ] 모든 사용자 입력이 검증 및 살균됨
131
+ - [ ] SQL 쿼리가 파라미터화 사용 (문자열 연결 금지)
132
+ - [ ] NoSQL 쿼리 인젝션 방지
133
+ - [ ] 파일 업로드 검증 (타입, 크기, 콘텐츠)
134
+ - [ ] URL 검증으로 SSRF 방지
135
+
136
+ ### 출력 인코딩
137
+ - [ ] HTML 출력이 XSS 방지를 위해 이스케이핑됨
138
+ - [ ] JSON 응답이 적절히 인코딩됨
139
+ - [ ] 에러 메시지에 사용자 데이터 미포함
140
+ - [ ] Content-Security-Policy 헤더 설정
141
+
142
+ ### 시크릿 관리
143
+ - [ ] 하드코딩된 API 키 없음
144
+ - [ ] 소스 코드에 비밀번호 없음
145
+ - [ ] 레포에 개인 키 없음
146
+ - [ ] 시크릿은 환경변수로 관리
147
+ - [ ] 시크릿이 로그나 에러에 노출되지 않음
148
+
149
+ ### 암호화
150
+ - [ ] 강력한 알고리즘 사용 (AES-256, RSA-2048+)
151
+ - [ ] 적절한 키 관리
152
+ - [ ] 암호학적으로 안전한 난수 생성
153
+ - [ ] 민감 데이터에 TLS/HTTPS 강제
154
+
155
+ ### 의존성
156
+ - [ ] 의존성에 알려진 취약점 없음
157
+ - [ ] 의존성이 최신 상태
158
+ - [ ] CRITICAL 또는 HIGH CVE 없음
159
+ - [ ] 의존성 출처 검증됨
160
+
161
+ ## 심각도 정의
162
+
163
+ | 심각도 | 설명 |
164
+ |--------|------|
165
+ | **CRITICAL** | 악용 가능한 취약점으로 심각한 영향 (데이터 유출, RCE, 크리덴셜 탈취) |
166
+ | **HIGH** | 특정 조건이 필요하지만 심각한 영향을 주는 취약점 |
167
+ | **MEDIUM** | 제한적 영향 또는 악용이 어려운 보안 약점 |
168
+ | **LOW** | 모범 사례 위반 또는 경미한 보안 우려 |
169
+
170
+ ## Remediation Priority (수정 우선순위)
171
+
172
+ | 우선순위 | 타임라인 | 대상 |
173
+ |----------|----------|------|
174
+ | 1. 노출된 시크릿 교체 | **즉시 (1시간 이내)** | 하드코딩된 키, 비밀번호, 토큰 |
175
+ | 2. CRITICAL 수정 | **긴급 (24시간 이내)** | 악용 가능한 취약점 |
176
+ | 3. HIGH 수정 | **중요 (1주일 이내)** | 조건부 취약점 |
177
+ | 4. MEDIUM 수정 | **계획 (1개월 이내)** | 보안 약점 |
178
+ | 5. LOW 수정 | **백로그 (여유 시)** | 모범 사례 위반 |
179
+
180
+ <Output>
181
+ ```
182
+ SECURITY REVIEW REPORT / 보안 리뷰 리포트
183
+ ==========================================
184
+
185
+ Scope: [전체 코드베이스 / 특정 디렉토리] (N개 파일 스캔)
186
+ Scan Date: YYYY-MM-DDTHH:MM:SSZ
187
+
188
+ CRITICAL (N)
189
+ ------------
190
+ 1. src/api/auth.ts:89 - 하드코딩된 API 키
191
+ Finding: AWS API 키가 소스 코드에 하드코딩됨
192
+ Impact: 코드 공개 또는 유출 시 크리덴셜 노출
193
+ Remediation: 환경변수로 이동, 키 즉시 교체
194
+ Reference: OWASP A02:2021 - Cryptographic Failures
195
+ CVE: (해당 시 CVE 번호)
196
+
197
+ 2. src/db/query.ts:45 - SQL Injection 취약점
198
+ Finding: 사용자 입력이 SQL 쿼리에 직접 연결됨
199
+ Impact: 공격자가 임의의 SQL 명령을 실행 가능
200
+ Remediation: 파라미터화 쿼리 또는 ORM 사용
201
+ Reference: OWASP A03:2021 - Injection
202
+
203
+ HIGH (N)
204
+ --------
205
+ ...
206
+
207
+ MEDIUM (N)
208
+ ----------
209
+ ...
210
+
211
+ LOW (N)
212
+ -------
213
+ ...
214
+
215
+ DEPENDENCY VULNERABILITIES / 의존성 취약점
216
+ ------------------------------------------
217
+ Found N vulnerabilities via npm audit:
218
+
219
+ CRITICAL: axios@0.21.0 - Server-Side Request Forgery (CVE-2021-3749)
220
+ Installed: axios@0.21.0
221
+ Fix: npm install axios@0.21.2
222
+
223
+ HIGH: lodash@4.17.19 - Prototype Pollution (CVE-2020-8203)
224
+ Installed: lodash@4.17.19
225
+ Fix: npm install lodash@4.17.21
226
+
227
+ ...
228
+
229
+ OVERALL ASSESSMENT / 종합 평가
230
+ -------------------------------
231
+ Security Posture: [EXCELLENT / GOOD / FAIR / POOR]
232
+ (N CRITICAL, N HIGH issues)
233
+
234
+ Immediate Actions Required:
235
+ 1. [즉시 조치 사항]
236
+ 2. [긴급 수정 사항]
237
+
238
+ Recommendation: [배포 가능 / CRITICAL 및 HIGH 이슈 해결 전 배포 금지]
239
+ ```
240
+ </Output>
241
+
242
+ <Policy>
243
+ - 취약점 발견 시 구체적인 공격 시나리오와 수정 방안을 함께 제시
244
+ - False positive를 최소화하되, 의심스러운 패턴은 빠짐없이 보고
245
+ - 보안 수정은 기능 동작에 영향을 주지 않도록 주의
246
+ - OWASP A01~A10 각 항목에 대해 명시적으로 검사 수행
247
+ - npm audit을 반드시 실행하여 의존성 취약점을 정량적으로 보고
248
+ - CVE 참조를 가능한 한 포함하여 추적 가능성 확보
249
+ </Policy>
250
+
251
+ ## 다른 스킬과의 연동
252
+
253
+ **Pipeline 연동:**
254
+ ```
255
+ /forgen:pipeline security "인증 모듈 리뷰"
256
+ ```
257
+ 사용 흐름: explore -> security-reviewer -> executor -> security-reviewer (재검증)
258
+
259
+ **팀 기반 병렬 리뷰:**
260
+ ```
261
+ /forgen:team 4:security-reviewer "모든 API 엔드포인트 감사"
262
+ ```
263
+ 여러 엔드포인트에 대해 병렬 보안 리뷰 수행
264
+
265
+ ## Best Practices
266
+
267
+ - **조기 리뷰** — 보안은 사후 점검이 아닌 설계 단계부터
268
+ - **자주 리뷰** — 주요 기능 변경이나 API 변경마다
269
+ - **자동화** — CI/CD 파이프라인에서 보안 스캔 실행
270
+ - **즉시 수정** — 보안 부채를 축적하지 않음
271
+ - **수정 검증** — 수정 후 반드시 보안 리뷰 재실행
272
+
273
+ <Arguments>
274
+ ## 사용법
275
+ `/forgen:security-review {점검 대상}`
276
+
277
+ ### 예시
278
+ - `/forgen:security-review` (기본: 전체 프로젝트)
279
+ - `/forgen:security-review src/api/`
280
+ - `/forgen:security-review 인증 관련 코드만 집중 점검`
281
+ - `/forgen:security-review 최근 변경사항의 보안 영향 분석`
282
+
283
+ ### 인자
284
+ - 디렉토리, 파일, 또는 관심 영역을 지정
285
+ - 인자 없으면 프로젝트 전체를 점검
286
+ </Arguments>
287
+
288
+ $ARGUMENTS
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: tdd
3
+ description: This skill should be used when the user asks to "tdd,test first,테스트 먼저,테스트 주도". Test-Driven Development workflow with Red-Green-Refactor cycle
4
+ triggers:
5
+ - "tdd"
6
+ - "test first"
7
+ - "테스트 먼저"
8
+ - "테스트 주도"
9
+ ---
10
+
11
+ <Purpose>
12
+ TDD(Test-Driven Development) 워크플로우를 실행합니다.
13
+ Red-Green-Refactor 사이클을 통해 견고한 코드를 점진적으로 구축합니다.
14
+ </Purpose>
15
+
16
+ ## The Iron Law / 철의 법칙
17
+
18
+ **실패하는 테스트 없이 프로덕션 코드를 작성하지 않는다**
19
+
20
+ 테스트 전에 코드를 작성했다면? **삭제하고 처음부터 다시 시작한다.** 예외 없음.
21
+
22
+ <Steps>
23
+ 1. **RED**: 실패하는 테스트를 먼저 작성합니다
24
+ - 요구사항을 테스트 케이스로 변환
25
+ - 엣지 케이스와 에러 케이스 포함
26
+ - 테스트 실행 — **반드시 실패해야 함**
27
+ - 첫 실행에 통과하면 테스트가 잘못된 것 — 수정 필요
28
+
29
+ 2. **GREEN**: 테스트를 통과하는 최소한의 코드를 작성합니다
30
+ - 가장 단순한 구현으로 시작
31
+ - "하는 김에" 추가 기능 금지
32
+ - 모든 테스트가 통과하는 것을 확인
33
+ - 불필요한 최적화나 추상화는 하지 않음
34
+
35
+ 3. **REFACTOR**: 코드를 정리합니다
36
+ - 중복 제거
37
+ - 네이밍 개선
38
+ - 필요 시 추상화 도입
39
+ - **변경할 때마다** 테스트 실행
40
+ - 모든 테스트가 여전히 통과해야 함
41
+
42
+ 4. **REPEAT**: 다음 요구사항으로 사이클 반복
43
+ </Steps>
44
+
45
+ ## Enforcement Rules / 시행 규칙
46
+
47
+ | 감지 상황 | 조치 |
48
+ |-----------|------|
49
+ | 테스트보다 코드가 먼저 작성됨 | **중단. 코드 삭제. 테스트 먼저 작성.** |
50
+ | 테스트가 첫 실행에 통과 | **테스트가 잘못됨. 실패하도록 수정.** |
51
+ | 한 사이클에 여러 기능 | **중단. 하나의 테스트, 하나의 기능.** |
52
+ | Refactor 단계 건너뜀 | **돌아가서 정리. 다음 기능 전에 리팩터.** |
53
+ | Refactor에서 동작 변경 | **중단. Refactor는 동작 보존만.** |
54
+ | 테스트를 수정하여 통과시킴 | **금지. 테스트는 요구사항. 코드를 수정.** |
55
+
56
+ ## 에이전트 위임
57
+
58
+ `test-engineer` 에이전트에 위임하여 TDD 사이클을 수행합니다:
59
+
60
+ ```
61
+ Agent(
62
+ subagent_type="test-engineer",
63
+ model="opus",
64
+ prompt="TDD TASK
65
+
66
+ Red-Green-Refactor 사이클로 기능을 구현하세요.
67
+
68
+ Feature: [구현할 기능]
69
+
70
+ Iron Law: 실패하는 테스트 없이 프로덕션 코드를 절대 작성하지 않는다.
71
+
72
+ 각 사이클에서:
73
+ 1. RED: 실패하는 테스트 작성 및 실행 (실패 확인)
74
+ 2. GREEN: 최소한의 코드로 테스트 통과
75
+ 3. REFACTOR: 코드 정리 (테스트 유지)
76
+
77
+ Output: 각 사이클별 RED/GREEN/REFACTOR 결과 리포트"
78
+ )
79
+ ```
80
+
81
+ ## External Consultation (Optional)
82
+
83
+ test-engineer 에이전트는 테스트 전략 검증을 위해 Claude Task 에이전트에 자문할 수 있습니다.
84
+
85
+ ### Protocol
86
+ 1. **자체 테스트 전략을 먼저 수립** — 독립적으로 테스트 설계
87
+ 2. **검증을 위한 자문** — Claude Task 에이전트를 통해 테스트 커버리지 전략 교차 확인
88
+ 3. **비판적 평가** — 외부 제안을 맹목적으로 수용하지 않음
89
+ 4. **우아한 폴백** — 위임이 불가능할 경우 절대 차단하지 않음
90
+
91
+ ### 자문이 필요한 경우
92
+ - 복잡한 도메인 로직의 포괄적 테스트 커버리지
93
+ - 핵심 경로의 엣지 케이스 식별
94
+ - 대규모 기능의 테스트 아키텍처
95
+ - 익숙하지 않은 테스팅 패턴
96
+
97
+ ### 자문을 생략하는 경우
98
+ - 단순 유닛 테스트
99
+ - 잘 알려진 테스팅 패턴
100
+ - 시간이 촉박한 TDD 사이클
101
+ - 작고 격리된 기능
102
+
103
+ ## Phase별 출력 형식 템플릿
104
+
105
+ ```
106
+ ## TDD Cycle: [기능 이름]
107
+
108
+ === RED Phase ===
109
+ Test File: [테스트 파일 경로]
110
+ Test Code:
111
+ [테스트 코드]
112
+
113
+ Expected Failure: [예상되는 에러 메시지]
114
+ Actual Result:
115
+ FAIL: [실제 실행 결과]
116
+ X failing, Y passing
117
+
118
+ Status: RED (테스트 실패 확인)
119
+
120
+ === GREEN Phase ===
121
+ Implementation File: [구현 파일 경로]
122
+ Implementation Code:
123
+ [최소한의 구현 코드]
124
+
125
+ Test Result:
126
+ PASS: [실행 결과]
127
+ All tests passing
128
+
129
+ Status: GREEN (테스트 통과 확인)
130
+
131
+ === REFACTOR Phase ===
132
+ Changes:
133
+ - [변경 사항 1]
134
+ - [변경 사항 2]
135
+
136
+ Test Result:
137
+ PASS: All tests still passing
138
+
139
+ Status: REFACTOR COMPLETE
140
+
141
+ === Cycle Summary ===
142
+ Feature: [구현된 기능]
143
+ Tests Added: N
144
+ Tests Passing: N/N
145
+ Next: [다음 사이클 기능]
146
+ ```
147
+
148
+ ## 명령어
149
+
150
+ 각 구현 전:
151
+ ```bash
152
+ # 프로젝트의 테스트 명령어 실행 — 새 실패 테스트가 하나여야 함
153
+ ```
154
+
155
+ 구현 후:
156
+ ```bash
157
+ # 프로젝트의 테스트 명령어 실행 — 새 테스트 통과, 기존 테스트도 모두 통과
158
+ ```
159
+
160
+ <Policy>
161
+ - 테스트 없이 프로덕션 코드를 작성하지 않습니다
162
+ - 한 번에 하나의 실패하는 테스트만 추가합니다
163
+ - Refactor 단계에서 동작을 변경하지 않습니다
164
+ - 매 사이클 완료 후 테스트 스위트 전체 실행
165
+ - 테스트를 수정하여 통과시키는 행위는 금지 (test hack 금지)
166
+ - 규율 자체가 가치입니다 — 지름길은 이점을 파괴합니다
167
+ </Policy>
168
+
169
+ <Arguments>
170
+ ## 사용법
171
+ `/forgen:tdd {구현할 기능}`
172
+
173
+ ### 예시
174
+ - `/forgen:tdd 이메일 유효성 검증 함수`
175
+ - `/forgen:tdd 장바구니 할인 계산 로직`
176
+ - `/forgen:tdd src/utils/parser.ts에 JSON 파싱 에러 핸들링 추가`
177
+
178
+ ### 인자
179
+ - 구현할 기능이나 요구사항을 설명
180
+ - 테스트 프레임워크는 프로젝트 설정에서 자동 감지 (jest, vitest 등)
181
+ </Arguments>
182
+
183
+ $ARGUMENTS