bigpowers 2.73.9 → 2.74.1

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 (160) hide show
  1. package/.continue/rules/context7-mcp.md +0 -0
  2. package/.continue/rules/diagnose-stall.md +0 -0
  3. package/.kilocode/rules/context7-mcp.md +0 -0
  4. package/.kilocode/rules/diagnose-stall.md +0 -0
  5. package/.pi/package.json +2 -2
  6. package/.pi/prompts/audit-code.md +17 -13
  7. package/.pi/prompts/build-epic.md +5 -0
  8. package/.pi/prompts/change-request.md +4 -1
  9. package/.pi/prompts/compose-workflow.md +17 -0
  10. package/.pi/prompts/context7-mcp.md +54 -0
  11. package/.pi/prompts/craft-skill.md +28 -0
  12. package/.pi/prompts/deepen-architecture.md +20 -0
  13. package/.pi/prompts/delegate-task.md +14 -0
  14. package/.pi/prompts/deploy.md +8 -0
  15. package/.pi/prompts/develop-tdd.md +15 -4
  16. package/.pi/prompts/diagnose-stall.md +53 -0
  17. package/.pi/prompts/dispatch-agents.md +53 -19
  18. package/.pi/prompts/evolve-skill.md +7 -0
  19. package/.pi/prompts/gate-trace.md +9 -1
  20. package/.pi/prompts/guard-git.md +14 -0
  21. package/.pi/prompts/kickoff-branch.md +4 -0
  22. package/.pi/prompts/migrate-spec.md +18 -0
  23. package/.pi/prompts/plan-work.md +62 -2
  24. package/.pi/prompts/publish-package.md +11 -0
  25. package/.pi/prompts/release-branch.md +46 -43
  26. package/.pi/prompts/request-review.md +57 -17
  27. package/.pi/prompts/research-first.md +3 -0
  28. package/.pi/prompts/run-benchmark.md +3 -3
  29. package/.pi/prompts/run-evals.md +26 -6
  30. package/.pi/prompts/run-planning.md +1 -0
  31. package/.pi/prompts/scope-work.md +3 -0
  32. package/.pi/prompts/search-skills.md +3 -0
  33. package/.pi/prompts/security-review.md +66 -12
  34. package/.pi/prompts/seed-conventions.md +68 -0
  35. package/.pi/prompts/session-state.md +5 -10
  36. package/.pi/prompts/slice-tasks.md +3 -0
  37. package/.pi/prompts/smoke-test.md +11 -0
  38. package/.pi/prompts/stocktake-skills.md +6 -1
  39. package/.pi/prompts/validate-contracts.md +12 -0
  40. package/.pi/prompts/validate-fix.md +2 -0
  41. package/.pi/prompts/verify-work.md +42 -20
  42. package/.pi/prompts/wire-ci.md +11 -0
  43. package/.pi/prompts/write-document.md +10 -0
  44. package/.pi/skills/audit-code/SKILL.md +17 -13
  45. package/.pi/skills/build-epic/SKILL.md +5 -0
  46. package/.pi/skills/change-request/SKILL.md +4 -1
  47. package/.pi/skills/compose-workflow/SKILL.md +17 -0
  48. package/.pi/skills/context7-mcp/SKILL.md +56 -0
  49. package/.pi/skills/craft-skill/SKILL.md +28 -0
  50. package/.pi/skills/deepen-architecture/SKILL.md +20 -0
  51. package/.pi/skills/delegate-task/SKILL.md +14 -0
  52. package/.pi/skills/deploy/SKILL.md +8 -0
  53. package/.pi/skills/develop-tdd/SKILL.md +15 -4
  54. package/.pi/skills/diagnose-stall/SKILL.md +55 -0
  55. package/.pi/skills/dispatch-agents/SKILL.md +53 -19
  56. package/.pi/skills/evolve-skill/SKILL.md +7 -0
  57. package/.pi/skills/gate-trace/SKILL.md +9 -1
  58. package/.pi/skills/guard-git/SKILL.md +14 -0
  59. package/.pi/skills/kickoff-branch/SKILL.md +4 -0
  60. package/.pi/skills/migrate-spec/SKILL.md +18 -0
  61. package/.pi/skills/plan-work/SKILL.md +62 -2
  62. package/.pi/skills/publish-package/SKILL.md +11 -0
  63. package/.pi/skills/release-branch/SKILL.md +46 -43
  64. package/.pi/skills/request-review/SKILL.md +57 -17
  65. package/.pi/skills/research-first/SKILL.md +3 -0
  66. package/.pi/skills/run-benchmark/SKILL.md +3 -3
  67. package/.pi/skills/run-evals/SKILL.md +26 -6
  68. package/.pi/skills/run-planning/SKILL.md +1 -0
  69. package/.pi/skills/scope-work/SKILL.md +3 -0
  70. package/.pi/skills/search-skills/SKILL.md +3 -0
  71. package/.pi/skills/security-review/SKILL.md +66 -12
  72. package/.pi/skills/seed-conventions/SKILL.md +68 -0
  73. package/.pi/skills/session-state/SKILL.md +5 -10
  74. package/.pi/skills/slice-tasks/SKILL.md +3 -0
  75. package/.pi/skills/smoke-test/SKILL.md +11 -0
  76. package/.pi/skills/stocktake-skills/SKILL.md +6 -1
  77. package/.pi/skills/validate-contracts/SKILL.md +12 -0
  78. package/.pi/skills/validate-fix/SKILL.md +2 -0
  79. package/.pi/skills/verify-work/SKILL.md +42 -20
  80. package/.pi/skills/wire-ci/SKILL.md +11 -0
  81. package/.pi/skills/write-document/SKILL.md +10 -0
  82. package/CHANGELOG.md +15 -0
  83. package/CLAUDE.md +59 -1
  84. package/CONVENTIONS.md +81 -0
  85. package/README.md +1 -1
  86. package/SKILL-INDEX.md +1 -1
  87. package/package.json +1 -1
  88. package/scripts/bp-churn-rank.sh +49 -0
  89. package/scripts/bp-read-agents.sh +1 -0
  90. package/scripts/check-import-boundaries.sh +64 -0
  91. package/scripts/compile-rule-matrix.sh +114 -0
  92. package/scripts/hooks/rtk-rewrite.sh +11 -0
  93. package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
  94. package/scripts/install.sh +6 -0
  95. package/scripts/lib/completeness-critic.sh +62 -0
  96. package/scripts/lib/doc-fetch-cache.sh +71 -0
  97. package/scripts/lib/golden-suite-gates.sh +3 -1
  98. package/scripts/lib/parallel-review-worktrees.sh +34 -0
  99. package/scripts/lib/plan-consistency-check.sh +88 -0
  100. package/scripts/lib/run-benchmark.py +210 -0
  101. package/scripts/lib/sync-context-engineering-ref.sh +19 -0
  102. package/scripts/references-manifest.yaml +19 -0
  103. package/scripts/run-benchmark.sh +6 -0
  104. package/scripts/run-skill-verify.sh +1 -0
  105. package/scripts/sync-references.sh +25 -0
  106. package/scripts/sync-skills.sh +12 -1
  107. package/scripts/validate-skill-catalog.sh +147 -0
  108. package/scripts/validate-skill-description.sh +70 -0
  109. package/skills/audit-code/SKILL.md +19 -13
  110. package/skills/build-epic/SKILL.md +6 -1
  111. package/skills/change-request/SKILL.md +4 -1
  112. package/skills/compose-workflow/SKILL.md +17 -0
  113. package/skills/context7-mcp/SKILL.md +57 -0
  114. package/skills/craft-skill/SKILL.md +29 -0
  115. package/skills/deepen-architecture/SKILL.md +22 -0
  116. package/skills/delegate-task/SKILL.md +14 -0
  117. package/skills/deploy/SKILL.md +9 -0
  118. package/skills/develop-tdd/SKILL.md +18 -4
  119. package/skills/diagnose-stall/SKILL.md +56 -0
  120. package/skills/dispatch-agents/SKILL.md +53 -19
  121. package/skills/elaborate-spec/SKILL.md +1 -0
  122. package/skills/evolve-skill/SKILL.md +7 -0
  123. package/skills/gate-trace/SKILL.md +11 -1
  124. package/skills/guard-git/REFERENCE.md +14 -0
  125. package/skills/kickoff-branch/SKILL.md +4 -1
  126. package/skills/migrate-spec/REFERENCE.md +12 -0
  127. package/skills/migrate-spec/SKILL.md +6 -0
  128. package/skills/plan-work/REFERENCE.md +29 -2
  129. package/skills/plan-work/SKILL.md +38 -0
  130. package/skills/publish-package/REFERENCE.md +11 -0
  131. package/skills/release-branch/REFERENCE.md +14 -0
  132. package/skills/release-branch/SKILL.md +33 -44
  133. package/skills/request-review/SKILL.md +59 -17
  134. package/skills/research-first/SKILL.md +3 -0
  135. package/skills/run-benchmark/SKILL.md +5 -4
  136. package/skills/run-evals/REFERENCE.md +14 -4
  137. package/skills/run-evals/SKILL.md +13 -2
  138. package/skills/run-planning/SKILL.md +1 -0
  139. package/skills/scope-work/SKILL.md +3 -0
  140. package/skills/search-skills/SKILL.md +3 -0
  141. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  142. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  143. package/skills/security-review/SKILL.md +53 -4
  144. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  145. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  146. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  147. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  148. package/skills/seed-conventions/REFERENCE.md +40 -0
  149. package/skills/seed-conventions/SKILL.md +28 -1
  150. package/skills/session-state/SKILL.md +5 -10
  151. package/skills/slice-tasks/SKILL.md +3 -0
  152. package/skills/smoke-test/REFERENCE.md +11 -0
  153. package/skills/stocktake-skills/SKILL.md +8 -1
  154. package/skills/validate-contracts/REFERENCE.md +12 -0
  155. package/skills/validate-fix/SKILL.md +3 -0
  156. package/skills/verify-work/REFERENCE.md +17 -0
  157. package/skills/verify-work/SKILL.md +25 -22
  158. package/skills/wire-ci/REFERENCE.md +11 -0
  159. package/skills/write-document/REFERENCE.md +10 -0
  160. package/skills-lock.json +41 -31
@@ -3,6 +3,8 @@ description: "PLANNING SPINE STEP 3 of 3 — Plan the work: write detailed imple
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s29
7
+
6
8
  # Plan Work
7
9
 
8
10
  > **Spine position:** Step 3 — scope-work → slice-tasks → plan-work.
@@ -44,14 +46,45 @@ If this plan touches an existing module, run `assess-impact` first to understand
44
46
 
45
47
  3. **Write capsule story spec + tasks** — Output two files inside the active epic capsule. See [REFERENCE.md](REFERENCE.md) for file formats and the plan-template. Each task MUST include a `risk:` field (`P0` | `P1` | `P2` | `P3`) based on BCP + story type heuristics (see REFERENCE.md). If a test plan artifact (`specs/tech-architecture/eNN-TEST_PLAN_LATEST.md`) exists, read it and inherit its P0/P1 risk classifications and scenario IDs (`SC-eNNsYY-P0-NN`). Each task optionally includes a `security:` field (`none` / `low` / `medium` / `high`) sourced from the epic's `specs/security/epics/<id>/THREAT_MODEL.md`. Tasks with `security: medium` or `security: high` MUST include "no new security findings in affected paths" in their verify steps.
46
48
 
49
+ **Requirement delta tags (e45s29):** When a story modifies existing behavior, the story spec § Requirements MUST use OpenSpec-style delta tags with mandatory before/after content:
50
+
51
+ | Tag | When | Required content |
52
+ |-----|------|------------------|
53
+ | `ADDED` | New requirement | Full requirement text |
54
+ | `MODIFIED` | Changed behavior | **Before:** prior behavior · **After:** new behavior |
55
+ | `REMOVED` | Retired requirement | **Before:** what existed · **After:** (removed) + rationale |
56
+ | `RENAMED` | ID or title change only | **Before:** old ID/title · **After:** new ID/title |
57
+
58
+ Net-new stories (greenfield) use `ADDED` only. `MODIFIED`/`REMOVED`/`RENAMED` without before/after blocks fail the plan-work gate.
59
+
47
60
  4. **Verify step format** — Every step MUST follow: `N. <What to do> → verify: <runnable command>`. See [REFERENCE.md](REFERENCE.md) for good/bad examples.
48
61
 
62
+ 4a. **Cross-artifact consistency pass (HARD GATE — e45s04)** — Before handoff, run:
63
+
64
+ ```bash
65
+ bash scripts/lib/plan-consistency-check.sh specs/epics/<capsule>/
66
+ ```
67
+
68
+ Print CRITICAL / HIGH / MED findings. **CRITICAL or HIGH blocks code generation** — fix capsule artifacts first. MED requires explicit user acknowledgment.
69
+
70
+ 4b. **tasks.yaml failing ledger (e45s06)** — Every new task entry starts with `status: failing`. Only flip to `status: passing` after its `verify:` command exits 0 during `develop-tdd` or `verify-work`. Never pre-mark passing at plan time.
71
+
49
72
  5. **Review with user** — Confirm step order, granularity, and that verify commands are runnable in this project.
50
73
 
74
+ ## Lifecycle Gates (e45s09)
75
+
76
+ | Gate | When | Pass condition |
77
+ |------|------|----------------|
78
+ | **Pre-Implementation** | Before `kickoff-branch` / first RED commit | Root-cause stated for bugs; `assess-impact` done for module changes; plan-consistency-check PASS |
79
+ | **Validation** | Story marked done | All tasks `status: passing`; verify evidence in `specs/verifications/` |
80
+ | **Reopen-don't-refile** | Regression on shipped story | Reopen existing story/bug — do not create duplicate capsule entries |
81
+
51
82
  After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
52
83
 
53
84
  ## Verify
54
85
 
86
+ → verify: `test -f scripts/lib/plan-consistency-check.sh && bash scripts/lib/plan-consistency-check.sh specs/epics/e45-quality-core/ 2>&1 | head -5`
87
+
55
88
 
56
89
 
57
90
  ## Handoff
@@ -63,6 +96,17 @@ Writes: state.yaml handoff.next_skill = kickoff-branch
63
96
 
64
97
  # Plan Work — Reference
65
98
 
99
+ ## Navigation
100
+
101
+ | Lines | Section |
102
+ |-------|---------|
103
+ | 1 | Title |
104
+ | 3–14 | Navigation |
105
+ | 16–38 | Output file formats |
106
+ | 40–71 | Plan template |
107
+ | 73–91 | Verify step format rules |
108
+ | 93–131 | Sub-operations (risk, define-success, zoom-out, slopcheck, delta tags) |
109
+
66
110
  ## Output file formats
67
111
 
68
112
  ### Story spec: `specs/epics/<capsule>/eNNsYY-<slug>.md`
@@ -74,14 +118,14 @@ Populated countable-story-format with all 20 sections. Minimum maturity: 3 (Coun
74
118
  ```yaml
75
119
  story_id: e01s01
76
120
  title: Login
77
- status: todo
121
+ status: failing
78
122
  bcps: 3
79
123
  tasks:
80
124
  - id: 1
81
125
  description: "Add login form component tests"
82
126
  verify: "npm test -- login-form.test.tsx"
83
127
  risk: P1
84
- status: todo
128
+ status: failing # flip to passing only after verify exits 0 (e45s06)
85
129
  ```
86
130
 
87
131
  Update `specs/epics/<capsule>/epic.yaml` manifest to list the story and its BCPs. Run `bash scripts/sync-status-from-epics.sh` after structural changes.
@@ -152,6 +196,22 @@ Every task and story MUST be assigned a `risk:` level (P0, P1, P2, P3). When `sp
152
196
 
153
197
  `verify-work` scales its UAT depth based on this field.
154
198
 
199
+ ### Requirement delta tags (e45s29)
200
+
201
+ When modifying existing behavior in story spec § Requirements:
202
+
203
+ ```markdown
204
+ #### MODIFIED: User can reset password via email link
205
+ **Before:** Password reset required admin approval.
206
+ **After:** Self-service reset via signed email link (expires 1h).
207
+
208
+ #### REMOVED: Legacy OAuth1 login
209
+ **Before:** OAuth1 provider supported for enterprise SSO.
210
+ **After:** (removed) — provider deprecated; OAuth2 only.
211
+ ```
212
+
213
+ Tags: `ADDED`, `MODIFIED`, `REMOVED`, `RENAMED`. `MODIFIED`/`REMOVED`/`RENAMED` without before/after → plan-work gate FAIL.
214
+
155
215
  ### Define Success
156
216
 
157
217
  Before planning, convert task statements into observable "step → verify: <cmd>" pairs:
@@ -77,6 +77,17 @@ See [REFERENCE.md](REFERENCE.md)
77
77
 
78
78
  # Publish Package — Reference
79
79
 
80
+ ## Navigation
81
+
82
+ | Lines | Section |
83
+ |-------|---------|
84
+ | 1 | Title |
85
+ | 3–18 | Navigation |
86
+ | 20–28 | Options |
87
+ | 30–60 | Examples |
88
+ | 62–72 | Integration with release-branch |
89
+ | 74–252 | Reference blocks 1–8 |
90
+
80
91
  ## Options
81
92
 
82
93
  | Flag | Description |
@@ -3,6 +3,13 @@ description: Make the merge/PR/keep/discard decision for a feature branch, verif
3
3
  ---
4
4
 
5
5
 
6
+ <!-- story: e38s07 -->
7
+ <!-- story: e45s15 -->
8
+ <!-- story: e45s32 -->
9
+ <!-- story: e45s39 -->
10
+ <!-- story: e20s02 -->
11
+
12
+
6
13
  # Release Branch
7
14
 
8
15
  > **HARD GATE** — Do NOT merge or release if tests fail or if coverage gates are not met. If the branch is red, return to `develop-tdd` to fix regressions or add missing tests before proceeding.
@@ -52,6 +59,8 @@ If REVIEW.md is missing or stale → run `security-review` inline. Findings bloc
52
59
 
53
60
  Run `gate-trace` before merge. FAIL blocks merge; CONCERNS requires explicit override in `specs/state.yaml` (`traceability_override: CONCERNS accepted, reason: <explanation>`). WAIVED if no matrix available.
54
61
 
62
+ > **Adversarial refute framing (e45s32):** The final pre-merge check is **refute, not rubber-stamp**. Before declaring ready, actively try to disprove traceability completeness — missing story tags, absent verify evidence, stale security review. Only proceed when refutation fails.
63
+
55
64
  ### 3. Diff review
56
65
 
57
66
  - [ ] All commits intentional, no secrets, CONVENTIONS.md compliance
@@ -72,9 +81,26 @@ bash scripts/land-branch.sh <task-slug> "feat(scope): description"
72
81
 
73
82
  ### 6. Create PR (team-pr only)
74
83
 
75
- Create the pull request, then merge via `gh`:
84
+ Create the pull request with a **literal provenance marker** in the body so agent-generated PRs are identifiable and do not rot silently:
85
+
86
+ ```markdown
87
+ <!-- bigpowers-provenance: agent-generated -->
88
+ ```
89
+
90
+ Place the marker on its own line immediately after the `## Summary` heading. Then merge via `gh`:
76
91
 
77
92
  ```bash
93
+ gh pr create --title "..." --body "$(cat <<'EOF'
94
+ ## Summary
95
+ <!-- bigpowers-provenance: agent-generated -->
96
+
97
+ - ...
98
+
99
+ ## Test plan
100
+ - [ ] ...
101
+
102
+ EOF
103
+ )"
78
104
  gh pr merge --squash --delete-branch
79
105
  ```
80
106
 
@@ -90,55 +116,18 @@ mv specs/epics/eNN-slug specs/epics/archive/
90
116
 
91
117
  ### 7b. CI verification & agent lock release (e39s02)
92
118
 
93
- > **HARD GATE** — Do NOT declare success until CI completes. A push that fails CI is a regression, not a release.
94
-
95
- After push, run CI polling:
119
+ > **HARD GATE** — Do NOT declare success until CI completes. **Three-independent-facts** (e45s15): commit landed, workflow green, registry visible — see [REFERENCE.md](REFERENCE.md#three-independent-facts-release).
96
120
 
97
121
  ```bash
98
122
  bash scripts/wait-for-ci.sh --timeout 600 --interval 30
99
123
  ```
100
124
 
101
- Then release the story lock:
102
-
103
- ```bash
104
- LOCK="specs/agent-locks.yaml"; STORY="<story-id>"
105
- [ -f "$LOCK" ] && python3 -c "
106
- import yaml
107
- d=yaml.safe_load(open('$LOCK'))
108
- if d:d['locks']=[l for l in d['locks'] if l.get('story_id')!='$STORY']
109
- yaml.dump(d,open('$LOCK','w'),default_flow_style=False)
110
- print(f'LOCK RELEASED: $STORY')
111
- "||echo "No lock for $STORY — idempotent"
112
- ```
113
-
114
- - [ ] CI workflow passes after push (wait-for-ci.sh exit 0)
115
- - [ ] `release.ci_verified: true` documented in state.yaml
116
- - On failure: `handoff.next_skill = fix-bug` with CI failure URL
117
-
118
- ### 8. Clean up worktree
119
-
120
- ```bash
121
- git worktree prune
122
- git worktree remove ../<branch-name> 2>/dev/null || true
123
- git branch -d <branch-name>
124
- ```
125
-
126
- ### 8a. Cycle-time recording
127
-
128
- After landing, record delivery metrics with the git-derived, additive script:
129
-
130
- ```bash
131
- bash scripts/record-cycle-time.sh append \
132
- --story <story_id> --bcps <bcps> \
133
- --range "$(git merge-base main HEAD)..HEAD" \
134
- --file specs/metrics/cycle-times.yaml
135
- ```
125
+ - [ ] CI passes; `release.ci_verified: true` in state.yaml
126
+ - On failure: `handoff.next_skill = fix-bug`
136
127
 
137
- ### 9. Return to main
128
+ ### 8. Clean up & return
138
129
 
139
- ```bash
140
- git checkout main && git status && pwd
141
- ```
130
+ Worktree prune, branch delete, `git checkout main`. Cycle-time: see [REFERENCE.md](REFERENCE.md#cycle-time).
142
131
 
143
132
  Report: "Branch released."
144
133
 
@@ -150,6 +139,20 @@ Report: "Branch released."
150
139
 
151
140
  # Release Branch — Reference
152
141
 
142
+ ## Navigation
143
+
144
+ | Lines | Section |
145
+ |-------|---------|
146
+ | 1–3 | Title |
147
+ | 5–16 | Navigation |
148
+ | 18–41 | PR body template |
149
+ | 43–54 | Worktree cleanup |
150
+ | 56–96 | Cycle-time recording |
151
+ | 98–119 | CI verification |
152
+ | 121–126 | Solo-local fallback |
153
+ | 128–134 | Handoff |
154
+ | 136–155 | Reference block 1 (manual squash) |
155
+
153
156
  # Release Branch — Reference
154
157
 
155
158
  ## PR body template (team-pr mode)
@@ -3,21 +3,44 @@ description: Dispatch a fresh reviewer agent with a clean context to critique th
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s28
7
+
6
8
  # Request Review
7
9
 
8
- Dispatch a fresh reviewer agent with a clean context. The reviewer has no shared state — it can give a genuine second opinion because it hasn't been involved in writing the code.
10
+ Dispatch fresh reviewer agents with clean contexts. Reviewers have no shared state — they find what the coding agent missed.
11
+
12
+ **Distinct from `audit-code`:** `audit-code` is self-review (internal). This skill dispatches external agents.
13
+
14
+ **Solo developer note:** Reviewer agents replace the human reviewer.
15
+
16
+ **Run `audit-code` first.** Don't waste reviewer attention on hygiene issues you could have caught yourself.
17
+
18
+ ## Santa Method — Dual-Blind AND Gate (e45s07)
19
+
20
+ Use **two independent reviewers** (Reviewer A and Reviewer B) with **no shared context** between them or the coding agent.
21
+
22
+ | Parameter | Value |
23
+ |-----------|-------|
24
+ | Reviewers | 2 (mandatory) |
25
+ | `MAX_REVIEW_ITERATIONS` | **5** (hard cap — e45s28; iteration 6 forbidden) |
26
+ | Pass rule | **AND-gate** — both reviewers must pass independently |
27
+ | Blindness | Neither reviewer sees the other's report until both complete |
9
28
 
10
- **Distinct from `audit-code`:** `audit-code` is the coding agent checking its own work (internal). This skill dispatches an external agent whose job is to find what the coding agent missed.
29
+ **Iteration loop (max `MAX_REVIEW_ITERATIONS`):**
11
30
 
12
- **Solo developer note:** This replaces the human reviewer. The reviewer agent IS the reviewer.
31
+ 1. Dispatch Reviewer A and Reviewer B in parallel with identical briefs but separate contexts.
32
+ 2. Collect both reports. Each categorizes findings: must-fix / should-fix / consider.
33
+ 3. **AND-gate:** If **either** reviewer has must-fix findings → FAIL round. Run `respond-review`, fix, re-dispatch both reviewers.
34
+ 4. If both pass (zero must-fix, score ≥ 94% each) → review complete.
35
+ 5. After **5** iterations without dual pass → **stop**; report "Review cap exhausted (5/5). Human decision required." Do not merge.
13
36
 
14
- **Run `audit-code` first.** This skill assumes `audit-code` has already passed. Don't waste a reviewer's attention on hygiene issues you could have caught yourself.
37
+ > **HARD GATE** — Single-reviewer pass is insufficient. Partial agreement does not satisfy the AND-gate.
15
38
 
16
39
  ## Process
17
40
 
18
41
  ### 1. Prepare the review brief
19
42
 
20
- Write a self-contained brief for the reviewer agent. Include:
43
+ Write a self-contained brief for each reviewer. Include:
21
44
 
22
45
  - What was built (feature description, not implementation)
23
46
  - Which files changed (the diff context)
@@ -27,12 +50,25 @@ Write a self-contained brief for the reviewer agent. Include:
27
50
  - What you're most uncertain about (where you want fresh eyes)
28
51
  - **Security focus** — If the epic has a `specs/security/epics/<id>/THREAT_MODEL.md`, include the relevant vulnerability categories as reviewer focal points. Also include the false-positive exclusion rules so the reviewer avoids known-safe patterns. Tag the review as `security-sensitive: true` if THREAT_MODEL risk is HIGH+.
29
52
 
30
- ### 2. Dispatch the reviewer agent
53
+ ### 2. Fan-out parallel reviewers (e45s17)
31
54
 
32
- Use the Agent tool with a completely fresh context. The agent prompt must be self-contained — no references to "our conversation" or "what we discussed."
55
+ Beyond the mandatory dual-blind pair (e45s07), optionally dispatch **N dimension-specific subagents in one message** — one check per agent for broader coverage (OpenAI Codex `code-review-*` pattern):
56
+
57
+ | Agent | Focus |
58
+ |-------|-------|
59
+ | R-correctness | Logic, edge cases, verify command result |
60
+ | R-conventions | CONVENTIONS.md, test quality (F.I.R.S.T) |
61
+ | R-security | Injection, auth, secrets (when `security-sensitive`) |
62
+ | R-design | Simpler alternatives, API shape |
63
+
64
+ Santa Method still applies: each agent is blind; AND-gate uses Reviewer A + B scores. Fan-out agents feed findings into `respond-review` but do not replace the dual-blind pair.
65
+
66
+ ### 2b. Dispatch both reviewer agents (parallel)
67
+
68
+ Use the Agent tool twice with completely fresh contexts. Each prompt must be self-contained — no references to "our conversation" or "what we discussed."
33
69
 
34
70
  ```
35
- You are a code reviewer. Review the following code changes.
71
+ You are code reviewer [A|B]. Review the following code changes independently.
36
72
 
37
73
  Context: [feature description]
38
74
  CONVENTIONS.md rules: [paste relevant sections]
@@ -54,18 +90,22 @@ For each finding, categorize as: must-fix / should-fix / consider.
54
90
  Run the verify command and report the result.
55
91
  ```
56
92
 
57
- ### 3. Collect the report
93
+ ### 3. Collect both reports
58
94
 
59
- When the reviewer returns:
60
- - Read every finding before acting on any
61
- - Note the verify command result
62
- - Compute the quality score: `100 × (total_items − must_fix − should_fix) / total_items`
63
- - Report the score to the user
95
+ When reviewers return:
96
+ - Read every finding from **both** reports before acting on any
97
+ - Note each verify command result
98
+ - Compute quality score per reviewer: `100 × (total_items − must_fix − should_fix) / total_items`
99
+ - **AND-gate check:** both scores ≥ 94% and zero must-fix from **both**?
64
100
 
65
- > **HARD GATE** — If score < 94%, do NOT merge. Run `respond-review` to resolve must-fix and should-fix findings first. The 94% threshold also applies to the compliance SCORE computed by `npm run compliance` (scripts/audit-compliance.sh): SCORE = passing Gherkin scenarios / total × 100.
101
+ > **HARD GATE** — If either score < 94% or either has must-fix → FAIL round. Run `respond-review` first. The 94% threshold also applies to `npm run compliance` (scripts/audit-compliance.sh).
66
102
 
67
103
  ### 4. Hand off to respond-review
68
104
 
69
- Pass the reviewer's report to `respond-review` to categorize findings and apply fixes.
105
+ Pass combined findings to `respond-review` to categorize and apply fixes. Increment iteration counter. Re-dispatch both reviewers until AND-gate passes or iteration 3 exhausted.
106
+
107
+ Report to user: "Review round [N/3]. Reviewer A: [score], Reviewer B: [score]. AND-gate: [PASS|FAIL]."
108
+
109
+ ## Verify
70
110
 
71
- Report to user: "Review complete. [N] findings: [X] must-fix, [Y] should-fix, [Z] consider. Running respond-review."
111
+ → verify: `grep -q 'AND-gate' skills/request-review/SKILL.md && grep -q 'max 3' skills/request-review/SKILL.md && echo OK`
@@ -3,6 +3,9 @@ description: Look-before-build — search registries, repo, existing skills, and
3
3
  ---
4
4
 
5
5
 
6
+ # story: e03s01
7
+ # story: e21s02
8
+
6
9
  # Research First
7
10
 
8
11
  > **HARD GATE** — Do NOT implement until prior art is searched. Minimum outcome: adopt, extend, compose, or build — with evidence.
@@ -27,9 +27,9 @@ Benchmark definitions partition scenarios into two sets:
27
27
  ## Usage
28
28
 
29
29
  ```bash
30
- run-benchmark <skill-name> # benchmark single skill
31
- run-benchmark --all # benchmark all with definitions
32
- run-benchmark <skill-name> --baseline # pin results as baseline
30
+ bash scripts/run-benchmark.sh <skill-name> # benchmark single skill
31
+ bash scripts/run-benchmark.sh --all # benchmark all with definitions
32
+ bash scripts/run-benchmark.sh <skill-name> --baseline # pin results as baseline
33
33
  ```
34
34
 
35
35
  ## Process
@@ -14,8 +14,18 @@ description: Eval-Driven Development — define capability and regression evals
14
14
  - **Capability evals** (does it do the job?)
15
15
  - **Regression evals** (did we break anything?)
16
16
  3. Assign grader type per eval: `code` (shell verify) or `model` (rubric).
17
- 4. Run evals; log results table with pass@k (e.g. 3/3 runs).
18
- 5. Block BUILD phase until capability evals pass at agreed k.
17
+ 4. Assign **strictness tier** per eval (graduated promotion — e45s37):
18
+
19
+ | Tier | Meaning | Promotion rule |
20
+ |------|---------|------------------|
21
+ | `EXPERIMENTAL` | New eval, may flake | Not gating |
22
+ | `USUALLY_PASSES` | Stable in dev; ≥2/3 recent runs pass | Blocks BUILD only when combined with ALWAYS_PASSES suite |
23
+ | `ALWAYS_PASSES` | Zero tolerance; required for release | Any single failure blocks BUILD and merge |
24
+
25
+ Promote: `EXPERIMENTAL → USUALLY_PASSES` after 3 consecutive passes; `USUALLY_PASSES → ALWAYS_PASSES` after 5 consecutive passes with zero flakes documented in `specs/state.yaml`.
26
+
27
+ 5. Run evals; log results table with pass@k (e.g. 3/3 runs) and tier per eval.
28
+ 6. Block BUILD phase until all `ALWAYS_PASSES` evals pass at agreed k. `USUALLY_PASSES` failures warn; `EXPERIMENTAL` failures log only.
19
29
 
20
30
  ## Artefact
21
31
 
@@ -29,16 +39,26 @@ description: Eval-Driven Development — define capability and regression evals
29
39
 
30
40
  # Run Evals — Reference
31
41
 
42
+ ## Strictness tiers (e45s37)
43
+
44
+ Add a `tier:` column to each eval row:
45
+
46
+ | Tier | Gate behaviour |
47
+ |------|----------------|
48
+ | `EXPERIMENTAL` | Log only — does not block |
49
+ | `USUALLY_PASSES` | Warn on failure; blocks only when paired with failing `ALWAYS_PASSES` |
50
+ | `ALWAYS_PASSES` | Hard block on any failure |
51
+
32
52
  ## EVALS template
33
53
 
34
54
  ```markdown
35
55
  # EVALS: <feature>
36
56
 
37
57
  ## Capability
38
- | ID | Eval | Grader | verify / rubric |
39
- |----|------|--------|-----------------|
40
- | C1 | ... | code | `verify: npm test -- <file>` |
41
- | C2 | ... | model | Rubric: [ ] criterion A [ ] criterion B |
58
+ | ID | Eval | Grader | Tier | verify / rubric |
59
+ |----|------|--------|------|-----------------|
60
+ | C1 | ... | code | ALWAYS_PASSES | `verify: npm test -- <file>` |
61
+ | C2 | ... | model | USUALLY_PASSES | Rubric: [ ] criterion A [ ] criterion B |
42
62
 
43
63
  ## Regression
44
64
  | ID | Eval | Grader | verify / rubric |
@@ -2,6 +2,7 @@
2
2
  description: "DISCOVER-PHASE ADVANCER — Drive the discover-phase checklist (specs/planning-status.yaml) through survey-context → scope-work → research-first → elaborate-spec → plan-release → slice-tasks. NOT a duplicate of plan-work or the planning spine; it orchestrates the pre-coding discover phase only."
3
3
  ---
4
4
 
5
+ # story: e24s03
5
6
 
6
7
  # Run Planning
7
8
 
@@ -3,6 +3,9 @@ description: "PLANNING SPINE STEP 1 of 3 — Scope the work: define what is in a
3
3
  ---
4
4
 
5
5
 
6
+ # story: e03s01
7
+ # story: e24s02
8
+
6
9
  # Scope Work
7
10
 
8
11
  > **Spine position:** Step 1 — scope-work → slice-tasks → plan-work.
@@ -3,6 +3,9 @@ description: Find the right bigpowers skill from natural-language intent using a
3
3
  ---
4
4
 
5
5
 
6
+ # story: e09s01
7
+ # story: e21s01
8
+
6
9
  # Search Skills
7
10
 
8
11
  > **HARD GATE** — Search results must be ranked by relevance. Do NOT return all matches without prioritization. Use skill metadata (phase, purpose, frequency) to rank.
@@ -3,12 +3,33 @@ description: >
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s41
7
+ <!-- story: e45s18 -->
8
+ # story: e26s01
9
+ # story: e26s02
10
+ # story: e26s03
11
+ # story: e26s04
12
+ # story: e26s05
13
+ # story: e26s06
14
+ # story: e26s07
15
+ # story: e45s26
16
+
6
17
  # Security Review
7
18
 
8
19
  > **HARD GATE** — Requires git context (branch with merge-base or diff). Never
9
20
  > writes files outside `specs/security/`. Findings below confidence 8/10 are
10
21
  > suppressed. **→ verify:** `git rev-parse HEAD >/dev/null 2>&1 && echo "ok" || echo "BLOCKED"`
11
22
 
23
+ ## Parallel worktree mode (e45s18)
24
+
25
+ When running alongside `audit-code`, use isolated worktrees so scans do not race on the same index:
26
+
27
+ ```bash
28
+ bash scripts/lib/parallel-review-worktrees.sh security-review
29
+ ```
30
+
31
+ Each check gets a detached worktree at `.bigpowers/worktrees/review-<name>/`; reports still write only under `specs/security/`.
32
+
12
33
  ## 5-phase scan
13
34
 
14
35
  | # | Phase | What |
@@ -23,6 +44,37 @@ description: >
23
44
 
24
45
  Covered: SQLi, XSS, SSRF, command injection, auth bypass, unsafe deserialization, path traversal, IDOR, crypto flaws, secrets exposure, template injection, NoSQLi
25
46
 
47
+ ## CWE mapping mandate (e45s26)
48
+
49
+ Every **new detection rule** added to this skill MUST:
50
+
51
+ 1. Map to a [CWE](https://cwe.mitre.org/) ID in `REFERENCE-vuln-categories.md` (e.g. SQLi → CWE-89, XSS → CWE-79).
52
+ 2. Ship **two fixture pairs** under `skills/security-review/fixtures/`:
53
+ - **Positive** — minimal code the rule MUST flag (vulnerable pattern present).
54
+ - **Negative** — structurally similar code the rule MUST NOT flag (safe pattern / false-positive guard).
55
+
56
+ | Rule | CWE | Positive fixture | Negative fixture |
57
+ |------|-----|------------------|------------------|
58
+ | SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
59
+ | XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
60
+
61
+ Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
62
+
63
+ ## SQL-safety doctrine (e45s41 — proven authorship)
64
+
65
+ Formal rule for SQL injection classification:
66
+
67
+ | SQL source | Attacker-reachable input? | Verdict |
68
+ |------------|---------------------------|---------|
69
+ | Hardcoded / compile-time constant string | N/A | **Safe** — proven authorship |
70
+ | Developer-authored query with bound parameters only | No dynamic fragments from user input | **Safe** |
71
+ | String concatenation / template with user-controlled values | Yes | **Unsafe** — report as SQLi |
72
+ | ORM query builder with user input in WHERE/JOIN | Yes | **Unsafe** unless parameterized |
73
+ | Stored procedure call with bound args | Args from trusted constants only | **Safe** |
74
+ | Stored procedure with dynamic SQL inside | User input reaches EXEC | **Unsafe** |
75
+
76
+ **Provenance test:** If the agent cannot prove the query string was authored entirely by the developer (no attacker-reachable interpolation), treat as vulnerable. Hardcoded SQL in migrations, seeds, and admin scripts is safe; anything reachable from HTTP/CLI/user input is not.
77
+
26
78
  ## BCP Plus Integration
27
79
 
28
80
  This skill maps to **BCP Plus dimension 12 (Security & Compliance)**. When BCP Plus sizing is active, the threat model categories above correspond to sub-elements within dimension 12. The NFR Gate rule applies: standard-expectation items (e.g., "use HTTPS", "hash passwords") score 0 with a one-line rationale; only above-standard security requirements contribute to the dimension 12 count. See `docs/references/bcp-plus.md` for the full 13-dimension framework and NFR Gate pattern.
@@ -56,11 +108,8 @@ Each finding: **`File:Line` — Severity — Category**
56
108
 
57
109
  ## Verify
58
110
 
59
-
60
-
61
111
  ```bash
62
- test -d specs/security && echo "OK: specs/security/ exists" || mkdir -p specs/security
63
- grep -q "Merge-base\|merge.base\|git diff" SKILL.md && echo "OK: git context verified"
112
+ test -d specs/security && echo "OK: specs/security/ exists" || mkdir -p specs/security; grep -q "Merge-base\|merge.base\|git diff" SKILL.md && echo "OK: git context verified"
64
113
  ```
65
114
 
66
115
  ---
@@ -174,14 +223,15 @@ Automatically exclude findings matching these patterns:
174
223
  | 8 | **Race conditions / timing attacks** that are theoretical | Only report if concretely problematic |
175
224
  | 9 | **Outdated third-party libraries** | Managed separately by dependency scanners |
176
225
  | 10 | **Memory safety** in Rust or other memory-safe languages | Impossible by language guarantees |
177
- | 11 | **Unit test files only** | Not production risk |
178
- | 12 | **Log spoofing** | Outputting unsanitized input to logs is not a vuln |
179
- | 13 | **SSRF that only controls path** | Only host/protocol control is exploitable |
180
- | 14 | **User-controlled content in AI system prompts** | Not a security vulnerability |
181
- | 15 | **Regex injection** | Injecting untrusted content into regex is not a vuln |
182
- | 16 | **Regex DOS** | Excluded alongside general DOS |
183
- | 17 | **Documentation files** (.md, .txt) | Insecure docs are not code vulnerabilities |
184
- | 18 | **Lack of audit logs** | Not a vulnerability |
226
+ | 11 | **Hardcoded SQL with proven authorship** — migrations, seeds, static admin queries with no user interpolation | Developer-authored SQL is safe per SQL-safety doctrine (e45s41) |
227
+ | 12 | **Unit test files only** | Not production risk |
228
+ | 13 | **Log spoofing** | Outputting unsanitized input to logs is not a vuln |
229
+ | 14 | **SSRF that only controls path** | Only host/protocol control is exploitable |
230
+ | 15 | **User-controlled content in AI system prompts** | Not a security vulnerability |
231
+ | 16 | **Regex injection** | Injecting untrusted content into regex is not a vuln |
232
+ | 17 | **Regex DOS** | Excluded alongside general DOS |
233
+ | 18 | **Documentation files** (.md, .txt) | Insecure docs are not code vulnerabilities |
234
+ | 19 | **Lack of audit logs** | Not a vulnerability |
185
235
 
186
236
  ## Precedent Rules
187
237
 
@@ -233,6 +283,8 @@ Each category: vulnerable pattern → safe pattern → code example.
233
283
  | Aspect | Detail |
234
284
  |--------|--------|
235
285
  | **Vulnerable** | String interpolation in SQL queries: `f"SELECT * FROM users WHERE id = {uid}"` |
286
+ | **CWE** | CWE-89 (SQL Injection) |
287
+ | **Fixtures** | `fixtures/CWE-89-sqli-positive.py` (flag) · `fixtures/CWE-89-sqli-negative.py` (pass) |
236
288
  | **Safe** | Parameterized queries / ORM: `cursor.execute("SELECT * FROM users WHERE id = %s", (uid,))` |
237
289
  | **Look for** | f-strings, `+` concatenation, `format()` in query builders; raw SQL in ORM `.raw()` / `.execute()` |
238
290
  | **False-positive guard** | Not a FP if the input is user-controlled (HTTP param, file, env var, CLI arg). Env vars are trusted (see exclusion rules). |
@@ -242,6 +294,8 @@ Each category: vulnerable pattern → safe pattern → code example.
242
294
  | Aspect | Detail |
243
295
  |--------|--------|
244
296
  | **Vulnerable** | `element.innerHTML = userInput`, `dangerouslySetInnerHTML={{__html: userInput}}` |
297
+ | **CWE** | CWE-79 (Cross-site Scripting) |
298
+ | **Fixtures** | `fixtures/CWE-79-xss-positive.js` (flag) · `fixtures/CWE-79-xss-negative.js` (pass) |
245
299
  | **Safe** | `element.textContent = userInput`, React JSX (auto-escaped), template engines with auto-escaping |
246
300
  | **Look for** | `.innerHTML`, `document.write()`, `dangerouslySetInnerHTML`, `v-html` (Vue), `bypassSecurityTrustHtml` (Angular) |
247
301
  | **False-positive guard** | React/Angular components without unsafe methods are NOT vulnerable (see exclusion rules). |