forge-orkes 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/.claude/agents/executor.md +37 -50
- package/template/.claude/agents/planner.md +33 -41
- package/template/.claude/agents/researcher.md +24 -26
- package/template/.claude/agents/reviewer.md +45 -53
- package/template/.claude/agents/verifier.md +30 -50
- package/template/.claude/skills/architecting/SKILL.md +32 -46
- package/template/.claude/skills/beads-integration/SKILL.md +27 -43
- package/template/.claude/skills/debugging/SKILL.md +34 -35
- package/template/.claude/skills/designing/SKILL.md +33 -52
- package/template/.claude/skills/discussing/SKILL.md +139 -180
- package/template/.claude/skills/executing/SKILL.md +85 -157
- package/template/.claude/skills/forge/SKILL.md +98 -142
- package/template/.claude/skills/initializing/SKILL.md +104 -144
- package/template/.claude/skills/planning/SKILL.md +65 -67
- package/template/.claude/skills/quick-tasking/SKILL.md +25 -31
- package/template/.claude/skills/researching/SKILL.md +22 -32
- package/template/.claude/skills/reviewing/SKILL.md +133 -164
- package/template/.claude/skills/securing/SKILL.md +19 -19
- package/template/.claude/skills/upgrading/SKILL.md +19 -27
- package/template/.claude/skills/verifying/SKILL.md +52 -80
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewing
|
|
3
|
-
description: "
|
|
3
|
+
description: "Post-verification health gate. Runs security audit (10 categories), architecture audit (4 dimensions), and refactoring scan (6 categories) in parallel. Determines if the milestone can ship and catalogs improvement opportunities."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Reviewing: Health Audit + Refactoring Review
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The pre-completion gate. After `verifying` confirms deliverables, assess codebase health and catalog improvements. Three parallel scans produce a structured report that gates milestone completion.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Triggers
|
|
11
11
|
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
12
|
+
- **Auto:** after `verifying` returns PASSED (Standard/Full tiers)
|
|
13
|
+
- **Manual:** on user request
|
|
14
14
|
|
|
15
|
-
## Process
|
|
15
|
+
## Process
|
|
16
16
|
|
|
17
|
-
1. Read project context
|
|
18
|
-
2. Scope the review — glob
|
|
19
|
-
3. Spawn three parallel subagents: Security
|
|
17
|
+
1. Read project context from `.forge/project.yml`
|
|
18
|
+
2. Scope the review — glob source files, determine milestone diff
|
|
19
|
+
3. Spawn three parallel subagents: Security + Architecture + Refactoring
|
|
20
20
|
4. Collect results, score per-category, determine overall status
|
|
21
21
|
5. Write health report to `.forge/audits/milestone-{id}-health-report.md`
|
|
22
22
|
6. Write accepted refactoring items to `.forge/refactor-backlog.yml`
|
|
23
|
-
7. Route
|
|
23
|
+
7. Route: healthy → complete, critical → user decides
|
|
24
24
|
|
|
25
25
|
## Step 1: Read Context
|
|
26
26
|
|
|
@@ -31,15 +31,15 @@ Read: .forge/constitution.md → active architectural gates (if exists)
|
|
|
31
31
|
Read: .forge/refactor-backlog.yml → existing backlog items (if any)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
- No database → SQL/NoSQL Injection
|
|
36
|
-
- No frontend → XSS Prevention
|
|
37
|
-
- No CI/CD config → Pipeline Security
|
|
34
|
+
Skip inapplicable security categories based on tech stack:
|
|
35
|
+
- No database → SQL/NoSQL Injection N/A
|
|
36
|
+
- No frontend → XSS Prevention N/A
|
|
37
|
+
- No CI/CD config → Pipeline Security N/A
|
|
38
38
|
|
|
39
|
-
Determine the milestone's
|
|
40
|
-
- Check git log for the
|
|
41
|
-
-
|
|
42
|
-
-
|
|
39
|
+
Determine the milestone's git diff starting point:
|
|
40
|
+
- Check git log for the milestone start commit
|
|
41
|
+
- Fallback: first commit after previous milestone's completion date
|
|
42
|
+
- Last resort: ask the user
|
|
43
43
|
|
|
44
44
|
## Step 2: Scope the Review
|
|
45
45
|
|
|
@@ -49,55 +49,49 @@ Glob: **/*.env*, **/docker-compose*, **/.github/workflows/*
|
|
|
49
49
|
Glob: **/next.config*, **/vite.config*, **/webpack.config*
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Get diff file list for refactoring scan:
|
|
53
53
|
```
|
|
54
54
|
git diff --name-only {milestone_start}..HEAD
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Present scope summary
|
|
58
|
-
*"Review scope: {N} source files, {N} config files, {N}
|
|
57
|
+
Present scope summary:
|
|
58
|
+
*"Review scope: {N} source files, {N} config files, {N} changed files. Scanning security (10), architecture (4), refactoring (6)."*
|
|
59
59
|
|
|
60
|
-
Build explicit file lists for each subagent — pass
|
|
60
|
+
Build explicit file lists for each subagent — pass paths, not globs.
|
|
61
61
|
|
|
62
62
|
## Step 3: Spawn Parallel Scans
|
|
63
63
|
|
|
64
|
-
Spawn all three
|
|
64
|
+
Spawn all three as fresh-context subagents. Each receives: explicit file list, tech stack from `project.yml`, instructions below.
|
|
65
65
|
|
|
66
66
|
### Part 1: Security Audit (subagent)
|
|
67
67
|
|
|
68
|
-
Spawn a security auditor agent with a fresh context window.
|
|
69
|
-
|
|
70
68
|
**10 Security Categories:**
|
|
71
69
|
|
|
72
|
-
| # | Category |
|
|
73
|
-
|
|
70
|
+
| # | Category | Checks |
|
|
71
|
+
|---|----------|--------|
|
|
74
72
|
| 1 | Authentication & Authorization | Every endpoint has auth middleware; role checks before data access |
|
|
75
|
-
| 2 | Data Scoping / Tenant Isolation | Queries scoped to correct user/tenant; no cross-tenant
|
|
76
|
-
| 3 | Input Validation | Request bodies/params validated before use
|
|
77
|
-
| 4 | Error Information Leakage | No stack traces, DB schemas, or
|
|
73
|
+
| 2 | Data Scoping / Tenant Isolation | Queries scoped to correct user/tenant; no cross-tenant leaks |
|
|
74
|
+
| 3 | Input Validation | Request bodies/params validated before use |
|
|
75
|
+
| 4 | Error Information Leakage | No stack traces, DB schemas, or internals in API responses |
|
|
78
76
|
| 5 | XSS Prevention | No unsanitized user content injected into DOM |
|
|
79
|
-
| 6 | SQL/NoSQL Injection | All queries
|
|
77
|
+
| 6 | SQL/NoSQL Injection | All queries parameterized, no string interpolation |
|
|
80
78
|
| 7 | Secrets Management | No hardcoded keys/tokens; `.env` in `.gitignore`; `process.env` usage |
|
|
81
79
|
| 8 | CORS Policy | No wildcard `*` origins in production; appropriate method restrictions |
|
|
82
80
|
| 9 | HTTP Security Headers | CSP, X-Frame-Options, HSTS, X-Content-Type-Options, Referrer-Policy |
|
|
83
|
-
| 10 | CI/CD Pipeline Security | Secrets via secrets context, not hardcoded in
|
|
81
|
+
| 10 | CI/CD Pipeline Security | Secrets via secrets context, not hardcoded in workflows |
|
|
84
82
|
|
|
85
|
-
**
|
|
86
|
-
- Read every file
|
|
87
|
-
- Every finding
|
|
88
|
-
-
|
|
89
|
-
- Document intentionally public endpoints
|
|
90
|
-
- Severity
|
|
91
|
-
- Prefer false negatives over false positives
|
|
92
|
-
-
|
|
83
|
+
**Rules:**
|
|
84
|
+
- Read every file. No sampling.
|
|
85
|
+
- Every finding needs: file path, line number, issue, severity, remediation.
|
|
86
|
+
- Check surrounding code for middleware/wrappers before flagging.
|
|
87
|
+
- Document intentionally public endpoints — don't flag them.
|
|
88
|
+
- Severity: `critical` = exploitable vulnerability, `warning` = defense-in-depth gap, `info` = observation.
|
|
89
|
+
- Prefer false negatives over false positives.
|
|
90
|
+
- Inapplicable categories → N/A with brief reason.
|
|
93
91
|
|
|
94
|
-
**
|
|
95
|
-
- Express vs Next.js vs Fastify endpoint patterns
|
|
96
|
-
- PostgreSQL vs MongoDB vs SQLite query patterns
|
|
97
|
-
- GitHub Actions vs GitLab CI vs other CI systems
|
|
98
|
-
- React vs Vue vs Svelte frontend patterns
|
|
92
|
+
**Adapt checks to detected stack:** Express/Next.js/Fastify endpoints, PostgreSQL/MongoDB/SQLite queries, GitHub Actions/GitLab CI, React/Vue/Svelte frontends.
|
|
99
93
|
|
|
100
|
-
**Output format
|
|
94
|
+
**Output format:**
|
|
101
95
|
|
|
102
96
|
```yaml
|
|
103
97
|
security_audit:
|
|
@@ -117,25 +111,22 @@ security_audit:
|
|
|
117
111
|
|
|
118
112
|
### Part 2: Architecture Audit (subagent)
|
|
119
113
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
**4 Architecture Dimensions:**
|
|
114
|
+
**4 Dimensions:**
|
|
123
115
|
|
|
124
|
-
| Dimension |
|
|
125
|
-
|
|
126
|
-
| **Scalability** | Synchronous blocking
|
|
127
|
-
| **Maintainability** |
|
|
128
|
-
| **Code Health** | Dead code
|
|
129
|
-
| **Structural Quality** |
|
|
116
|
+
| Dimension | Checks |
|
|
117
|
+
|-----------|--------|
|
|
118
|
+
| **Scalability** | Synchronous blocking, missing pagination, unbounded queries, N+1 patterns, missing caching, single points of failure, hardcoded limits |
|
|
119
|
+
| **Maintainability** | Files >300 lines, nesting >4 levels, god components/classes, circular deps, duplicated logic warranting abstraction |
|
|
120
|
+
| **Code Health** | Dead code/unused exports, TODO/FIXME inventory with age, untested critical paths, stale/vulnerable deps |
|
|
121
|
+
| **Structural Quality** | Business logic in UI layer, inconsistent patterns across features, missing error boundaries, API contract inconsistency |
|
|
130
122
|
|
|
131
|
-
**
|
|
123
|
+
**Rules:**
|
|
132
124
|
- Check actual code, not theoretical concerns.
|
|
133
125
|
- Every finding references specific files with evidence.
|
|
134
|
-
- Severity: `critical` =
|
|
135
|
-
- Respect existing ADRs in `.forge/decisions/` — don't flag intentional
|
|
136
|
-
- Respect constitutional articles in `.forge/constitution.md` — if the constitution permits a pattern, don't flag it.
|
|
126
|
+
- Severity: `critical` = debt causing production issues or blocking future work, `warning` = quality concern, `info` = improvement opportunity.
|
|
127
|
+
- Respect existing ADRs in `.forge/decisions/` and constitutional articles — don't flag intentional choices.
|
|
137
128
|
|
|
138
|
-
**Output format
|
|
129
|
+
**Output format:**
|
|
139
130
|
|
|
140
131
|
```yaml
|
|
141
132
|
architecture_audit:
|
|
@@ -162,29 +153,29 @@ architecture_audit:
|
|
|
162
153
|
|
|
163
154
|
### Part 3: Refactoring Scan (subagent)
|
|
164
155
|
|
|
165
|
-
|
|
156
|
+
Pass only files changed during the milestone (from git diff).
|
|
166
157
|
|
|
167
|
-
**6
|
|
158
|
+
**6 Categories:**
|
|
168
159
|
|
|
169
|
-
| # | Category |
|
|
170
|
-
|
|
171
|
-
| 1 | **Duplication** | Similar logic in 2+ places
|
|
172
|
-
| 2 | **Complexity hotspots** | Functions >50 lines, nesting >3 levels
|
|
173
|
-
| 3 | **Naming & clarity** | Unclear
|
|
174
|
-
| 4 | **Pattern inconsistency** | Same
|
|
175
|
-
| 5 | **Dead code** | Unused functions, unreachable branches, commented-out code
|
|
176
|
-
| 6 | **Abstraction issues** | Over-engineered helpers
|
|
160
|
+
| # | Category | Look For |
|
|
161
|
+
|---|----------|----------|
|
|
162
|
+
| 1 | **Duplication** | Similar logic in 2+ places extractable into shared function/hook/utility |
|
|
163
|
+
| 2 | **Complexity hotspots** | Functions >50 lines, nesting >3 levels, high cyclomatic complexity, overly long files |
|
|
164
|
+
| 3 | **Naming & clarity** | Unclear names, misleading abstractions, functions exceeding their name's scope |
|
|
165
|
+
| 4 | **Pattern inconsistency** | Same concern handled differently across milestone files (error handling, data fetching, state) |
|
|
166
|
+
| 5 | **Dead code** | Unused functions, unreachable branches, commented-out code, unused imports |
|
|
167
|
+
| 6 | **Abstraction issues** | Over-engineered one-use helpers, repeated inline code warranting extraction, premature/missing abstractions |
|
|
177
168
|
|
|
178
|
-
**
|
|
169
|
+
**Rules:**
|
|
179
170
|
- Read every file in the diff. No sampling.
|
|
180
|
-
- Every finding
|
|
181
|
-
-
|
|
182
|
-
- Don't duplicate
|
|
183
|
-
- Estimate effort
|
|
184
|
-
- Suggest a concrete approach
|
|
185
|
-
-
|
|
171
|
+
- Every finding references a specific file and line range.
|
|
172
|
+
- Don't flag patterns documented in the constitution.
|
|
173
|
+
- Don't duplicate security or architecture findings.
|
|
174
|
+
- Estimate effort: `quick` (< 30 min, < 50 lines) or `standard` (needs planning).
|
|
175
|
+
- Suggest a concrete approach, not "refactor this."
|
|
176
|
+
- Fewer high-quality findings over many low-signal ones.
|
|
186
177
|
|
|
187
|
-
**Output format
|
|
178
|
+
**Output format:**
|
|
188
179
|
|
|
189
180
|
```yaml
|
|
190
181
|
refactoring_scan:
|
|
@@ -200,30 +191,28 @@ refactoring_scan:
|
|
|
200
191
|
|
|
201
192
|
## Step 4: Score Results
|
|
202
193
|
|
|
203
|
-
After all three subagents return, compute scores.
|
|
204
|
-
|
|
205
194
|
**Per-category scoring (security + architecture):**
|
|
206
195
|
|
|
207
196
|
| Status | Meaning |
|
|
208
197
|
|--------|---------|
|
|
209
|
-
| `passed` | No issues
|
|
210
|
-
| `warning` | Non-critical issues
|
|
211
|
-
| `critical` |
|
|
212
|
-
| `na` | Category doesn't apply
|
|
198
|
+
| `passed` | No issues |
|
|
199
|
+
| `warning` | Non-critical issues |
|
|
200
|
+
| `critical` | Exploitable vulnerabilities or architectural blockers |
|
|
201
|
+
| `na` | Category doesn't apply |
|
|
213
202
|
|
|
214
|
-
**Overall health
|
|
203
|
+
**Overall health:**
|
|
215
204
|
|
|
216
205
|
| Overall | Condition |
|
|
217
206
|
|---------|-----------|
|
|
218
|
-
| `passed` |
|
|
219
|
-
| `warnings_only` | One
|
|
220
|
-
| `issues_found` | One
|
|
207
|
+
| `passed` | All categories passed or N/A |
|
|
208
|
+
| `warnings_only` | One+ warnings, zero critical |
|
|
209
|
+
| `issues_found` | One+ critical findings |
|
|
221
210
|
|
|
222
|
-
|
|
211
|
+
Refactoring findings are separate — they never block completion.
|
|
223
212
|
|
|
224
213
|
## Step 5: Write Health Report
|
|
225
214
|
|
|
226
|
-
Create `.forge/audits/`
|
|
215
|
+
Create `.forge/audits/` if needed. Write to `.forge/audits/milestone-{id}-health-report.md`.
|
|
227
216
|
|
|
228
217
|
**YAML frontmatter:**
|
|
229
218
|
|
|
@@ -259,7 +248,7 @@ total_files_scanned: N
|
|
|
259
248
|
# Review Report: {milestone name}
|
|
260
249
|
|
|
261
250
|
## Executive Summary
|
|
262
|
-
{1-3 sentences:
|
|
251
|
+
{1-3 sentences: health assessment, key findings, refactoring highlights, recommendation}
|
|
263
252
|
|
|
264
253
|
## Security Findings
|
|
265
254
|
|
|
@@ -268,7 +257,7 @@ total_files_scanned: N
|
|
|
268
257
|
|------|------|----------|-------|-------------|
|
|
269
258
|
| ... | ... | ... | ... | ... |
|
|
270
259
|
|
|
271
|
-
{Repeat
|
|
260
|
+
{Repeat per category. N/A categories: single line "N/A — {reason}"}
|
|
272
261
|
|
|
273
262
|
## Architecture Findings
|
|
274
263
|
|
|
@@ -277,7 +266,7 @@ total_files_scanned: N
|
|
|
277
266
|
|------|------|----------|-------|-------------|
|
|
278
267
|
| ... | ... | ... | ... | ... |
|
|
279
268
|
|
|
280
|
-
{Repeat
|
|
269
|
+
{Repeat per dimension}
|
|
281
270
|
|
|
282
271
|
## Refactoring Opportunities
|
|
283
272
|
|
|
@@ -286,59 +275,56 @@ total_files_scanned: N
|
|
|
286
275
|
|------|-------|-------------|--------|----------|
|
|
287
276
|
| ... | ... | ... | quick/standard | ... |
|
|
288
277
|
|
|
289
|
-
{Repeat
|
|
278
|
+
{Repeat per category with findings}
|
|
290
279
|
|
|
291
280
|
## Public Endpoints
|
|
292
|
-
{
|
|
281
|
+
{Intentionally public endpoints documented during security audit}
|
|
293
282
|
|
|
294
283
|
## Files Scanned
|
|
295
|
-
{Count and list of all files scanned
|
|
284
|
+
{Count and list of all files scanned}
|
|
296
285
|
```
|
|
297
286
|
|
|
298
|
-
|
|
287
|
+
If a previous milestone audit exists in `.forge/audits/`, compare results and note improvements/regressions in the executive summary.
|
|
299
288
|
|
|
300
289
|
## Step 6: Present Results + Triage Refactoring
|
|
301
290
|
|
|
302
291
|
### Health Results
|
|
303
292
|
|
|
304
|
-
Present
|
|
293
|
+
Present health status first — this is the gate.
|
|
305
294
|
|
|
306
|
-
**
|
|
307
|
-
*"Health audit passed. No security vulnerabilities or architectural concerns
|
|
295
|
+
**HEALTHY (all passed):**
|
|
296
|
+
*"Health audit passed. No security vulnerabilities or architectural concerns."*
|
|
308
297
|
|
|
309
|
-
**
|
|
310
|
-
*"
|
|
311
|
-
Inline
|
|
298
|
+
**NEEDS ATTENTION (critical issues):**
|
|
299
|
+
*"Critical issues found:"*
|
|
300
|
+
Inline top 3 findings per critical category.
|
|
312
301
|
|
|
313
|
-
**
|
|
314
|
-
*"
|
|
302
|
+
**WARNINGS ONLY:**
|
|
303
|
+
*"Passed with warnings — no critical issues, {N} items worth noting. Full report: `.forge/audits/milestone-{id}-health-report.md`."*
|
|
315
304
|
|
|
316
305
|
### Refactoring Triage
|
|
317
306
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*"I also found {N} refactoring opportunities in the code built during this milestone:"*
|
|
307
|
+
Show findings grouped by category (max 10 initially):
|
|
321
308
|
|
|
322
|
-
|
|
323
|
-
*"**Duplication** ({N} items):*
|
|
324
|
-
*1. `src/api/users.ts:42-67` — Duplicate email validation in createUser and updateUser. Quick fix: extract shared helper. [Accept / Dismiss]*
|
|
325
|
-
*2. ...*"
|
|
309
|
+
*"{N} refactoring opportunities found:"*
|
|
326
310
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
-
|
|
330
|
-
- **Accept all** → bulk add all remaining items to backlog
|
|
331
|
-
- **Dismiss all** → skip everything, no backlog items added
|
|
311
|
+
Per category:
|
|
312
|
+
*"**Duplication** ({N}):*
|
|
313
|
+
*1. `src/api/users.ts:42-67` — Duplicate email validation. Quick fix: extract helper. [Accept / Dismiss]*"
|
|
332
314
|
|
|
333
|
-
|
|
315
|
+
User responses:
|
|
316
|
+
- **Accept** → add to backlog
|
|
317
|
+
- **Dismiss** → skip (optionally ask reason to calibrate future scans)
|
|
318
|
+
- **Accept all** → bulk add remaining
|
|
319
|
+
- **Dismiss all** → skip everything
|
|
334
320
|
|
|
335
321
|
## Step 7: Write Backlog + Route
|
|
336
322
|
|
|
337
323
|
### Write Refactoring Backlog
|
|
338
324
|
|
|
339
|
-
Read existing `.forge/refactor-backlog.yml
|
|
325
|
+
Read existing `.forge/refactor-backlog.yml`. Determine next item ID by incrementing from highest existing.
|
|
340
326
|
|
|
341
|
-
Append accepted items
|
|
327
|
+
Append accepted items:
|
|
342
328
|
|
|
343
329
|
```yaml
|
|
344
330
|
items:
|
|
@@ -355,83 +341,66 @@ items:
|
|
|
355
341
|
completed: null
|
|
356
342
|
```
|
|
357
343
|
|
|
358
|
-
If
|
|
344
|
+
If file doesn't exist, create from `.forge/templates/refactor-backlog.yml`.
|
|
359
345
|
|
|
360
346
|
### Route Based on Health Status
|
|
361
347
|
|
|
362
|
-
#### HEALTHY or WARNINGS ONLY (
|
|
348
|
+
#### HEALTHY or WARNINGS ONLY (accepted)
|
|
363
349
|
|
|
364
|
-
Update `.forge/state/milestone-{id}.yml`:
|
|
365
|
-
|
|
350
|
+
Update `.forge/state/milestone-{id}.yml`: set `current.status` to `complete`.
|
|
351
|
+
Update `.forge/state/index.yml`: set milestone status to `complete`, update `last_updated`.
|
|
366
352
|
|
|
367
|
-
|
|
368
|
-
- Set milestone status to `complete`
|
|
369
|
-
- Update `last_updated` timestamp
|
|
353
|
+
*"Milestone [{name}] complete. {N} refactoring items in backlog."*
|
|
370
354
|
|
|
371
|
-
|
|
372
|
-
*"Milestone [{name}] is complete. {N} refactoring items are in the backlog for whenever you want to tackle them."*
|
|
355
|
+
If Beads installed, run `bd complete`.
|
|
373
356
|
|
|
374
|
-
|
|
357
|
+
#### NEEDS ATTENTION (critical issues)
|
|
375
358
|
|
|
376
|
-
|
|
359
|
+
Do NOT mark complete. Present choices:
|
|
377
360
|
|
|
378
|
-
Do NOT mark milestone complete. Present choices:
|
|
379
|
-
|
|
380
|
-
*"Options:"*
|
|
381
361
|
- **A. Fix critical issues** — return to `planning` in fix mode with findings as requirements
|
|
382
|
-
- **B. Accept risk
|
|
383
|
-
|
|
384
|
-
If user chooses A:
|
|
385
|
-
- Create fix requirements from critical findings
|
|
386
|
-
- Route to `planning` skill in fix mode
|
|
387
|
-
- After fix execution + re-verification, re-run `reviewing` (not full verification — just this review)
|
|
362
|
+
- **B. Accept risk** — document accepted risks in report, complete the milestone
|
|
388
363
|
|
|
389
|
-
If
|
|
390
|
-
|
|
391
|
-
- Complete the milestone (same as HEALTHY path above)
|
|
364
|
+
If A: create fix requirements from findings → route to `planning` → after fix + re-verification → re-run `reviewing`.
|
|
365
|
+
If B: append "Accepted Risks" section to report → complete milestone (same as HEALTHY path).
|
|
392
366
|
|
|
393
367
|
#### WARNINGS ONLY (user wants to fix)
|
|
394
368
|
|
|
395
|
-
|
|
396
|
-
- Create fix requirements from warning findings
|
|
397
|
-
- Route to `planning` in fix mode
|
|
398
|
-
- After fix execution, re-run `reviewing`
|
|
369
|
+
Create fix requirements from warnings → route to `planning` in fix mode → after fix → re-run `reviewing`.
|
|
399
370
|
|
|
400
371
|
## Gate Type: Mixed
|
|
401
372
|
|
|
402
|
-
- **Security critical
|
|
403
|
-
- **Architecture critical
|
|
373
|
+
- **Security critical** → soft gate (user can accept risk)
|
|
374
|
+
- **Architecture critical** → soft gate (user has final authority)
|
|
404
375
|
- **Warnings** → advisory (noted in report, user chooses)
|
|
405
|
-
- **Refactoring items** → never block (cataloged to backlog
|
|
376
|
+
- **Refactoring items** → never block (cataloged to backlog)
|
|
406
377
|
|
|
407
|
-
The report documents the decision either way
|
|
378
|
+
The report documents the decision either way — audit trail.
|
|
408
379
|
|
|
409
380
|
## Backlog Lifecycle
|
|
410
381
|
|
|
411
|
-
Backlog items follow this lifecycle:
|
|
412
|
-
|
|
413
382
|
```
|
|
414
383
|
pending → in_progress → done
|
|
415
|
-
pending → dismissed (during triage or later
|
|
384
|
+
pending → dismissed (during triage or later)
|
|
416
385
|
```
|
|
417
386
|
|
|
418
|
-
|
|
419
|
-
|
|
387
|
+
`effort: quick` items → pick up via `quick-tasking`.
|
|
388
|
+
`effort: standard` items → Standard tier flow.
|
|
420
389
|
|
|
421
|
-
|
|
422
|
-
1. `forge` surfaces it as
|
|
390
|
+
Working a backlog item:
|
|
391
|
+
1. `forge` surfaces it as available
|
|
423
392
|
2. User selects it
|
|
424
393
|
3. Route to `quick-tasking` or Standard tier based on effort
|
|
425
|
-
4. On completion,
|
|
394
|
+
4. On completion, set `status: done` and `completed` date
|
|
426
395
|
|
|
427
396
|
## Phase Handoff
|
|
428
397
|
|
|
429
|
-
After reviewing completes (all paths
|
|
398
|
+
After reviewing completes (all paths):
|
|
430
399
|
|
|
431
|
-
1.
|
|
432
|
-
2.
|
|
433
|
-
3.
|
|
400
|
+
1. Confirm health report written to `.forge/audits/milestone-{id}-health-report.md` and backlog updated
|
|
401
|
+
2. Set `current.status` to `complete` in `.forge/state/milestone-{id}.yml`
|
|
402
|
+
3. Present:
|
|
434
403
|
|
|
435
|
-
*"Milestone [{name}] complete.
|
|
404
|
+
*"Milestone [{name}] complete. Report: `.forge/audits/milestone-{id}-health-report.md`. {N} refactoring items in backlog.*
|
|
436
405
|
|
|
437
406
|
*Start new work with `/forge` or tackle backlog items anytime."*
|
|
@@ -7,11 +7,11 @@ description: "Use when building features that touch authentication, user data, e
|
|
|
7
7
|
|
|
8
8
|
Security is a requirement, not a feature. Review before shipping.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Trigger
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
YES to any of these? Run this skill:
|
|
13
13
|
|
|
14
|
-
1. Does
|
|
14
|
+
1. Does the feature touch **authentication or authorization**?
|
|
15
15
|
2. Does it **store or transmit user data**?
|
|
16
16
|
3. Does it **call external APIs** or accept webhooks?
|
|
17
17
|
4. Does it **handle secrets, keys, or tokens**?
|
|
@@ -20,43 +20,43 @@ Ask these 4 questions. If YES to any, run this skill:
|
|
|
20
20
|
|
|
21
21
|
### Authentication & Authorization
|
|
22
22
|
- [ ] Passwords hashed with bcrypt/scrypt/argon2 (never MD5/SHA)
|
|
23
|
-
- [ ] Sessions/tokens expire
|
|
23
|
+
- [ ] Sessions/tokens expire with reasonable defaults
|
|
24
24
|
- [ ] Token refresh mechanism exists
|
|
25
25
|
- [ ] Authorization checked server-side before every data access
|
|
26
26
|
- [ ] Failed login attempts rate-limited
|
|
27
27
|
- [ ] Password reset flow doesn't reveal account existence
|
|
28
28
|
|
|
29
29
|
### Input Validation & Injection
|
|
30
|
-
- [ ] All user input validated server-side
|
|
30
|
+
- [ ] All user input validated server-side
|
|
31
31
|
- [ ] SQL queries use parameterized statements (never string concatenation)
|
|
32
32
|
- [ ] HTML output escaped to prevent XSS
|
|
33
|
-
- [ ] File uploads validated: type, size, content (not
|
|
34
|
-
- [ ] URL parameters sanitized
|
|
33
|
+
- [ ] File uploads validated: type, size, content (not extension alone)
|
|
34
|
+
- [ ] URL parameters sanitized
|
|
35
35
|
- [ ] JSON parsing has size limits
|
|
36
36
|
|
|
37
37
|
### Secrets Management
|
|
38
|
-
- [ ] Secrets
|
|
39
|
-
- [ ] `.env`
|
|
38
|
+
- [ ] Secrets in environment variables, never in code
|
|
39
|
+
- [ ] `.env` in `.gitignore`
|
|
40
40
|
- [ ] No secrets in logs, error messages, or stack traces
|
|
41
|
-
- [ ] API keys scoped to minimum
|
|
42
|
-
- [ ]
|
|
41
|
+
- [ ] API keys scoped to minimum permissions
|
|
42
|
+
- [ ] Documented rotation process
|
|
43
43
|
|
|
44
44
|
### Data Protection
|
|
45
|
-
- [ ] Sensitive data encrypted at rest
|
|
46
|
-
- [ ] HTTPS enforced for all
|
|
45
|
+
- [ ] Sensitive data encrypted at rest
|
|
46
|
+
- [ ] HTTPS enforced for all transit
|
|
47
47
|
- [ ] PII not logged (names, emails, addresses, IPs)
|
|
48
|
-
- [ ] Data retention policy defined
|
|
49
|
-
- [ ] CORS
|
|
48
|
+
- [ ] Data retention policy defined
|
|
49
|
+
- [ ] CORS allows only known origins
|
|
50
50
|
|
|
51
51
|
### Dependencies
|
|
52
52
|
- [ ] `npm audit` (or equivalent) passes or vulnerabilities documented
|
|
53
|
-
- [ ] No known vulnerable versions of critical
|
|
54
|
-
- [ ] Lock file committed
|
|
53
|
+
- [ ] No known vulnerable versions of critical deps
|
|
54
|
+
- [ ] Lock file committed
|
|
55
55
|
- [ ] Dependencies from trusted registries only
|
|
56
56
|
|
|
57
57
|
### Error Handling
|
|
58
|
-
- [ ] Error messages don't leak
|
|
59
|
-
- [ ] Unhandled exceptions caught and logged
|
|
58
|
+
- [ ] Error messages don't leak internals (stack traces, DB schema, file paths)
|
|
59
|
+
- [ ] Unhandled exceptions caught and logged, not displayed
|
|
60
60
|
- [ ] Rate limiting on all public endpoints
|
|
61
61
|
- [ ] Graceful degradation when external services fail
|
|
62
62
|
|