bigpowers 2.73.9 → 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 (134) 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 +7 -0
  69. package/CLAUDE.md +59 -1
  70. package/CONVENTIONS.md +76 -0
  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/sync-context-engineering-ref.sh +19 -0
  87. package/scripts/references-manifest.yaml +19 -0
  88. package/scripts/run-benchmark.sh +6 -0
  89. package/scripts/sync-references.sh +25 -0
  90. package/scripts/validate-skill-catalog.sh +147 -0
  91. package/scripts/validate-skill-description.sh +70 -0
  92. package/skills/audit-code/SKILL.md +19 -13
  93. package/skills/change-request/SKILL.md +3 -1
  94. package/skills/compose-workflow/SKILL.md +15 -0
  95. package/skills/context7-mcp/SKILL.md +57 -0
  96. package/skills/craft-skill/SKILL.md +29 -0
  97. package/skills/deepen-architecture/SKILL.md +22 -0
  98. package/skills/delegate-task/SKILL.md +14 -0
  99. package/skills/deploy/SKILL.md +9 -0
  100. package/skills/develop-tdd/SKILL.md +18 -4
  101. package/skills/diagnose-stall/SKILL.md +56 -0
  102. package/skills/dispatch-agents/SKILL.md +51 -19
  103. package/skills/gate-trace/SKILL.md +11 -1
  104. package/skills/guard-git/REFERENCE.md +14 -0
  105. package/skills/migrate-spec/REFERENCE.md +12 -0
  106. package/skills/plan-work/REFERENCE.md +29 -2
  107. package/skills/plan-work/SKILL.md +38 -0
  108. package/skills/publish-package/REFERENCE.md +11 -0
  109. package/skills/release-branch/REFERENCE.md +14 -0
  110. package/skills/release-branch/SKILL.md +28 -43
  111. package/skills/request-review/SKILL.md +59 -17
  112. package/skills/run-benchmark/SKILL.md +4 -4
  113. package/skills/run-evals/REFERENCE.md +14 -4
  114. package/skills/run-evals/SKILL.md +13 -2
  115. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  116. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  117. package/skills/security-review/SKILL.md +45 -0
  118. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  119. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  120. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  121. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  122. package/skills/seed-conventions/REFERENCE.md +40 -0
  123. package/skills/seed-conventions/SKILL.md +22 -0
  124. package/skills/session-state/SKILL.md +5 -10
  125. package/skills/slice-tasks/SKILL.md +3 -0
  126. package/skills/smoke-test/REFERENCE.md +11 -0
  127. package/skills/stocktake-skills/SKILL.md +3 -1
  128. package/skills/validate-contracts/REFERENCE.md +12 -0
  129. package/skills/validate-fix/SKILL.md +3 -0
  130. package/skills/verify-work/REFERENCE.md +17 -0
  131. package/skills/verify-work/SKILL.md +18 -20
  132. package/skills/wire-ci/REFERENCE.md +11 -0
  133. package/skills/write-document/REFERENCE.md +10 -0
  134. package/skills-lock.json +32 -22
@@ -1,3 +1,5 @@
1
+ # story: e45s02
2
+ <!-- story: e45s12 -->
1
3
  ---
2
4
  name: craft-skill
3
5
  model: sonnet
@@ -9,6 +11,19 @@ description: Create new bigpowers skills with proper structure, progressive disc
9
11
 
10
12
  > **HARD GATE** — Do NOT name a skill without a two-word verb-noun pair. Do NOT merge a new skill without running `sync-skills.sh` — the generated `.cursor/rules/` and `.gemini/` artifacts must match the source SKILL.md.
11
13
 
14
+ ## CSO Description Discipline (e45s02)
15
+
16
+ The YAML `description` is the **Catalog Selection Object** — the only field agents see when picking a skill.
17
+
18
+ | Rule | Limit |
19
+ |------|-------|
20
+ | Max length | 1024 characters |
21
+ | Voice | Third person |
22
+ | Content | Capability + `Use when …` triggers only |
23
+ | Forbidden | Workflow steps, phase chains, numbered lists, `→ verify:`, HARD GATE prose |
24
+
25
+ Move process detail into the SKILL.md body or REFERENCE.md — never into `description`.
26
+
12
27
  ## Process
13
28
 
14
29
  1. **Gather requirements** — ask user about:
@@ -40,6 +55,12 @@ description: Create new bigpowers skills with proper structure, progressive disc
40
55
  - Anything missing or unclear?
41
56
  - Should any section be more/less detailed?
42
57
 
58
+ 6. **Completion-honesty gate (HARD GATE — e45s02)** — Before declaring done:
59
+ - Run `bash scripts/validate-skill-description.sh skills/<name>/SKILL.md` — must exit 0
60
+ - Run `bash scripts/sync-skills.sh` — must complete without error
61
+ - Run `bash scripts/run-skill-verify.sh <name>` if the skill defines a verify command
62
+ - Show terminal output for each — narration without evidence is rejected
63
+
43
64
  ## Naming Rules
44
65
 
45
66
  Every skill name must be a **two-word verb-noun pair**. See [REFERENCE.md](REFERENCE.md) for full rules, examples, and documented exceptions.
@@ -53,10 +74,18 @@ If the skill produces written output, it goes in `specs/` at the project root. D
53
74
  After drafting, verify:
54
75
 
55
76
  - [ ] Name is a two-word verb-noun pair (or follows grill-me exception)
77
+ - [ ] Description < 1024 chars, triggers only, no workflow-summary leakage
56
78
  - [ ] Description includes triggers ("Use when...")
57
79
  - [ ] SKILL.md under 100 lines
58
80
  - [ ] No time-sensitive info
59
81
  - [ ] Consistent terminology with CONVENTIONS.md
60
82
  - [ ] specs/ output documented if applicable
83
+ - [ ] `validate-skill-description.sh` exits 0
61
84
  - [ ] `sync-skills.sh` run to propagate to Cursor/Gemini
85
+ - [ ] `bash scripts/validate-skill-catalog.sh` passes for the new skill (HARD GATE — completion honesty)
86
+
87
+ > **HARD GATE** — Do NOT declare the skill done until `bash scripts/validate-skill-catalog.sh --strict --skill <name>` exits 0. Validator enforces verb-noun name, HARD GATE block, description ≤1024 chars, and `→ verify:` command.
88
+
89
+ ## Verify
62
90
 
91
+ → verify: `bash scripts/validate-skill-catalog.sh --strict --skill craft-skill && bash scripts/validate-skill-description.sh skills/craft-skill/SKILL.md && echo OK || echo FAIL`
@@ -1,3 +1,5 @@
1
+ # story: e45s31
2
+ <!-- story: e45s14 -->
1
3
  ---
2
4
  name: deepen-architecture
3
5
  model: sonnet
@@ -45,6 +47,12 @@ Read existing documentation first:
45
47
 
46
48
  If any of these files don't exist, proceed silently — don't flag their absence or suggest creating them upfront.
47
49
 
50
+ **Look-here-first (churn heuristic):** Before organic exploration, rank candidate modules by recent commit frequency. High-churn files are architectural friction magnets — start there.
51
+
52
+ ```bash
53
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 20
54
+ ```
55
+
48
56
  Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
49
57
 
50
58
  - Where does understanding one concept require bouncing between many small modules?
@@ -93,3 +101,17 @@ Side effects happen inline as decisions crystallize:
93
101
  - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer. See [ADR-FORMAT.md](../model-domain/ADR-FORMAT.md).
94
102
  - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
95
103
 
104
+ ### 5. Import-boundary hygiene (e45s14)
105
+
106
+ When a deepening move **splits or merges modules**, update `specs/import-boundaries.json` (Playwright `DEPS.list` pattern) — declare which `scripts/lib/*.sh` files may `source` which peers. CI enforces via:
107
+
108
+ ```bash
109
+ bash scripts/check-import-boundaries.sh
110
+ ```
111
+
112
+ Run the check before proposing cross-module `source` edges. Convention docs alone do not authorize new imports; the allowlist must list them.
113
+
114
+ ## Verify
115
+
116
+ → verify: `test -f specs/import-boundaries.json && bash scripts/check-import-boundaries.sh && echo OK || echo FAIL`
117
+
@@ -5,6 +5,8 @@ effort: standard
5
5
  description: Delegate one complex task to a single subagent, review its work in two stages before merging back. Sequential — one agent at a time, with oversight. Use when a task is complex and requires careful review before the result is accepted. Distinct from dispatch-agents (no parallelism here; reviewer sees full diff before proceeding).
6
6
  ---
7
7
 
8
+ # story: e45s30
9
+
8
10
  # Delegate Task
9
11
  > **HARD GATE** — **HARD GATE** — Delegated work must have clear success criteria and verification commands. The delegate must be able to verify completion independently.
10
12
 
@@ -13,6 +15,18 @@ Delegate a single complex task to a subagent with a two-stage review gate before
13
15
 
14
16
  **Distinct from `dispatch-agents`:** This skill runs one subagent sequentially with a mandatory review. `dispatch-agents` runs multiple subagents in parallel without inter-task review gates.
15
17
 
18
+ ## Subagent depth tiers (e45s30)
19
+
20
+ Select brief depth from task `risk:` and skill `effort:` before spawning:
21
+
22
+ | Tier | When | Brief includes |
23
+ |------|------|----------------|
24
+ | `full_maturity` | P0 stories, multi-file refactors, security work | Full template + CONVENTIONS excerpts + threat model if present |
25
+ | `standard` | Default implementation tasks | Goal, scope, out-of-bounds, constraints, verify, prior decisions |
26
+ | `minimal_decisive` | Light probes, read-only audits | Goal, verify, explicit file list (≤15 lines total) |
27
+
28
+ State `depth: <tier>` in the Agent tool description field.
29
+
16
30
  ## Process
17
31
 
18
32
  ### 1. Define the task
@@ -1,3 +1,4 @@
1
+ <!-- story: e45s15 -->
1
2
  ---
2
3
  name: deploy
3
4
  description: "Build → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production."
@@ -105,3 +106,11 @@ For comprehensive health-checking, chain to the `smoke-test` skill:
105
106
  bash scripts/run-smoke.sh "$DEPLOY_URL"
106
107
  ```
107
108
 
109
+ ### 7. Three-independent-facts verification (e45s15)
110
+
111
+ Before declaring deploy success, verify **three independent facts** — build artifact, platform accept, live/registry reachability. See [REFERENCE.md](REFERENCE.md#three-independent-facts).
112
+
113
+ ## Verify
114
+
115
+ → verify: `command -v curl >/dev/null 2>&1 && grep -qi 'three-independent-facts' skills/deploy/SKILL.md && echo OK || echo FAIL`
116
+
@@ -1,4 +1,7 @@
1
1
  # story: e51s04
2
+ # story: e45s06
3
+ # story: e45s08
4
+ # story: e45s34
2
5
  ---
3
6
  name: develop-tdd
4
7
  model: sonnet
@@ -52,16 +55,27 @@ Apply the **enforce-first** F.I.R.S.T rubric: Fast, Independent, Repeatable, Sel
52
55
  Write ONE test that confirms ONE thing about the system:
53
56
 
54
57
  ```
55
- RED: Write test for first behavior → test fails → commit: test(<scope>): ...
56
- GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ...
58
+ RED: Write test for first behavior → test fails → commit: test(<scope>): ... (test-only; red in CI)
59
+ GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ... (fix commit; green)
57
60
  REFACTOR (optional): clean up → commit: refactor(<scope>): ...
58
61
  ```
59
62
 
63
+ > **Two-commit red/green policy (HARD GATE — e45s08)** — Each behavior cycle requires **two separate commits**: (1) test-only commit that fails in CI (RED), then (2) implementation commit that makes it pass (GREEN). Never combine test + fix in one commit. Show `git log -2 --oneline` as evidence before proceeding to the next behavior.
64
+
65
+ > **tasks.yaml ledger (e45s06)** — After each task's `verify:` exits 0, update `eNNsYY-tasks.yaml`: set that task's `status: passing`. Story-level `status: passing` only when all tasks pass.
66
+
60
67
  ### 3. Incremental Loop
61
68
 
62
- > **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Emit a placeholder comment rather than going silent.
69
+ > **Snapshot-before-transition (e45s34):** Before each RED → GREEN or GREEN → REFACTOR transition, create a checkpoint so a failed transition can be rolled back cleanly:
70
+
71
+ ```bash
72
+ bash scripts/bp-yaml-snapshot.sh specs/state.yaml # if state changed this cycle
73
+ git stash push -m "tdd-checkpoint-$(git rev-parse --short HEAD)-red" --keep-index 2>/dev/null || true
74
+ ```
75
+
76
+ After GREEN passes and is committed, drop the stash (`git stash drop` if empty). Never refactor while RED.
63
77
 
64
- For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. Commit after every GREEN phase.
78
+ For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. **Two commits per behavior** (test-only RED, then fix GREEN). Commit after every GREEN phase.
65
79
 
66
80
  ### 4. Visual Slices (UI alternate workflow)
67
81
 
@@ -0,0 +1,56 @@
1
+ # story: e45s38
2
+ ---
3
+ name: diagnose-stall
4
+ model: haiku
5
+ effort: light
6
+ description: Diagnose why agent orchestration stopped producing progress — silent stalls in /loop, dispatch-agents, or execute-plan. Use when work appears hung, no output for several minutes, or a subagent never returned.
7
+ ---
8
+
9
+ # Diagnose Stall
10
+
11
+ > **HARD GATE** — Do NOT restart work blindly. Run this diagnostic first when orchestration goes quiet without an explicit terminal state.
12
+
13
+ Explicit handler for silent stalls in long-running agent workflows (`/loop`, `dispatch-agents`, `execute-plan`, `build-epic` resume mode).
14
+
15
+ ## Stall signals
16
+
17
+ | Signal | Likely cause |
18
+ |--------|----------------|
19
+ | No stdout for >5 min on a monitored loop tick | Sleep/watcher misconfigured or prompt never re-armed |
20
+ | Subagent dispatched but no completion message | Agent hung, blocked on approval, or scope too large |
21
+ | `dispatch-agents` cycle 3 reached with gaps | Circuit exhausted — needs human escalation |
22
+ | Verify command running >15 min | Missing timeout or waiting on external service |
23
+ | `handoff.next_skill` unchanged across turns | Prior skill never wrote handoff |
24
+
25
+ ## Process
26
+
27
+ 1. **Read state** — `specs/state.yaml`: `handoff.next_skill`, `active_flow`, `metrics.story_start`, open decisions.
28
+ 2. **Check locks** — `bash scripts/check-stale-locks.sh` if present; read `specs/agent-locks.yaml`.
29
+ 3. **Inspect terminals** — list background shells; note PIDs, last output timestamp, exit codes.
30
+ 4. **Classify stall type:**
31
+ - **waiting_approval** — tool blocked on user consent
32
+ - **blocked_dependency** — prior task incomplete or red gate
33
+ - **agent_exhausted** — max iterations/cycles reached
34
+ - **misconfigured_loop** — duplicate sentinel, wrong regex, or sleeper not re-armed
35
+ - **external_io** — network, CI, or deploy wait without timeout
36
+ - **unknown** — escalate with evidence bundle
37
+ 5. **Recommend recovery** — one action only (resume, kill PID, re-dispatch with smaller brief, escalate to user).
38
+ 6. **Write report** — `specs/verifications/STALL-<timestamp>.md` with classification, evidence, and recommended next skill.
39
+
40
+ ## Integration
41
+
42
+ | Caller | When to invoke |
43
+ |--------|----------------|
44
+ | `/loop` (Cursor) | After two consecutive ticks with no observable progress |
45
+ | `dispatch-agents` | When a wave exceeds expected duration with zero returns |
46
+ | `execute-plan` | When a step checkpoint is overdue |
47
+ | User | "Why did this stop?" / "Nothing is happening" |
48
+
49
+ ## Verify
50
+
51
+ → verify: `test -f specs/state.yaml && echo "OK: diagnose-stall can read session state" || echo "WARN: no state.yaml — diagnostic limited"`
52
+
53
+ ## Handoff
54
+
55
+ Gate: READY → next: survey-context (if state unclear) or resume prior skill from `state.yaml`
56
+ Writes: `specs/verifications/STALL-*.md`
@@ -1,3 +1,5 @@
1
+ # story: e45s38
2
+ <!-- story: e45s11 -->
1
3
  ---
2
4
  name: dispatch-agents
3
5
  model: sonnet
@@ -5,6 +7,8 @@ effort: standard
5
7
  description: Dispatch multiple subagents in parallel on independent tasks. No waiting between them — all run concurrently. Use when tasks are truly decoupled and speed matters. Distinct from delegate-task (concurrent here, no inter-task review gate).
6
8
  ---
7
9
 
10
+ # story: e45s30
11
+
8
12
  # Dispatch Agents
9
13
  > **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
14
 
@@ -36,30 +40,57 @@ Before dispatching, verify each task pair is truly independent:
36
40
 
37
41
  If any two tasks conflict, sequence them with `delegate-task` or `execute-plan` instead.
38
42
 
39
- ### 2. Write task briefs
43
+ ## Subagent depth tiers (e45s30)
40
44
 
41
- Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
45
+ Map `effort:` frontmatter and story `risk:` to prompt depth — do not send `minimal_decisive` agents a `full_maturity` brief.
42
46
 
43
- For each task, use this minimal template (each agent starts cold — brief size directly controls token cost and hallucination risk):
47
+ | Tier | When | Brief shape | Token budget |
48
+ |------|------|-------------|----------------|
49
+ | `full_maturity` | `effort: heavy`, `risk: P0`, security-sensitive diffs | Full `task_brief` + CONVENTIONS excerpts + threat model if present | Full envelope |
50
+ | `standard` | `effort: standard`, `risk: P1`–`P2` | Standard `task_brief` fields below | Default |
51
+ | `minimal_decisive` | `effort: light`, `risk: P3`, read-only exploration | `goal` + `verify` + `in_scope` only | ≤15 lines |
44
52
 
53
+ Record `depth: <tier>` in the Agent tool description when dispatching.
54
+
55
+ ### 2. Write typed task briefs (Orca message protocol)
56
+
57
+ Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
58
+
59
+ Every inter-agent message uses a **typed envelope** — no freeform prose between waves:
60
+
61
+ | `type` | When | Required fields |
62
+ |--------|------|-----------------|
63
+ | `task_brief` | Dispatch | `task_id`, `goal`, `in_scope`, `out_of_bounds`, `verify`, `prior_decisions` |
64
+ | `checkpoint` | Mid-wave progress | `task_id`, `status` (`running`\|`blocked`), `comment` (one line) |
65
+ | `result` | Agent return | `task_id`, `exit` (`pass`\|`fail`), `summary`, `verify_output` |
66
+ | `circuit_open` | 3 consecutive failures | `task_id`, `failures` (3), `escalate_to` (`user`) |
67
+
68
+ Example `task_brief` (each agent starts cold — brief size directly controls token cost and hallucination risk):
69
+
70
+ ```yaml
71
+ type: task_brief
72
+ task_id: agent-1
73
+ goal: [one sentence — what success looks like]
74
+ in_scope: [explicit file or module list]
75
+ out_of_bounds: [what NOT to touch]
76
+ verify: [runnable command]
77
+ prior_decisions: [relevant entries from specs/state.yaml — omit if none]
45
78
  ```
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
- ```
79
+
80
+ Emit **`checkpoint`** comments when an agent is slow or blocked — one line, no stack traces. Parent reads checkpoints before spawning follow-ups.
52
81
 
53
82
  Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.
54
83
 
55
- ### 3. Iterative retrieval (max 3 cycles)
84
+ ### 3. Circuit breaker + iterative retrieval (max 3 cycles)
85
+
86
+ 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
87
 
57
88
  After each wave completes:
58
- 1. **Dispatch** — run parallel agents with briefs.
59
- 2. **Evaluate** — read outputs; list gaps vs goal.
89
+ 1. **Dispatch** — run parallel agents with typed `task_brief` envelopes.
90
+ 2. **Evaluate** — read `result` messages; list gaps vs goal; honor open circuits.
60
91
  3. **Refine** — tighten briefs or spawn follow-up agents (max **3 cycles** total).
61
92
 
62
- Stop when gaps empty or cycle 3 reached — escalate to user.
93
+ 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
94
 
64
95
  ### 4. Dispatch in parallel
65
96
 
@@ -73,14 +104,15 @@ Agent 3: brief for task C
73
104
 
74
105
  ### 5. Collect and review results
75
106
 
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
107
+ When all agents return: review each result, run verify commands, check diffs for scope violations.
80
108
 
81
109
  ### 6. Integrate
82
110
 
83
- Merge accepted results. If any agent's result conflicts with another, resolve manually and note the conflict.
111
+ Merge accepted results. Resolve conflicts manually; note in summary.
112
+
113
+ Report: which tasks succeeded, which need revision, overall verify status.
114
+
115
+ ## Verify
84
116
 
85
- Report a summary: which tasks succeeded, which need revision, and overall verify status.
117
+ → verify: `grep -q 'circuit_open' skills/dispatch-agents/SKILL.md && grep -q 'task_brief' skills/dispatch-agents/SKILL.md && echo OK || echo FAIL`
86
118
 
@@ -1,7 +1,9 @@
1
+ # story: e45s05
1
2
  ---
2
3
  name: gate-trace
3
4
  description: "Deterministic traceability quality gate — reads coverage matrix + blind-spot data, applies decision rules with oracle confidence downgrade, emits PASS/CONCERNS/FAIL/WAIVED verdict. Use before release-branch to gate merges on traceability."
4
5
  # story: e38s06
6
+ # story: e45s32
5
7
  model: haiku
6
8
  effort: light
7
9
  ---
@@ -39,7 +41,15 @@ TEA-inspired: if trace links rely on heuristics rather than explicit tags, confi
39
41
  5. Apply oracle confidence downgrade based on the heuristic link ratio from the matrix's `oracle_stats`.
40
42
  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."
41
43
  7. Output verdict + rationale to stdout.
42
- 7. Update `specs/execution-status.yaml` with gate-trace result.
44
+ 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.
45
+ 9. **Completeness critic (e45s05)** — Run adversarial gap-finding:
46
+
47
+ ```bash
48
+ bash scripts/lib/completeness-critic.sh
49
+ ```
50
+
51
+ Classify output as **BLOCKER / WARNING / FILLED**. **BLOCKER overrides any PASS verdict → FAIL.** Append critic summary to rationale.
52
+ 10. Update `specs/execution-status.yaml` with gate-trace result.
43
53
 
44
54
  ## Verdict Semantics
45
55
 
@@ -1,5 +1,19 @@
1
1
  # Git guardrails — reference
2
2
 
3
+ ## Navigation
4
+
5
+ | Lines | Section |
6
+ |-------|---------|
7
+ | 1 | Title |
8
+ | 3–14 | Navigation |
9
+ | 16–24 | Secret patterns |
10
+ | 26–44 | Copy layout |
11
+ | 46–72 | Claude Code |
12
+ | 74–92 | Cursor and Cursor CLI |
13
+ | 94–120 | Gemini CLI |
14
+ | 122–135 | Google Antigravity |
15
+ | 137–178 | Verify (local tests) |
16
+
3
17
  ## Secret patterns (audit + pre-commit)
4
18
 
5
19
  Agents must not commit files containing:
@@ -1,5 +1,17 @@
1
1
  # Migrate Spec — Reference
2
2
 
3
+ ## Navigation
4
+
5
+ | Lines | Section |
6
+ |-------|---------|
7
+ | 1 | Title |
8
+ | 3–22 | Navigation |
9
+ | 24–62 | spec-kit → bigpowers Mapping |
10
+ | 64–130 | BMAD → bigpowers Mapping |
11
+ | 132–154 | Learnings to Adopt |
12
+ | 156–350 | Output Formats + state.yaml template |
13
+ | 352–620 | Reference blocks 1–2 + extended mappings |
14
+
3
15
  # migrate-spec Reference — spec-kit, BMAD, Learnings
4
16
 
5
17
  Transformation rules for spec-kit and BMAD projects, plus learnings to adopt and output formats.
@@ -1,5 +1,16 @@
1
1
  # Plan Work — Reference
2
2
 
3
+ ## Navigation
4
+
5
+ | Lines | Section |
6
+ |-------|---------|
7
+ | 1 | Title |
8
+ | 3–14 | Navigation |
9
+ | 16–38 | Output file formats |
10
+ | 40–71 | Plan template |
11
+ | 73–91 | Verify step format rules |
12
+ | 93–131 | Sub-operations (risk, define-success, zoom-out, slopcheck, delta tags) |
13
+
3
14
  ## Output file formats
4
15
 
5
16
  ### Story spec: `specs/epics/<capsule>/eNNsYY-<slug>.md`
@@ -11,14 +22,14 @@ Populated countable-story-format with all 20 sections. Minimum maturity: 3 (Coun
11
22
  ```yaml
12
23
  story_id: e01s01
13
24
  title: Login
14
- status: todo
25
+ status: failing
15
26
  bcps: 3
16
27
  tasks:
17
28
  - id: 1
18
29
  description: "Add login form component tests"
19
30
  verify: "npm test -- login-form.test.tsx"
20
31
  risk: P1
21
- status: todo
32
+ status: failing # flip to passing only after verify exits 0 (e45s06)
22
33
  ```
23
34
 
24
35
  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.
@@ -89,6 +100,22 @@ Every task and story MUST be assigned a `risk:` level (P0, P1, P2, P3). When `sp
89
100
 
90
101
  `verify-work` scales its UAT depth based on this field.
91
102
 
103
+ ### Requirement delta tags (e45s29)
104
+
105
+ When modifying existing behavior in story spec § Requirements:
106
+
107
+ ```markdown
108
+ #### MODIFIED: User can reset password via email link
109
+ **Before:** Password reset required admin approval.
110
+ **After:** Self-service reset via signed email link (expires 1h).
111
+
112
+ #### REMOVED: Legacy OAuth1 login
113
+ **Before:** OAuth1 provider supported for enterprise SSO.
114
+ **After:** (removed) — provider deprecated; OAuth2 only.
115
+ ```
116
+
117
+ Tags: `ADDED`, `MODIFIED`, `REMOVED`, `RENAMED`. `MODIFIED`/`REMOVED`/`RENAMED` without before/after → plan-work gate FAIL.
118
+
92
119
  ### Define Success
93
120
 
94
121
  Before planning, convert task statements into observable "step → verify: <cmd>" pairs:
@@ -1,3 +1,8 @@
1
+ # story: e45s04
2
+ # story: e45s06
3
+ # story: e45s09
4
+ # story: e45s33
5
+ # story: e45s35
1
6
  ---
2
7
  name: plan-work
3
8
  model: opus
@@ -5,6 +10,8 @@ effort: standard
5
10
  description: "PLANNING SPINE STEP 3 of 3 — Plan the work: write detailed implementation tasks into the active epic capsule (specs/epics/eNN-slug/). Produces countable-story-format .md specs and runnable -tasks.yaml files. Use after slice-tasks (step 2). Not a substitute for scope-work (step 1) or slice-tasks (step 2)."
6
11
  ---
7
12
 
13
+ # story: e45s29
14
+
8
15
  # Plan Work
9
16
 
10
17
  > **Spine position:** Step 3 — scope-work → slice-tasks → plan-work.
@@ -46,14 +53,45 @@ If this plan touches an existing module, run `assess-impact` first to understand
46
53
 
47
54
  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
55
 
56
+ **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:
57
+
58
+ | Tag | When | Required content |
59
+ |-----|------|------------------|
60
+ | `ADDED` | New requirement | Full requirement text |
61
+ | `MODIFIED` | Changed behavior | **Before:** prior behavior · **After:** new behavior |
62
+ | `REMOVED` | Retired requirement | **Before:** what existed · **After:** (removed) + rationale |
63
+ | `RENAMED` | ID or title change only | **Before:** old ID/title · **After:** new ID/title |
64
+
65
+ Net-new stories (greenfield) use `ADDED` only. `MODIFIED`/`REMOVED`/`RENAMED` without before/after blocks fail the plan-work gate.
66
+
49
67
  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
68
 
69
+ 4a. **Cross-artifact consistency pass (HARD GATE — e45s04)** — Before handoff, run:
70
+
71
+ ```bash
72
+ bash scripts/lib/plan-consistency-check.sh specs/epics/<capsule>/
73
+ ```
74
+
75
+ Print CRITICAL / HIGH / MED findings. **CRITICAL or HIGH blocks code generation** — fix capsule artifacts first. MED requires explicit user acknowledgment.
76
+
77
+ 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.
78
+
51
79
  5. **Review with user** — Confirm step order, granularity, and that verify commands are runnable in this project.
52
80
 
81
+ ## Lifecycle Gates (e45s09)
82
+
83
+ | Gate | When | Pass condition |
84
+ |------|------|----------------|
85
+ | **Pre-Implementation** | Before `kickoff-branch` / first RED commit | Root-cause stated for bugs; `assess-impact` done for module changes; plan-consistency-check PASS |
86
+ | **Validation** | Story marked done | All tasks `status: passing`; verify evidence in `specs/verifications/` |
87
+ | **Reopen-don't-refile** | Regression on shipped story | Reopen existing story/bug — do not create duplicate capsule entries |
88
+
53
89
  After writing capsule tasks, suggest `kickoff-branch` (if not already on a feature branch) then `build-epic`, `execute-plan`, or `develop-tdd`.
54
90
 
55
91
  ## Verify
56
92
 
93
+ → 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`
94
+
57
95
 
58
96
 
59
97
  ## Handoff
@@ -1,5 +1,16 @@
1
1
  # Publish Package — Reference
2
2
 
3
+ ## Navigation
4
+
5
+ | Lines | Section |
6
+ |-------|---------|
7
+ | 1 | Title |
8
+ | 3–18 | Navigation |
9
+ | 20–28 | Options |
10
+ | 30–60 | Examples |
11
+ | 62–72 | Integration with release-branch |
12
+ | 74–252 | Reference blocks 1–8 |
13
+
3
14
  ## Options
4
15
 
5
16
  | Flag | Description |
@@ -1,5 +1,19 @@
1
1
  # Release Branch — Reference
2
2
 
3
+ ## Navigation
4
+
5
+ | Lines | Section |
6
+ |-------|---------|
7
+ | 1–3 | Title |
8
+ | 5–16 | Navigation |
9
+ | 18–41 | PR body template |
10
+ | 43–54 | Worktree cleanup |
11
+ | 56–96 | Cycle-time recording |
12
+ | 98–119 | CI verification |
13
+ | 121–126 | Solo-local fallback |
14
+ | 128–134 | Handoff |
15
+ | 136–155 | Reference block 1 (manual squash) |
16
+
3
17
  # Release Branch — Reference
4
18
 
5
19
  ## PR body template (team-pr mode)