bigpowers 2.73.9 → 2.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/.continue/rules/context7-mcp.md +0 -0
  2. package/.continue/rules/diagnose-stall.md +0 -0
  3. package/.kilocode/rules/context7-mcp.md +0 -0
  4. package/.kilocode/rules/diagnose-stall.md +0 -0
  5. package/.pi/package.json +2 -2
  6. package/.pi/prompts/audit-code.md +17 -13
  7. package/.pi/prompts/build-epic.md +5 -0
  8. package/.pi/prompts/change-request.md +4 -1
  9. package/.pi/prompts/compose-workflow.md +17 -0
  10. package/.pi/prompts/context7-mcp.md +54 -0
  11. package/.pi/prompts/craft-skill.md +28 -0
  12. package/.pi/prompts/deepen-architecture.md +20 -0
  13. package/.pi/prompts/delegate-task.md +14 -0
  14. package/.pi/prompts/deploy.md +8 -0
  15. package/.pi/prompts/develop-tdd.md +15 -4
  16. package/.pi/prompts/diagnose-stall.md +53 -0
  17. package/.pi/prompts/dispatch-agents.md +53 -19
  18. package/.pi/prompts/evolve-skill.md +7 -0
  19. package/.pi/prompts/gate-trace.md +9 -1
  20. package/.pi/prompts/guard-git.md +14 -0
  21. package/.pi/prompts/kickoff-branch.md +4 -0
  22. package/.pi/prompts/migrate-spec.md +18 -0
  23. package/.pi/prompts/plan-work.md +62 -2
  24. package/.pi/prompts/publish-package.md +11 -0
  25. package/.pi/prompts/release-branch.md +46 -43
  26. package/.pi/prompts/request-review.md +57 -17
  27. package/.pi/prompts/research-first.md +3 -0
  28. package/.pi/prompts/run-benchmark.md +3 -3
  29. package/.pi/prompts/run-evals.md +26 -6
  30. package/.pi/prompts/run-planning.md +1 -0
  31. package/.pi/prompts/scope-work.md +3 -0
  32. package/.pi/prompts/search-skills.md +3 -0
  33. package/.pi/prompts/security-review.md +66 -12
  34. package/.pi/prompts/seed-conventions.md +68 -0
  35. package/.pi/prompts/session-state.md +5 -10
  36. package/.pi/prompts/slice-tasks.md +3 -0
  37. package/.pi/prompts/smoke-test.md +11 -0
  38. package/.pi/prompts/stocktake-skills.md +6 -1
  39. package/.pi/prompts/validate-contracts.md +12 -0
  40. package/.pi/prompts/validate-fix.md +2 -0
  41. package/.pi/prompts/verify-work.md +42 -20
  42. package/.pi/prompts/wire-ci.md +11 -0
  43. package/.pi/prompts/write-document.md +10 -0
  44. package/.pi/skills/audit-code/SKILL.md +17 -13
  45. package/.pi/skills/build-epic/SKILL.md +5 -0
  46. package/.pi/skills/change-request/SKILL.md +4 -1
  47. package/.pi/skills/compose-workflow/SKILL.md +17 -0
  48. package/.pi/skills/context7-mcp/SKILL.md +56 -0
  49. package/.pi/skills/craft-skill/SKILL.md +28 -0
  50. package/.pi/skills/deepen-architecture/SKILL.md +20 -0
  51. package/.pi/skills/delegate-task/SKILL.md +14 -0
  52. package/.pi/skills/deploy/SKILL.md +8 -0
  53. package/.pi/skills/develop-tdd/SKILL.md +15 -4
  54. package/.pi/skills/diagnose-stall/SKILL.md +55 -0
  55. package/.pi/skills/dispatch-agents/SKILL.md +53 -19
  56. package/.pi/skills/evolve-skill/SKILL.md +7 -0
  57. package/.pi/skills/gate-trace/SKILL.md +9 -1
  58. package/.pi/skills/guard-git/SKILL.md +14 -0
  59. package/.pi/skills/kickoff-branch/SKILL.md +4 -0
  60. package/.pi/skills/migrate-spec/SKILL.md +18 -0
  61. package/.pi/skills/plan-work/SKILL.md +62 -2
  62. package/.pi/skills/publish-package/SKILL.md +11 -0
  63. package/.pi/skills/release-branch/SKILL.md +46 -43
  64. package/.pi/skills/request-review/SKILL.md +57 -17
  65. package/.pi/skills/research-first/SKILL.md +3 -0
  66. package/.pi/skills/run-benchmark/SKILL.md +3 -3
  67. package/.pi/skills/run-evals/SKILL.md +26 -6
  68. package/.pi/skills/run-planning/SKILL.md +1 -0
  69. package/.pi/skills/scope-work/SKILL.md +3 -0
  70. package/.pi/skills/search-skills/SKILL.md +3 -0
  71. package/.pi/skills/security-review/SKILL.md +66 -12
  72. package/.pi/skills/seed-conventions/SKILL.md +68 -0
  73. package/.pi/skills/session-state/SKILL.md +5 -10
  74. package/.pi/skills/slice-tasks/SKILL.md +3 -0
  75. package/.pi/skills/smoke-test/SKILL.md +11 -0
  76. package/.pi/skills/stocktake-skills/SKILL.md +6 -1
  77. package/.pi/skills/validate-contracts/SKILL.md +12 -0
  78. package/.pi/skills/validate-fix/SKILL.md +2 -0
  79. package/.pi/skills/verify-work/SKILL.md +42 -20
  80. package/.pi/skills/wire-ci/SKILL.md +11 -0
  81. package/.pi/skills/write-document/SKILL.md +10 -0
  82. package/CHANGELOG.md +15 -0
  83. package/CLAUDE.md +59 -1
  84. package/CONVENTIONS.md +81 -0
  85. package/README.md +1 -1
  86. package/SKILL-INDEX.md +1 -1
  87. package/package.json +1 -1
  88. package/scripts/bp-churn-rank.sh +49 -0
  89. package/scripts/bp-read-agents.sh +1 -0
  90. package/scripts/check-import-boundaries.sh +64 -0
  91. package/scripts/compile-rule-matrix.sh +114 -0
  92. package/scripts/hooks/rtk-rewrite.sh +11 -0
  93. package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
  94. package/scripts/install.sh +6 -0
  95. package/scripts/lib/completeness-critic.sh +62 -0
  96. package/scripts/lib/doc-fetch-cache.sh +71 -0
  97. package/scripts/lib/golden-suite-gates.sh +3 -1
  98. package/scripts/lib/parallel-review-worktrees.sh +34 -0
  99. package/scripts/lib/plan-consistency-check.sh +88 -0
  100. package/scripts/lib/run-benchmark.py +210 -0
  101. package/scripts/lib/sync-context-engineering-ref.sh +19 -0
  102. package/scripts/references-manifest.yaml +19 -0
  103. package/scripts/run-benchmark.sh +6 -0
  104. package/scripts/run-skill-verify.sh +1 -0
  105. package/scripts/sync-references.sh +25 -0
  106. package/scripts/sync-skills.sh +12 -1
  107. package/scripts/validate-skill-catalog.sh +147 -0
  108. package/scripts/validate-skill-description.sh +70 -0
  109. package/skills/audit-code/SKILL.md +19 -13
  110. package/skills/build-epic/SKILL.md +6 -1
  111. package/skills/change-request/SKILL.md +4 -1
  112. package/skills/compose-workflow/SKILL.md +17 -0
  113. package/skills/context7-mcp/SKILL.md +57 -0
  114. package/skills/craft-skill/SKILL.md +29 -0
  115. package/skills/deepen-architecture/SKILL.md +22 -0
  116. package/skills/delegate-task/SKILL.md +14 -0
  117. package/skills/deploy/SKILL.md +9 -0
  118. package/skills/develop-tdd/SKILL.md +18 -4
  119. package/skills/diagnose-stall/SKILL.md +56 -0
  120. package/skills/dispatch-agents/SKILL.md +53 -19
  121. package/skills/elaborate-spec/SKILL.md +1 -0
  122. package/skills/evolve-skill/SKILL.md +7 -0
  123. package/skills/gate-trace/SKILL.md +11 -1
  124. package/skills/guard-git/REFERENCE.md +14 -0
  125. package/skills/kickoff-branch/SKILL.md +4 -1
  126. package/skills/migrate-spec/REFERENCE.md +12 -0
  127. package/skills/migrate-spec/SKILL.md +6 -0
  128. package/skills/plan-work/REFERENCE.md +29 -2
  129. package/skills/plan-work/SKILL.md +38 -0
  130. package/skills/publish-package/REFERENCE.md +11 -0
  131. package/skills/release-branch/REFERENCE.md +14 -0
  132. package/skills/release-branch/SKILL.md +33 -44
  133. package/skills/request-review/SKILL.md +59 -17
  134. package/skills/research-first/SKILL.md +3 -0
  135. package/skills/run-benchmark/SKILL.md +5 -4
  136. package/skills/run-evals/REFERENCE.md +14 -4
  137. package/skills/run-evals/SKILL.md +13 -2
  138. package/skills/run-planning/SKILL.md +1 -0
  139. package/skills/scope-work/SKILL.md +3 -0
  140. package/skills/search-skills/SKILL.md +3 -0
  141. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  142. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  143. package/skills/security-review/SKILL.md +53 -4
  144. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  145. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  146. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  147. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  148. package/skills/seed-conventions/REFERENCE.md +40 -0
  149. package/skills/seed-conventions/SKILL.md +28 -1
  150. package/skills/session-state/SKILL.md +5 -10
  151. package/skills/slice-tasks/SKILL.md +3 -0
  152. package/skills/smoke-test/REFERENCE.md +11 -0
  153. package/skills/stocktake-skills/SKILL.md +8 -1
  154. package/skills/validate-contracts/REFERENCE.md +12 -0
  155. package/skills/validate-fix/SKILL.md +3 -0
  156. package/skills/verify-work/REFERENCE.md +17 -0
  157. package/skills/verify-work/SKILL.md +25 -22
  158. package/skills/wire-ci/REFERENCE.md +11 -0
  159. package/skills/write-document/REFERENCE.md +10 -0
  160. package/skills-lock.json +41 -31
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env bash
2
+ # story: e45s12
3
+ # validate-skill-catalog.sh — code-enforced skill catalog hygiene (Hermes Curator pattern)
4
+ # Exit 0 when catalog passes; 1 on violations. --archive lists zero-usage skills for archiving.
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
9
+ cd "$REPO_ROOT"
10
+
11
+ SKILLS_ROOT="$REPO_ROOT/skills"
12
+ [[ -d "$SKILLS_ROOT" ]] || SKILLS_ROOT="$REPO_ROOT"
13
+
14
+ ARCHIVE_MODE=false
15
+ STRICT=false
16
+ TARGET_SKILL=""
17
+ VIOLATIONS=0
18
+ WARNINGS=0
19
+
20
+ # Documented naming exceptions (craft-skill REFERENCE.md)
21
+ VERB_NOUN_EXCEPTIONS="grill-me grill-with-docs context7-mcp using-bigpowers deploy"
22
+
23
+ usage() {
24
+ echo "Usage: bash scripts/validate-skill-catalog.sh [--archive] [--strict] [--skill <name>]"
25
+ exit 2
26
+ }
27
+
28
+ while [[ $# -gt 0 ]]; do
29
+ case "$1" in
30
+ --archive) ARCHIVE_MODE=true; shift ;;
31
+ --strict) STRICT=true; shift ;;
32
+ --skill) TARGET_SKILL="${2:-}"; shift 2 ;;
33
+ --skill=*) TARGET_SKILL="${1#*=}"; shift ;;
34
+ -h|--help) usage ;;
35
+ *) echo "Unknown flag: $1" >&2; usage ;;
36
+ esac
37
+ done
38
+
39
+ report_catalog_violation() { echo "FAIL: $1" >&2; VIOLATIONS=$((VIOLATIONS + 1)); }
40
+ report_catalog_warning() { echo "WARN: $1" >&2; WARNINGS=$((WARNINGS + 1)); }
41
+
42
+ check_verb_noun() {
43
+ local name="$1"
44
+ if echo " $VERB_NOUN_EXCEPTIONS " | grep -q " $name "; then
45
+ return 0
46
+ fi
47
+ if [[ ! "$name" =~ ^[a-z][a-z0-9]*(-[a-z][a-z0-9]*)+$ ]]; then
48
+ report_catalog_violation "$name: not verb-noun kebab-case"
49
+ return 1
50
+ fi
51
+ local segments
52
+ segments=$(echo "$name" | tr '-' '\n' | wc -l | tr -d ' ')
53
+ if [[ "$segments" -gt 2 ]]; then
54
+ report_catalog_violation "$name: more than two hyphen segments (verb-noun only)"
55
+ fi
56
+ }
57
+
58
+ check_skill() {
59
+ local skill_md="$1"
60
+ local name
61
+ name=$(basename "$(dirname "$skill_md")")
62
+
63
+ check_verb_noun "$name" || true
64
+
65
+ if ! grep -q 'HARD GATE' "$skill_md" 2>/dev/null; then
66
+ if $STRICT; then report_catalog_violation "$name: missing HARD GATE block"; else report_catalog_warning "$name: missing HARD GATE block"; fi
67
+ fi
68
+
69
+ local desc
70
+ desc=$(awk 'BEGIN{f=0} /^---$/{f++; next} f==1{print} f==2{exit}' "$skill_md" \
71
+ | grep -E '^description:' | head -1 | sed 's/^description: *//; s/^> //' | tr -d '"' || true)
72
+ if [[ -n "$desc" && ${#desc} -gt 1024 ]]; then
73
+ report_catalog_violation "$name: description ${#desc} chars (max 1024)"
74
+ fi
75
+
76
+ local lines
77
+ lines=$(wc -l < "$skill_md" | tr -d ' ')
78
+ if [[ "$lines" -gt 300 ]]; then
79
+ report_catalog_warning "$name: SKILL.md $lines lines (target ≤300; split to REFERENCE.md)"
80
+ fi
81
+
82
+ local cmd
83
+ cmd=$(grep -E '^(> )?→ verify:' "$skill_md" 2>/dev/null | tail -1 | sed 's/^> // ; s/^→ verify: *//' || true)
84
+ if [[ -z "$cmd" ]]; then
85
+ if $STRICT; then report_catalog_violation "$name: missing → verify: command"; else report_catalog_warning "$name: missing → verify: command"; fi
86
+ fi
87
+ }
88
+
89
+ echo "Validating skill catalog under $SKILLS_ROOT ..."
90
+ if [[ -n "$TARGET_SKILL" ]]; then
91
+ skill_md="$SKILLS_ROOT/$TARGET_SKILL/SKILL.md"
92
+ [[ -f "$skill_md" ]] || { echo "FAIL: $skill_md not found" >&2; exit 1; }
93
+ check_skill "$skill_md"
94
+ else
95
+ for skill_md in "$SKILLS_ROOT"/*/SKILL.md; do
96
+ [[ -f "$skill_md" ]] || continue
97
+ check_skill "$skill_md"
98
+ done
99
+ fi
100
+
101
+ if $ARCHIVE_MODE; then
102
+ STATE="$REPO_ROOT/specs/state.yaml"
103
+ echo ""
104
+ echo "=== Archive candidates (zero calls in metrics.skill_timings) ==="
105
+ if [[ ! -f "$STATE" ]]; then
106
+ echo " (no specs/state.yaml — skip usage scan)"
107
+ else
108
+ python3 - "$STATE" "$SKILLS_ROOT" <<'PY'
109
+ import sys, glob, os
110
+ from pathlib import Path
111
+
112
+ state_path, skills_root = sys.argv[1], sys.argv[2]
113
+ text = Path(state_path).read_text(encoding="utf-8")
114
+ timings = set()
115
+ in_timings = False
116
+ for line in text.splitlines():
117
+ if line.strip() == "skill_timings:":
118
+ in_timings = True
119
+ continue
120
+ if in_timings:
121
+ if line.startswith(" ") and not line.startswith(" ") and line.rstrip().endswith(":"):
122
+ timings.add(line.strip().rstrip(":"))
123
+ elif line.strip() and not line.startswith(" "):
124
+ in_timings = False
125
+
126
+ skills = [os.path.basename(os.path.dirname(p)) for p in glob.glob(f"{skills_root}/*/SKILL.md")]
127
+ zero = sorted(s for s in skills if s not in timings)
128
+ if zero:
129
+ for s in zero:
130
+ print(f" ARCHIVE_CANDIDATE: {s} (0 calls — move to specs/epics/archive/ or delete)")
131
+ else:
132
+ print(" (no zero-usage skills)")
133
+ PY
134
+ fi
135
+ fi
136
+
137
+ echo ""
138
+ if [[ "$VIOLATIONS" -gt 0 ]]; then
139
+ echo "CATALOG INVALID: $VIOLATIONS violation(s), $WARNINGS warning(s)"
140
+ exit 1
141
+ fi
142
+ if $STRICT && [[ "$WARNINGS" -gt 0 ]]; then
143
+ echo "CATALOG INVALID (strict): $WARNINGS warning(s)"
144
+ exit 1
145
+ fi
146
+ echo "CATALOG OK: $WARNINGS warning(s)"
147
+ exit 0
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env bash
2
+ # story: e45s02
3
+ # CSO description discipline — max 1024 chars, no workflow-summary leakage.
4
+ set -euo pipefail
5
+
6
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7
+ SKILLS_ROOT="$REPO_ROOT/skills"
8
+ [[ -d "$SKILLS_ROOT" ]] || SKILLS_ROOT="$REPO_ROOT"
9
+
10
+ MAX_LEN=1024
11
+ ERRORS=0
12
+
13
+ audit_skill_description_cso() {
14
+ local path="$1"
15
+ local skill desc len
16
+
17
+ skill="$(basename "$(dirname "$path")")"
18
+ desc="$(
19
+ awk 'BEGIN{n=0} /^---$/{n++; next} n==1{print; next} n>=2{exit}' "$path" \
20
+ | grep -E '^description:' | head -1 | sed 's/^description:[[:space:]]*//' | sed 's/^"//;s/"$//'
21
+ )"
22
+
23
+ if [[ -z "$desc" ]]; then
24
+ echo "FAIL: $skill — missing description frontmatter"
25
+ ERRORS=$((ERRORS + 1))
26
+ return
27
+ fi
28
+
29
+ len=${#desc}
30
+ if (( len > MAX_LEN )); then
31
+ echo "FAIL: $skill — description ${len} chars (max ${MAX_LEN})"
32
+ ERRORS=$((ERRORS + 1))
33
+ fi
34
+
35
+ # Workflow-summary leakage: numbered steps, phase chains, verify prose in description
36
+ local leak=0
37
+ if echo "$desc" | grep -qE '(^|[[:space:]])([0-9]+\.|Step [0-9]+|First,|Then,|Finally,|→ verify:|HARD GATE|Process:|Workflow:)'; then
38
+ leak=1
39
+ fi
40
+ if echo "$desc" | grep -qE '(discover →|scope-work →|plan-work →|develop-tdd →|verify-work →|→ .* → )'; then
41
+ leak=1
42
+ fi
43
+ if (( leak )); then
44
+ echo "FAIL: $skill — workflow-summary leakage in description (keep triggers only; move steps to body)"
45
+ ERRORS=$((ERRORS + 1))
46
+ fi
47
+
48
+ if echo "$desc" | grep -qE 'model:[[:space:]]*(haiku|sonnet|opus)'; then
49
+ echo "FAIL: $skill — model hint belongs in frontmatter, not description"
50
+ ERRORS=$((ERRORS + 1))
51
+ fi
52
+ }
53
+
54
+ if [[ $# -gt 0 ]]; then
55
+ for f in "$@"; do
56
+ [[ -f "$f" ]] || { echo "FAIL: not found: $f" >&2; exit 1; }
57
+ audit_skill_description_cso "$f"
58
+ done
59
+ else
60
+ while IFS= read -r f; do
61
+ audit_skill_description_cso "$f"
62
+ done < <(find "$SKILLS_ROOT" -maxdepth 2 -name SKILL.md | sort)
63
+ fi
64
+
65
+ if (( ERRORS > 0 )); then
66
+ echo "validate-skill-description: $ERRORS issue(s)" >&2
67
+ exit 1
68
+ fi
69
+
70
+ echo "validate-skill-description: PASS"
@@ -1,4 +1,6 @@
1
1
  # story: e51s04
2
+ # story: e45s18
3
+ # story: e45s31
2
4
  ---
3
5
  name: audit-code
4
6
  model: haiku
@@ -14,11 +16,27 @@ Run this self-review before asking anyone else to look at the code. The goal is
14
16
 
15
17
  **Distinct from `request-review`:** This is the coding agent checking its own work. No second agent is involved. Run this first; run `request-review` after this passes.
16
18
 
19
+ ## Look-here-first (churn heuristic)
20
+
21
+ Before the checklist, rank changed files by git churn and review **high-churn hotspots first** — they carry the most latent risk regardless of diff size.
22
+
23
+ ```bash
24
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 15
25
+ ```
26
+
27
+ Apply the full checklist to churn-ranked files in descending order. Files with zero recent commits but large diffs still get reviewed; churn only sets priority, not scope.
28
+
17
29
  ## Modes
18
30
 
19
31
  - Default: full checklist
20
32
  - --quick: Run only Supply Chain and Test Coverage. Use for changes under 50 LOC.
21
33
  - --gate: Non-interactive mode for automated CI gating (used by build-epic step 6). Exit with non-zero status code (`exit 1`) on ANY checklist failure; `exit 0` only if ALL items pass. Produces a compact pass/fail summary to stderr. On failure, list every ✗ item with reason.
34
+ - --parallel: Run checklist sections in **isolated git worktrees** (e45s18) so concurrent checks cannot corrupt each other's working tree. See [REFERENCE.md](REFERENCE.md) or:
35
+
36
+ ```bash
37
+ bash scripts/lib/parallel-review-worktrees.sh audit-code
38
+ ```
39
+
22
40
 
23
41
  ## Checklist
24
42
 
@@ -110,24 +128,12 @@ Report the checklist with ✓ / ✗ per item. For each ✗, describe what needs
110
128
  If all items pass: suggest running `request-review` for an independent second opinion.
111
129
  If any items fail: fix them before proceeding.
112
130
 
113
- ### Gate mode output (`--gate`)
114
-
115
- In `--gate` mode, print one summary line per checklist section:
116
-
117
- ```
118
- PASS Supply Chain & Security
119
- FAIL Provenance & Metadata (2 items)
120
- PASS Law of Demeter
121
- ...
122
- ```
123
-
124
- Aggregate exit code: `0` if all sections PASS, `1` (non-zero) if any section FAILs. Write the full audit report to `specs/verifications/AUDIT-<epic>-<story>.md` as a permanent record.
131
+ In `--gate` mode, print one summary line per checklist section (`PASS Supply Chain` / `FAIL Provenance (2 items)`). Exit `0` only if all PASS. Write full report to `specs/verifications/AUDIT-<epic>-<story>.md`.
125
132
 
126
133
  ## Verify
127
134
 
128
135
  → verify: `test -f CONVENTIONS.md && test -d skills/enforce-first && test -d skills/request-review && echo "OK: audit-code dependencies present" || echo "FAIL"`
129
136
 
130
-
131
137
  ## Handoff
132
138
 
133
139
  Gate: READY -> next: commit-message
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: build-epic
3
- # story: e38s02
3
+ # story: e18s01 e18s02 e18s03 e38s02
4
4
  model: sonnet
5
5
  effort: standard
6
6
  description: Eight-step epic build cycle — reads state.yaml, execution-status.yaml, and one epic capsule; updates status via bp-yaml-set or direct edit. Resume mode runs one step per invocation. Use instead of ad-hoc execute-plan for release work.
7
7
  ---
8
8
 
9
+ # story: e20s05
10
+
9
11
  # Build Epic
10
12
 
11
13
  Scope: one story. Called by orchestrate-project Phase 4. Not a replacement for orchestrate-project.
@@ -90,3 +92,6 @@ Write `handoff.next_skill` and `handoff.context` in `state.yaml` when pausing mi
90
92
  ## Verify
91
93
 
92
94
  → verify: `test -f specs/state.yaml && test -f specs/execution-status.yaml && test -f specs/release-plan.yaml && test -d skills/assess-impact && test -d skills/audit-code && test -d skills/security-review && echo "OK: build-epic dependencies present" || echo "FAIL"`
95
+
96
+
97
+ <!-- story: e38s02 -->
@@ -5,6 +5,9 @@ effort: standard
5
5
  description: Add a new requirement or reorder epics by WSJF against specs/release-plan.yaml and epic capsule directories. Modes Add and Reorder. Use when a new requirement arrives mid-release or the plan needs prioritization.
6
6
  ---
7
7
 
8
+ # story: e45s29
9
+ # story: e20s01
10
+
8
11
  # Change Request
9
12
 
10
13
  > **HARD GATE** — `specs/release-plan.yaml` must exist before running either mode. If it doesn't, run `plan-release` first.
@@ -19,7 +22,7 @@ Intake a new requirement mid-flight without disrupting work in progress.
19
22
 
20
23
  1. **Capture**: What is the change? What problem does it solve?
21
24
  2. **Locate**: Which existing stories in `specs/epics/` does it affect or replace?
22
- 3. **Draft**: Add story + `tasks[]` with Gherkin-style AC in epic YAML (each task has `verify`).
25
+ 3. **Draft**: Add story + `tasks[]` with Gherkin-style AC in epic YAML (each task has `verify`). Tag requirement deltas: `ADDED` / `MODIFIED` / `REMOVED` / `RENAMED` with before/after for non-`ADDED` changes (e45s29).
23
26
  4. **Place**: Append story under existing epic capsule, or create `specs/epics/eNN-slug.yaml` and register in `release-plan.yaml` `epics[]`.
24
27
  5. **Score**: Compute WSJF; note if it outranks in-progress work.
25
28
 
@@ -5,6 +5,10 @@ model: sonnet
5
5
  effort: standard
6
6
  ---
7
7
 
8
+ # story: e09s01
9
+ # story: e45s27
10
+ # story: e21s04
11
+
8
12
  # Compose Workflow
9
13
  > **HARD GATE** — **HARD GATE** — Workflows are orchestration, not automation. Do NOT create workflows for tasks that should be single skills. Workflow complexity must be justified.
10
14
 
@@ -21,6 +25,19 @@ effort: standard
21
25
  > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
22
26
  > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
23
27
 
28
+ ## Terminal-state taxonomy (e45s27)
29
+
30
+ Every workflow step and `/loop` tick MUST exit with exactly one terminal state:
31
+
32
+ | State | Meaning | Next action |
33
+ |-------|---------|-------------|
34
+ | `success` | Step verify passed; artifacts written | Advance to next skill in recipe |
35
+ | `no-op` | Nothing to do (already green / already applied) | Skip step; advance |
36
+ | `blocked` | External gate (approval, red CI, missing dep) | `diagnose-stall` or escalate to user |
37
+ | `exhausted` | Max iterations/cycles reached (review cap, dispatch cycles) | Stop; human decision required |
38
+
39
+ Record terminal state in `specs/state.yaml` `handoff.last_terminal_state` when a recipe step completes. `/loop` ticks that produce no progress for two consecutive wakes → invoke `diagnose-stall`.
40
+
24
41
  ## Standard Recipe Library
25
42
 
26
43
  Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: context7-mcp
3
+ # story: e45s19 e45s20
4
+ model: haiku
5
+ effort: light
6
+ description: Fetch current library docs via Context7 MCP instead of training data. Use when user asks about frameworks, APIs, setup, or code examples for React, Next.js, Prisma, etc.
7
+ ---
8
+
9
+ # Context7 MCP
10
+
11
+ > **HARD GATE** — Max **3** Context7 tool calls per user question (`resolve-library-id` + `query-docs` count toward the cap). On quota/rate-limit errors, emit an explicit **CONTEXT7_UNAVAILABLE** block — do NOT silently answer from training data.
12
+ >
13
+ > **HARD GATE** — Before HTTP fetch, check `bash scripts/lib/doc-fetch-cache.sh get "<libraryId>:<query>"`. Cache hit within TTL → use cached body (no round-trip). On ETag mismatch after conditional refresh, replace cache entry.
14
+
15
+ ## When to Use
16
+
17
+ - Setup/configuration questions ("How do I configure Next.js middleware?")
18
+ - Code involving libraries ("Write a Prisma query for…")
19
+ - API references ("What are the Supabase auth methods?")
20
+ - User mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
21
+
22
+ ## Bounded Retry (max 3x)
23
+
24
+ | Attempt | Action |
25
+ |---------|--------|
26
+ | 1 | `resolve-library-id` → pick best match |
27
+ | 2 | `query-docs` with selected `libraryId` |
28
+ | 3 | Retry `query-docs` once with refined query (narrower scope) |
29
+
30
+ After 3 failures, stop and print:
31
+
32
+ ```
33
+ CONTEXT7_UNAVAILABLE
34
+ Reason: <quota|rate-limit|no-match|timeout>
35
+ Action: Ask user to retry later, paste official docs URL, or run `bts docs <lib>`.
36
+ Do NOT substitute training-data answers without labeling them UNVERIFIED.
37
+ ```
38
+
39
+ ## Fetch Cache (ETag-revalidated)
40
+
41
+ 1. **Cache key:** `"<libraryId>:<normalized-query>"` (lowercase, trimmed).
42
+ 2. **Read:** `bash scripts/lib/doc-fetch-cache.sh get "<key>"` — exit 0 → use cached body.
43
+ 3. **Miss / stale:** call `query-docs`; store via `doc-fetch-cache.sh put`.
44
+ 4. **TTL:** 300s default (`DOC_CACHE_TTL`). Stale entries refresh on next fetch; honor `ETag` when MCP returns it.
45
+
46
+ `bts docs <lib>` shares the same cache helper when invoked from this skill.
47
+
48
+ ## Process
49
+
50
+ 1. `resolve-library-id` with `libraryName` + full user `query`.
51
+ 2. Select match: name similarity, reputation, benchmark score; prefer version-specific IDs when user names a version.
52
+ 3. `query-docs` with `libraryId` + specific question (one concept per call).
53
+ 4. Answer using fetched docs; cite library/version when relevant.
54
+
55
+ ## Verify
56
+
57
+ → verify: `test -f scripts/lib/doc-fetch-cache.sh && grep -q CONTEXT7_UNAVAILABLE skills/context7-mcp/SKILL.md && echo OK || echo FAIL`
@@ -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`