bigpowers 2.25.0 → 2.27.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 (45) hide show
  1. package/.pi/package.json +2 -2
  2. package/.pi/prompts/build-epic.md +22 -0
  3. package/.pi/prompts/compose-workflow.md +9 -7
  4. package/.pi/prompts/develop-tdd.md +20 -0
  5. package/.pi/prompts/elaborate-spec.md +20 -1
  6. package/.pi/prompts/evolve-skill.md +14 -7
  7. package/.pi/prompts/kickoff-branch.md +26 -1
  8. package/.pi/prompts/quick-fix.md +2 -0
  9. package/.pi/prompts/run-benchmark.md +69 -0
  10. package/.pi/prompts/run-planning.md +19 -0
  11. package/.pi/prompts/scope-work.md +6 -0
  12. package/.pi/prompts/slice-tasks.md +6 -0
  13. package/.pi/prompts/stocktake-skills.md +3 -1
  14. package/.pi/prompts/verify-work.md +30 -0
  15. package/.pi/skills/build-epic/SKILL.md +22 -0
  16. package/.pi/skills/compose-workflow/SKILL.md +9 -7
  17. package/.pi/skills/develop-tdd/SKILL.md +20 -0
  18. package/.pi/skills/elaborate-spec/SKILL.md +20 -1
  19. package/.pi/skills/evolve-skill/SKILL.md +14 -7
  20. package/.pi/skills/kickoff-branch/SKILL.md +26 -1
  21. package/.pi/skills/quick-fix/SKILL.md +2 -0
  22. package/.pi/skills/run-benchmark/SKILL.md +71 -0
  23. package/.pi/skills/run-planning/SKILL.md +19 -0
  24. package/.pi/skills/scope-work/SKILL.md +6 -0
  25. package/.pi/skills/slice-tasks/SKILL.md +6 -0
  26. package/.pi/skills/stocktake-skills/SKILL.md +3 -1
  27. package/.pi/skills/verify-work/SKILL.md +30 -0
  28. package/CHANGELOG.md +25 -0
  29. package/SKILL-INDEX.md +2 -2
  30. package/build-epic/SKILL.md +22 -0
  31. package/compose-workflow/SKILL.md +9 -7
  32. package/develop-tdd/SKILL.md +20 -0
  33. package/elaborate-spec/SKILL.md +20 -1
  34. package/evolve-skill/SKILL.md +14 -7
  35. package/kickoff-branch/SKILL.md +26 -1
  36. package/package.json +1 -1
  37. package/quick-fix/SKILL.md +2 -0
  38. package/run-benchmark/SKILL.md +70 -0
  39. package/run-planning/SKILL.md +19 -0
  40. package/scope-work/SKILL.md +6 -0
  41. package/scripts/run-skill-verify.sh +57 -0
  42. package/skills-lock.json +17 -12
  43. package/slice-tasks/SKILL.md +6 -0
  44. package/stocktake-skills/SKILL.md +3 -1
  45. package/verify-work/SKILL.md +30 -0
package/.pi/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.25.0",
4
- "description": "68 skills — 61 agent skills for spec-driven, test-first software development by solo developers",
3
+ "version": "2.27.0",
4
+ "description": "69 skills — 61 agent skills for spec-driven, test-first software development by solo developers",
5
5
  "keywords": [
6
6
  "pi-package"
7
7
  ],
@@ -46,6 +46,28 @@ After step 5 (verify-work) completes successfully, step 6 runs `audit-code` auto
46
46
  4. **Audit artifact:** Full audit report saved to `specs/verifications/AUDIT-<epic>-<story>.md` regardless of pass/fail, for reviewer traceability.
47
47
  5. **Enforce F.I.R.S.T:** After audit-code passes, run `enforce-first --quick` on new/modified tests. Append F.I.R.S.T violations (if any) to the audit report. Failing F.I.R.S.T criteria trigger the same loop-back to step 4.
48
48
 
49
+ ## --fast mode
50
+
51
+ Coalesces read-and-report steps to reduce token overhead. Activate with `build-epic --fast`.
52
+
53
+ | Normal | --fast | Change |
54
+ |--------|--------|--------|
55
+ | Step 1 (survey-context) | 1+2 together | survey + plan in one invocation |
56
+ | Step 2 (plan-work) | (absorbed into 1) | — |
57
+ | Step 3 (kickoff-branch) | Step 2 | unchanged, sequential |
58
+ | Step 4 (develop-tdd) | Step 3 | unchanged, sequential |
59
+ | Step 5 (verify-work) | Step 4 | unchanged, sequential |
60
+ | Step 6 (audit-code) | 5+6 together | audit + commit-message in one invocation |
61
+ | Step 7 (commit-message) | (absorbed into 6) | — |
62
+ | Step 8 (release-branch) | Step 7 | unchanged, sequential |
63
+
64
+ **Total invocations:** 8 → 6 per story.
65
+
66
+ **Rules:**
67
+ - Steps 3/4/5/8 (kickoff, develop, verify, release) still run sequentially — they require user interaction or branch state.
68
+ - `--fast` does NOT skip any checklist items; it only coalesces steps that are pure read-and-report.
69
+ - Record `epic_cycle.fast_mode: true` in `state.yaml` when this flag is active.
70
+
49
71
  ## Handoff
50
72
 
51
73
  Write `handoff.next_skill` and `handoff.context` in `state.yaml` when pausing mid-epic.
@@ -10,13 +10,15 @@ description: Chain multiple bigpowers skills into a custom workflow recipe saved
10
10
  ## Process
11
11
 
12
12
  1. Interview: goal, phases, which skills, gates between steps.
13
- 2. Write `specs/WORKFLOW-<name>.md`:
14
- - Trigger ("Use when...")
15
- - Ordered steps: `skill artefact → verify`
16
- - HARD GATEs between phases
13
+ 2. Write `specs/workflows/<name>.yaml`:
14
+ - `name`, `command`, `description`, `skills[]`, `verify`
15
+ - Optional: `args` for skill-specific arguments
17
16
  3. Register in state.yaml Active Decisions.
18
17
  4. Optional: reference from `orchestrate-project` Ad-Hoc mode.
19
18
 
19
+ > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
20
+ > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
21
+
20
22
  ## Standard Recipe Library
21
23
 
22
24
  Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
@@ -24,13 +26,13 @@ Reference them in AGENTS.md so `/command` directly invokes the matching recipe.
24
26
 
25
27
  | Command | Workflow | Skill chain |
26
28
  |---------|----------|-------------|
27
- | `/check-stack` | check-stack | survey-context → assess-impact → verify-work |
29
+ | `/check-stack` | check-stack | survey-context → assess-impact → setup-environment |
28
30
  | `/ship` | ship | audit-code → commit-message → release-branch |
29
31
  | `/tdd` | tdd | develop-tdd → enforce-first |
30
32
  | `/code-review` | code-review | audit-code → request-review → respond-review |
31
- | `/security` | security | audit-code (security focus) → request-review |
33
+ | `/security` | security | audit-code → request-review |
32
34
  | `/plan` | plan | survey-context → research-first → plan-work |
33
- | `/build-fix` | build-fix | investigate-bug → diagnose-root → quick-fix → validate-fix |
35
+ | `/build-fix` | build-fix | investigate-bug → diagnose-root → develop-tdd → validate-fix |
34
36
  | `/e2e` | e2e | smoke-test → verify-work |
35
37
 
36
38
  Add to `AGENTS.md`:
@@ -148,6 +148,26 @@ Once all tests pass: locate the Verification Script in the active epic capsule,
148
148
  [ ] verify: command passes
149
149
  ```
150
150
 
151
+ ## --config mode
152
+
153
+ For pure-config tasks (update package.json, edit YAML, tweak manifest) where there is no test infrastructure to write against. The RED state is "verify command fails"; GREEN is "verify command passes."
154
+
155
+ **When to use:** task has a runnable `verify:` command and the deliverable is a config file change with no new behavior to unit-test. Invoke as `develop-tdd --config`.
156
+
157
+ **Cycle:**
158
+
159
+ ```
160
+ RED: Run verify command → it fails (expected)
161
+ GREEN: Apply config change → verify passes
162
+ COMMIT: commit: chore(<scope>): <change>
163
+ ```
164
+
165
+ **Rules:**
166
+ - Skips test-writing phase entirely — do NOT write a test file for config tasks.
167
+ - `verify:` command is **required** and must be runnable (no placeholder).
168
+ - Commit message follows Conventional Commits (`chore:` or `feat:` as appropriate).
169
+ - Still runs full `verify-work` after all tasks complete.
170
+
151
171
  ## Handoff
152
172
 
153
173
  Gate: READY -> next: verify-work
@@ -71,7 +71,26 @@ Summarize your understanding in 3–5 bullet points aligned with [countable-stor
71
71
 
72
72
  Ask: "Is this an accurate summary? Anything missing or wrong?"
73
73
 
74
- ### 5. Suggest next skill
74
+ ### 5. Write specs/planning-context.yaml
75
+
76
+ After the user confirms the summary in step 4, persist the key decisions:
77
+
78
+ ```yaml
79
+ # specs/planning-context.yaml — written by elaborate-spec; consumed by scope-work and slice-tasks
80
+ feature_name: "<from step 1>"
81
+ problem_statement: "<one paragraph>"
82
+ constraints:
83
+ - "<constraint 1>"
84
+ out_of_scope:
85
+ - "<excluded item 1>"
86
+ key_decisions:
87
+ - decision: "<what was decided>"
88
+ rationale: "<why>"
89
+ ```
90
+
91
+ If `specs/planning-context.yaml` already exists, ask: `"Planning context from a prior session exists. Update it? [Y/n]"`. Overwrite on Y; leave unchanged on N.
92
+
93
+ ### 6. Suggest next skill
75
94
 
76
95
  Once the spec is clear, recommend the next step:
77
96
  - If domain model needs work → `model-domain`
@@ -9,16 +9,23 @@ description: Benchmark-gated skill evolution — consume bigpowers-benchmark rep
9
9
 
10
10
  ## Loop
11
11
 
12
- 1. Run `bigpowers-benchmark` (external repo); save report path in state.yaml.
13
- 2. Identify target skill + measurable gap from report.
14
- 3. `plan-work`minimal change proposal with verify commands.
15
- 4. Edit via `craft-skill` / direct SKILL.md edit; run `sync-skills.sh`.
16
- 5. Re-run benchmark; compare scores.
17
- 6. Record decision in `specs/adr/` + `session-state`; revert if regression.
12
+ 1. **Establish baseline** — Run `run-benchmark <skill> --baseline`. If no definition exists at `specs/benchmarks/<skill>.yaml`, create one following `specs/benchmarks/SCHEMA.md` first. Save report path in `state.yaml`. If `specs/benchmarks/reports/BASELINE-<skill>.yaml` already exists, skip this step.
13
+
14
+ 2. **Identify gap** Read the baseline report (`specs/benchmarks/reports/BASELINE-<skill>.yaml`). Find scenarios with `result: FAIL` or low `pass_at_k`. This is the measurable gap.
15
+
16
+ 3. **`plan-work`** Write a minimal change proposal targeting the failing scenarios. Include verify commands.
17
+
18
+ 4. **Edit** via `craft-skill` / direct SKILL.md edit; run `bash scripts/sync-skills.sh`.
19
+
20
+ 5. **Re-run benchmark** — `run-benchmark <skill>`. Compare new `pass_at_k` against baseline.
21
+ - **IMPROVED or STABLE** → advance to step 6.
22
+ - **REGRESSION** (`new pass_at_k < baseline`) → revert the change and loop back to step 3.
23
+
24
+ 6. **Record decision** — Write `specs/adr/NNNN-evolve-<skill>.md` with before/after `pass_at_k` scores. Update `session-state`.
18
25
 
19
26
  ## Verify
20
27
 
21
- → verify: benchmark report shows post-change score baseline (document paths in state.yaml)
28
+ → verify: `grep -c 'run-benchmark\|pass_at_k\|BASELINE-' evolve-skill/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
22
29
 
23
30
  See [REFERENCE.md](REFERENCE.md) for ADR template.
24
31
 
@@ -31,7 +31,32 @@ git status # working tree MUST be clean
31
31
  git log --oneline -5
32
32
  ```
33
33
 
34
- If working tree is dirty, ask the user to stash or commit first. If not on `$DEFAULT` after checkout, stop and fix before continuing.
34
+ **Spec-only pre-kickoff** before enforcing the clean-tree gate, check whether dirty files are spec artifacts:
35
+
36
+ ```bash
37
+ DIRTY=$(git status --porcelain | awk '{print $2}')
38
+ NON_SPEC=$(echo "$DIRTY" | grep -v '^specs/' || true)
39
+
40
+ if [ -z "$DIRTY" ]; then
41
+ : # clean — proceed
42
+ elif [ -z "$NON_SPEC" ]; then
43
+ # spec-only dirty tree — offer auto-commit
44
+ echo "Dirty spec artifacts: $(echo $DIRTY | tr '\n' ' ')"
45
+ read -p "Commit spec artifacts before kickoff? [Y/n]: " CONFIRM
46
+ CONFIRM=${CONFIRM:-Y}
47
+ if [[ "$CONFIRM" =~ ^[Yy] ]]; then
48
+ git add specs/
49
+ git commit -m "chore(state): checkpoint before kickoff"
50
+ fi
51
+ else
52
+ echo "Dirty tree: $NON_SPEC (not a spec artifact). Stash or commit before proceeding."
53
+ exit 1
54
+ fi
55
+ ```
56
+
57
+ - **Spec artifacts** match `specs/` — state.yaml, epics YAMLs, execution-status.yaml, etc.
58
+ - **Non-spec dirty files** (src/, scripts/, SKILL.md, …) still enforce the full clean-tree gate.
59
+ - If not on `$DEFAULT` after checkout, stop and fix before continuing.
35
60
 
36
61
  ### 3. Pre-flight & Conflict Resolution
37
62
 
@@ -6,6 +6,8 @@ description: "Streamlined fast-path for trivial data-only fixes — no TDD, no b
6
6
 
7
7
  # Quick Fix
8
8
 
9
+ > **HARD GATE** — ALL entry criteria must pass before invoking quick-fix. If any guardrail triggers during execution, abort immediately and fall back to `investigate-bug`. Do NOT use quick-fix for logic changes, multi-file edits, or diffs > 5 lines.
10
+
9
11
  Fast-track for trivial data-only fixes that do not require the full bug-fix chain.
10
12
 
11
13
  When a bug fix is purely data — an add-missing-key, a typo correction, a config value update — the standard 6-skill chain (investigate-bug → diagnose-root → develop-tdd → kickoff-branch → verify-work → release-branch) is wasteful overhead. Quick-fix collapses it to 2 skills: **quick-fix** then **release-branch**.
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Run skill quality benchmarks from specs/benchmarks/ definitions and write pass@k reports. Use before and after evolve-skill to prove quality changes are improvements, not regressions.
3
+ ---
4
+
5
+
6
+ # Run Benchmark
7
+
8
+ > **HARD GATE** — Do NOT use benchmark scores to declare a skill "good" or "bad" in isolation. Benchmarks measure relative quality vs. a baseline — they catch regressions, they do not certify correctness.
9
+
10
+ Reads benchmark definitions from `specs/benchmarks/`, executes each scenario's grader, and writes a structured `pass@k` report that `evolve-skill` consumes.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ # Benchmark a single skill
16
+ run-benchmark <skill-name>
17
+
18
+ # Benchmark all skills with definitions
19
+ run-benchmark --all
20
+
21
+ # Pin current results as baseline
22
+ run-benchmark <skill-name> --baseline
23
+ ```
24
+
25
+ ## Process
26
+
27
+ 1. **Locate definition** — Read `specs/benchmarks/<skill>.yaml`. If absent, report: `"No benchmark definition found for <skill>. Create specs/benchmarks/<skill>.yaml first."` and stop.
28
+
29
+ 2. **Run each scenario** — For each scenario in `scenarios[]`:
30
+ - **Code grader:** Run `grader.command` in repo root via `bash -c`. Exit 0 → PASS. Non-zero → FAIL. Timeout: 15 seconds.
31
+ - **Rubric grader:** Present each criterion to the agent as a yes/no question about the scenario output. ≥ 80% yes → PASS, else FAIL.
32
+
33
+ 3. **Calculate pass@k** — `pass@k = sum(weight of PASS scenarios) / sum(all weights)`. Round to 2 decimal places.
34
+
35
+ 4. **Write report** to `specs/benchmarks/reports/BENCHMARK-<skill>-<YYYY-MM-DD>.yaml`:
36
+
37
+ ```yaml
38
+ skill: survey-context
39
+ run_date: "2026-06-22"
40
+ pass_at_k: 0.83
41
+ total_scenarios: 3
42
+ passed: 2
43
+ failed: 1
44
+ scenarios:
45
+ - id: s01
46
+ name: "detects active epic from state.yaml"
47
+ result: PASS
48
+ weight: 1.0
49
+ - id: s02
50
+ name: "reads release-plan.yaml and reports next epic"
51
+ result: PASS
52
+ weight: 1.0
53
+ - id: s03
54
+ name: "handles missing state.yaml gracefully"
55
+ result: FAIL
56
+ weight: 0.5
57
+ failure_note: "crashed instead of suggesting state.yaml creation"
58
+ ```
59
+
60
+ 5. **Baseline mode** (`--baseline`) — Copy the report to `specs/benchmarks/reports/BASELINE-<skill>.yaml`. This is the reference point for regression checks in `evolve-skill`.
61
+
62
+ 6. **Compare to baseline** — If a `BASELINE-<skill>.yaml` exists, compare `pass_at_k`. Report:
63
+ - `IMPROVED: 0.67 → 0.83`
64
+ - `REGRESSION: 0.83 → 0.67 — do NOT ship this change`
65
+ - `STABLE: 0.83 = 0.83`
66
+
67
+ ## Verify
68
+
69
+ → verify: `test -f run-benchmark/SKILL.md && grep -q 'pass_at_k\|pass.at.k' run-benchmark/SKILL.md && echo OK || echo FAIL`
@@ -36,6 +36,21 @@ Each key maps to a skill invocation. Optional keys can be skipped; required keys
36
36
 
37
37
  2. **Find next step** — Find the first workflow key with `status: pending`. If the key is `optional`, check if the user wants to run it. If not, mark it `skipped`.
38
38
 
39
+ 2a. **Context capsule check** — Before invoking `elaborate-spec`, check whether a fresh `specs/planning-context.yaml` exists:
40
+ ```bash
41
+ test -f specs/planning-context.yaml && python3 -c "
42
+ import yaml, datetime
43
+ d = yaml.safe_load(open('specs/planning-context.yaml'))
44
+ written = d.get('written_at','')
45
+ if written:
46
+ age = (datetime.datetime.now(datetime.timezone.utc) - datetime.datetime.fromisoformat(written)).total_seconds() / 3600
47
+ print(f'Context age: {age:.1f}h')
48
+ " 2>/dev/null || echo "No context or no written_at"
49
+ ```
50
+ - If context is **< 24h old**, ask: `"Planning context from Xh ago exists for '<feature_name>'. Re-run elaborate-spec? [y/N]"`. Skip elaborate-spec on N.
51
+ - If context is **≥ 24h old** or absent, run elaborate-spec normally.
52
+ - On planning cycle completion (all required keys done), clear the capsule: delete `specs/planning-context.yaml` and set `planning-status.yaml` `context_capsule: null`.
53
+
39
54
  3. **Invoke the matching skill** — Run the skill that matches the workflow key:
40
55
  - `survey-context` — where are we?
41
56
  - `scope-work` — what's in and out?
@@ -52,6 +67,10 @@ Each key maps to a skill invocation. Optional keys can be skipped; required keys
52
67
 
53
68
  In `specs/planning-status.yaml`:
54
69
  ```yaml
70
+ context_capsule: # written by elaborate-spec; cleared on cycle completion
71
+ written_at: "2026-06-22T03:00:00Z"
72
+ written_by: elaborate-spec
73
+ feature_name: "add dark mode"
55
74
  workflows:
56
75
  survey-context:
57
76
  required: true
@@ -17,6 +17,12 @@ Turn the current conversation into a bounded PRD at `specs/product/SCOPE_LATEST.
17
17
 
18
18
  ## Process
19
19
 
20
+ 0. **Read planning-context.yaml** — If `specs/planning-context.yaml` exists, read it before doing anything else:
21
+ ```bash
22
+ test -f specs/planning-context.yaml && echo "Context found" || echo "No context — starting fresh"
23
+ ```
24
+ Pre-populate `feature_name`, `constraints`, and `out_of_scope` from the file. Skip re-asking questions already answered by elaborate-spec. If the file is absent, proceed normally.
25
+
20
26
  1. **Gather context** — Read existing `specs/` artifacts (`release-plan.yaml`, `plans/TECH_STACK_LATEST.md`, `requirements/VISION_LATEST.yaml` if any). Understand what the project is building and why.
21
27
 
22
28
  2. **Interview (if needed)** — Clarify: What is the goal? Who are the users? What is definitely in scope? What is explicitly out of scope? What constraints exist (time, budget, tech)? How will success be measured?
@@ -17,6 +17,12 @@ Produce **epic capsule story tasks** in `specs/epics/eNN-slug/` — vertical sli
17
17
 
18
18
  ## Process
19
19
 
20
+ 0. **Read planning-context.yaml** — If `specs/planning-context.yaml` exists, read it first:
21
+ ```bash
22
+ test -f specs/planning-context.yaml && echo "Context found" || echo "No context — starting fresh"
23
+ ```
24
+ Use `feature_name`, `constraints`, and `out_of_scope` to inform slice boundaries. `key_decisions` in the file may constrain how stories are cut (e.g., "no external deps" constrains slice 2). If absent, proceed normally.
25
+
20
26
  1. **Read context** — Read `specs/product/SCOPE_LATEST.yaml` and/or `specs/release-plan.yaml`. Understand what the epic delivers end-to-end.
21
27
 
22
28
  2. **Cut tracer-bullet slices** — Identify the thinnest possible vertical path through the stack that delivers user value. Start with this slice; it will catch integration issues first. For example:
@@ -14,7 +14,8 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
14
14
  | Mode | Scope |
15
15
  |------|-------|
16
16
  | **Quick Scan** | Skills changed since last tag or in current diff |
17
- | **Full** | All 62 skills per SKILL-INDEX.md + catalog audit |
17
+ | **Full** | All skills per SKILL-INDEX.md + catalog audit |
18
+ | **--verify** | Run `bash scripts/run-skill-verify.sh` and append health results to the stocktake report |
18
19
 
19
20
  ## Process
20
21
 
@@ -26,6 +27,7 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
26
27
  - Skills with zero calls (potential dead weight)
27
28
  - Skills with high average time (candidates for `evolve-skill`)
28
29
  5. Critical findings → `plan-work` story; cosmetic → `evolve-skill` candidate.
30
+ 6. **--verify mode:** Run `bash scripts/run-skill-verify.sh` and append a `## Verify Health` section to the stocktake report: `"N/68 PASS, M FAIL, K SKIP"`. FAIL skills are critical findings and go straight to `plan-work`.
29
31
 
30
32
  ### Skill timing data (`metrics.skill_timings`)
31
33
 
@@ -15,6 +15,7 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
15
15
 
16
16
  - Default: full UAT plus gaps loop
17
17
  - --smoke: Cold-start only plus one happy-path flow. Use for hotfixes.
18
+ - --cli: CLI tool verification — replaces cold-start with binary smoke checklist. Use for CLI tools with no server process.
18
19
 
19
20
  ## Process
20
21
 
@@ -23,6 +24,12 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
23
24
  0. **Branch check** — must not be `main`/`master`.
24
25
 
25
26
  1. Read active story tasks from `specs/epics/<capsule>/eNNsYY-tasks.yaml` and story spec from `specs/epics/<capsule>/eNNsYY-<slug>.md` (countable-story-format, Gherkin in §17).
27
+ 1a. **Pre-UAT verify validation** — for each task's `verify:` command, run it and detect pattern mismatches before UAT begins. If a grep/awk/jq command fails, check whether the pattern is wrong vs. a genuine failure:
28
+ ```bash
29
+ # For a failing grep -q 'PATTERN' FILE, check what is actually in FILE
30
+ grep 'PATTERN' FILE || grep -n '' FILE | head -20 # show nearest lines
31
+ ```
32
+ Report: `"Pattern 'X' not found. Nearest match: 'Y' at line N"` and ask `"Update verify command? [Y/n]"`. Fix before proceeding — a mismatched verify command produces false failures during UAT.
26
33
  2. **Cold-start smoke** (if app): stop server, clear caches, boot from scratch.
27
34
  3. **AGENTS.md preflight** — before running default checks, call `bash scripts/bp-read-agents.sh` to detect project-specific commands. If `BP_PREFLIGHT` is set, run it instead of the default mechanical gates (or in addition to them if the project requires both). Output: `"Using preflight from AGENTS.md: <cmd>"`. Fall back to `CLAUDE.md` commands if AGENTS.md is absent.
28
35
  4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md).
@@ -90,6 +97,29 @@ phases:
90
97
 
91
98
  > **HARD GATE** — Verification evidence MUST be persisted before marking the story done. No evidence = not verified.
92
99
 
100
+ ## --cli mode
101
+
102
+ For CLI tools where cold-start smoke (stop server / clear caches) does not apply. Auto-detected when the project has no server process (no `listen()`, no `server.js`, no blocking `main()`); or explicitly activated with `--cli`.
103
+
104
+ **Auto-detect binary name:**
105
+ ```bash
106
+ # Cargo.toml
107
+ BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}')
108
+ # package.json
109
+ BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
110
+ # Makefile
111
+ BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
112
+ ```
113
+
114
+ **CLI verification checklist (replaces cold-start smoke):**
115
+
116
+ 1. `--help` smoke: `$BINARY --help` → assert output contains "Usage"
117
+ 2. `--version` check: `$BINARY --version` → assert version matches manifest (Cargo.toml / package.json)
118
+ 3. Happy-path: run documented example command from README.md → assert non-empty output
119
+ 4. Edge case: `$BINARY --invalid-flag` → assert exit code ≠ 0 and error message printed
120
+
121
+ No "stop server" or "clear caches" steps are executed in `--cli` mode. Steps 3–6 of the default process (mechanical gates, UAT, gaps loop) still run unchanged.
122
+
93
123
  ## Verify
94
124
 
95
125
  → verify: `test -f specs/verifications/<story_id>-verify.yaml && echo "Evidence persisted"`
@@ -48,6 +48,28 @@ After step 5 (verify-work) completes successfully, step 6 runs `audit-code` auto
48
48
  4. **Audit artifact:** Full audit report saved to `specs/verifications/AUDIT-<epic>-<story>.md` regardless of pass/fail, for reviewer traceability.
49
49
  5. **Enforce F.I.R.S.T:** After audit-code passes, run `enforce-first --quick` on new/modified tests. Append F.I.R.S.T violations (if any) to the audit report. Failing F.I.R.S.T criteria trigger the same loop-back to step 4.
50
50
 
51
+ ## --fast mode
52
+
53
+ Coalesces read-and-report steps to reduce token overhead. Activate with `build-epic --fast`.
54
+
55
+ | Normal | --fast | Change |
56
+ |--------|--------|--------|
57
+ | Step 1 (survey-context) | 1+2 together | survey + plan in one invocation |
58
+ | Step 2 (plan-work) | (absorbed into 1) | — |
59
+ | Step 3 (kickoff-branch) | Step 2 | unchanged, sequential |
60
+ | Step 4 (develop-tdd) | Step 3 | unchanged, sequential |
61
+ | Step 5 (verify-work) | Step 4 | unchanged, sequential |
62
+ | Step 6 (audit-code) | 5+6 together | audit + commit-message in one invocation |
63
+ | Step 7 (commit-message) | (absorbed into 6) | — |
64
+ | Step 8 (release-branch) | Step 7 | unchanged, sequential |
65
+
66
+ **Total invocations:** 8 → 6 per story.
67
+
68
+ **Rules:**
69
+ - Steps 3/4/5/8 (kickoff, develop, verify, release) still run sequentially — they require user interaction or branch state.
70
+ - `--fast` does NOT skip any checklist items; it only coalesces steps that are pure read-and-report.
71
+ - Record `epic_cycle.fast_mode: true` in `state.yaml` when this flag is active.
72
+
51
73
  ## Handoff
52
74
 
53
75
  Write `handoff.next_skill` and `handoff.context` in `state.yaml` when pausing mid-epic.
@@ -12,13 +12,15 @@ model: sonnet
12
12
  ## Process
13
13
 
14
14
  1. Interview: goal, phases, which skills, gates between steps.
15
- 2. Write `specs/WORKFLOW-<name>.md`:
16
- - Trigger ("Use when...")
17
- - Ordered steps: `skill artefact → verify`
18
- - HARD GATEs between phases
15
+ 2. Write `specs/workflows/<name>.yaml`:
16
+ - `name`, `command`, `description`, `skills[]`, `verify`
17
+ - Optional: `args` for skill-specific arguments
19
18
  3. Register in state.yaml Active Decisions.
20
19
  4. Optional: reference from `orchestrate-project` Ad-Hoc mode.
21
20
 
21
+ > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
22
+ > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
23
+
22
24
  ## Standard Recipe Library
23
25
 
24
26
  Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
@@ -26,13 +28,13 @@ Reference them in AGENTS.md so `/command` directly invokes the matching recipe.
26
28
 
27
29
  | Command | Workflow | Skill chain |
28
30
  |---------|----------|-------------|
29
- | `/check-stack` | check-stack | survey-context → assess-impact → verify-work |
31
+ | `/check-stack` | check-stack | survey-context → assess-impact → setup-environment |
30
32
  | `/ship` | ship | audit-code → commit-message → release-branch |
31
33
  | `/tdd` | tdd | develop-tdd → enforce-first |
32
34
  | `/code-review` | code-review | audit-code → request-review → respond-review |
33
- | `/security` | security | audit-code (security focus) → request-review |
35
+ | `/security` | security | audit-code → request-review |
34
36
  | `/plan` | plan | survey-context → research-first → plan-work |
35
- | `/build-fix` | build-fix | investigate-bug → diagnose-root → quick-fix → validate-fix |
37
+ | `/build-fix` | build-fix | investigate-bug → diagnose-root → develop-tdd → validate-fix |
36
38
  | `/e2e` | e2e | smoke-test → verify-work |
37
39
 
38
40
  Add to `AGENTS.md`:
@@ -150,6 +150,26 @@ Once all tests pass: locate the Verification Script in the active epic capsule,
150
150
  [ ] verify: command passes
151
151
  ```
152
152
 
153
+ ## --config mode
154
+
155
+ For pure-config tasks (update package.json, edit YAML, tweak manifest) where there is no test infrastructure to write against. The RED state is "verify command fails"; GREEN is "verify command passes."
156
+
157
+ **When to use:** task has a runnable `verify:` command and the deliverable is a config file change with no new behavior to unit-test. Invoke as `develop-tdd --config`.
158
+
159
+ **Cycle:**
160
+
161
+ ```
162
+ RED: Run verify command → it fails (expected)
163
+ GREEN: Apply config change → verify passes
164
+ COMMIT: commit: chore(<scope>): <change>
165
+ ```
166
+
167
+ **Rules:**
168
+ - Skips test-writing phase entirely — do NOT write a test file for config tasks.
169
+ - `verify:` command is **required** and must be runnable (no placeholder).
170
+ - Commit message follows Conventional Commits (`chore:` or `feat:` as appropriate).
171
+ - Still runs full `verify-work` after all tasks complete.
172
+
153
173
  ## Handoff
154
174
 
155
175
  Gate: READY -> next: verify-work
@@ -73,7 +73,26 @@ Summarize your understanding in 3–5 bullet points aligned with [countable-stor
73
73
 
74
74
  Ask: "Is this an accurate summary? Anything missing or wrong?"
75
75
 
76
- ### 5. Suggest next skill
76
+ ### 5. Write specs/planning-context.yaml
77
+
78
+ After the user confirms the summary in step 4, persist the key decisions:
79
+
80
+ ```yaml
81
+ # specs/planning-context.yaml — written by elaborate-spec; consumed by scope-work and slice-tasks
82
+ feature_name: "<from step 1>"
83
+ problem_statement: "<one paragraph>"
84
+ constraints:
85
+ - "<constraint 1>"
86
+ out_of_scope:
87
+ - "<excluded item 1>"
88
+ key_decisions:
89
+ - decision: "<what was decided>"
90
+ rationale: "<why>"
91
+ ```
92
+
93
+ If `specs/planning-context.yaml` already exists, ask: `"Planning context from a prior session exists. Update it? [Y/n]"`. Overwrite on Y; leave unchanged on N.
94
+
95
+ ### 6. Suggest next skill
77
96
 
78
97
  Once the spec is clear, recommend the next step:
79
98
  - If domain model needs work → `model-domain`
@@ -11,16 +11,23 @@ model: opus
11
11
 
12
12
  ## Loop
13
13
 
14
- 1. Run `bigpowers-benchmark` (external repo); save report path in state.yaml.
15
- 2. Identify target skill + measurable gap from report.
16
- 3. `plan-work`minimal change proposal with verify commands.
17
- 4. Edit via `craft-skill` / direct SKILL.md edit; run `sync-skills.sh`.
18
- 5. Re-run benchmark; compare scores.
19
- 6. Record decision in `specs/adr/` + `session-state`; revert if regression.
14
+ 1. **Establish baseline** — Run `run-benchmark <skill> --baseline`. If no definition exists at `specs/benchmarks/<skill>.yaml`, create one following `specs/benchmarks/SCHEMA.md` first. Save report path in `state.yaml`. If `specs/benchmarks/reports/BASELINE-<skill>.yaml` already exists, skip this step.
15
+
16
+ 2. **Identify gap** Read the baseline report (`specs/benchmarks/reports/BASELINE-<skill>.yaml`). Find scenarios with `result: FAIL` or low `pass_at_k`. This is the measurable gap.
17
+
18
+ 3. **`plan-work`** Write a minimal change proposal targeting the failing scenarios. Include verify commands.
19
+
20
+ 4. **Edit** via `craft-skill` / direct SKILL.md edit; run `bash scripts/sync-skills.sh`.
21
+
22
+ 5. **Re-run benchmark** — `run-benchmark <skill>`. Compare new `pass_at_k` against baseline.
23
+ - **IMPROVED or STABLE** → advance to step 6.
24
+ - **REGRESSION** (`new pass_at_k < baseline`) → revert the change and loop back to step 3.
25
+
26
+ 6. **Record decision** — Write `specs/adr/NNNN-evolve-<skill>.md` with before/after `pass_at_k` scores. Update `session-state`.
20
27
 
21
28
  ## Verify
22
29
 
23
- → verify: benchmark report shows post-change score baseline (document paths in state.yaml)
30
+ → verify: `grep -c 'run-benchmark\|pass_at_k\|BASELINE-' evolve-skill/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
24
31
 
25
32
  See [REFERENCE.md](REFERENCE.md) for ADR template.
26
33
 
@@ -33,7 +33,32 @@ git status # working tree MUST be clean
33
33
  git log --oneline -5
34
34
  ```
35
35
 
36
- If working tree is dirty, ask the user to stash or commit first. If not on `$DEFAULT` after checkout, stop and fix before continuing.
36
+ **Spec-only pre-kickoff** before enforcing the clean-tree gate, check whether dirty files are spec artifacts:
37
+
38
+ ```bash
39
+ DIRTY=$(git status --porcelain | awk '{print $2}')
40
+ NON_SPEC=$(echo "$DIRTY" | grep -v '^specs/' || true)
41
+
42
+ if [ -z "$DIRTY" ]; then
43
+ : # clean — proceed
44
+ elif [ -z "$NON_SPEC" ]; then
45
+ # spec-only dirty tree — offer auto-commit
46
+ echo "Dirty spec artifacts: $(echo $DIRTY | tr '\n' ' ')"
47
+ read -p "Commit spec artifacts before kickoff? [Y/n]: " CONFIRM
48
+ CONFIRM=${CONFIRM:-Y}
49
+ if [[ "$CONFIRM" =~ ^[Yy] ]]; then
50
+ git add specs/
51
+ git commit -m "chore(state): checkpoint before kickoff"
52
+ fi
53
+ else
54
+ echo "Dirty tree: $NON_SPEC (not a spec artifact). Stash or commit before proceeding."
55
+ exit 1
56
+ fi
57
+ ```
58
+
59
+ - **Spec artifacts** match `specs/` — state.yaml, epics YAMLs, execution-status.yaml, etc.
60
+ - **Non-spec dirty files** (src/, scripts/, SKILL.md, …) still enforce the full clean-tree gate.
61
+ - If not on `$DEFAULT` after checkout, stop and fix before continuing.
37
62
 
38
63
  ### 3. Pre-flight & Conflict Resolution
39
64
 
@@ -8,6 +8,8 @@ model: sonnet
8
8
 
9
9
  # Quick Fix
10
10
 
11
+ > **HARD GATE** — ALL entry criteria must pass before invoking quick-fix. If any guardrail triggers during execution, abort immediately and fall back to `investigate-bug`. Do NOT use quick-fix for logic changes, multi-file edits, or diffs > 5 lines.
12
+
11
13
  Fast-track for trivial data-only fixes that do not require the full bug-fix chain.
12
14
 
13
15
  When a bug fix is purely data — an add-missing-key, a typo correction, a config value update — the standard 6-skill chain (investigate-bug → diagnose-root → develop-tdd → kickoff-branch → verify-work → release-branch) is wasteful overhead. Quick-fix collapses it to 2 skills: **quick-fix** then **release-branch**.