@jamie-tam/forge 6.0.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 (213) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +389 -0
  3. package/agents/architect.md +92 -0
  4. package/agents/builder.md +122 -0
  5. package/agents/code-reviewer.md +107 -0
  6. package/agents/concept-designer.md +207 -0
  7. package/agents/craft-reviewer.md +132 -0
  8. package/agents/critic.md +130 -0
  9. package/agents/doc-writer.md +85 -0
  10. package/agents/dreamer.md +129 -0
  11. package/agents/e2e-runner.md +89 -0
  12. package/agents/gotcha-hunter.md +127 -0
  13. package/agents/prototype-builder.md +193 -0
  14. package/agents/prototype-codifier.md +204 -0
  15. package/agents/prototype-reviewer.md +163 -0
  16. package/agents/security-reviewer.md +108 -0
  17. package/agents/spec-reviewer.md +94 -0
  18. package/agents/tracer.md +98 -0
  19. package/agents/wireframer.md +109 -0
  20. package/commands/abort.md +25 -0
  21. package/commands/bugfix.md +151 -0
  22. package/commands/evolve.md +118 -0
  23. package/commands/feature.md +236 -0
  24. package/commands/forge.md +100 -0
  25. package/commands/greenfield.md +185 -0
  26. package/commands/hotfix.md +98 -0
  27. package/commands/refactor.md +147 -0
  28. package/commands/resume.md +25 -0
  29. package/commands/setup.md +201 -0
  30. package/commands/status.md +27 -0
  31. package/commands/task-force.md +110 -0
  32. package/commands/validate.md +12 -0
  33. package/dist/__tests__/active-manifest.test.js +272 -0
  34. package/dist/__tests__/copy.test.js +96 -0
  35. package/dist/__tests__/gate-check.test.js +384 -0
  36. package/dist/__tests__/wiki.test.js +472 -0
  37. package/dist/__tests__/work-manifest.test.js +304 -0
  38. package/dist/active-manifest.js +229 -0
  39. package/dist/cli.js +158 -0
  40. package/dist/copy.js +124 -0
  41. package/dist/gate-check.js +326 -0
  42. package/dist/hooks.js +60 -0
  43. package/dist/init.js +140 -0
  44. package/dist/manifest.js +90 -0
  45. package/dist/merge.js +77 -0
  46. package/dist/paths.js +36 -0
  47. package/dist/uninstall.js +216 -0
  48. package/dist/update.js +158 -0
  49. package/dist/verify-manifest.js +65 -0
  50. package/dist/verify.js +98 -0
  51. package/dist/wiki-ui.js +310 -0
  52. package/dist/wiki.js +364 -0
  53. package/dist/work-manifest.js +798 -0
  54. package/hooks/config/gate-requirements.json +79 -0
  55. package/hooks/hooks.json +143 -0
  56. package/hooks/scripts/analyze-telemetry.sh +114 -0
  57. package/hooks/scripts/gate-enforcer.sh +164 -0
  58. package/hooks/scripts/pre-compact.sh +90 -0
  59. package/hooks/scripts/session-start.sh +81 -0
  60. package/hooks/scripts/telemetry.sh +41 -0
  61. package/hooks/scripts/wiki-lint.sh +87 -0
  62. package/hooks/templates/AGENTS.md.template +48 -0
  63. package/hooks/templates/CLAUDE.md.template +45 -0
  64. package/package.json +55 -0
  65. package/protocols/README.md +40 -0
  66. package/protocols/codex.md +151 -0
  67. package/protocols/graphify.md +156 -0
  68. package/references/common/agent-coordination.md +65 -0
  69. package/references/common/coding-standards.md +54 -0
  70. package/references/common/feature-tracking.md +21 -0
  71. package/references/common/io-protocol.md +36 -0
  72. package/references/common/phases.md +57 -0
  73. package/references/common/quality-gates.md +130 -0
  74. package/references/common/skill-authoring.md +154 -0
  75. package/references/common/skill-compliance.md +30 -0
  76. package/references/python/standards.md +44 -0
  77. package/references/react/standards.md +61 -0
  78. package/references/typescript/standards.md +42 -0
  79. package/rules/common/forge-system.md +59 -0
  80. package/rules/common/git-workflow.md +40 -0
  81. package/rules/common/guardrails.md +37 -0
  82. package/rules/common/quality-gates.md +18 -0
  83. package/rules/common/security.md +50 -0
  84. package/rules/common/skill-selection.md +78 -0
  85. package/rules/common/testing.md +58 -0
  86. package/rules/common/verification.md +39 -0
  87. package/skills/build-pr-workflow/SKILL.md +301 -0
  88. package/skills/build-pr-workflow/references/pr-template.md +62 -0
  89. package/skills/build-pr-workflow/references/subagent-merge.md +47 -0
  90. package/skills/build-pr-workflow/references/worktree-setup.md +125 -0
  91. package/skills/build-prototype/SKILL.md +264 -0
  92. package/skills/build-scaffold/SKILL.md +340 -0
  93. package/skills/build-tdd/SKILL.md +89 -0
  94. package/skills/build-wireframe/SKILL.md +110 -0
  95. package/skills/build-wireframe/assets/baseline-template.html +486 -0
  96. package/skills/build-wireframe/references/demo-walkthroughs.md +170 -0
  97. package/skills/build-wireframe/references/gotchas.md +188 -0
  98. package/skills/build-wireframe/references/legend-lines.md +141 -0
  99. package/skills/concept-slides/SKILL.md +192 -0
  100. package/skills/deliver-db-migration/SKILL.md +466 -0
  101. package/skills/deliver-deploy/SKILL.md +407 -0
  102. package/skills/deliver-onboarding/SKILL.md +198 -0
  103. package/skills/deliver-onboarding/references/document-templates.md +393 -0
  104. package/skills/deliver-onboarding/templates/getting-started.md +122 -0
  105. package/skills/discover-codebase-analysis/SKILL.md +448 -0
  106. package/skills/discover-requirements/SKILL.md +418 -0
  107. package/skills/discover-requirements/templates/prd.md +99 -0
  108. package/skills/discover-requirements/templates/technical-spec.md +123 -0
  109. package/skills/discover-requirements/templates/user-stories.md +76 -0
  110. package/skills/harden/SKILL.md +214 -0
  111. package/skills/iterate-prototype/SKILL.md +241 -0
  112. package/skills/plan-architecture/SKILL.md +457 -0
  113. package/skills/plan-architecture/templates/adr-template.md +52 -0
  114. package/skills/plan-architecture/templates/api-contract.md +99 -0
  115. package/skills/plan-architecture/templates/db-schema.md +81 -0
  116. package/skills/plan-architecture/templates/system-design.md +111 -0
  117. package/skills/plan-brainstorm/SKILL.md +433 -0
  118. package/skills/plan-design-system/SKILL.md +279 -0
  119. package/skills/plan-task-decompose/SKILL.md +454 -0
  120. package/skills/quality-code-review/SKILL.md +286 -0
  121. package/skills/quality-security-audit/SKILL.md +292 -0
  122. package/skills/quality-security-audit/references/audit-report-template.md +89 -0
  123. package/skills/quality-security-audit/references/owasp-checks.md +178 -0
  124. package/skills/quality-test-execution/SKILL.md +435 -0
  125. package/skills/quality-test-plan/SKILL.md +297 -0
  126. package/skills/quality-test-plan/references/test-type-guide.md +263 -0
  127. package/skills/quality-test-plan/templates/e2e-test-plan.md +72 -0
  128. package/skills/quality-test-plan/templates/integration-test-plan.md +74 -0
  129. package/skills/quality-test-plan/templates/load-test-plan.md +111 -0
  130. package/skills/quality-test-plan/templates/smoke-test-plan.md +68 -0
  131. package/skills/quality-test-plan/templates/unit-test-plan.md +56 -0
  132. package/skills/quality-uiux/SKILL.md +481 -0
  133. package/skills/support-debug/SKILL.md +464 -0
  134. package/skills/support-dream/SKILL.md +213 -0
  135. package/skills/support-gotcha/SKILL.md +249 -0
  136. package/skills/support-runtime-reachability/SKILL.md +190 -0
  137. package/skills/support-runtime-reachability/scripts/__fixtures__/case-01-passes-app-use/src/app.ts +7 -0
  138. package/skills/support-runtime-reachability/scripts/__fixtures__/case-01-passes-app-use/src/handlers/cases.ts +7 -0
  139. package/skills/support-runtime-reachability/scripts/__fixtures__/case-02-orphan-no-app-use/src/app.ts +8 -0
  140. package/skills/support-runtime-reachability/scripts/__fixtures__/case-02-orphan-no-app-use/src/handlers/cases.ts +7 -0
  141. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/App.tsx +5 -0
  142. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/components/RingingBanner.tsx +7 -0
  143. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/hooks/useTwilio.ts +6 -0
  144. package/skills/support-runtime-reachability/scripts/__fixtures__/case-04-jsx-component-rendered/src/App.tsx +5 -0
  145. package/skills/support-runtime-reachability/scripts/__fixtures__/case-04-jsx-component-rendered/src/components/MyComp.tsx +3 -0
  146. package/skills/support-runtime-reachability/scripts/__fixtures__/case-05-jsx-component-not-rendered/src/App.tsx +3 -0
  147. package/skills/support-runtime-reachability/scripts/__fixtures__/case-05-jsx-component-not-rendered/src/components/Orphan.tsx +3 -0
  148. package/skills/support-runtime-reachability/scripts/__fixtures__/case-06-class-instantiated/src/lib/Service.ts +6 -0
  149. package/skills/support-runtime-reachability/scripts/__fixtures__/case-06-class-instantiated/src/main.ts +4 -0
  150. package/skills/support-runtime-reachability/scripts/__fixtures__/case-07-class-not-instantiated/src/lib/Lonely.ts +5 -0
  151. package/skills/support-runtime-reachability/scripts/__fixtures__/case-07-class-not-instantiated/src/main.ts +2 -0
  152. package/skills/support-runtime-reachability/scripts/__fixtures__/case-08-default-export-imported-and-called/src/handler.ts +3 -0
  153. package/skills/support-runtime-reachability/scripts/__fixtures__/case-08-default-export-imported-and-called/src/main.ts +3 -0
  154. package/skills/support-runtime-reachability/scripts/__fixtures__/case-09-default-export-orphan/src/handler.ts +3 -0
  155. package/skills/support-runtime-reachability/scripts/__fixtures__/case-09-default-export-orphan/src/main.ts +2 -0
  156. package/skills/support-runtime-reachability/scripts/__fixtures__/case-10-aliased-named-export/src/lib.ts +5 -0
  157. package/skills/support-runtime-reachability/scripts/__fixtures__/case-10-aliased-named-export/src/main.ts +3 -0
  158. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/lib/index.ts +1 -0
  159. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/lib/internal.ts +3 -0
  160. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/main.ts +3 -0
  161. package/skills/support-runtime-reachability/scripts/__fixtures__/case-12-test-only-caller/src/util.test.ts +5 -0
  162. package/skills/support-runtime-reachability/scripts/__fixtures__/case-12-test-only-caller/src/util.ts +3 -0
  163. package/skills/support-runtime-reachability/scripts/__fixtures__/case-13-gated-pending-annotation/src/future.ts +4 -0
  164. package/skills/support-runtime-reachability/scripts/__fixtures__/case-14-untraceable-annotation/src/decorated.ts +4 -0
  165. package/skills/support-runtime-reachability/scripts/__fixtures__/case-15-untraceable-empty/src/lazy.ts +4 -0
  166. package/skills/support-runtime-reachability/scripts/__fixtures__/case-16-python-module/src/lib.py +15 -0
  167. package/skills/support-runtime-reachability/scripts/__fixtures__/case-16-python-module/src/main.py +5 -0
  168. package/skills/support-runtime-reachability/scripts/__fixtures__/case-17-router-use/src/parent.ts +5 -0
  169. package/skills/support-runtime-reachability/scripts/__fixtures__/case-17-router-use/src/routes/cases.ts +5 -0
  170. package/skills/support-runtime-reachability/scripts/__fixtures__/case-18-shadowed-name-fp/src/lib/foo.ts +3 -0
  171. package/skills/support-runtime-reachability/scripts/__fixtures__/case-18-shadowed-name-fp/src/other.ts +8 -0
  172. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/handlers/cases.ts +4 -0
  173. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/handlers/users.ts +4 -0
  174. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/main.ts +5 -0
  175. package/skills/support-runtime-reachability/scripts/__fixtures__/case-20-aliased-import-usage/src/handlers/cases.ts +3 -0
  176. package/skills/support-runtime-reachability/scripts/__fixtures__/case-20-aliased-import-usage/src/main.ts +4 -0
  177. package/skills/support-runtime-reachability/scripts/__fixtures__/case-21-mixed-default-and-named/src/lib.ts +5 -0
  178. package/skills/support-runtime-reachability/scripts/__fixtures__/case-21-mixed-default-and-named/src/main.ts +5 -0
  179. package/skills/support-runtime-reachability/scripts/__fixtures__/case-22-dynamic-import-then-caller/src/lib.ts +3 -0
  180. package/skills/support-runtime-reachability/scripts/__fixtures__/case-22-dynamic-import-then-caller/src/main.ts +8 -0
  181. package/skills/support-runtime-reachability/scripts/__fixtures__/case-23-dynamic-import-with-space/src/lib.ts +3 -0
  182. package/skills/support-runtime-reachability/scripts/__fixtures__/case-23-dynamic-import-with-space/src/main.ts +7 -0
  183. package/skills/support-runtime-reachability/scripts/check.mjs +638 -0
  184. package/skills/support-runtime-reachability/scripts/check.test.mjs +244 -0
  185. package/skills/support-skill-validator/SKILL.md +194 -0
  186. package/skills/support-skill-validator/references/false-positives.md +59 -0
  187. package/skills/support-skill-validator/references/validation-checks.md +280 -0
  188. package/skills/support-system-guide/SKILL.md +311 -0
  189. package/skills/support-task-force/SKILL.md +265 -0
  190. package/skills/support-task-force/references/dispatch-pattern.md +178 -0
  191. package/skills/support-task-force/references/synthesis-template.md +126 -0
  192. package/skills/support-wiki-bootstrap/SKILL.md +37 -0
  193. package/skills/support-wiki-lint/SKILL.md +196 -0
  194. package/skills/support-wiki-lint/scripts/lint.mjs +488 -0
  195. package/skills/support-wiki-lint/scripts/lint.test.mjs +196 -0
  196. package/templates/README.md +23 -0
  197. package/templates/aiwiki/CLAUDE.md.template +78 -0
  198. package/templates/aiwiki/schemas/architecture.md +118 -0
  199. package/templates/aiwiki/schemas/convention.md +112 -0
  200. package/templates/aiwiki/schemas/decision.md +144 -0
  201. package/templates/aiwiki/schemas/gotcha.md +118 -0
  202. package/templates/aiwiki/schemas/oracle.md +105 -0
  203. package/templates/aiwiki/schemas/session.md +125 -0
  204. package/templates/manifests/bugfix.yaml +41 -0
  205. package/templates/manifests/feature.yaml +69 -0
  206. package/templates/manifests/greenfield.yaml +61 -0
  207. package/templates/manifests/hotfix.yaml +45 -0
  208. package/templates/manifests/refactor.yaml +44 -0
  209. package/templates/manifests/v5/SCHEMA.md +327 -0
  210. package/templates/manifests/v5/feature.yaml +77 -0
  211. package/templates/manifests/v6/SCHEMA.md +199 -0
  212. package/templates/wiki-html/dream-detail.html +378 -0
  213. package/templates/wiki-html/dreams-list.html +155 -0
@@ -0,0 +1,286 @@
1
+ ---
2
+ name: quality-code-review
3
+ description: "Use when code has been written — orchestrates the review chain (safety → craft → reachability → gotcha-hunter) with risk-based escalation. Triggers on 'review my code', 'check this PR', 'is this ready', 'audit this diff'. Optional Codex adversarial cross-check fires when consent is on."
4
+ ---
5
+
6
+ # Code Review
7
+
8
+ ## Overview
9
+
10
+ Code review is not one pass — it is a chain of focused reviewers, each with its own context window. Safety, craft, reachability, and prior-art recall are different bug classes; conflating them dilutes every reviewer. This skill dispatches the chain in sequence, gathers findings, and produces a unified report.
11
+
12
+ **Core principle:** find what breaks first, then improve what works, then prove what runs, then check what we already learned.
13
+
14
+ **Announce at start:** "I'm using the quality-code-review skill to review this code."
15
+
16
+ ## When to Use
17
+
18
+ - After completing a TDD cycle (per-task review).
19
+ - Before creating a PR (final review).
20
+ - When requested for ad-hoc code review.
21
+ - During `/feature`, `/bugfix`, `/refactor` commands at the review phase.
22
+
23
+ ## The Review Chain
24
+
25
+ Each link in the chain is a separate subagent dispatch. Subagents do not share context — main session aggregates their reports.
26
+
27
+ ```
28
+ [risk-classify] → [code-reviewer] → [craft-reviewer] → [support-runtime-reachability] → [gotcha-hunter] → [Codex adversarial] → [aggregate + decide]
29
+ Pass 1: safety Pass 2: craft per-slice wiring gate prior-art recall optional cross-check
30
+ ```
31
+
32
+ ### Step 0: Codex consent
33
+
34
+ Run the Codex consent flow from `protocols/codex.md` before dispatching. The choice gates Pass 2.5 (adversarial cross-check), not the rest of the chain.
35
+
36
+ - **Takeover:** Skip Pass 1 + Pass 2; dispatch Codex `adversarial-review` for the entire diff. Continue to reachability after.
37
+ - **Verify:** Run the chain normally; Codex adversarial-reviews Claude's findings at Pass 2.5.
38
+ - **Skip / unavailable:** Run the chain normally; no adversarial step.
39
+
40
+ ### Step 1: Risk classification
41
+
42
+ Classify before dispatching anything — risk level decides which links of the chain run.
43
+
44
+ | Risk | Trigger | Chain |
45
+ |---|---|---|
46
+ | **Low** | Style, docs, config, non-functional | code-reviewer (light) + gotcha-hunter |
47
+ | **Medium** | Business logic, API endpoints, data processing, UI with state | full chain |
48
+ | **High** | Auth/authz, payments, PII, encryption, user-input rendering, query construction from user input, SSRF surfaces, new external integrations | full chain + escalate to `quality-security-audit` |
49
+ | **Critical** | Infrastructure, deploy config, DB migrations, CI/CD | full chain + security audit + human approval before merge |
50
+
51
+ `gotcha-hunter` runs at every risk level — recall is cheap (the agent only reads markdown), and a "config" change that matches a known recurring failure pattern is exactly what the catalog exists to surface. Skip only `craft-reviewer` and `support-runtime-reachability` at low risk.
52
+
53
+ See **Risk Classification Guide** below for the full mapping.
54
+
55
+ ### Step 2: Pass 1 — code-reviewer (safety)
56
+
57
+ Dispatch `code-reviewer` subagent. It owns: SQL safety, race conditions, auth boundaries, secret exposure, injection vulnerabilities, data-loss risks, unhandled async errors. Returns `[CRITICAL]` findings and a SAFETY REVIEW SUMMARY.
58
+
59
+ If `code-reviewer` returns `BLOCK`, halt the chain. Surface findings; require fixes before re-running.
60
+
61
+ ### Step 3: Pass 2 — craft-reviewer
62
+
63
+ Dispatch `craft-reviewer` subagent. It owns: library idiom adherence (Context7-verified), codebase pattern conformance, stub detection. Returns severity-tagged findings and a CRAFT REVIEW SUMMARY.
64
+
65
+ `craft-reviewer` does not block the chain on its own — its findings inform the final decision.
66
+
67
+ ### Step 4: Per-slice runtime reachability gate
68
+
69
+ Invoke the `support-runtime-reachability` skill. It walks the slice diff, finds exports, and verifies each has a production caller (or escape-hatch annotation). Writes the per-slice `runtime-reach` gate result to the manifest.
70
+
71
+ If the gate fails, halt the chain. Orphan exports must be wired, annotated, or removed before review continues.
72
+
73
+ ### Step 5: Gotcha hunter — prior-art recall
74
+
75
+ Dispatch the `gotcha-hunter` subagent with the diff scope. It scans `aiwiki/gotchas/` (project) and `~/.claude/gotchas/` (global), matches entries against the diff, and returns a ranked relevance list. Each surfaced gotcha cites the existing prevention.
76
+
77
+ `gotcha-hunter` does not block the chain. Use its findings to:
78
+ - check whether earlier passes missed a known recurring failure mode,
79
+ - include the cited gotcha files in the final review report so the developer reads the prior lesson, not just the verdict.
80
+
81
+ If the agent reports `promotion-pending` entries, treat that as a separate warning — those are draft rules awaiting session-start review (see `support-gotcha` Step 6); the chain continues but the user should resolve them before the next slice closes.
82
+
83
+ ### Step 6: Pass 2.5 — Codex adversarial cross-check (Verify mode only)
84
+
85
+ If the user selected **Verify** at Step 0, dispatch Codex `adversarial-review` to cross-check what Claude's chain found. Codex is looking for: gaps Claude missed, dead code, cross-module inconsistencies, security concerns the chain didn't surface.
86
+
87
+ ```bash
88
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" adversarial-review --scope branch \
89
+ "Review the diff for gaps, dead code, cross-module inconsistencies, and security concerns the prior chain missed. Focus on what is WRONG or MISSING, not style."
90
+ ```
91
+
92
+ Surface Codex's findings alongside Claude's; flag disagreements for the user to resolve.
93
+
94
+ ### Step 7: Plan alignment
95
+
96
+ Verify the implementation aligns with the plan:
97
+
98
+ 1. Read the task from `.forge/work/{type}/{name}/tasks.md`.
99
+ 2. Compare implementation against the task description.
100
+ 3. Check API contracts at `.forge/work/{type}/{name}/architecture/api-contract.md`.
101
+ 4. Check DB schema at `.forge/work/{type}/{name}/architecture/db-schema.md`.
102
+ 5. Verify decision log consistency at `aiwiki/decisions/`.
103
+
104
+ Flag deviations. Intentional deviations go in the decision log.
105
+
106
+ ### Step 8: Aggregate and decide
107
+
108
+ Combine findings from all subagents into a unified report (see **Review Report Format** below). The main session decides — never blindly accept a subagent verdict.
109
+
110
+ ## Subagent Dispatch
111
+
112
+ | Subagent | Owns | When |
113
+ |---|---|---|
114
+ | `code-reviewer` | Pass 1 safety | Always (unless Codex Takeover) |
115
+ | `craft-reviewer` | Pass 2 craft + idioms + stubs | Medium / High / Critical risk |
116
+ | `support-runtime-reachability` (skill) | Slice wiring gate | Medium / High / Critical risk; per-slice gate before final approval |
117
+ | `gotcha-hunter` | Prior-art recall (project + global gotcha catalogs) | Always — runs after the chain's other passes (after the wiring gate when present, otherwise immediately after `code-reviewer`); surfaces relevant gotchas + any promotion-pending warnings |
118
+ | Codex `adversarial-review` | Cross-check (gaps/dead-code/inconsistencies) | If user selected Verify or Takeover |
119
+
120
+ Each subagent receives: changed files, test results, architecture artifacts, decision log. Each runs in its own context window so the main session stays lean.
121
+
122
+ ## Risk Classification Guide
123
+
124
+ | Change Area | Default Risk | Escalate If |
125
+ |---|---|---|
126
+ | README, comments | Low | Never |
127
+ | CSS, styling | Low | Involves user input (XSS) |
128
+ | Config files | Low | Secrets, deploy targets |
129
+ | Business logic | Medium | Handles money or PII |
130
+ | API endpoints | Medium | Auth-required endpoints |
131
+ | Database queries | Medium | Schema changes, migrations |
132
+ | Auth/authz | High | Always |
133
+ | Payment/billing | High | Always |
134
+ | User data handling | High | PII, GDPR-relevant |
135
+ | Encryption/hashing | High | Always |
136
+ | User-input rendering | High | Output to HTML/templates without encoding |
137
+ | Query construction | High | User input in SQL/NoSQL/LDAP/command strings |
138
+ | Server-side requests | High | User-controlled URL or hostname |
139
+ | External integrations | High | New third-party service, auth token, or webhook |
140
+ | Infrastructure/deploy | Critical | Always |
141
+ | CI/CD pipeline | Critical | Always |
142
+ | Database migrations | Critical | Production database |
143
+
144
+ When the diff touches a High row, escalate to `quality-security-audit` after the chain. When the diff touches a Critical row, require human approval before merge.
145
+
146
+ ## Auto-Fix vs Ask
147
+
148
+ | Issue Type | Action |
149
+ |---|---|
150
+ | Formatting, whitespace | Auto-fix silently |
151
+ | Obvious naming improvements | Auto-fix, mention in report |
152
+ | Missing error handling | Auto-fix if pattern is clear from the codebase |
153
+ | Architecture decisions | Ask user (batch all questions into one) |
154
+ | Tradeoffs (performance vs readability) | Ask user with recommendation |
155
+ | Convention conflicts | Check decision log first; ask if no precedent |
156
+
157
+ Batch all "ask user" items into a single question. Do not ask one at a time.
158
+
159
+ ## Review Report Format
160
+
161
+ ```markdown
162
+ ## Code Review Report
163
+
164
+ **Scope:** [files reviewed]
165
+ **Risk:** [Low / Medium / High / Critical]
166
+ **Reviewers:** code-reviewer, craft-reviewer, support-runtime-reachability, gotcha-hunter[, Codex]
167
+
168
+ ### Pass 1 — Safety (code-reviewer)
169
+ - SQL safety: PASS
170
+ - Race conditions: PASS
171
+ - Auth boundaries: PASS
172
+ - Secret exposure: PASS
173
+ - Injection vulnerabilities: PASS
174
+ - Data-loss risks: 1 finding (auto-fixed)
175
+
176
+ ### Pass 2 — Craft (craft-reviewer)
177
+ - Idiom adherence: PASS (axios v1.7 verified)
178
+ - Pattern conformance: 1 finding (existing pattern at src/handlers/users.ts:22)
179
+ - Stub detection: PASS
180
+
181
+ ### Slice gate — runtime-reach (support-runtime-reachability)
182
+ - 4 exports checked, all wired ✓
183
+
184
+ ### Prior-art recall (gotcha-hunter)
185
+ - Project gotchas relevant: 0
186
+ - Global gotchas relevant: 1 — Stub logger silently drops events (~/.claude/gotchas/{YYYY-MM-DD}-{slug}.md)
187
+ - Promotion-pending: 0
188
+
189
+ ### Pass 2.5 — Codex adversarial (if Verify)
190
+ - 1 finding: dead import in src/lib/utils.ts
191
+
192
+ ### Plan Alignment
193
+ - Matches task description ✓
194
+ - API contract compliant ✓
195
+ - Decision log consistent ✓
196
+
197
+ ### Findings
198
+ | # | Reviewer | Severity | Description | Status |
199
+ |---|---|---|---|---|
200
+ | 1 | code-reviewer | Critical | Missing transaction in createOrder | Auto-fixed |
201
+ | 2 | craft-reviewer | Important | Throws bare Error for validation | Awaiting user |
202
+ | 3 | gotcha-hunter | Advisory | Logger stub pattern matches a global gotcha — confirm via console-tee | Cited |
203
+ | 4 | Codex | Important | Dead import `formatDate` in utils.ts | Auto-fixed |
204
+
205
+ ### Decision
206
+ **APPROVED** / **APPROVED WITH CONCERNS** / **CHANGES REQUESTED** / **BLOCKED**
207
+ ```
208
+
209
+ ## Decision Outcomes
210
+
211
+ | Decision | Meaning | Action |
212
+ |---|---|---|
213
+ | APPROVED | No issues, or all issues auto-fixed | Proceed |
214
+ | APPROVED WITH CONCERNS | Non-blocking issues documented | Proceed; log concerns |
215
+ | CHANGES REQUESTED | Issues must be fixed | Return to `build-tdd` |
216
+ | BLOCKED | Critical safety, runtime-reach failure, or architecture problem | Escalate to user |
217
+
218
+ ## Common Mistakes
219
+
220
+ | Mistake | Fix |
221
+ |---|---|
222
+ | Reviewing without running tests first | Tests must pass before review starts |
223
+ | Conflating safety, craft, and reachability into one pass | Dispatch the four subagents separately; each owns its concern |
224
+ | Skipping `craft-reviewer` because Pass 1 was clean | Pass 2 catches different bugs; safety alone isn't enough |
225
+ | Treating runtime-reach as optional | The wiring gate is per-slice; orphan exports block the slice |
226
+ | Skipping `gotcha-hunter` because nothing felt familiar | The catalog exists because we already forgot — the agent is recall, not intuition |
227
+ | Asking questions one at a time | Batch all "ask user" items into a single message |
228
+ | Auto-fixing architecture decisions | Architecture changes require user approval |
229
+
230
+ ## Red Flags
231
+
232
+ **Never:**
233
+ - Skip the safety pass.
234
+ - Auto-fix security or architecture decisions.
235
+ - Proceed with critical safety findings unresolved.
236
+ - Pass the runtime-reach gate by adding a no-op caller.
237
+
238
+ **Always:**
239
+ - Run safety first; halt the chain on a `BLOCK`.
240
+ - Classify risk before dispatching.
241
+ - Aggregate findings from all reviewers — don't hide one to make the report look clean.
242
+ - Verify plan alignment after the chain runs.
243
+
244
+ ## I/O Contract
245
+
246
+ | Field | Value |
247
+ |---|---|
248
+ | **Requires** | Implementation code + passing tests, architecture artifacts (`.forge/work/{type}/{name}/architecture/`), decision log (`aiwiki/decisions/`) |
249
+ | **Produces** | Unified review report (in conversation or `.forge/work/{type}/{name}/review-report.md`), auto-fixes applied to code |
250
+ | **Feeds into** | `quality-test-execution` (final review), next TDD task (per-task review), `build-pr-workflow` (PR gate) |
251
+ | **Updates manifest** | `slice_graph.slices.<id>.gates.{code-review, runtime-reach}` per-slice; `phases.quality.code-review-final.gate-passed: true` at manifest level |
252
+
253
+ ## Graphify Context
254
+
255
+ **Protocol:** `protocols/graphify.md` | **Guard:** Run the status check from the protocol before Step 2.
256
+
257
+ Graph context reveals cross-module blast radius — surface to the subagents in their dispatch prompts:
258
+
259
+ - **Communities** identify subsystems the diff touches; cross-community changes are higher risk.
260
+ - **God nodes** get extra scrutiny.
261
+ - **EXTRACTED edges** trace dependency paths.
262
+
263
+ CLI queries (if graph exists):
264
+ - `graphify query "what depends on [changed file]" --budget 1000 --graph graphify-out/graph.json`
265
+ - `graphify explain "[changed module]" --graph graphify-out/graph.json`
266
+
267
+ ## Integration
268
+
269
+ **Called by:**
270
+ - `/feature` (per-task review + final review)
271
+ - `/bugfix` (review before PR)
272
+ - `/refactor` (review before PR)
273
+ - On-demand
274
+
275
+ **Dispatches:**
276
+ - `code-reviewer` (Pass 1 safety)
277
+ - `craft-reviewer` (Pass 2 craft)
278
+ - `support-runtime-reachability` skill (per-slice gate)
279
+ - `gotcha-hunter` (prior-art recall)
280
+ - Codex `adversarial-review` (optional cross-check)
281
+
282
+ **Pairs with:**
283
+ - `build-tdd` — feeds the diff to review
284
+ - `quality-security-audit` — escalation for High/Critical risk
285
+ - `quality-test-execution` — runs after final review approves
286
+ - `build-pr-workflow` — approved review gates PR creation
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: quality-security-audit
3
+ description: "Use when deploying auth/data-handling code, when code-review escalates high-risk findings, or when changes touch auth, crypto, or integrations."
4
+ ---
5
+
6
+ # Security Audit
7
+
8
+ ## Overview
9
+
10
+ Perform a focused security audit covering the most critical vulnerability categories. Every finding includes a realistic exploit scenario -- not just "best practice" warnings.
11
+
12
+ **Core principle:** If you cannot describe how an attacker would exploit it, it is not a real finding. If you can describe the exploit, it must be fixed.
13
+
14
+ **Announce at start:** "I'm using the quality-security-audit skill to audit this code for security vulnerabilities."
15
+
16
+ ## When to Use
17
+
18
+ - Before deployment to production
19
+ - When `quality-code-review` escalates to security audit (High/Critical risk)
20
+ - On-demand when the user requests a security review
21
+ - After adding authentication, authorization, payment, or data handling code
22
+ - When integrating third-party packages or services
23
+
24
+ **Not for:**
25
+ - General code quality (that is quality-code-review)
26
+ - Performance issues (that is quality-code-review performance section)
27
+ - Non-security configuration issues
28
+
29
+ ## When to load references
30
+
31
+ - **`references/owasp-checks.md`** — full OWASP Top 10 (A01-A10): per-category check lists and realistic exploit scenarios. Load this when starting Phase 1.
32
+ - **`references/audit-report-template.md`** — canonical markdown structure for the audit report, plus the finding format used in every phase. Load this when writing the report or recording any finding.
33
+
34
+ ## Agent Dispatch
35
+
36
+ Dispatch the **security-reviewer** subagent for the audit. It specializes in OWASP Top 10 analysis with exploit scenarios and runs an independent review. The security-reviewer determines the appropriate depth based on the scope of changes.
37
+
38
+ ## The Audit Process
39
+
40
+ ### Phase 0: Codex Mode Check
41
+
42
+ Run the Codex consent flow from `protocols/codex.md` before proceeding.
43
+
44
+ - **Takeover selected:** Dispatch Codex `adversarial-review` to execute the full OWASP audit and all 6 phases. Claude reviews Codex's findings at the end.
45
+ - **Verify selected** or **Skip / Codex unavailable:** Proceed with Phases 1-6 below. If Verify was selected, the Codex Adversarial Review step at the end will dispatch Codex to check Claude's findings.
46
+
47
+ ### Phase 1: OWASP Top 10 Check
48
+
49
+ Systematically check the code against each OWASP Top 10 category. Load **`references/owasp-checks.md`** for the full per-category check lists and exploit scenarios.
50
+
51
+ | ID | Category | Sample check |
52
+ |---|---|---|
53
+ | A01 | Broken Access Control | IDOR, missing authorization, CORS misconfig, directory traversal |
54
+ | A02 | Cryptographic Failures | Weak hashes, plaintext secrets, missing TLS, weak RNG |
55
+ | A03 | Injection | SQL/NoSQL/command/LDAP/template/header injection |
56
+ | A04 | Insecure Design | Missing rate limiting, race conditions, business logic flaws |
57
+ | A05 | Security Misconfiguration | Debug in prod, default credentials, missing security headers |
58
+ | A06 | Vulnerable Components | CVEs in deps, abandoned packages — run `npm audit` / `pip audit` / `govulncheck` / `cargo audit` |
59
+ | A07 | Auth Failures | Weak passwords, session fixation, hardcoded JWT secret |
60
+ | A08 | Data Integrity Failures | Unsigned updates, untrusted deserialization |
61
+ | A09 | Logging & Monitoring Failures | Missing audit logs, PII in logs, no alerting |
62
+ | A10 | SSRF | User-controlled URLs, internal network access, cloud metadata endpoint exposure |
63
+
64
+ For every finding at MEDIUM or above, include a realistic exploit scenario using the finding format in `references/audit-report-template.md`.
65
+
66
+ ### Phase 2: Secrets Scanning
67
+
68
+ Scan the entire codebase for hardcoded secrets.
69
+
70
+ **Search patterns:**
71
+
72
+ ```
73
+ # API keys
74
+ grep -rn "api[_-]?key.*=.*['\"][a-zA-Z0-9]" --include="*.ts" --include="*.js" --include="*.py"
75
+
76
+ # AWS credentials
77
+ grep -rn "AKIA[0-9A-Z]{16}" .
78
+ grep -rn "aws[_-]?secret" --include="*.ts" --include="*.js" --include="*.py" --include="*.env*"
79
+
80
+ # JWT secrets
81
+ grep -rn "jwt[_-]?secret.*=.*['\"]" .
82
+
83
+ # Generic passwords
84
+ grep -rn "password.*=.*['\"][^$]" --include="*.ts" --include="*.js" --include="*.py"
85
+
86
+ # Private keys
87
+ grep -rn "BEGIN.*PRIVATE KEY" .
88
+
89
+ # Connection strings with credentials
90
+ grep -rn "://[^/]*:.*@" --include="*.ts" --include="*.js" --include="*.py"
91
+ ```
92
+
93
+ **Check these files specifically:**
94
+ - All `.env` files (should not be committed)
95
+ - Configuration files (config.ts, settings.py, etc.)
96
+ - Test fixtures and seed data
97
+ - Docker-compose files
98
+ - CI/CD configuration files
99
+ - README and documentation
100
+
101
+ ### Phase 3: Dependency Vulnerabilities
102
+
103
+ Run automated tools and manually review results.
104
+
105
+ ```bash
106
+ # Step 1: Run audit tool
107
+ npm audit --json > audit-results.json
108
+ # or: pip audit --format json > audit-results.json
109
+
110
+ # Step 2: Analyze severity distribution
111
+ # Critical: Patch immediately
112
+ # High: Patch before deployment
113
+ # Medium: Patch within sprint
114
+ # Low: Track and patch in maintenance cycle
115
+ ```
116
+
117
+ Record each vulnerability using the finding format in `references/audit-report-template.md`, including a BLOCKED line that notes whether anything prevents the upgrade.
118
+
119
+ ### Phase 4: Supply Chain Risks
120
+
121
+ Review dependencies for supply chain attack vectors.
122
+
123
+ **Check for:**
124
+ - **Typosquatting:** Package names similar to popular packages (e.g., `lodashe` instead of `lodash`)
125
+ - **Unpinned versions:** Using `^` or `*` instead of exact versions in production dependencies
126
+ - **Very new packages:** Published within last 30 days with no established track record
127
+ - **Single maintainer packages:** Bus factor of 1 for critical dependencies
128
+ - **Excessive permissions:** Packages requesting unnecessary filesystem or network access
129
+ - **Install scripts:** Packages with postinstall scripts that run arbitrary code
130
+
131
+ ```bash
132
+ # Check for install scripts
133
+ npm ls --json | jq '.dependencies | to_entries[] | select(.value.scripts.postinstall)'
134
+
135
+ # Check package age and download counts
136
+ npm view <package> time.created
137
+ npm view <package> --json | jq '.dist-tags, .maintainers'
138
+ ```
139
+
140
+ ### Phase 5: Auth/Authz Boundary Verification
141
+
142
+ Systematically map and verify authentication and authorization boundaries.
143
+
144
+ **Process:**
145
+
146
+ 1. **List all endpoints/routes** with their required auth level
147
+ 2. **Verify each endpoint** has appropriate middleware/guards
148
+ 3. **Test boundary conditions:**
149
+ - Unauthenticated access to protected endpoints
150
+ - Authenticated user accessing another user's resources
151
+ - Regular user accessing admin endpoints
152
+ - Expired token handling
153
+ - Invalid token handling
154
+
155
+ ```markdown
156
+ | Endpoint | Required Auth | Actual Auth | IDOR Check | Status |
157
+ |----------|--------------|-------------|------------|--------|
158
+ | GET /api/users | Admin | Admin middleware | N/A | PASS |
159
+ | GET /api/users/:id | Owner or Admin | Auth middleware only | FAIL - no owner check | FAIL |
160
+ | POST /api/users | Public | None | N/A | PASS |
161
+ | PUT /api/users/:id | Owner | Auth middleware only | FAIL - no owner check | FAIL |
162
+ | DELETE /api/users/:id | Admin | Auth middleware | N/A | PASS |
163
+ ```
164
+
165
+ ### Phase 6: Data Exposure Review
166
+
167
+ Check for unintentional data exposure.
168
+
169
+ **Check these locations:**
170
+ - **Log output:** Search for PII (email, phone, address, SSN) in log statements
171
+ - **Error messages:** Ensure errors do not expose stack traces, SQL queries, or internal paths
172
+ - **API responses:** Verify responses do not include fields not in the API contract (e.g., password hash, internal IDs)
173
+ - **Client-side bundles:** Check that server-only data is not included in frontend builds
174
+ - **Debug endpoints:** Ensure no debug/test endpoints exist in production code
175
+ - **Database backups:** Verify backup strategy does not expose data
176
+
177
+ ## Audit Report
178
+
179
+ Write the report following the structure in **`references/audit-report-template.md`**. The template covers metadata, executive summary, findings (by severity), dependency audit, supply chain review, auth boundary map, secrets scan, recommendations, and the quality gate.
180
+
181
+ ## Codex Adversarial Review
182
+
183
+ After completing all 6 phases, check the mode recorded at Phase 0. If **Verify** was selected, dispatch `adversarial-review` to find authorization gaps, cross-package permission mismatches, and security primitives defined but not enforced. Merge Claude + Codex findings in the final report. If **Takeover** was selected, skip this step (Codex already ran the audit). If **Skip**, do nothing. Do NOT re-run the consent flow. See **Codex Integration** section below for full details.
184
+
185
+ ## Severity Classification
186
+
187
+ | Severity | Criteria | Response Time |
188
+ |----------|----------|---------------|
189
+ | CRITICAL | Active exploitation possible, data breach risk | Fix before any deployment |
190
+ | HIGH | Exploitable with moderate effort, significant impact | Fix before production deployment |
191
+ | MEDIUM | Exploitable with significant effort, limited impact | Fix within current sprint |
192
+ | LOW | Theoretical risk, minimal impact | Track and fix in maintenance |
193
+ | INFO | Best practice recommendation, no exploit scenario | Optional improvement |
194
+
195
+ **Rule:** INFO-level findings with no exploit scenario are acceptable. MEDIUM and above MUST have a realistic exploit scenario.
196
+
197
+ ## Common Mistakes
198
+
199
+ | Mistake | Fix |
200
+ |---------|-----|
201
+ | "Best practice" warnings without exploit | Every finding needs a realistic exploit scenario |
202
+ | Skipping dependency audit | Always run the automated audit tool |
203
+ | Only checking new code | Audit the full attack surface, not just changes |
204
+ | Missing auth boundary verification | Systematically map and verify every endpoint |
205
+ | Not checking logs for PII | Logs are a common data leak vector |
206
+ | Accepting "we'll fix it later" for critical findings | Critical findings block deployment. Period. |
207
+ | Not checking supply chain | Dependency attacks are increasingly common |
208
+
209
+ ## Red Flags
210
+
211
+ **Never:**
212
+ - Report findings without exploit scenarios (except INFO level)
213
+ - Skip any of the 6 phases
214
+ - Allow deployment with CRITICAL findings
215
+ - Ignore dependency vulnerabilities
216
+ - Accept "we'll add auth later" for protected endpoints
217
+
218
+ **Always:**
219
+ - Check all OWASP Top 10 categories
220
+ - Run automated dependency audit
221
+ - Verify auth boundaries systematically
222
+ - Check for secrets in code
223
+ - Provide realistic exploit scenarios
224
+ - Prioritize findings by severity
225
+ - Include fix recommendations
226
+
227
+ ## I/O Contract
228
+
229
+ | Field | Value |
230
+ |---|---|
231
+ | **Requires** | Implementation code, dependency manifests (package.json, requirements.txt, go.mod), deployment configuration (if applicable) |
232
+ | **Produces** | Security audit report (`.forge/work/{type}/{name}/security-audit.md` or in conversation) |
233
+ | **Returns to** | `quality-code-review` (escalation response — findings returned to caller for fixing) |
234
+ | **Feeds into** | `deliver-deploy` (security gate) |
235
+ | **Updates manifest** | `gates-passed.security-audit: true/false` |
236
+
237
+ ## Graphify Context (Optional)
238
+
239
+ **Protocol:** `protocols/graphify.md` | **Guard:** Run the status check from the protocol before Phase 1.
240
+
241
+ Security audits benefit heavily from graph context — community boundaries reveal cross-package permission patterns, and dependency tracing exposes auth chain gaps.
242
+
243
+ **How graph data maps to this skill:**
244
+ - **God nodes** → highest-risk components, audit these first
245
+ - **Community boundaries** → cross-community edges reveal permission chain gaps
246
+ - **EXTRACTED edges** → trusted dependency paths for auth flow verification
247
+ - **INFERRED edges** → flag as potential hidden auth bypasses
248
+
249
+ **CLI queries** (if graph exists and CLI available):
250
+ - `graphify path "auth" "billing" --graph graphify-out/graph.json` — trace permission chains across packages
251
+ - `graphify path "middleware" "routes" --graph graphify-out/graph.json` — verify auth middleware covers all route groups
252
+ - `graphify query "what routes lack authentication" --budget 1500 --graph graphify-out/graph.json` — find unprotected endpoints
253
+
254
+ **Codex bridge:** Pass graph community boundaries and permission chain traces to the Codex verify step below. Graph signals materially improve Codex's recall on cross-package authorization gaps.
255
+
256
+ ---
257
+
258
+ ## Codex Integration
259
+
260
+ **Modes:** Verify or Takeover | **Protocol:** `protocols/codex.md` | **Command:** `adversarial-review`
261
+
262
+ - **Verify:** Claude runs the OWASP audit, Codex adversarial-reviews for gaps.
263
+ - **Takeover:** Codex runs the full security audit, Claude reviews findings.
264
+
265
+ **When:** After Claude's security-reviewer completes the OWASP audit (sequential, not parallel). This is the highest-value Codex integration point — the Codex + graph combination consistently surfaces authorization gaps that the primary security-reviewer misses — including cross-package permission mismatches and unused security primitives.
266
+
267
+ **Invocation:**
268
+ ```bash
269
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" adversarial-review --scope branch "authorization gaps, permission mismatches across packages, security primitives defined but not enforced. Find what the existing review missed."
270
+ ```
271
+
272
+ **What Codex reviews:**
273
+ - Authorization gaps (weaker checks on some routes vs others)
274
+ - Cross-package permission mismatches
275
+ - Unused security primitives (defined but unenforced limits, uncalled validators)
276
+ - Secrets or credentials in code
277
+
278
+ **Presentation:** Claude security findings + Codex security findings + disagreements. User resolves before gate passes.
279
+
280
+ ---
281
+
282
+ ## Integration
283
+
284
+ **Called by:**
285
+ - `quality-code-review` (escalation from High/Critical risk classification)
286
+ - `/feature` command (before deployment, if project profile requires it)
287
+ - On-demand by user request
288
+
289
+ **Pairs with:**
290
+ - `quality-code-review` (reviews feed back for fixing)
291
+ - `deliver-deploy` (security audit is a deployment gate)
292
+ - `build-tdd` (security fixes follow TDD cycle)
@@ -0,0 +1,89 @@
1
+ # Audit report template
2
+
3
+ The canonical structure for the security audit report. Output to `.forge/work/{type}/{name}/security-audit.md` or surface in the conversation.
4
+
5
+ ```markdown
6
+ # Security Audit Report: {Feature/Project Name}
7
+
8
+ ## Metadata
9
+ - **Date:** {date}
10
+ - **Scope:** {files/components audited}
11
+ - **Auditor:** security-reviewer subagent
12
+
13
+ ## Executive Summary
14
+ - **Critical findings:** {count}
15
+ - **High findings:** {count}
16
+ - **Medium findings:** {count}
17
+ - **Low findings:** {count}
18
+ - **Overall risk:** {Critical / High / Medium / Low}
19
+ - **Deployment recommendation:** {BLOCK / PROCEED WITH FIXES / PROCEED}
20
+
21
+ ## Findings
22
+
23
+ ### CRITICAL
24
+
25
+ #### [SEC-001] SQL Injection in search endpoint
26
+ - **Category:** A03 - Injection
27
+ - **File:** src/products/repository.ts:45
28
+ - **Exploit scenario:** [detailed exploit as shown above]
29
+ - **Impact:** Full database read access
30
+ - **Fix:** Use parameterized queries
31
+ - **Status:** OPEN
32
+
33
+ ### HIGH
34
+
35
+ #### [SEC-002] Missing rate limiting on login
36
+ - **Category:** A04 - Insecure Design
37
+ - **File:** src/auth/routes.ts
38
+ - **Exploit scenario:** [detailed exploit]
39
+ - **Impact:** Account takeover via brute force
40
+ - **Fix:** Add rate limiting middleware
41
+ - **Status:** OPEN
42
+
43
+ [...continue for all findings...]
44
+
45
+ ## Dependency Audit
46
+ | Package | CVE | Severity | Fix Available | Status |
47
+ |---------|-----|----------|---------------|--------|
48
+ | lodash@4.17.20 | CVE-2024-XXXX | HIGH | Yes (4.17.21) | OPEN |
49
+
50
+ ## Supply Chain Review
51
+ | Package | Risk | Details | Status |
52
+ |---------|------|---------|--------|
53
+ | express@^4.18.0 | MEDIUM | Unpinned version | OPEN |
54
+
55
+ ## Auth Boundary Map
56
+ [Endpoint auth verification table]
57
+
58
+ ## Secrets Scan
59
+ | Location | Type | Status |
60
+ |----------|------|--------|
61
+ | No secrets found in codebase | - | PASS |
62
+
63
+ ## Recommendations
64
+ 1. [Prioritized list of fixes]
65
+ 2. [Ordered by severity then effort]
66
+
67
+ ## Quality Gate
68
+ **PASS / FAIL**
69
+ - Zero critical findings: {PASS/FAIL}
70
+ - Zero high findings unaddressed: {PASS/FAIL}
71
+ - All dependencies up to date: {PASS/FAIL}
72
+ - No secrets in codebase: {PASS/FAIL}
73
+ ```
74
+
75
+ ## Finding format (for any phase)
76
+
77
+ When recording an individual finding (in any phase, not just OWASP), use this shape:
78
+
79
+ ```
80
+ FINDING: {short title}
81
+ FILE: {file:line}
82
+ CODE: {the offending snippet}
83
+ EXPLOIT: {how an attacker would exploit this — required for MEDIUM and above}
84
+ IMPACT: {what attacker gains}
85
+ SEVERITY: {CRITICAL | HIGH | MEDIUM | LOW | INFO}
86
+ FIX: {concrete remediation}
87
+ ```
88
+
89
+ INFO-level findings (best-practice recommendations with no realistic exploit) may omit the EXPLOIT line.