bigpowers 2.73.8 → 2.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) 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/change-request.md +3 -1
  8. package/.pi/prompts/compose-workflow.md +15 -0
  9. package/.pi/prompts/context7-mcp.md +54 -0
  10. package/.pi/prompts/craft-skill.md +28 -0
  11. package/.pi/prompts/deepen-architecture.md +20 -0
  12. package/.pi/prompts/delegate-task.md +14 -0
  13. package/.pi/prompts/deploy.md +8 -0
  14. package/.pi/prompts/develop-tdd.md +15 -4
  15. package/.pi/prompts/diagnose-stall.md +53 -0
  16. package/.pi/prompts/dispatch-agents.md +49 -19
  17. package/.pi/prompts/gate-trace.md +9 -1
  18. package/.pi/prompts/guard-git.md +14 -0
  19. package/.pi/prompts/migrate-spec.md +12 -0
  20. package/.pi/prompts/plan-work.md +62 -2
  21. package/.pi/prompts/publish-package.md +11 -0
  22. package/.pi/prompts/release-branch.md +39 -43
  23. package/.pi/prompts/request-review.md +57 -17
  24. package/.pi/prompts/run-benchmark.md +3 -3
  25. package/.pi/prompts/run-evals.md +26 -6
  26. package/.pi/prompts/security-review.md +56 -8
  27. package/.pi/prompts/seed-conventions.md +61 -0
  28. package/.pi/prompts/session-state.md +5 -10
  29. package/.pi/prompts/slice-tasks.md +3 -0
  30. package/.pi/prompts/smoke-test.md +11 -0
  31. package/.pi/prompts/stocktake-skills.md +2 -1
  32. package/.pi/prompts/validate-contracts.md +12 -0
  33. package/.pi/prompts/validate-fix.md +2 -0
  34. package/.pi/prompts/verify-work.md +31 -20
  35. package/.pi/prompts/wire-ci.md +11 -0
  36. package/.pi/prompts/write-document.md +10 -0
  37. package/.pi/skills/audit-code/SKILL.md +17 -13
  38. package/.pi/skills/change-request/SKILL.md +3 -1
  39. package/.pi/skills/compose-workflow/SKILL.md +15 -0
  40. package/.pi/skills/context7-mcp/SKILL.md +56 -0
  41. package/.pi/skills/craft-skill/SKILL.md +28 -0
  42. package/.pi/skills/deepen-architecture/SKILL.md +20 -0
  43. package/.pi/skills/delegate-task/SKILL.md +14 -0
  44. package/.pi/skills/deploy/SKILL.md +8 -0
  45. package/.pi/skills/develop-tdd/SKILL.md +15 -4
  46. package/.pi/skills/diagnose-stall/SKILL.md +55 -0
  47. package/.pi/skills/dispatch-agents/SKILL.md +49 -19
  48. package/.pi/skills/gate-trace/SKILL.md +9 -1
  49. package/.pi/skills/guard-git/SKILL.md +14 -0
  50. package/.pi/skills/migrate-spec/SKILL.md +12 -0
  51. package/.pi/skills/plan-work/SKILL.md +62 -2
  52. package/.pi/skills/publish-package/SKILL.md +11 -0
  53. package/.pi/skills/release-branch/SKILL.md +39 -43
  54. package/.pi/skills/request-review/SKILL.md +57 -17
  55. package/.pi/skills/run-benchmark/SKILL.md +3 -3
  56. package/.pi/skills/run-evals/SKILL.md +26 -6
  57. package/.pi/skills/security-review/SKILL.md +56 -8
  58. package/.pi/skills/seed-conventions/SKILL.md +61 -0
  59. package/.pi/skills/session-state/SKILL.md +5 -10
  60. package/.pi/skills/slice-tasks/SKILL.md +3 -0
  61. package/.pi/skills/smoke-test/SKILL.md +11 -0
  62. package/.pi/skills/stocktake-skills/SKILL.md +2 -1
  63. package/.pi/skills/validate-contracts/SKILL.md +12 -0
  64. package/.pi/skills/validate-fix/SKILL.md +2 -0
  65. package/.pi/skills/verify-work/SKILL.md +31 -20
  66. package/.pi/skills/wire-ci/SKILL.md +11 -0
  67. package/.pi/skills/write-document/SKILL.md +10 -0
  68. package/CHANGELOG.md +14 -0
  69. package/CLAUDE.md +59 -1
  70. package/CONVENTIONS.md +80 -5
  71. package/README.md +1 -1
  72. package/SKILL-INDEX.md +1 -1
  73. package/package.json +1 -1
  74. package/scripts/bp-churn-rank.sh +49 -0
  75. package/scripts/check-import-boundaries.sh +64 -0
  76. package/scripts/compile-rule-matrix.sh +114 -0
  77. package/scripts/hooks/rtk-rewrite.sh +11 -0
  78. package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
  79. package/scripts/install.sh +6 -0
  80. package/scripts/lib/completeness-critic.sh +62 -0
  81. package/scripts/lib/doc-fetch-cache.sh +71 -0
  82. package/scripts/lib/golden-suite-gates.sh +3 -1
  83. package/scripts/lib/parallel-review-worktrees.sh +34 -0
  84. package/scripts/lib/plan-consistency-check.sh +88 -0
  85. package/scripts/lib/run-benchmark.py +210 -0
  86. package/scripts/lib/simple_yaml.py +130 -0
  87. package/scripts/lib/sync-context-engineering-ref.sh +19 -0
  88. package/scripts/lib/trace-matrix.py +10 -281
  89. package/scripts/lib/trace_renderer.py +147 -0
  90. package/scripts/references-manifest.yaml +19 -0
  91. package/scripts/run-benchmark.sh +6 -0
  92. package/scripts/sync-references.sh +25 -0
  93. package/scripts/test-trace-matrix-size.sh +46 -0
  94. package/scripts/validate-skill-catalog.sh +147 -0
  95. package/scripts/validate-skill-description.sh +70 -0
  96. package/skills/audit-code/SKILL.md +19 -13
  97. package/skills/change-request/SKILL.md +3 -1
  98. package/skills/compose-workflow/SKILL.md +15 -0
  99. package/skills/context7-mcp/SKILL.md +57 -0
  100. package/skills/craft-skill/SKILL.md +29 -0
  101. package/skills/deepen-architecture/SKILL.md +22 -0
  102. package/skills/delegate-task/SKILL.md +14 -0
  103. package/skills/deploy/SKILL.md +9 -0
  104. package/skills/develop-tdd/SKILL.md +18 -4
  105. package/skills/diagnose-stall/SKILL.md +56 -0
  106. package/skills/dispatch-agents/SKILL.md +51 -19
  107. package/skills/gate-trace/SKILL.md +11 -1
  108. package/skills/guard-git/REFERENCE.md +14 -0
  109. package/skills/migrate-spec/REFERENCE.md +12 -0
  110. package/skills/plan-work/REFERENCE.md +29 -2
  111. package/skills/plan-work/SKILL.md +38 -0
  112. package/skills/publish-package/REFERENCE.md +11 -0
  113. package/skills/release-branch/REFERENCE.md +14 -0
  114. package/skills/release-branch/SKILL.md +28 -43
  115. package/skills/request-review/SKILL.md +59 -17
  116. package/skills/run-benchmark/SKILL.md +4 -4
  117. package/skills/run-evals/REFERENCE.md +14 -4
  118. package/skills/run-evals/SKILL.md +13 -2
  119. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  120. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  121. package/skills/security-review/SKILL.md +45 -0
  122. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  123. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  124. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  125. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  126. package/skills/seed-conventions/REFERENCE.md +40 -0
  127. package/skills/seed-conventions/SKILL.md +22 -0
  128. package/skills/session-state/SKILL.md +5 -10
  129. package/skills/slice-tasks/SKILL.md +3 -0
  130. package/skills/smoke-test/REFERENCE.md +11 -0
  131. package/skills/stocktake-skills/SKILL.md +3 -1
  132. package/skills/validate-contracts/REFERENCE.md +12 -0
  133. package/skills/validate-fix/SKILL.md +3 -0
  134. package/skills/verify-work/REFERENCE.md +17 -0
  135. package/skills/verify-work/SKILL.md +18 -20
  136. package/skills/wire-ci/REFERENCE.md +11 -0
  137. package/skills/write-document/REFERENCE.md +10 -0
  138. package/skills-lock.json +32 -22
@@ -5,6 +5,8 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s30
9
+
8
10
  # Dispatch Agents
9
11
  > **HARD GATE** — **HARD GATE** — Agent work must be parallelizable and have explicit synchronization points. Do NOT dispatch work that has hidden dependencies between agents.
10
12
 
@@ -36,30 +38,57 @@ Before dispatching, verify each task pair is truly independent:
36
38
 
37
39
  If any two tasks conflict, sequence them with `delegate-task` or `execute-plan` instead.
38
40
 
39
- ### 2. Write task briefs
41
+ ## Subagent depth tiers (e45s30)
40
42
 
41
- Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
43
+ Map `effort:` frontmatter and story `risk:` to prompt depth — do not send `minimal_decisive` agents a `full_maturity` brief.
42
44
 
43
- For each task, use this minimal template (each agent starts cold — brief size directly controls token cost and hallucination risk):
45
+ | Tier | When | Brief shape | Token budget |
46
+ |------|------|-------------|----------------|
47
+ | `full_maturity` | `effort: heavy`, `risk: P0`, security-sensitive diffs | Full `task_brief` + CONVENTIONS excerpts + threat model if present | Full envelope |
48
+ | `standard` | `effort: standard`, `risk: P1`–`P2` | Standard `task_brief` fields below | Default |
49
+ | `minimal_decisive` | `effort: light`, `risk: P3`, read-only exploration | `goal` + `verify` + `in_scope` only | ≤15 lines |
44
50
 
51
+ Record `depth: <tier>` in the Agent tool description when dispatching.
52
+
53
+ ### 2. Write typed task briefs (Orca message protocol)
54
+
55
+ Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
56
+
57
+ Every inter-agent message uses a **typed envelope** — no freeform prose between waves:
58
+
59
+ | `type` | When | Required fields |
60
+ |--------|------|-----------------|
61
+ | `task_brief` | Dispatch | `task_id`, `goal`, `in_scope`, `out_of_bounds`, `verify`, `prior_decisions` |
62
+ | `checkpoint` | Mid-wave progress | `task_id`, `status` (`running`\|`blocked`), `comment` (one line) |
63
+ | `result` | Agent return | `task_id`, `exit` (`pass`\|`fail`), `summary`, `verify_output` |
64
+ | `circuit_open` | 3 consecutive failures | `task_id`, `failures` (3), `escalate_to` (`user`) |
65
+
66
+ Example `task_brief` (each agent starts cold — brief size directly controls token cost and hallucination risk):
67
+
68
+ ```yaml
69
+ type: task_brief
70
+ task_id: agent-1
71
+ goal: [one sentence — what success looks like]
72
+ in_scope: [explicit file or module list]
73
+ out_of_bounds: [what NOT to touch]
74
+ verify: [runnable command]
75
+ prior_decisions: [relevant entries from specs/state.yaml — omit if none]
45
76
  ```
46
- Goal: [one sentence — what success looks like]
47
- In scope: [explicit file or module list]
48
- Out of bounds: [what NOT to touch]
49
- Verify: [runnable command]
50
- Prior decisions: [relevant entries from specs/state.yaml — omit section if none apply]
51
- ```
77
+
78
+ Emit **`checkpoint`** comments when an agent is slow or blocked — one line, no stack traces. Parent reads checkpoints before spawning follow-ups.
52
79
 
53
80
  Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.
54
81
 
55
- ### 3. Iterative retrieval (max 3 cycles)
82
+ ### 3. Circuit breaker + iterative retrieval (max 3 cycles)
83
+
84
+ Track **consecutive failures per `task_id`**. On the **3rd consecutive `result.exit: fail`** for the same task, emit `type: circuit_open` and **stop dispatching** that task — escalate to user with the three failure summaries. Reset counter on any `pass`.
56
85
 
57
86
  After each wave completes:
58
- 1. **Dispatch** — run parallel agents with briefs.
59
- 2. **Evaluate** — read outputs; list gaps vs goal.
87
+ 1. **Dispatch** — run parallel agents with typed `task_brief` envelopes.
88
+ 2. **Evaluate** — read `result` messages; list gaps vs goal; honor open circuits.
60
89
  3. **Refine** — tighten briefs or spawn follow-up agents (max **3 cycles** total).
61
90
 
62
- Stop when gaps empty or cycle 3 reached — escalate to user.
91
+ Stop when gaps empty, circuit opens, or cycle 3 reached — escalate to user. If agents go silent without returning, invoke `diagnose-stall` before spawning another wave.
63
92
 
64
93
  ### 4. Dispatch in parallel
65
94
 
@@ -73,13 +102,14 @@ Agent 3: brief for task C
73
102
 
74
103
  ### 5. Collect and review results
75
104
 
76
- When all agents return:
77
- - Review each result independently
78
- - Run all verify commands
79
- - Check diffs for scope violations or CONVENTIONS.md breaches
105
+ When all agents return: review each result, run verify commands, check diffs for scope violations.
80
106
 
81
107
  ### 6. Integrate
82
108
 
83
- Merge accepted results. If any agent's result conflicts with another, resolve manually and note the conflict.
109
+ Merge accepted results. Resolve conflicts manually; note in summary.
110
+
111
+ Report: which tasks succeeded, which need revision, overall verify status.
112
+
113
+ ## Verify
84
114
 
85
- Report a summary: which tasks succeeded, which need revision, and overall verify status.
115
+ → verify: `grep -q 'circuit_open' skills/dispatch-agents/SKILL.md && grep -q 'task_brief' skills/dispatch-agents/SKILL.md && echo OK || echo FAIL`
@@ -38,7 +38,15 @@ TEA-inspired: if trace links rely on heuristics rather than explicit tags, confi
38
38
  5. Apply oracle confidence downgrade based on the heuristic link ratio from the matrix's `oracle_stats`.
39
39
  6. **Drift check (e39s03):** If `specs/drift-report.json` exists and has suspect links, mark verdict as CONCERNS with note: "Drift detected — some implementing files are newer than their specs. Run scripts/check-spec-drift.sh for details."
40
40
  7. Output verdict + rationale to stdout.
41
- 7. Update `specs/execution-status.yaml` with gate-trace result.
41
+ 8. **Adversarial refute check (e45s32):** Before emitting PASS, attempt to **refute** the verdict — list at least one concrete traceability gap that would block merge if it were real. If the gap is real, downgrade the verdict. Rubber-stamping is prohibited; every PASS must survive one refutation attempt.
42
+ 9. **Completeness critic (e45s05)** — Run adversarial gap-finding:
43
+
44
+ ```bash
45
+ bash scripts/lib/completeness-critic.sh
46
+ ```
47
+
48
+ Classify output as **BLOCKER / WARNING / FILLED**. **BLOCKER overrides any PASS verdict → FAIL.** Append critic summary to rationale.
49
+ 10. Update `specs/execution-status.yaml` with gate-trace result.
42
50
 
43
51
  ## Verdict Semantics
44
52
 
@@ -48,6 +48,20 @@ Full JSON examples, merge rules, Antigravity deny-list entries, and test command
48
48
 
49
49
  # Git guardrails — reference
50
50
 
51
+ ## Navigation
52
+
53
+ | Lines | Section |
54
+ |-------|---------|
55
+ | 1 | Title |
56
+ | 3–14 | Navigation |
57
+ | 16–24 | Secret patterns |
58
+ | 26–44 | Copy layout |
59
+ | 46–72 | Claude Code |
60
+ | 74–92 | Cursor and Cursor CLI |
61
+ | 94–120 | Gemini CLI |
62
+ | 122–135 | Google Antigravity |
63
+ | 137–178 | Verify (local tests) |
64
+
51
65
  ## Secret patterns (audit + pre-commit)
52
66
 
53
67
  Agents must not commit files containing:
@@ -240,6 +240,18 @@ These GSD artifacts are not migrated — they are execution records, not plannin
240
240
 
241
241
  # Migrate Spec — Reference
242
242
 
243
+ ## Navigation
244
+
245
+ | Lines | Section |
246
+ |-------|---------|
247
+ | 1 | Title |
248
+ | 3–22 | Navigation |
249
+ | 24–62 | spec-kit → bigpowers Mapping |
250
+ | 64–130 | BMAD → bigpowers Mapping |
251
+ | 132–154 | Learnings to Adopt |
252
+ | 156–350 | Output Formats + state.yaml template |
253
+ | 352–620 | Reference blocks 1–2 + extended mappings |
254
+
243
255
  # migrate-spec Reference — spec-kit, BMAD, Learnings
244
256
 
245
257
  Transformation rules for spec-kit and BMAD projects, plus learnings to adopt and output formats.
@@ -5,6 +5,8 @@ model: opus
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s29
9
+
8
10
  # Plan Work
9
11
 
10
12
  > **Spine position:** Step 3 — scope-work → slice-tasks → plan-work.
@@ -46,14 +48,45 @@ If this plan touches an existing module, run `assess-impact` first to understand
46
48
 
47
49
  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.
48
50
 
51
+ **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:
52
+
53
+ | Tag | When | Required content |
54
+ |-----|------|------------------|
55
+ | `ADDED` | New requirement | Full requirement text |
56
+ | `MODIFIED` | Changed behavior | **Before:** prior behavior · **After:** new behavior |
57
+ | `REMOVED` | Retired requirement | **Before:** what existed · **After:** (removed) + rationale |
58
+ | `RENAMED` | ID or title change only | **Before:** old ID/title · **After:** new ID/title |
59
+
60
+ Net-new stories (greenfield) use `ADDED` only. `MODIFIED`/`REMOVED`/`RENAMED` without before/after blocks fail the plan-work gate.
61
+
49
62
  4. **Verify step format** — Every step MUST follow: `N. <What to do> → verify: <runnable command>`. See [REFERENCE.md](REFERENCE.md) for good/bad examples.
50
63
 
64
+ 4a. **Cross-artifact consistency pass (HARD GATE — e45s04)** — Before handoff, run:
65
+
66
+ ```bash
67
+ bash scripts/lib/plan-consistency-check.sh specs/epics/<capsule>/
68
+ ```
69
+
70
+ Print CRITICAL / HIGH / MED findings. **CRITICAL or HIGH blocks code generation** — fix capsule artifacts first. MED requires explicit user acknowledgment.
71
+
72
+ 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.
73
+
51
74
  5. **Review with user** — Confirm step order, granularity, and that verify commands are runnable in this project.
52
75
 
76
+ ## Lifecycle Gates (e45s09)
77
+
78
+ | Gate | When | Pass condition |
79
+ |------|------|----------------|
80
+ | **Pre-Implementation** | Before `kickoff-branch` / first RED commit | Root-cause stated for bugs; `assess-impact` done for module changes; plan-consistency-check PASS |
81
+ | **Validation** | Story marked done | All tasks `status: passing`; verify evidence in `specs/verifications/` |
82
+ | **Reopen-don't-refile** | Regression on shipped story | Reopen existing story/bug — do not create duplicate capsule entries |
83
+
53
84
  After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
54
85
 
55
86
  ## Verify
56
87
 
88
+ → 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`
89
+
57
90
 
58
91
 
59
92
  ## Handoff
@@ -65,6 +98,17 @@ Writes: state.yaml handoff.next_skill = kickoff-branch
65
98
 
66
99
  # Plan Work — Reference
67
100
 
101
+ ## Navigation
102
+
103
+ | Lines | Section |
104
+ |-------|---------|
105
+ | 1 | Title |
106
+ | 3–14 | Navigation |
107
+ | 16–38 | Output file formats |
108
+ | 40–71 | Plan template |
109
+ | 73–91 | Verify step format rules |
110
+ | 93–131 | Sub-operations (risk, define-success, zoom-out, slopcheck, delta tags) |
111
+
68
112
  ## Output file formats
69
113
 
70
114
  ### Story spec: `specs/epics/<capsule>/eNNsYY-<slug>.md`
@@ -76,14 +120,14 @@ Populated countable-story-format with all 20 sections. Minimum maturity: 3 (Coun
76
120
  ```yaml
77
121
  story_id: e01s01
78
122
  title: Login
79
- status: todo
123
+ status: failing
80
124
  bcps: 3
81
125
  tasks:
82
126
  - id: 1
83
127
  description: "Add login form component tests"
84
128
  verify: "npm test -- login-form.test.tsx"
85
129
  risk: P1
86
- status: todo
130
+ status: failing # flip to passing only after verify exits 0 (e45s06)
87
131
  ```
88
132
 
89
133
  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.
@@ -154,6 +198,22 @@ Every task and story MUST be assigned a `risk:` level (P0, P1, P2, P3). When `sp
154
198
 
155
199
  `verify-work` scales its UAT depth based on this field.
156
200
 
201
+ ### Requirement delta tags (e45s29)
202
+
203
+ When modifying existing behavior in story spec § Requirements:
204
+
205
+ ```markdown
206
+ #### MODIFIED: User can reset password via email link
207
+ **Before:** Password reset required admin approval.
208
+ **After:** Self-service reset via signed email link (expires 1h).
209
+
210
+ #### REMOVED: Legacy OAuth1 login
211
+ **Before:** OAuth1 provider supported for enterprise SSO.
212
+ **After:** (removed) — provider deprecated; OAuth2 only.
213
+ ```
214
+
215
+ Tags: `ADDED`, `MODIFIED`, `REMOVED`, `RENAMED`. `MODIFIED`/`REMOVED`/`RENAMED` without before/after → plan-work gate FAIL.
216
+
157
217
  ### Define Success
158
218
 
159
219
  Before planning, convert task statements into observable "step → verify: <cmd>" pairs:
@@ -79,6 +79,17 @@ See [REFERENCE.md](REFERENCE.md)
79
79
 
80
80
  # Publish Package — Reference
81
81
 
82
+ ## Navigation
83
+
84
+ | Lines | Section |
85
+ |-------|---------|
86
+ | 1 | Title |
87
+ | 3–18 | Navigation |
88
+ | 20–28 | Options |
89
+ | 30–60 | Examples |
90
+ | 62–72 | Integration with release-branch |
91
+ | 74–252 | Reference blocks 1–8 |
92
+
82
93
  ## Options
83
94
 
84
95
  | Flag | Description |
@@ -54,6 +54,8 @@ If REVIEW.md is missing or stale → run `security-review` inline. Findings bloc
54
54
 
55
55
  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.
56
56
 
57
+ > **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.
58
+
57
59
  ### 3. Diff review
58
60
 
59
61
  - [ ] All commits intentional, no secrets, CONVENTIONS.md compliance
@@ -74,9 +76,26 @@ bash scripts/land-branch.sh <task-slug> "feat(scope): description"
74
76
 
75
77
  ### 6. Create PR (team-pr only)
76
78
 
77
- Create the pull request, then merge via `gh`:
79
+ Create the pull request with a **literal provenance marker** in the body so agent-generated PRs are identifiable and do not rot silently:
80
+
81
+ ```markdown
82
+ <!-- bigpowers-provenance: agent-generated -->
83
+ ```
84
+
85
+ Place the marker on its own line immediately after the `## Summary` heading. Then merge via `gh`:
78
86
 
79
87
  ```bash
88
+ gh pr create --title "..." --body "$(cat <<'EOF'
89
+ ## Summary
90
+ <!-- bigpowers-provenance: agent-generated -->
91
+
92
+ - ...
93
+
94
+ ## Test plan
95
+ - [ ] ...
96
+
97
+ EOF
98
+ )"
80
99
  gh pr merge --squash --delete-branch
81
100
  ```
82
101
 
@@ -92,55 +111,18 @@ mv specs/epics/eNN-slug specs/epics/archive/
92
111
 
93
112
  ### 7b. CI verification & agent lock release (e39s02)
94
113
 
95
- > **HARD GATE** — Do NOT declare success until CI completes. A push that fails CI is a regression, not a release.
96
-
97
- After push, run CI polling:
114
+ > **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).
98
115
 
99
116
  ```bash
100
117
  bash scripts/wait-for-ci.sh --timeout 600 --interval 30
101
118
  ```
102
119
 
103
- Then release the story lock:
104
-
105
- ```bash
106
- LOCK="specs/agent-locks.yaml"; STORY="<story-id>"
107
- [ -f "$LOCK" ] && python3 -c "
108
- import yaml
109
- d=yaml.safe_load(open('$LOCK'))
110
- if d:d['locks']=[l for l in d['locks'] if l.get('story_id')!='$STORY']
111
- yaml.dump(d,open('$LOCK','w'),default_flow_style=False)
112
- print(f'LOCK RELEASED: $STORY')
113
- "||echo "No lock for $STORY — idempotent"
114
- ```
115
-
116
- - [ ] CI workflow passes after push (wait-for-ci.sh exit 0)
117
- - [ ] `release.ci_verified: true` documented in state.yaml
118
- - On failure: `handoff.next_skill = fix-bug` with CI failure URL
119
-
120
- ### 8. Clean up worktree
121
-
122
- ```bash
123
- git worktree prune
124
- git worktree remove ../<branch-name> 2>/dev/null || true
125
- git branch -d <branch-name>
126
- ```
127
-
128
- ### 8a. Cycle-time recording
120
+ - [ ] CI passes; `release.ci_verified: true` in state.yaml
121
+ - On failure: `handoff.next_skill = fix-bug`
129
122
 
130
- After landing, record delivery metrics with the git-derived, additive script:
123
+ ### 8. Clean up & return
131
124
 
132
- ```bash
133
- bash scripts/record-cycle-time.sh append \
134
- --story <story_id> --bcps <bcps> \
135
- --range "$(git merge-base main HEAD)..HEAD" \
136
- --file specs/metrics/cycle-times.yaml
137
- ```
138
-
139
- ### 9. Return to main
140
-
141
- ```bash
142
- git checkout main && git status && pwd
143
- ```
125
+ Worktree prune, branch delete, `git checkout main`. Cycle-time: see [REFERENCE.md](REFERENCE.md#cycle-time).
144
126
 
145
127
  Report: "Branch released."
146
128
 
@@ -152,6 +134,20 @@ Report: "Branch released."
152
134
 
153
135
  # Release Branch — Reference
154
136
 
137
+ ## Navigation
138
+
139
+ | Lines | Section |
140
+ |-------|---------|
141
+ | 1–3 | Title |
142
+ | 5–16 | Navigation |
143
+ | 18–41 | PR body template |
144
+ | 43–54 | Worktree cleanup |
145
+ | 56–96 | Cycle-time recording |
146
+ | 98–119 | CI verification |
147
+ | 121–126 | Solo-local fallback |
148
+ | 128–134 | Handoff |
149
+ | 136–155 | Reference block 1 (manual squash) |
150
+
155
151
  # Release Branch — Reference
156
152
 
157
153
  ## PR body template (team-pr mode)
@@ -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`
@@ -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 |