forge-orkes 0.3.9 → 0.3.11

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.
@@ -1,26 +1,26 @@
1
1
  ---
2
2
  name: reviewing
3
- description: "Use after verifying passes to assess codebase health and catalog improvement opportunities. Combines security audit (10 categories), architecture audit (4 dimensions), and refactoring scan (6 categories) into a single review pass. This is the pre-completion gate — it answers 'is this healthy enough to ship, and what could be better?'"
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
- You are the pre-completion gate. After `verifying` confirms the work delivers what was promised, you assess codebase health AND catalog improvement opportunities in a single review pass. Three parallel scans — security, architecture, and refactoring — produce a structured report that determines whether the milestone can complete.
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
- ## When to Trigger
10
+ ## Triggers
11
11
 
12
- - **Automatically** after `verifying` returns a PASSED verdict (Standard and Full tiers)
13
- - **On-demand** at any time via user request
12
+ - **Auto:** after `verifying` returns PASSED (Standard/Full tiers)
13
+ - **Manual:** on user request
14
14
 
15
- ## Process Overview
15
+ ## Process
16
16
 
17
- 1. Read project context (`.forge/project.yml`) to determine tech stack
18
- 2. Scope the review — glob all source files, determine milestone diff
19
- 3. Spawn three parallel subagents: Security Audit + Architecture Audit + Refactoring Scan
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 based on results: healthy → complete, critical issues → user decides
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
- Determine which security categories apply based on the tech stack. For example:
35
- - No database → SQL/NoSQL Injection is N/A
36
- - No frontend → XSS Prevention is N/A
37
- - No CI/CD config → Pipeline Security is N/A
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 starting point for the git diff (for refactoring scan):
40
- - Check git log for the commit tagged or noted as the milestone start
41
- - If unavailable, use the first commit after the previous milestone's completion date
42
- - Fallback: ask the user for the starting commit or branch
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
- Also get the diff file list for the refactoring scan:
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 to user:
58
- *"Review scope: {N} source files, {N} config files, {N} files changed in this milestone. Scanning security (10 categories), architecture (4 dimensions), and refactoring opportunities (6 categories). This will take a moment."*
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 file paths, not globs, so nothing is missed.
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 scans as fresh-context subagents. Each receives the explicit file list for their scope, the tech stack from `project.yml`, and their specific instructions below.
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 | What It Checks |
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 data leaks |
76
- | 3 | Input Validation | Request bodies/params validated before use in queries or logic |
77
- | 4 | Error Information Leakage | No stack traces, DB schemas, or internal details in API responses |
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 use parameterized placeholders, no string interpolation |
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 workflow files |
81
+ | 10 | CI/CD Pipeline Security | Secrets via secrets context, not hardcoded in workflows |
84
82
 
85
- **Agent behavior rules:**
86
- - Read every file in the provided list. No sampling or skipping.
87
- - Every finding must have: file path, line number, what's wrong, severity, remediation.
88
- - Understand context before flagging — read surrounding code, check for middleware, wrappers, and higher-order protections.
89
- - Document intentionally public endpoints; don't flag them as vulnerabilities.
90
- - Severity is firm: `critical` = exploitable vulnerability, `warning` = defense-in-depth gap, `info` = observation.
91
- - Prefer false negatives over false positives — only flag what you're confident about.
92
- - Categories that don't apply to this project's stack mark as N/A with brief explanation.
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
- **Project adaptation:** Adapt checks to the detected stack:
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** (return to orchestrator):
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
- Spawn an architecture auditor agent with a fresh context window.
121
-
122
- **4 Architecture Dimensions:**
114
+ **4 Dimensions:**
123
115
 
124
- | Dimension | What It Checks |
125
- |-----------|---------------|
126
- | **Scalability** | Synchronous blocking calls, missing pagination, unbounded queries, N+1 query patterns, missing caching opportunities, single points of failure, hardcoded limits |
127
- | **Maintainability** | Code complexity hotspots (files >300 lines, deeply nested logic >4 levels, god components/classes), circular dependencies, duplicated logic that warrants abstraction |
128
- | **Code Health** | Dead code / unused exports, TODO/FIXME inventory with age, test coverage gaps (untested critical paths), stale/vulnerable dependencies |
129
- | **Structural Quality** | Separation of concerns violations (business logic in UI layer), inconsistent patterns across similar features, missing error boundaries, API contract consistency |
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
- **Agent behavior rules:**
123
+ **Rules:**
132
124
  - Check actual code, not theoretical concerns.
133
125
  - Every finding references specific files with evidence.
134
- - Severity: `critical` = architectural debt that will cause production issues or block future work, `warning` = quality concern worth addressing, `info` = improvement opportunity.
135
- - Respect existing ADRs in `.forge/decisions/` — don't flag intentional architectural choices as issues.
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** (return to orchestrator):
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
- Spawn a refactoring scanner agent with a fresh context window. Pass it only the files changed during the milestone (from the git diff).
156
+ Pass only files changed during the milestone (from git diff).
166
157
 
167
- **6 Refactoring Categories:**
158
+ **6 Categories:**
168
159
 
169
- | # | Category | What to Look For |
170
- |---|----------|-----------------|
171
- | 1 | **Duplication** | Similar logic in 2+ places that could be extracted into a shared function, hook, or utility |
172
- | 2 | **Complexity hotspots** | Functions >50 lines, nesting >3 levels deep, high cyclomatic complexity, overly long files |
173
- | 3 | **Naming & clarity** | Unclear variable/function names, misleading abstractions, functions that do more than their name suggests |
174
- | 4 | **Pattern inconsistency** | Same thing done differently across the milestone's files (e.g., error handling, data fetching, state management) |
175
- | 5 | **Dead code** | Unused functions, unreachable branches, commented-out code left behind, unused imports |
176
- | 6 | **Abstraction issues** | Over-engineered helpers used once, repeated inline code that warrants extraction, premature or missing abstractions |
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
- **Agent behavior rules:**
169
+ **Rules:**
179
170
  - Read every file in the diff. No sampling.
180
- - Every finding must reference a specific file and line range.
181
- - Understand context — don't flag intentional patterns documented in the constitution.
182
- - Don't duplicate findings from the security or architecture audits.
183
- - Estimate effort for each item: `quick` (< 30 min, under 50 lines) or `standard` (needs planning).
184
- - Suggest a concrete approach for each finding, not just "refactor this."
185
- - Prefer fewer high-quality findings over many low-signal ones.
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** (return to orchestrator):
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 found |
210
- | `warning` | Non-critical issues (info-level also maps here) |
211
- | `critical` | Real vulnerabilities or architectural blockers |
212
- | `na` | Category doesn't apply to this project |
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 status:**
203
+ **Overall health:**
215
204
 
216
205
  | Overall | Condition |
217
206
  |---------|-----------|
218
- | `passed` | ALL categories and dimensions passed or N/A |
219
- | `warnings_only` | One or more warnings, zero critical |
220
- | `issues_found` | One or more critical findings |
207
+ | `passed` | All categories passed or N/A |
208
+ | `warnings_only` | One+ warnings, zero critical |
209
+ | `issues_found` | One+ critical findings |
221
210
 
222
- **Refactoring findings** are separate from the health status — they never block completion.
211
+ Refactoring findings are separate — they never block completion.
223
212
 
224
213
  ## Step 5: Write Health Report
225
214
 
226
- Create `.forge/audits/` directory if needed. Write to `.forge/audits/milestone-{id}-health-report.md`.
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: overall health assessment, key findings, refactoring highlights, recommendation}
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 for each category. N/A categories get a single line: "N/A — {reason}"}
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 for each dimension}
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 for each refactoring category with findings}
278
+ {Repeat per category with findings}
290
279
 
291
280
  ## Public Endpoints
292
- {List of intentionally public endpoints documented during security audit}
281
+ {Intentionally public endpoints documented during security audit}
293
282
 
294
283
  ## Files Scanned
295
- {Count and list of all files scanned across all three scans}
284
+ {Count and list of all files scanned}
296
285
  ```
297
286
 
298
- **Health trend tracking:** If a previous audit exists for an earlier milestone (check `.forge/audits/` for prior reports), compare results and note improvements or regressions in the executive summary.
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 the health status first — this is the gate.
293
+ Present health status first — this is the gate.
305
294
 
306
- **If HEALTHY (all passed):**
307
- *"Health audit passed. No security vulnerabilities or architectural concerns found."*
295
+ **HEALTHY (all passed):**
296
+ *"Health audit passed. No security vulnerabilities or architectural concerns."*
308
297
 
309
- **If NEEDS ATTENTION (critical issues):**
310
- *"Review found critical issues that should be addressed before shipping:"*
311
- Inline the top 3 findings per critical category so the user sees them immediately.
298
+ **NEEDS ATTENTION (critical issues):**
299
+ *"Critical issues found:"*
300
+ Inline top 3 findings per critical category.
312
301
 
313
- **If WARNINGS ONLY:**
314
- *"Review passed with warnings — no critical issues, but {N} items worth noting. See the full report at `.forge/audits/milestone-{id}-health-report.md`."*
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
- After presenting health results, show refactoring findings for triage. Group by category, max 10 initially:
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
- For each category with findings:
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
- The user can respond with:
328
- - **Accept** (individual item) → add to backlog
329
- - **Dismiss** (individual item) skip, not a real issue or intentional
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
- For dismissed items, optionally ask for a brief reason (helps calibrate future scans).
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` (if any). Determine the next item ID by incrementing from the highest existing ID.
325
+ Read existing `.forge/refactor-backlog.yml`. Determine next item ID by incrementing from highest existing.
340
326
 
341
- Append accepted items to `.forge/refactor-backlog.yml`:
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 the file doesn't exist yet, create it from the template at `.forge/templates/refactor-backlog.yml`.
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 (user accepts)
348
+ #### HEALTHY or WARNINGS ONLY (accepted)
363
349
 
364
- Update `.forge/state/milestone-{id}.yml`:
365
- - Set `current.status` to `complete`
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
- Update `.forge/state/index.yml`:
368
- - Set milestone status to `complete`
369
- - Update `last_updated` timestamp
353
+ *"Milestone [{name}] complete. {N} refactoring items in backlog."*
370
354
 
371
- Present to user:
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
- If Beads is installed, run `bd complete` to update the dependency graph.
357
+ #### NEEDS ATTENTION (critical issues)
375
358
 
376
- #### NEEDS ATTENTION (critical issues found)
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 and continue** — document accepted risks in report, complete the milestone
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 user chooses B:
390
- - Append "Accepted Risks" section to the health report with user's acknowledgment
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
- If user wants to fix warnings instead of accepting:
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 findings** → soft gate (user can accept risk, but strongly recommended to fix)
403
- - **Architecture critical findings** → soft gate (same — user has final authority)
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 for future work)
376
+ - **Refactoring items** → never block (cataloged to backlog)
406
377
 
407
- The report documents the decision either way, creating an audit trail.
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 review)
384
+ pending → dismissed (during triage or later)
416
385
  ```
417
386
 
418
- Items with `effort: quick` can be picked up directly via `quick-tasking`.
419
- Items with `effort: standard` should go through the Standard tier flow.
387
+ `effort: quick` items pick up via `quick-tasking`.
388
+ `effort: standard` items Standard tier flow.
420
389
 
421
- When working a backlog item:
422
- 1. `forge` surfaces it as an available task
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, update the item's `status` to `done` and set `completed` date
394
+ 4. On completion, set `status: done` and `completed` date
426
395
 
427
396
  ## Phase Handoff
428
397
 
429
- After reviewing completes (all paths: HEALTHY, accepted risk, accepted warnings):
398
+ After reviewing completes (all paths):
430
399
 
431
- 1. **Verify persistence** — Confirm health report is written to `.forge/audits/milestone-{id}-health-report.md` and refactoring backlog is updated
432
- 2. **Update state** — Set `current.status` to `complete` in `.forge/state/milestone-{id}.yml`
433
- 3. **Present completion:**
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. Review report at `.forge/audits/milestone-{id}-health-report.md`. {N} refactoring items in backlog.*
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
- ## When This Skill Triggers
10
+ ## Trigger
11
11
 
12
- Ask these 4 questions. If YES to any, run this skill:
12
+ YES to any of these? Run this skill:
13
13
 
14
- 1. Does this feature touch **authentication or authorization**?
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 (configurable, reasonable default)
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 (not just client-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 just extension)
34
- - [ ] URL parameters sanitized before use
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 stored in environment variables, never in code
39
- - [ ] `.env` file in `.gitignore`
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 required permissions
42
- - [ ] Secrets rotated periodically (documented rotation process)
41
+ - [ ] API keys scoped to minimum permissions
42
+ - [ ] Documented rotation process
43
43
 
44
44
  ### Data Protection
45
- - [ ] Sensitive data encrypted at rest (if stored)
46
- - [ ] HTTPS enforced for all data in transit
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 (how long, when deleted)
49
- - [ ] CORS configured to allow only known origins
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 dependencies
54
- - [ ] Lock file committed (package-lock.json, yarn.lock)
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 internal details (stack traces, DB schema, file paths)
59
- - [ ] Unhandled exceptions caught and logged (not displayed to user)
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