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
@@ -5,21 +5,44 @@ model: opus
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s28
9
+
8
10
  # Request Review
9
11
 
10
- 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.
12
+ Dispatch fresh reviewer agents with clean contexts. Reviewers have no shared state — they find what the coding agent missed.
13
+
14
+ **Distinct from `audit-code`:** `audit-code` is self-review (internal). This skill dispatches external agents.
15
+
16
+ **Solo developer note:** Reviewer agents replace the human reviewer.
17
+
18
+ **Run `audit-code` first.** Don't waste reviewer attention on hygiene issues you could have caught yourself.
19
+
20
+ ## Santa Method — Dual-Blind AND Gate (e45s07)
21
+
22
+ Use **two independent reviewers** (Reviewer A and Reviewer B) with **no shared context** between them or the coding agent.
23
+
24
+ | Parameter | Value |
25
+ |-----------|-------|
26
+ | Reviewers | 2 (mandatory) |
27
+ | `MAX_REVIEW_ITERATIONS` | **5** (hard cap — e45s28; iteration 6 forbidden) |
28
+ | Pass rule | **AND-gate** — both reviewers must pass independently |
29
+ | Blindness | Neither reviewer sees the other's report until both complete |
11
30
 
12
- **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.
31
+ **Iteration loop (max `MAX_REVIEW_ITERATIONS`):**
13
32
 
14
- **Solo developer note:** This replaces the human reviewer. The reviewer agent IS the reviewer.
33
+ 1. Dispatch Reviewer A and Reviewer B in parallel with identical briefs but separate contexts.
34
+ 2. Collect both reports. Each categorizes findings: must-fix / should-fix / consider.
35
+ 3. **AND-gate:** If **either** reviewer has must-fix findings → FAIL round. Run `respond-review`, fix, re-dispatch both reviewers.
36
+ 4. If both pass (zero must-fix, score ≥ 94% each) → review complete.
37
+ 5. After **5** iterations without dual pass → **stop**; report "Review cap exhausted (5/5). Human decision required." Do not merge.
15
38
 
16
- **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.
39
+ > **HARD GATE** — Single-reviewer pass is insufficient. Partial agreement does not satisfy the AND-gate.
17
40
 
18
41
  ## Process
19
42
 
20
43
  ### 1. Prepare the review brief
21
44
 
22
- Write a self-contained brief for the reviewer agent. Include:
45
+ Write a self-contained brief for each reviewer. Include:
23
46
 
24
47
  - What was built (feature description, not implementation)
25
48
  - Which files changed (the diff context)
@@ -29,12 +52,25 @@ Write a self-contained brief for the reviewer agent. Include:
29
52
  - What you're most uncertain about (where you want fresh eyes)
30
53
  - **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+.
31
54
 
32
- ### 2. Dispatch the reviewer agent
55
+ ### 2. Fan-out parallel reviewers (e45s17)
33
56
 
34
- 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."
57
+ 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):
58
+
59
+ | Agent | Focus |
60
+ |-------|-------|
61
+ | R-correctness | Logic, edge cases, verify command result |
62
+ | R-conventions | CONVENTIONS.md, test quality (F.I.R.S.T) |
63
+ | R-security | Injection, auth, secrets (when `security-sensitive`) |
64
+ | R-design | Simpler alternatives, API shape |
65
+
66
+ 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.
67
+
68
+ ### 2b. Dispatch both reviewer agents (parallel)
69
+
70
+ Use the Agent tool twice with completely fresh contexts. Each prompt must be self-contained — no references to "our conversation" or "what we discussed."
35
71
 
36
72
  ```
37
- You are a code reviewer. Review the following code changes.
73
+ You are code reviewer [A|B]. Review the following code changes independently.
38
74
 
39
75
  Context: [feature description]
40
76
  CONVENTIONS.md rules: [paste relevant sections]
@@ -56,18 +92,22 @@ For each finding, categorize as: must-fix / should-fix / consider.
56
92
  Run the verify command and report the result.
57
93
  ```
58
94
 
59
- ### 3. Collect the report
95
+ ### 3. Collect both reports
60
96
 
61
- When the reviewer returns:
62
- - Read every finding before acting on any
63
- - Note the verify command result
64
- - Compute the quality score: `100 × (total_items − must_fix − should_fix) / total_items`
65
- - Report the score to the user
97
+ When reviewers return:
98
+ - Read every finding from **both** reports before acting on any
99
+ - Note each verify command result
100
+ - Compute quality score per reviewer: `100 × (total_items − must_fix − should_fix) / total_items`
101
+ - **AND-gate check:** both scores ≥ 94% and zero must-fix from **both**?
66
102
 
67
- > **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.
103
+ > **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).
68
104
 
69
105
  ### 4. Hand off to respond-review
70
106
 
71
- Pass the reviewer's report to `respond-review` to categorize findings and apply fixes.
107
+ 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.
108
+
109
+ Report to user: "Review round [N/3]. Reviewer A: [score], Reviewer B: [score]. AND-gate: [PASS|FAIL]."
110
+
111
+ ## Verify
72
112
 
73
- Report to user: "Review complete. [N] findings: [X] must-fix, [Y] should-fix, [Z] consider. Running respond-review."
113
+ → verify: `grep -q 'AND-gate' skills/request-review/SKILL.md && grep -q 'max 3' skills/request-review/SKILL.md && echo OK`
@@ -5,6 +5,9 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e03s01
9
+ # story: e21s02
10
+
8
11
  # Research First
9
12
 
10
13
  > **HARD GATE** — Do NOT implement until prior art is searched. Minimum outcome: adopt, extend, compose, or build — with evidence.
@@ -29,9 +29,9 @@ Benchmark definitions partition scenarios into two sets:
29
29
  ## Usage
30
30
 
31
31
  ```bash
32
- run-benchmark <skill-name> # benchmark single skill
33
- run-benchmark --all # benchmark all with definitions
34
- run-benchmark <skill-name> --baseline # pin results as baseline
32
+ bash scripts/run-benchmark.sh <skill-name> # benchmark single skill
33
+ bash scripts/run-benchmark.sh --all # benchmark all with definitions
34
+ bash scripts/run-benchmark.sh <skill-name> --baseline # pin results as baseline
35
35
  ```
36
36
 
37
37
  ## Process
@@ -16,8 +16,18 @@ model: sonnet
16
16
  - **Capability evals** (does it do the job?)
17
17
  - **Regression evals** (did we break anything?)
18
18
  3. Assign grader type per eval: `code` (shell verify) or `model` (rubric).
19
- 4. Run evals; log results table with pass@k (e.g. 3/3 runs).
20
- 5. Block BUILD phase until capability evals pass at agreed k.
19
+ 4. Assign **strictness tier** per eval (graduated promotion — e45s37):
20
+
21
+ | Tier | Meaning | Promotion rule |
22
+ |------|---------|------------------|
23
+ | `EXPERIMENTAL` | New eval, may flake | Not gating |
24
+ | `USUALLY_PASSES` | Stable in dev; ≥2/3 recent runs pass | Blocks BUILD only when combined with ALWAYS_PASSES suite |
25
+ | `ALWAYS_PASSES` | Zero tolerance; required for release | Any single failure blocks BUILD and merge |
26
+
27
+ Promote: `EXPERIMENTAL → USUALLY_PASSES` after 3 consecutive passes; `USUALLY_PASSES → ALWAYS_PASSES` after 5 consecutive passes with zero flakes documented in `specs/state.yaml`.
28
+
29
+ 5. Run evals; log results table with pass@k (e.g. 3/3 runs) and tier per eval.
30
+ 6. Block BUILD phase until all `ALWAYS_PASSES` evals pass at agreed k. `USUALLY_PASSES` failures warn; `EXPERIMENTAL` failures log only.
21
31
 
22
32
  ## Artefact
23
33
 
@@ -31,16 +41,26 @@ model: sonnet
31
41
 
32
42
  # Run Evals — Reference
33
43
 
44
+ ## Strictness tiers (e45s37)
45
+
46
+ Add a `tier:` column to each eval row:
47
+
48
+ | Tier | Gate behaviour |
49
+ |------|----------------|
50
+ | `EXPERIMENTAL` | Log only — does not block |
51
+ | `USUALLY_PASSES` | Warn on failure; blocks only when paired with failing `ALWAYS_PASSES` |
52
+ | `ALWAYS_PASSES` | Hard block on any failure |
53
+
34
54
  ## EVALS template
35
55
 
36
56
  ```markdown
37
57
  # EVALS: <feature>
38
58
 
39
59
  ## Capability
40
- | ID | Eval | Grader | verify / rubric |
41
- |----|------|--------|-----------------|
42
- | C1 | ... | code | `verify: npm test -- <file>` |
43
- | C2 | ... | model | Rubric: [ ] criterion A [ ] criterion B |
60
+ | ID | Eval | Grader | Tier | verify / rubric |
61
+ |----|------|--------|------|-----------------|
62
+ | C1 | ... | code | ALWAYS_PASSES | `verify: npm test -- <file>` |
63
+ | C2 | ... | model | USUALLY_PASSES | Rubric: [ ] criterion A [ ] criterion B |
44
64
 
45
65
  ## Regression
46
66
  | ID | Eval | Grader | verify / rubric |
@@ -4,6 +4,7 @@ description: "\"DISCOVER-PHASE ADVANCER — Drive the discover-phase checklist (
4
4
  model: sonnet
5
5
  ---
6
6
 
7
+ # story: e24s03
7
8
 
8
9
  # Run Planning
9
10
 
@@ -5,6 +5,9 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e03s01
9
+ # story: e24s02
10
+
8
11
  # Scope Work
9
12
 
10
13
  > **Spine position:** Step 1 — scope-work → slice-tasks → plan-work.
@@ -5,6 +5,9 @@ model: haiku
5
5
  ---
6
6
 
7
7
 
8
+ # story: e09s01
9
+ # story: e21s01
10
+
8
11
  # Search Skills
9
12
 
10
13
  > **HARD GATE** — Search results must be ranked by relevance. Do NOT return all matches without prioritization. Use skill metadata (phase, purpose, frequency) to rank.
@@ -5,12 +5,33 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s41
9
+ <!-- story: e45s18 -->
10
+ # story: e26s01
11
+ # story: e26s02
12
+ # story: e26s03
13
+ # story: e26s04
14
+ # story: e26s05
15
+ # story: e26s06
16
+ # story: e26s07
17
+ # story: e45s26
18
+
8
19
  # Security Review
9
20
 
10
21
  > **HARD GATE** — Requires git context (branch with merge-base or diff). Never
11
22
  > writes files outside `specs/security/`. Findings below confidence 8/10 are
12
23
  > suppressed. **→ verify:** `git rev-parse HEAD >/dev/null 2>&1 && echo "ok" || echo "BLOCKED"`
13
24
 
25
+ ## Parallel worktree mode (e45s18)
26
+
27
+ When running alongside `audit-code`, use isolated worktrees so scans do not race on the same index:
28
+
29
+ ```bash
30
+ bash scripts/lib/parallel-review-worktrees.sh security-review
31
+ ```
32
+
33
+ Each check gets a detached worktree at `.bigpowers/worktrees/review-<name>/`; reports still write only under `specs/security/`.
34
+
14
35
  ## 5-phase scan
15
36
 
16
37
  | # | Phase | What |
@@ -25,6 +46,37 @@ model: sonnet
25
46
 
26
47
  Covered: SQLi, XSS, SSRF, command injection, auth bypass, unsafe deserialization, path traversal, IDOR, crypto flaws, secrets exposure, template injection, NoSQLi
27
48
 
49
+ ## CWE mapping mandate (e45s26)
50
+
51
+ Every **new detection rule** added to this skill MUST:
52
+
53
+ 1. Map to a [CWE](https://cwe.mitre.org/) ID in `REFERENCE-vuln-categories.md` (e.g. SQLi → CWE-89, XSS → CWE-79).
54
+ 2. Ship **two fixture pairs** under `skills/security-review/fixtures/`:
55
+ - **Positive** — minimal code the rule MUST flag (vulnerable pattern present).
56
+ - **Negative** — structurally similar code the rule MUST NOT flag (safe pattern / false-positive guard).
57
+
58
+ | Rule | CWE | Positive fixture | Negative fixture |
59
+ |------|-----|------------------|------------------|
60
+ | SQL injection | CWE-89 | `fixtures/CWE-89-sqli-positive.py` | `fixtures/CWE-89-sqli-negative.py` |
61
+ | XSS (DOM) | CWE-79 | `fixtures/CWE-79-xss-positive.js` | `fixtures/CWE-79-xss-negative.js` |
62
+
63
+ Before merging a new category, run both fixtures through the detection guidance and confirm positive flags / negative passes.
64
+
65
+ ## SQL-safety doctrine (e45s41 — proven authorship)
66
+
67
+ Formal rule for SQL injection classification:
68
+
69
+ | SQL source | Attacker-reachable input? | Verdict |
70
+ |------------|---------------------------|---------|
71
+ | Hardcoded / compile-time constant string | N/A | **Safe** — proven authorship |
72
+ | Developer-authored query with bound parameters only | No dynamic fragments from user input | **Safe** |
73
+ | String concatenation / template with user-controlled values | Yes | **Unsafe** — report as SQLi |
74
+ | ORM query builder with user input in WHERE/JOIN | Yes | **Unsafe** unless parameterized |
75
+ | Stored procedure call with bound args | Args from trusted constants only | **Safe** |
76
+ | Stored procedure with dynamic SQL inside | User input reaches EXEC | **Unsafe** |
77
+
78
+ **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.
79
+
28
80
  ## BCP Plus Integration
29
81
 
30
82
  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.
@@ -58,11 +110,8 @@ Each finding: **`File:Line` — Severity — Category**
58
110
 
59
111
  ## Verify
60
112
 
61
-
62
-
63
113
  ```bash
64
- test -d specs/security && echo "OK: specs/security/ exists" || mkdir -p specs/security
65
- grep -q "Merge-base\|merge.base\|git diff" SKILL.md && echo "OK: git context verified"
114
+ 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"
66
115
  ```
67
116
 
68
117
  ---
@@ -176,14 +225,15 @@ Automatically exclude findings matching these patterns:
176
225
  | 8 | **Race conditions / timing attacks** that are theoretical | Only report if concretely problematic |
177
226
  | 9 | **Outdated third-party libraries** | Managed separately by dependency scanners |
178
227
  | 10 | **Memory safety** in Rust or other memory-safe languages | Impossible by language guarantees |
179
- | 11 | **Unit test files only** | Not production risk |
180
- | 12 | **Log spoofing** | Outputting unsanitized input to logs is not a vuln |
181
- | 13 | **SSRF that only controls path** | Only host/protocol control is exploitable |
182
- | 14 | **User-controlled content in AI system prompts** | Not a security vulnerability |
183
- | 15 | **Regex injection** | Injecting untrusted content into regex is not a vuln |
184
- | 16 | **Regex DOS** | Excluded alongside general DOS |
185
- | 17 | **Documentation files** (.md, .txt) | Insecure docs are not code vulnerabilities |
186
- | 18 | **Lack of audit logs** | Not a vulnerability |
228
+ | 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) |
229
+ | 12 | **Unit test files only** | Not production risk |
230
+ | 13 | **Log spoofing** | Outputting unsanitized input to logs is not a vuln |
231
+ | 14 | **SSRF that only controls path** | Only host/protocol control is exploitable |
232
+ | 15 | **User-controlled content in AI system prompts** | Not a security vulnerability |
233
+ | 16 | **Regex injection** | Injecting untrusted content into regex is not a vuln |
234
+ | 17 | **Regex DOS** | Excluded alongside general DOS |
235
+ | 18 | **Documentation files** (.md, .txt) | Insecure docs are not code vulnerabilities |
236
+ | 19 | **Lack of audit logs** | Not a vulnerability |
187
237
 
188
238
  ## Precedent Rules
189
239
 
@@ -235,6 +285,8 @@ Each category: vulnerable pattern → safe pattern → code example.
235
285
  | Aspect | Detail |
236
286
  |--------|--------|
237
287
  | **Vulnerable** | String interpolation in SQL queries: `f"SELECT * FROM users WHERE id = {uid}"` |
288
+ | **CWE** | CWE-89 (SQL Injection) |
289
+ | **Fixtures** | `fixtures/CWE-89-sqli-positive.py` (flag) · `fixtures/CWE-89-sqli-negative.py` (pass) |
238
290
  | **Safe** | Parameterized queries / ORM: `cursor.execute("SELECT * FROM users WHERE id = %s", (uid,))` |
239
291
  | **Look for** | f-strings, `+` concatenation, `format()` in query builders; raw SQL in ORM `.raw()` / `.execute()` |
240
292
  | **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). |
@@ -244,6 +296,8 @@ Each category: vulnerable pattern → safe pattern → code example.
244
296
  | Aspect | Detail |
245
297
  |--------|--------|
246
298
  | **Vulnerable** | `element.innerHTML = userInput`, `dangerouslySetInnerHTML={{__html: userInput}}` |
299
+ | **CWE** | CWE-79 (Cross-site Scripting) |
300
+ | **Fixtures** | `fixtures/CWE-79-xss-positive.js` (flag) · `fixtures/CWE-79-xss-negative.js` (pass) |
247
301
  | **Safe** | `element.textContent = userInput`, React JSX (auto-escaped), template engines with auto-escaping |
248
302
  | **Look for** | `.innerHTML`, `document.write()`, `dangerouslySetInnerHTML`, `v-html` (Vue), `bypassSecurityTrustHtml` (Angular) |
249
303
  | **False-positive guard** | React/Angular components without unsafe methods are NOT vulnerable (see exclusion rules). |
@@ -5,6 +5,13 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e10s01
9
+ # story: e47s02
10
+ # story: e10s02
11
+ # story: e51s02
12
+ # story: e45s21
13
+
14
+
8
15
  # Seed Conventions
9
16
  > **HARD GATE** — Before any new code lands, confirm the project conventions are understood. Ask: 'What does a good commit message look like in this project?'
10
17
 
@@ -63,7 +70,28 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
63
70
 
64
71
  When generating `CLAUDE.md`, if the user did not name a Preflight command, chain the Test + Lint + Build interview answers into one **Preflight** row (e.g. `npm test && npm run lint && npm run build`).
65
72
 
73
+ ### Self-installing fenced markers (e45s21)
74
+
75
+ Skills that write into `CLAUDE.md` or `AGENTS.md` MUST use **fenced HTML comment markers** so handwritten content outside the fence is never clobbered:
76
+
77
+ ```markdown
78
+ <!-- BEGIN bigpowers:section-id -->
79
+ …agent-managed content only…
80
+ <!-- END bigpowers:section-id -->
81
+ ```
82
+
83
+ **Merge rule:** On update, replace only the content *between* matching `BEGIN`/`END` pairs. If a marker pair is missing, append a new fenced block at the end of the file — never rewrite the whole file.
84
+
85
+ **Standard marker IDs** for seeded projects (see [REFERENCE.md](REFERENCE.md) § Fenced markers):
66
86
 
87
+ | Marker ID | Owner skill | Purpose |
88
+ |-----------|-------------|---------|
89
+ | `project` | seed-conventions | Project, Commands, Architecture |
90
+ | `context-routing` | seed-conventions | Glob → sub-AGENTS.md routing table |
91
+ | `learned-preferences` | session-state | Learned User Preferences + Workspace Facts |
92
+ | `tooling` | setup-environment, guard-git | sqz/rtk/hook blocks installed by tooling skills |
93
+
94
+ Emit these fences in `AGENTS.md` (and therefore `CLAUDE.md` symlink) from `docs/templates/AGENTS.md`. User prose outside fences is sacred.
67
95
 
68
96
  - [ ] CLAUDE.md exists and is populated
69
97
  - [ ] CONVENTIONS.md exists and includes specs/ output convention
@@ -77,8 +105,48 @@ When generating `CLAUDE.md`, if the user did not name a Preflight command, chain
77
105
  ---
78
106
 
79
107
  # story: e51s02 e37s01 e37s03 e37s14
108
+ # story: e45s21
80
109
  # Seed Conventions — Reference Templates
81
110
 
111
+ ## Navigation
112
+
113
+ | Lines | Section |
114
+ |-------|---------|
115
+ | 1–4 | Title + story tags |
116
+ | 6–22 | Navigation (this table) |
117
+ | 24–35 | AGENTS.md spine |
118
+ | 37–76 | Agent config template |
119
+ | 78–85 | opencode.json template |
120
+ | 87–96 | Aider bridge |
121
+ | 98–108 | Codex CLI wiring |
122
+ | 110–118 | CONVENTIONS.md |
123
+ | 120–122 | Stack profile fragments |
124
+ | 124–153 | Local tool wiring |
125
+
126
+ ## Fenced markers (e45s21)
127
+
128
+ Self-installing blocks prevent skills from overwriting user-authored prose. Pattern:
129
+
130
+ ```markdown
131
+ <!-- BEGIN bigpowers:section-id -->
132
+ …managed content…
133
+ <!-- END bigpowers:section-id -->
134
+ ```
135
+
136
+ **Merge algorithm:**
137
+
138
+ 1. If `BEGIN bigpowers:<id>` exists → replace inner content only.
139
+ 2. If missing → append new fenced block at EOF.
140
+ 3. Never delete content outside fences.
141
+
142
+ Seed these marker IDs in generated `AGENTS.md`:
143
+
144
+ | ID | Initial content |
145
+ |----|-----------------|
146
+ | `project` | Project, Commands, Architecture, Conventions, Never, Agent Rules |
147
+ | `context-routing` | Glob → sub-AGENTS.md table (see CLAUDE.md e45s22) |
148
+ | `learned-preferences` | Empty Learned User Preferences + Workspace Facts lists |
149
+
82
150
  ## AGENTS.md spine (Reach Template — e37s01)
83
151
 
84
152
  Canonical source: copy from `docs/templates/AGENTS.md` in the bigpowers repo (Reach Template).
@@ -5,6 +5,8 @@ model: haiku
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s23
9
+
8
10
  # Session State
9
11
  > **HARD GATE** — **HARD GATE** — Session state must be synchronized with git state. If state.yaml conflicts with the working tree, halt and ask for clarification. Do NOT assume state is correct.
10
12
 
@@ -19,6 +21,8 @@ Maintain a single source of truth for the *current* session in `specs/state.yaml
19
21
 
20
22
  Legacy markdown (`specs/archive/STATE.md`, `RELEASE-PLAN.md`) is **not** SoT when YAML exists — use `specs/state.yaml` only.
21
23
 
24
+ When a story modifies existing behavior, patch only between matching marker pairs in `CLAUDE.md` / `AGENTS.md` `learned-preferences` fence — see e45s21.
25
+
22
26
  ## Handoff block (cold start)
23
27
 
24
28
  When ending a session or before a context-heavy spawn, update `handoff` in `state.yaml`:
@@ -65,6 +69,7 @@ When starting a new session or after a significant context flush:
65
69
  Whenever a significant decision is made or a milestone is reached:
66
70
 
67
71
  - [ ] Patch via `bash scripts/bp-yaml-set.sh specs/state.yaml git.hash <hash>` (or edit directly).
72
+ - [ ] Patch `handoff` and `learned_preferences` / `workspace_facts` in `CLAUDE.md` fenced block when durable user preferences or repo facts crystallize (e45s23).
68
73
  - [ ] Update `handoff.open_decisions` with rationale.
69
74
  - [ ] Update `epic_cycle` when advancing `ship-epic` steps.
70
75
  - [ ] Record open questions under `handoff.open_decisions` or an ADR.
@@ -131,16 +136,6 @@ handoff:
131
136
  next_skill: survey-context
132
137
  ```
133
138
 
134
- ## Tracking commit ratio
135
-
136
- After `release-branch` lands, compute fix-to-feature ratio via:
137
- ```bash
138
- FEAT_COUNT=$(git log main --oneline --grep="^feat" | wc -l | tr -d ' ')
139
- FIX_COUNT=$(git log main --oneline --grep="^fix" | wc -l | tr -d ' ')
140
- FIX_PCT=$((FIX_COUNT * 100 / (FEAT_COUNT + FIX_COUNT)))
141
- ```
142
- Update `specs/state.yaml` `metrics.commit_ratio` with counts. If `fix_pct > 30%`, emit: `"High fix rate (N%) — deploy + smoke-test recommended"`.
143
-
144
139
  ## Anti-Patterns
145
140
 
146
141
  - **Duplicate Plan**: Don't copy `release-plan.yaml` or epic shards into `state.yaml`.
@@ -5,6 +5,8 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s29
9
+
8
10
  # Slice Tasks
9
11
 
10
12
  > **Spine position:** Step 2 — scope-work → slice-tasks → plan-work.
@@ -37,6 +39,7 @@ Produce **epic capsule story tasks** in `specs/epics/eNN-slug/` — vertical sli
37
39
  - `eNNsYY-tasks.yaml` with `story_id`, `title`, `status`, `bcps`, `tasks[]` (each with `id`, `description`, `verify`, `status`)
38
40
  - Story spec `.md` files are written by `plan-work` and follow countable-story-format.md
39
41
  - The epic capsule manifest (`epic.yaml`) is updated to list the story ID and BCPs
42
+ - **Requirement deltas (e45s29):** Stories that alter existing behavior MUST carry `delta:` in `epic.yaml` (`ADDED` | `MODIFIED` | `REMOVED` | `RENAMED`). `plan-work` expands deltas into full before/after requirement text.
40
43
 
41
44
  5. **Order by WSJF** in `release-plan.yaml` epic list — highest WSJF first. Weight-shortest-job-first ensures the highest value arrives earliest.
42
45
 
@@ -70,6 +70,17 @@ DEPLOY_URL="$DEPLOY_URL" bash scripts/run-smoke.sh
70
70
 
71
71
  # Smoke Test — Reference
72
72
 
73
+ ## Navigation
74
+
75
+ | Lines | Section |
76
+ |-------|---------|
77
+ | 1 | Title |
78
+ | 3–12 | Navigation |
79
+ | 14–31 | Runner script |
80
+ | 33–42 | Configuration reference |
81
+ | 44–53 | Verification |
82
+ | 55–160 | Reference blocks 1–5 |
83
+
73
84
  ## Runner script
74
85
 
75
86
  A ready-to-use runner is provided for standalone operation:
@@ -5,6 +5,10 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e09s01
9
+ <!-- story: e45s12 -->
10
+
11
+
8
12
  # Stocktake Skills
9
13
  > **HARD GATE** — **HARD GATE** — Skill inventory must be current. Missing HARD GATEs, stale descriptions, or broken verify commands are defects, not cosmetic. Fix them in `evolve-skill`.
10
14
 
@@ -21,6 +25,7 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
21
25
 
22
26
  ## Process
23
27
 
28
+ 0. **Catalog validator (code-enforced)** — run `bash scripts/validate-skill-catalog.sh`. Any FAIL is a critical finding before manual review. Add `--archive` to list zero-usage skills from `metrics.skill_timings` for auto-archiving candidates (move to `specs/epics/archive/` or delete after user confirms).
24
29
  1. Run `bash scripts/audit-catalog.sh` to verify pi/skills ↔ source SKILL.md sync. Mismatch is a critical finding.
25
30
  2. Run mode; for each skill check: exists, verb-noun, &lt;300 lines total, HARD GATE present, INDEX row matches.
26
31
  3. Write `specs/STOCKTAKE-<date>.md` with findings table (skill, issue, severity).
@@ -52,7 +57,7 @@ Timing data is populated by `scripts/bp-timing.sh start|end <skill>` calls withi
52
57
 
53
58
  ## Verify
54
59
 
55
- → verify: `test -f specs/STOCKTAKE-*.md && echo OK || echo MISSING`
60
+ → verify: `test -f specs/STOCKTAKE-*.md && bash scripts/validate-skill-catalog.sh && echo OK || echo MISSING`
56
61
 
57
62
  See [REFERENCE.md](REFERENCE.md) for checklist.
58
63
 
@@ -115,6 +115,18 @@ bash scripts/validate-contracts.sh <contract-file>
115
115
 
116
116
  # Validate Contracts — Reference
117
117
 
118
+ ## Navigation
119
+
120
+ | Lines | Section |
121
+ |-------|---------|
122
+ | 1 | Title |
123
+ | 3–14 | Navigation |
124
+ | 16–24 | Integration |
125
+ | 26–35 | Configuration |
126
+ | 37–46 | Verification |
127
+ | 48–170 | Reference blocks + Examples 1–6 |
128
+ | 172–190 | Integration (duplicate) + Configuration + Verification |
129
+
118
130
  ## Integration
119
131
 
120
132
  - **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.
@@ -11,6 +11,8 @@ model: haiku
11
11
 
12
12
  Prove the fix works. "I think it works" is not evidence. Run the suite, show the output, then harden against recurrence.
13
13
 
14
+ > **Two-commit red/green policy (e45s08)** — Bug fixes follow the same two-commit discipline as `develop-tdd`: first commit adds/adjusts the failing test (`test(<scope>): …`), second commit applies the fix (`fix(<scope>): …`). Do not squash RED and GREEN before review.
15
+
14
16
  ## Checklist
15
17
 
16
18
  ### 1. Re-run the originally failing test