@gobing-ai/spur 0.3.41 → 0.3.43

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 (185) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/README.md +15 -1
  3. package/config/templates/AGENTS.md +5 -3
  4. package/config/workflows/task-pipeline.yaml +113 -12
  5. package/package.json +15 -12
  6. package/plugins/README.md +655 -0
  7. package/plugins/sp/README.md +621 -0
  8. package/plugins/sp/agents/expert-spur.md +109 -0
  9. package/plugins/sp/agents/super-coder.md +126 -0
  10. package/plugins/sp/agents/super-planner.md +283 -0
  11. package/plugins/sp/agents/super-reviewer.md +154 -0
  12. package/plugins/sp/commands/dev-arch.md +30 -0
  13. package/plugins/sp/commands/dev-brainstorm.md +40 -0
  14. package/plugins/sp/commands/dev-changelog.md +28 -0
  15. package/plugins/sp/commands/dev-daily.md +29 -0
  16. package/plugins/sp/commands/dev-debug.md +29 -0
  17. package/plugins/sp/commands/dev-dogfood.md +33 -0
  18. package/plugins/sp/commands/dev-featurechange.md +130 -0
  19. package/plugins/sp/commands/dev-find-conflict.md +51 -0
  20. package/plugins/sp/commands/dev-find-issue.md +76 -0
  21. package/plugins/sp/commands/dev-find-next.md +60 -0
  22. package/plugins/sp/commands/dev-fixall.md +33 -0
  23. package/plugins/sp/commands/dev-gitmsg.md +28 -0
  24. package/plugins/sp/commands/dev-gtd.md +97 -0
  25. package/plugins/sp/commands/dev-handover.md +26 -0
  26. package/plugins/sp/commands/dev-idea.md +50 -0
  27. package/plugins/sp/commands/dev-next.md +31 -0
  28. package/plugins/sp/commands/dev-parallel.md +30 -0
  29. package/plugins/sp/commands/dev-plan.md +46 -0
  30. package/plugins/sp/commands/dev-refine.md +48 -0
  31. package/plugins/sp/commands/dev-refineall.md +65 -0
  32. package/plugins/sp/commands/dev-refresh.md +32 -0
  33. package/plugins/sp/commands/dev-reverse.md +32 -0
  34. package/plugins/sp/commands/dev-review.md +31 -0
  35. package/plugins/sp/commands/dev-run.md +63 -0
  36. package/plugins/sp/commands/dev-runall.md +83 -0
  37. package/plugins/sp/commands/dev-simplify.md +39 -0
  38. package/plugins/sp/commands/dev-unit.md +29 -0
  39. package/plugins/sp/commands/dev-verify.md +48 -0
  40. package/plugins/sp/commands/dev-verifyall.md +72 -0
  41. package/plugins/sp/commands/dev-wrap.md +48 -0
  42. package/plugins/sp/commands/dev-wrapall.md +51 -0
  43. package/plugins/sp/commands/rule-add.md +18 -0
  44. package/plugins/sp/commands/rule-refine.md +18 -0
  45. package/plugins/sp/commands/rule-scan.md +18 -0
  46. package/plugins/sp/commands/spur-init.md +22 -0
  47. package/plugins/sp/commands/workflow-add.md +18 -0
  48. package/plugins/sp/commands/workflow-refine.md +18 -0
  49. package/plugins/sp/hooks/agent-hint.ts +60 -0
  50. package/plugins/sp/hooks/careful-guard.ts +147 -0
  51. package/plugins/sp/hooks/context-post-tool.ts +325 -0
  52. package/plugins/sp/hooks/context-session-start.ts +182 -0
  53. package/plugins/sp/hooks/context-session-stop.ts +95 -0
  54. package/plugins/sp/hooks/hooks.json +51 -0
  55. package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
  56. package/plugins/sp/hooks/task-write-guard.ts +84 -0
  57. package/plugins/sp/plugin.json +8 -0
  58. package/plugins/sp/scripts/batch-preflight.ts +204 -0
  59. package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
  60. package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
  61. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
  62. package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
  63. package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
  64. package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
  65. package/plugins/sp/scripts/task-size-precheck.ts +202 -0
  66. package/plugins/sp/scripts/validate-commands.ts +651 -0
  67. package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
  68. package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
  69. package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
  70. package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
  71. package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
  72. package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
  73. package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
  74. package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
  75. package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
  76. package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
  77. package/plugins/sp/skills/code-implementation/SKILL.md +203 -0
  78. package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
  79. package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
  80. package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
  81. package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
  82. package/plugins/sp/skills/code-review/SKILL.md +112 -0
  83. package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
  84. package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
  85. package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
  86. package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
  87. package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
  88. package/plugins/sp/skills/code-testing/SKILL.md +108 -0
  89. package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
  90. package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
  91. package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
  92. package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
  93. package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
  94. package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
  95. package/plugins/sp/skills/code-verification/SKILL.md +535 -0
  96. package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
  97. package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
  98. package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
  99. package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
  100. package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
  101. package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
  102. package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
  103. package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
  104. package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
  105. package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
  106. package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
  107. package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
  108. package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
  109. package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
  110. package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
  111. package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
  112. package/plugins/sp/skills/functional-review/SKILL.md +364 -0
  113. package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
  114. package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
  115. package/plugins/sp/skills/issue-finding/SKILL.md +442 -0
  116. package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
  117. package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
  118. package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
  119. package/plugins/sp/skills/issue-finding/references/session-formats.md +151 -0
  120. package/plugins/sp/skills/next-feature/SKILL.md +125 -0
  121. package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
  122. package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
  123. package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
  124. package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
  125. package/plugins/sp/skills/next-router/SKILL.md +181 -0
  126. package/plugins/sp/skills/next-router/references/messages.md +90 -0
  127. package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
  128. package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
  129. package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +109 -0
  130. package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
  131. package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
  132. package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
  133. package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
  134. package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
  135. package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
  136. package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
  137. package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
  138. package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
  139. package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
  140. package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
  141. package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
  142. package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
  143. package/plugins/sp/skills/spur-cli/references/features.md +234 -0
  144. package/plugins/sp/skills/spur-cli/references/init.md +119 -0
  145. package/plugins/sp/skills/spur-cli/references/message.md +98 -0
  146. package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
  147. package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
  148. package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
  149. package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
  150. package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
  151. package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
  152. package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
  153. package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
  154. package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
  155. package/plugins/sp/skills/spur-cli/references/tasks.md +280 -0
  156. package/plugins/sp/skills/spur-cli/references/team.md +133 -0
  157. package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
  158. package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
  159. package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
  160. package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
  161. package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
  162. package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
  163. package/plugins/sp/skills/spur-dev/references/cross-cutting.md +680 -0
  164. package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
  165. package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
  166. package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
  167. package/plugins/sp/skills/spur-dev/references/execution-batch.md +790 -0
  168. package/plugins/sp/skills/spur-dev/references/execution-workflow.md +352 -0
  169. package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
  170. package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
  171. package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
  172. package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
  173. package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
  174. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +120 -0
  175. package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
  176. package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
  177. package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
  178. package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
  179. package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
  180. package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
  181. package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
  182. package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
  183. package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
  184. package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
  185. package/spur.js +6035 -4963
@@ -0,0 +1,621 @@
1
+ # Spur Dev Plugin (`sp`)
2
+
3
+ The spec-pipeline plugin for Spur's planning→execution lifecycle. It wraps the `spur` CLI (task,
4
+ feature, rule, workflow, agent) with a thin orchestration spine (`sp:spur-dev`) that dispatches
5
+ deep competency skills for each unit of work, plus scenario-specific slash commands that give each
6
+ lifecycle step a deterministic entry point.
7
+
8
+ > **Spur** — a local-first harness engineering toolkit that wraps mainstream coding agents (Claude
9
+ > Code, Codex, Gemini CLI, Antigravity, pi, OpenCode, OpenClaw) with constraint checking, workflow
10
+ > orchestration, history analytics, and operational visibility. The `sp` plugin is the Claude Code
11
+ > plugin surface for that toolkit.
12
+
13
+ - **Marketplace entry:** `name: "sp"`, `version: "0.3.41"`, `source: "./plugins/sp"` (`plugin.json`,
14
+ kept in sync with `.claude-plugin/marketplace.json`).
15
+ - **Owner:** Robin Min.
16
+
17
+ Read this file first for the map; read [skills/spur-dev/SKILL.md](skills/spur-dev/SKILL.md) for the
18
+ spine itself, and [skills/spur-dev/references/glossary.md](skills/spur-dev/references/glossary.md)
19
+ for sp's own vocabulary (spine, competency, facade, corpus, gate, verdict, half, HITL, WBS, ...).
20
+
21
+ ---
22
+
23
+ ## How to use it daily
24
+
25
+ ### The main flow
26
+
27
+ One feature, start to finish — see the Command index below for exact command names:
28
+
29
+ ```
30
+ idea/plan vague description → feature + AC + decomposed task batch
31
+
32
+ run <wbs> → pipeline: precheck → implement → test → review → approve(HITL) → verify → record → done
33
+
34
+ verify <wbs> → traceability + AC verdict (PASS clears the gate; this also runs inside the run step)
35
+
36
+ wrap <wbs> → learnings, metrics, doc-sync, feature transition, branch cleanup
37
+ ```
38
+
39
+ The idea entry and the plan entry both land at a validated, decomposed feature — the former adds a
40
+ grilling discovery interview first; the latter starts from an already-written description. Pick one,
41
+ not both. The verify entry is independently invocable (its `--force` flag re-audits an already-`done`
42
+ task), but the full pipeline already runs the same verification as one of its stages.
43
+
44
+ ### On-ramps
45
+
46
+ Entry points that feed the main flow above, or run independently of it — see the index for names:
47
+
48
+ - The **rule-authoring scan** mines recent history for a recurring anti-pattern worth codifying as a
49
+ constraint rule, before it costs another review cycle.
50
+ - The **dogfood driver** exercises any skill/command/CLI surface end-to-end with bounded auto-fix and
51
+ self-monitoring; use it to validate a change to this plugin itself.
52
+ - The **fix-everything sweep** cleans lint/type/test errors across the working tree, independent of
53
+ any single task.
54
+ - Two small git helpers generate a conventional commit message from staged changes, and a changelog
55
+ from git history.
56
+ - The **project bootstrapper** scaffolds a brand-new Spur project (config + docs), then tailors it
57
+ to the target stack.
58
+
59
+ ### Batch and parallel paths
60
+
61
+ The main flow is one task/feature at a time. Two entries widen the aperture (see the index for exact
62
+ names): a **batch pipeline runner** drives a whole set of tasks through their pipelines in
63
+ dependency-correct order — resolve the set, topologically sort, run each one, emit a single batch
64
+ report, sequential by default — and a **parallel fan-out** spreads independent tasks or
65
+ investigations across subagents when explicitly requested and the independence checks (dependency,
66
+ file-overlap, token-budget) clear, falling back to sequential otherwise. A batch sibling of the
67
+ single-task wrap-up closes out a whole set of completed tasks in one pass.
68
+
69
+ ### Crossing a session boundary
70
+
71
+ Two different problems, two different tools:
72
+
73
+ - **The harness compacts your context mid-task.** That's normal. Keep the _planning_ half in one
74
+ unbroken context window, because HITL gates and decomposition state don't survive a context reset;
75
+ _execution_ is designed to survive it — pick a fresh session, reload task state via the CLI, and
76
+ resume. Prefer a fresh context per task execution over carrying a long history forward.
77
+ - **You're blocked and need to hand off** — to another session, another agent, or a human. That's
78
+ what the **handover generator** is for: it captures goal, progress, the blocker, rejected
79
+ approaches, and next steps as a structured document, so whoever picks this up next doesn't have to
80
+ re-derive what's already been ruled out.
81
+
82
+ Rule of thumb: a fresh session is for _continuing the same work_; a handover document is for
83
+ _someone else picking it up cold_.
84
+
85
+ ### Command index
86
+
87
+ Every file in `commands/`, grouped by the noun it operates on, one line each — the canonical name
88
+ list this README is checked against.
89
+
90
+ #### Lifecycle — planning
91
+
92
+ | Command | What it does |
93
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
+ | `dev-idea` | Turn a vague idea into a feature with AC and a decomposed task batch — discovery, idea-eval, feature-create, AC, feature-check, system-design, decompose, batch-create, handoff |
95
+ | `dev-plan` | Plan a feature from a written description — intake → feature create → AC generation → feature check gate → decomposition → batch-create |
96
+ | `dev-brainstorm` | Interactive solution design — heuristic discovery interview followed by structured ideation with trade-offs and confidence scoring |
97
+ | `dev-refine` | Refine task requirements via structured Q&A — clarify scope, elicit missing details, tighten acceptance criteria; `--depth ready` for implement-ready freeze |
98
+
99
+ #### Lifecycle — execution
100
+
101
+ | Command | What it does |
102
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
103
+ | `dev-next` | Status-aware router — inspect a task (or next frontier under a feature), dispatch the best existing `/sp:dev-*` command, chain on clean success |
104
+ | `dev-run` | Run a task — full pipeline (precheck→implement→test→review→approve→verify→record→done) or single-step (implement) |
105
+ | `dev-review` | Multi-dimensional review for a task or path — functional requirements traceability, SECUA framework, and architectural depth |
106
+ | `dev-verify` | Verify a task against its requirements and Acceptance Criteria — traceability check producing a PASS/PARTIAL/FAIL verdict with evidence |
107
+ | `dev-unit` | Generate or extend tests until the unit target is met |
108
+ | `dev-wrap` | Wrap up a single completed task — learnings, metrics, doc-sync, optional feature transition and branch cleanup |
109
+ | `dev-refresh` | Refresh feature status by feature ID, task WBS, or batch sweep via spur feature sync |
110
+ | `dev-featurechange` | Restructure feature tree from a mapping file — dry-run/apply via `spur feature move`, task edges, root `docs/*.md` only |
111
+
112
+ #### Lifecycle — batch and parallel
113
+
114
+ | Command | What it does |
115
+ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | `dev-runall` | Run a batch of tasks through their pipelines in dependency-correct order — resolve a set, topo-sort, run each via task-pipeline.yaml, emit a batch report |
117
+ | `dev-parallel` | Fan out independent tasks or investigations in parallel via subagents — choose the right pattern and synthesize results |
118
+ | `dev-refineall` | Batch-refine tasks (feature or selector) — planning-half bulk fill of Background/Requirements/AC/Design/Plan before runall; `--depth ready` for implement-ready freeze |
119
+ | `dev-verifyall` | Batch-verify tasks against requirements and AC — resolves a set, runs per-task verification, produces consolidated PASS/PARTIAL/FAIL summary report |
120
+ | `dev-wrapall` | Wrap up a batch of completed tasks — learnings, metrics, doc-sync, feature transition, optional branch cleanup |
121
+
122
+ #### Lifecycle — operations and hygiene
123
+
124
+ | Command | What it does |
125
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
126
+ | `dev-handover` | Generate a structured handover document when blocked — captures goal, progress, blocker, rejected approaches, and next steps |
127
+ | `dev-debug` | Systematic debugging protocol — reproduce, isolate, diagnose root cause, apply minimal fix, and verify with regression tests |
128
+ | `dev-daily` | Generate a daily summary report from agent usage data, git history, and notes |
129
+ | `dev-dogfood` | Dogfood an agent skill/command/CLI — drive it end-to-end with bounded auto-fix, self-monitor, and emit a comprehensive report |
130
+ | `dev-find-issue` | Review agent session logs, identify performance bottlenecks and behavioral anti-patterns, and generate a structured task file with proposed fixes |
131
+ | `dev-find-conflict` | Authority-aware semantic audit across source, task, feature, and project authority files — detect conflicts, resolve claim-specific authority, and route confirmed repairs through owner surfaces |
132
+ | `dev-find-next` | Prompt-first feature frontier prioritizer — ranks the open feature frontier by derived importance/urgency with per-candidate evidence; gates unactionable features; emits tree defects as proposals only |
133
+ | `dev-fixall` | Fix all lint, type, and test errors systematically across the working tree |
134
+ | `dev-simplify` | Simplify recently-changed code for clarity without changing behavior — incremental, test-after-each, revert on regression |
135
+ | `dev-arch` | Survey a codebase (or module tree) for shallow modules and deepening opportunities — emit a ranked MARKDOWN candidate report that feeds the planning half; never auto-refactors |
136
+ | `dev-reverse` | Reverse-engineer a codebase — analyze unfamiliar repos, generate HLD/architecture docs, audit quality/security, and produce onboarding documentation |
137
+ | `dev-gitmsg` | Generate conventional commit message(s) from staged changes via per-file summarization, optionally commit |
138
+ | `dev-gtd` | Get things done — quality gate (auto-fix) → act CI simulation → conventional commit → push → gh verify in one flow |
139
+ | `dev-changelog` | Generate changelog from git commits |
140
+
141
+ #### Rule authoring
142
+
143
+ | Command | What it does |
144
+ | ------------- | --------------------------------------------------------- |
145
+ | `rule-scan` | Discover recurring anti-patterns worth codifying as rules |
146
+ | `rule-add` | Author a validated, smoke-tested constraint rule |
147
+ | `rule-refine` | Refine a constraint rule or preset, then re-verify it |
148
+
149
+ #### Workflow authoring
150
+
151
+ | Command | What it does |
152
+ | ----------------- | ------------------------------------------------------------------------- |
153
+ | `workflow-add` | Author a validated, dry-run-verified workflow in the right execution mode |
154
+ | `workflow-refine` | Refine an existing workflow, then re-validate and re-dry-run it |
155
+
156
+ #### Project bootstrap
157
+
158
+ | Command | What it does |
159
+ | ----------- | --------------------------------------------------------------------------------------------------------- |
160
+ | `spur-init` | Initialize a new Spur project — scaffold config + docs, then customize for this project's stack and scope |
161
+
162
+ ---
163
+
164
+ ## How it works
165
+
166
+ ### Skills, not commands
167
+
168
+ Commands above are thin wrappers; the actual logic lives in `skills/`. The spine (`sp:spur-dev`)
169
+ dispatches five competency skills by function — design (`sp:sys-architecture`), decomposition
170
+ (`sp:spec-decomposition`), implementation (`sp:code-implementation`), testing (`sp:code-testing`),
171
+ and verification (`sp:code-verification`) — plus a CLI facade (`sp:spur-cli`, one reference per
172
+ `spur` noun) and standalone technique skills (`sp:next-router`, `sp:test-driven-development`, `sp:brainstorm`,
173
+ `sp:wayfinder`, `sp:sys-debugging`, `sp:code-review`, `sp:code-simplification`, `sp:code-improvement`,
174
+ `sp:parallel-execution`, `sp:branch-workflow`, `sp:doc-evolve`, `sp:dogfood-testing`,
175
+ `sp:daily-summary`, `sp:reverse-engineering`, `sp:issue-finding`, `sp:conflict-finding`, `sp:indexed-context`). See
176
+ [skills/spur-dev/SKILL.md](skills/spur-dev/SKILL.md)'s Step routing table for which skill owns which
177
+ pipeline step.
178
+
179
+ ### Directory layout
180
+
181
+ ```
182
+ plugins/sp/
183
+ ├── skills/ # Domain knowledge + workflow docs (28 skills)
184
+ │ ├── brainstorm/ # Structured ideation workflow
185
+ │ │ ├── agents/openai.yaml
186
+ │ │ ├── examples/ideation-example.md
187
+ │ │ └── references/workflows.md
188
+ │ ├── branch-workflow/ # Branch lifecycle + worktree patterns
189
+ │ │ └── references/{branch-lifecycle, worktree-patterns}.md
190
+ │ ├── code-implementation/ # Implementation competency
191
+ │ │ └── references/{debugging, implementation-patterns}.md
192
+ │ ├── code-improvement/ # Architectural deepening opportunities
193
+ │ │ └── references/deepening-signals.md
194
+ │ ├── code-review/ # Pre-commit self-review + SECUA review lenses
195
+ │ │ └── references/{review-lenses, self-review-checklist}.md
196
+ │ ├── code-simplification/ # Behavior-preserving simplification
197
+ │ ├── code-testing/ # Testing / coverage competency
198
+ │ │ └── references/{unit-testing.md, stacks/{bun-ts, go, python}.md}
199
+ │ ├── code-verification/ # Verify + SECUA review
200
+ │ │ └── references/{code-improvement, secu-review, verdict-schema}.md
201
+ │ ├── daily-summary/ # Daily summary report generator
202
+ │ │ └── agents/openai.yaml
203
+ │ ├── doc-evolve/ # Key-document evolution per constitution
204
+ │ │ └── references/operations.md
205
+ │ ├── dogfood-testing/ # Dogfood backbone — 4-phase protocol + report
206
+ │ │ └── references/{monitor-ledger, report-template}.md
207
+ │ ├── doubt-driven-development/ # In-flight adversarial decision review (SKILL.md only)
208
+ │ ├── functional-review/ # Requirements traceability assessment (Phase 8b gate)
209
+ │ │ └── references/verdict-schema.md
210
+ │ ├── indexed-context/ # Cross-agent project context (anatomy, learnings, pitfalls, buglog, ledger)
211
+ │ ├── next-router/ # Status→command router backing /sp:dev-next
212
+ │ │ └── references/routing-table.md
213
+ │ ├── parallel-execution/ # Fan-out decision framework + patterns
214
+ │ │ └── references/{fan-out-patterns, result-synthesis}.md
215
+ │ ├── source-driven-development/ # Source-first API/contract verification (SKILL.md only)
216
+ │ ├── spec-decomposition/ # Feature/spec → task-batch competency
217
+ │ │ └── references/decomposition.md
218
+ │ ├── spur-cli/ # CLI facade — one reference per `spur` noun
219
+ │ │ └── references/
220
+ │ │ ├── tasks.md + tasks/{verbs, section-editing}.md
221
+ │ │ ├── features.md + features/{verbs, acceptance-criteria, roadmap-priority}.md
222
+ │ │ ├── rules.md + rules/{operations, authoring-rules, fine-tuning, validation-and-extension}.md
223
+ │ │ └── workflows.md + workflows/{operations, authoring-workflows, validation-and-extension}.md
224
+ │ ├── spur-dev/ # Thin planning→execution orchestration spine
225
+ │ │ └── references/ # ac-style-guide, cross-cutting, decision-brief, dev-operations,
226
+ │ │ execution-batch, execution-workflow, feature-link-helper,
227
+ │ │ flag-glossary, gate-checklists, glossary, planning-workflow,
228
+ │ │ product-planning (12 files)
229
+ │ ├── test-driven-development/ # TDD workflow companion (SKILL.md only)
230
+ │ ├── reverse-engineering/ # Codebase reverse engineering / HLD / audit
231
+ │ │ ├── agents/openai.yaml
232
+ │ │ └── SKILL.md
233
+ │ ├── issue-finding/ # Session-log forensics → fix task generation
234
+ │ │ ├── agents/openai.yaml
235
+ │ │ ├── examples/{session-test-loop.jsonl, expected-findings.json}
236
+ │ │ └── references/session-formats.md
237
+ │ ├── conflict-finding/ # Authority-aware four-pillar semantic conflict audit
238
+ │ │ └── references/{authority-resolution.md, comparison-protocol.md, finding-contract.md, remediation-routing.md}
239
+ │ ├── next-feature/ # Prompt-first feature frontier prioritizer (backs /sp:dev-find-next)
240
+ │ │ └── references/{signal-derivation.md, ranking-rubric.md, proposal-contract.md, handoff-routing.md}
241
+ │ ├── sys-architecture/ # Architecture / ADR judgment competency
242
+ │ │ └── references/decision-method.md
243
+ │ ├── sys-debugging/ # Structured debugging protocol
244
+ │ │ └── references/debugging-protocol.md
245
+ │ └── wayfinder/ # Multi-session investigation maps (SKILL.md only)
246
+ ├── commands/ # 37 slash-command wrappers — the SSOT (hand-editable thin wrappers; see Commands below)
247
+ ├── agents/ # 4 specialist subagents (expert-spur, super-coder, super-planner, super-reviewer)
248
+ ├── hooks/ # hooks.json + task-write-guard.{ts,test.ts} + context-{session-start,post-tool,session-stop}.ts
249
+ │ # + careful-guard.{ts,test.ts} + context-hooks.test.ts + token-estimate.test.ts
250
+ ├── scripts/ # Executable helpers, split from prompts (ADR-031) — validate-commands.ts (thin-wrapper validator), batch-preflight.ts + scripts/<skill>/
251
+ │ # (daily-summary: {daily-summary, logger}.ts; dogfood-testing: {detect-pipeline-driving, validate-report}.ts)
252
+ ├── tests/ # Plugin tests — command-contract.test.ts + skill-structure.test.ts + batch-preflight.test.ts + per-skill suites
253
+ ├── evals/ # Skill behavioral eval harness (scenarios + judge + run-eval runner)
254
+ ├── plugin.json # Marketplace entry
255
+ └── README.md # This file
256
+ ```
257
+
258
+ ### Entity design
259
+
260
+ The plugin follows a strict **three-tier delegation** — each tier has a single responsibility and
261
+ delegates to the next. No tier reaches across another.
262
+
263
+ ```
264
+ Tier 1 — Entry Points (Commands / Agents / Hooks)
265
+ │ Parse user input, route to the correct skill
266
+ │ Contains ZERO domain logic
267
+
268
+ Tier 2 — Knowledge Layer (Skills)
269
+ │ Provide domain knowledge, workflows, and patterns
270
+ │ Delegate every deterministic, corpus-mutating operation to the CLI
271
+ │ Contains ZERO validation logic
272
+
273
+ Tier 3 — Execution Layer (spur CLI + Guard Scripts)
274
+ │ Perform deterministic operations (create, update, check, resolve, run)
275
+ │ Validate before writing — the CLI is the gate
276
+ │ Enforce hard gates (PreToolUse guard)
277
+ ```
278
+
279
+ #### 1. Skills (`skills/`)
280
+
281
+ The single source of truth for domain knowledge and workflow documentation. Each skill is a
282
+ self-contained knowledge module that teaches the agent how to operate one slice of the Spur CLI
283
+ surface or run one workflow. All skills target the same five core platforms: `claude-code`, `codex`,
284
+ `antigravity`, `opencode`, `openclaw`; `conflict-finding`, `issue-finding`, `next-feature`, and
285
+ `reverse-engineering` additionally declare `pi`.
286
+
287
+ | Skill | Ver | Domain |
288
+ | --------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
289
+ | `spur-dev` | 1.1 | Thin orchestration spine — drives planning→execution, gates, HITL, and dispatches competencies; never inlines implementation/testing/decomposition/review |
290
+ | `spur-cli` | 1.0 | CLI facade — one reference per `spur` noun (`task`, `feature`, `rule`, `workflow`), each with verb tables, flag guides, `--json` shapes, and write-contract rules |
291
+ | `sys-architecture` | 1.0 | Architecture / ADR judgment — module boundaries, data flow, transport/storage/auth choices, build-vs-extend decisions |
292
+ | `spec-decomposition` | 1.0 | Feature/spec → validated task-batch decomposition — scenario-to-task mapping, variant selection, granularity sizing, batch-JSON production |
293
+ | `code-implementation` | 1.0 | Implementation competency — task-driven code changes, stack-pattern selection, root-cause debugging, and Solution change-map production |
294
+ | `code-testing` | 1.0 | Testing competency — run tests, measure coverage, categorize gaps, extend targeted tests with per-stack adapters (Bun/TS, Go, Python) |
295
+ | `code-verification` | 1.0 | Requirements-traceability verdict (PASS/PARTIAL/FAIL) + SECUA code review (Security, Efficiency, Correctness, Usability, Architecture); backs `/sp:dev-verify` and `/sp:dev-review` |
296
+ | `code-review` | 1.0 | Pre-commit self-review checklist (6 categories, catches 60-80% of issues) + SECUA review lenses + findings processing |
297
+ | `code-simplification` | 1.0 | Behavior-preserving simplification — Chesterton's Fence, signal tables, incremental change + test-after-each, scope-to-changed |
298
+ | `code-improvement` | 1.0 | Architectural deepening — surface shallow/tightly-coupled modules and propose refactors that make them deep, testable, AI-navigable; backs `/sp:dev-arch` |
299
+ | `functional-review` | 1.0 | Requirements-traceability assessment — per-requirement verdicts with file:line evidence that the implementation satisfies ALL task requirements; pipeline Phase 8b gate |
300
+ | `doubt-driven-development` | 1.0 | In-flight adversarial review of a non-trivial decision before committing it — hand artifact + contract to a fresh-context skeptic, reconcile, stop at 3 cycles |
301
+ | `source-driven-development` | 1.0 | Source-first verification — verify framework/API/library facts against primary sources before generating code; separates "the API exists" from "used correctly under its contract" |
302
+ | `dogfood-testing` | 1.2 | Dogfood backbone — drives a testee end-to-end with bounded auto-fix, a live monitor ledger, and a structured report; @1.2 adds footer-mandatory reports, 7-check finalize-or-abort, and the `validate-report` CLI; backs `/sp:dev-dogfood` |
303
+ | `next-router` | 1.0 | Status→command router — resolve a task WBS or feature frontier, TABLE A/B/C lookup with light-gate short-circuit, single dispatch or HITL stop; backs `/sp:dev-next` |
304
+ | `parallel-execution` | 1.0 | Fan-out decision framework — when to parallelize, four proven fan-out patterns, and result synthesis; backs `/sp:dev-parallel` |
305
+ | `sys-debugging` | 1.0 | Structured debugging protocol — reproduce→isolate→root cause→fix→regression test; "ask the debugger before the LLM" principle |
306
+ | `branch-workflow` | 1.0 | Branch-lifecycle discipline — create→worktree→commit→self-review→merge→cleanup; git worktree patterns for parallel branches |
307
+ | `test-driven-development` | 1.0.0 | TDD workflow companion — red-green-refactor cycle, behavior-first test design, AAA structure, data builders, mock-at-boundary anti-patterns |
308
+ | `brainstorm` | 1.0.0 | Structured ideation workflow — generate solution options with trade-offs and confidence scoring |
309
+ | `wayfinder` | 1.0.0 | Multi-session investigation maps — chart a spur feature as the map when the destination itself is foggy, then resolve one ticket per session until the route is clear |
310
+ | `daily-summary` | 1.0.0 | Daily summary report generator — orchestrates ccusage CLI + git history into structured markdown summaries |
311
+ | `doc-evolve` | 1.0 | Key-document evolution per `docs/99_PROJECT_CONSTITUTION.md` — drift audits, same-commit sync checks, frontmatter-contract verification, machine-appended lessons |
312
+ | `reverse-engineering` | 1.1 | Codebase analysis / HLD generation / audit — depth-driven reverse engineering with orthogonal mode, focus, and format controls; backs `/sp:dev-reverse` |
313
+ | `issue-finding` | 1.1 | Session-log forensics — multi-source discovery, bottleneck ranking, optional topic focus, CLI-gated fix task generation; backs `/sp:dev-find-issue` |
314
+ | `conflict-finding` | 1.0 | Authority-aware semantic audit — four-pillar (source/task/feature/authority) conflict discovery, claim-specific authority resolution, reproducible evidence, confirmed owner-routed remediation; backs `/sp:dev-find-conflict` |
315
+ | `next-feature` | 1.0 | Prompt-first feature frontier prioritizer — sync-first precondition, B3 actionability gate (cited, never restated), tiered rubric over measured signals, D1–D4 defect proposals conforming to the restructure map schema; backs `/sp:dev-find-next` |
316
+ | `indexed-context` | 1.0 | Cross-agent project context — anatomy/learnings/pitfalls/buglog/memory in `.spur/context/`; hook-tracked token-ledger; graceful degradation on agents without hooks |
317
+
318
+ Each skill directory contains:
319
+
320
+ - `SKILL.md` — main documentation with YAML frontmatter (`name`, `description`, `metadata.version`,
321
+ `metadata.platforms`, `metadata.interactions`, `openclaw.emoji`, …).
322
+ - `references/` — deep-dive docs where the skill warrants them. `spur-cli` ships one reference per
323
+ CLI noun plus per-noun sub-references for verbs, authoring, and operations; `spur-dev` carries
324
+ planning, execution, batch, gate-checklist, and glossary references; `code-testing` ships
325
+ per-stack adapters.
326
+ - Executable TypeScript helpers live under plugin-level `scripts/<skill>/` (e.g. `daily-summary`,
327
+ `dogfood-testing`) — split from the prompt layer (`skills/`), with their suites in `tests/<skill>/`.
328
+ - Some skills (`brainstorm`, `daily-summary`, `reverse-engineering`, `issue-finding`) carry `agents/openai.yaml` for multi-model dispatch.
329
+
330
+ **Design principle:** Skills are **knowledge, not execution**. They describe _what to do and why_;
331
+ the `spur` CLI performs every deterministic, corpus-mutating operation and validates before writing.
332
+ Skills contain zero validation logic — the CLI is the gate.
333
+
334
+ #### 2. Commands (`commands/`)
335
+
336
+ Thin slash-command wrappers that parse user arguments and delegate to the corresponding skill. Each
337
+ command is a user-facing entry point that bridges natural language to skill invocation. There are
338
+ **37 commands** (see the Command index above for the full list), organized by the surface they wrap:
339
+
340
+ | Prefix | Count | Delegates to | Purpose |
341
+ | ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
342
+ | `dev-*` | 31 | `sp:spur-dev`, `sp:code-implementation`, `sp:code-testing`, `sp:code-verification`, `sp:code-simplification`, `sp:next-router`, `sp:brainstorm`, `sp:dogfood-testing`, `sp:parallel-execution`, `sp:sys-debugging`, `sp:daily-summary`, `sp:issue-finding`, `sp:conflict-finding`, `sp:reverse-engineering`, inline | The dev-workflow surface — planning, execution, batch, wrap-up, review/verify, hygiene |
343
+ | `rule-*` | 3 | `sp:spur-cli` | The rule surface — `rule-add`, `rule-refine`, `rule-scan` |
344
+ | `workflow-*` | 2 | `sp:spur-cli` | The workflow surface — `workflow-add`, `workflow-refine` |
345
+ | `spur-init` | 1 | `sp:doc-evolve` | Project bootstrap (`spur init`) with doc-evolve integration |
346
+
347
+ Each command file contains:
348
+
349
+ - YAML frontmatter (`description`, `argument-hint`, `allowed-tools`).
350
+ - A delegation block: `Skill(skill="sp:<skill-name>", args="<operation> $ARGUMENTS")`.
351
+
352
+ **Commands as SSOT (ADR-032).** The 37 `.md` files in `commands/` are the authoritative,
353
+ hand-editable source for the operator command surface. Per-platform adapters are **install-time
354
+ output** owned by `superskill` (`superskill install sp`) and never committed here. Plugin `sp` ships
355
+ no per-platform artifacts — only the platform-independent thin wrappers.
356
+
357
+ **Thin-wrapper contract** is enforced by `scripts/validate-commands.ts`:
358
+
359
+ ```bash
360
+ bun plugins/sp/scripts/validate-commands.ts # validate all 37 commands
361
+ bun plugins/sp/scripts/validate-commands.ts --json # machine-readable output
362
+ ```
363
+
364
+ The validator checks five gates. For **non-`dev-*`** commands: (a) heading whitelist — only
365
+ `## Usage` + `## Implementation` beyond the H1 title; (b) frontmatter schema — `description`,
366
+ `argument-hint`, `allowed-tools` present; (c) target resolution — every `sp:<skill>` reference,
367
+ workflow file, and procedure anchor in `## Implementation` exists on disk; (d) `allowed-tools`
368
+ coherence — `Skill` is present iff the body contains a `Skill()` call. For **`dev-*`** commands,
369
+ gate (a) is strengthened: the ordered three-heading set `## Argument Flags` → `## Usage` →
370
+ `## Implementation` is required, and gate (e) checks the `argument-hint` is syntax-only (no
371
+ Markdown links), the `## Argument Flags` table has exactly `Flag | Description | Default` columns,
372
+ the command carries exactly one glossary reference, and canonical hint tokens have bidirectional
373
+ parity with table rows. The same gates are tested in `tests/command-contract.test.ts` and
374
+ `tests/command-flag-parity.test.ts`. See
375
+ `docs/design/dev-command-argument-contract.md` for the full contract.
376
+
377
+ Commands are hand-editable by design: edit the `.md` directly; the validator catches drift.
378
+ **A fresh session is required to trust an in-session dogfood of a just-edited wrapper** (platforms
379
+ snapshot command bodies at session start).
380
+
381
+ **Design principle:** Commands are **pass-through routers**. They contain zero domain logic — they
382
+ parse `$ARGUMENTS` and forward to the skill, which owns the workflow knowledge.
383
+
384
+ #### 3. Agents (`agents/`)
385
+
386
+ Specialist subagents that run in isolated context windows. Four shapes: **expert agents** route a
387
+ request to the single skill they own; **`super-coder`** is the build agent that owns architecture,
388
+ system design, production code, test code, and debugging by dispatching the four build competency
389
+ skills rather than inlining their logic; **`super-planner`** drives one task end-to-end or a
390
+ dependency-ordered task batch through the `sp:spur-dev` pipeline; **`super-reviewer`** runs the
391
+ multi-dimensional review (functional traceability + SECUA + architectural depth) standalone or as
392
+ the pipeline's Phase 7 review step.
393
+
394
+ | Agent | Shape | Delegates to | Color | Trigger examples |
395
+ | ---------------- | ------------ | ----------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------- |
396
+ | `expert-spur` | expert | `sp:spur-cli` | green | "create tasks", "feature lifecycle", "add a rule", "author a workflow" |
397
+ | `super-coder` | builder | `sp:sys-architecture` + `sp:code-implementation` + `sp:code-testing` + `sp:sys-debugging` | blue | "implement this", "write the code", "fix this bug", "design the architecture" |
398
+ | `super-planner` | orchestrator | `sp:spur-dev` + `sp:dogfood-testing` | green | "run this task end to end", "run all tasks", "run the batch", "runall" |
399
+ | `super-reviewer` | reviewer | `sp:code-verification` + `sp:functional-review` + `sp:code-improvement` | crimson | "review this", "check the code", "SECUA review", "run task 0042 through review" |
400
+
401
+ Each agent has:
402
+
403
+ - `skills: [sp:<skill-name>]` - bound to one (`expert-spur`), four (`sp:sys-architecture`,
404
+ `sp:code-implementation`, `sp:code-testing`, `sp:sys-debugging` for `super-coder`; `sp:spur-dev`,
405
+ `sp:parallel-execution`, `sp:dogfood-testing`, `sp:next-router` for `super-planner`), or three
406
+ (`sp:code-verification`, `sp:functional-review`, `sp:code-improvement` for `super-reviewer`).
407
+ - `model: inherit` — inherits the parent session's model.
408
+ - `color` — roster display accent.
409
+ - `tools` — allowed tool set (`Read`, `Grep`, `Glob`, `Bash`, `Skill`).
410
+
411
+ **Design principle:** Agents are **delegates, not implementors**. They never contain domain logic.
412
+ `expert-spur` routes CLI corpus work to `sp:spur-cli`; `super-coder` dispatches the four build
413
+ competencies and does not orchestrate batches (that is `super-planner`) or review (that is
414
+ `super-reviewer`); `super-planner` drives the single-task/batch loop (the algorithm lives in
415
+ `sp:spur-dev/references/execution-batch.md`); `super-reviewer` fans a review out across its three
416
+ skill dimensions without reaching into individual pipeline steps. For a single well-scoped
417
+ operation, the matching `/sp:*` command is lighter; for work spanning multiple phases or a batch,
418
+ the agent provides an isolated context window.
419
+
420
+ #### 4. Hooks (`hooks/`)
421
+
422
+ Event-driven enforcement that runs automatically without user invocation. `hooks.json` registers
423
+ four handlers:
424
+
425
+ | Event | Matcher | Handler | Timeout |
426
+ | -------------- | ------------------------------------- | ---------------------------------------------- | ------- |
427
+ | `PreToolUse` | `Write\|Edit` | `superskill hook run sp task-write-guard` | 10s |
428
+ | `PostToolUse` | `Bash\|Grep\|Glob\|Read\|Write\|Edit` | `superskill hook run sp context-post-tool` | 10s |
429
+ | `SessionStart` | — | `superskill hook run sp context-session-start` | 15s |
430
+ | `SessionEnd` | — | `superskill hook run sp context-session-stop` | 15s |
431
+
432
+ **Write guard.** The `PreToolUse` hook fires on every `Write`/`Edit` tool call and checks whether
433
+ the target path is **owned by a task** (i.e. it is a file in the task corpus under `docs/tasks/`).
434
+ If so, the write is denied — task files are mutated through the `spur task` CLI only, never by
435
+ hand. The hook is **pure delegation**: it asks `spur task resolve <path>` whether the path is owned
436
+ and decides the exit code alone; it contains zero validation logic of its own.
437
+
438
+ **Context hooks.** The `context-*` trio backs the `sp:indexed-context` skill: `context-post-tool`
439
+ estimates the token cost of each matched tool call and appends it to `.spur/context/token-ledger.jsonl`
440
+ (with redaction of sensitive argument fields), `context-session-start` seeds the indexed-context
441
+ hint on first launch, and `context-session-stop` closes out the session record.
442
+
443
+ **Available but unwired:** `careful-guard.ts` ships in `hooks/` (with tests) as an opt-in
444
+ `PreToolUse` guard that asks before destructive shell commands (`rm -rf`, `DROP TABLE`,
445
+ `git push --force`, …) — it is **not** registered in `hooks.json`. Fail-open by contract; escape
446
+ hatch `SPUR_CAREFUL=off`.
447
+
448
+ **Escape hatch:** `SPUR_WRITE_GUARD=off` short-circuits the write guard before any subprocess.
449
+
450
+ #### 5. Scripts (`scripts/` + `hooks/`)
451
+
452
+ Executable TypeScript that implements hook enforcement logic and deterministic helpers. Scripts are
453
+ the runtime layer — they run as processes, not as LLM context. Per **ADR-031**, executable helpers
454
+ live at plugin level: `scripts/<skill>/` with their suites at `tests/<skill>/`; skill directories
455
+ hold `SKILL.md` and prompt-side companions only.
456
+
457
+ | Script | Role |
458
+ | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
459
+ | `hooks/task-write-guard.ts` | Compatibility shim for older installs that still execute the script path directly. Forwards stdin to the stable PATH command `superskill hook run sp task-write-guard`, mirrors parseable PreToolUse decisions, and fails open if the runtime is unavailable. Performs no source-tree CLI lookup. |
460
+ | `hooks/context-*.ts` | Runtime for the three registered context hooks (session-start, post-tool, session-stop) — token-cost estimation + ledger append for `sp:indexed-context` |
461
+ | `hooks/careful-guard.ts` | Opt-in destructive-command guard (unwired — see Hooks above) |
462
+ | `scripts/batch-preflight.ts` | Pure TABLE A STOP evaluation for `super-planner` — skip doomed pipeline launches without spawning a Skill subprocess; recovery hints map stuck statuses to a single `/sp:dev-*` hop |
463
+ | `scripts/dogfood-testing/detect-pipeline-driving.ts` | Word-boundary detector for pipeline-driving testees (leading-space invariant) |
464
+ | `scripts/dogfood-testing/validate-report.ts` | Pure `validateReport(md)` — footer-mandatory + 7-check finalize-or-abort contract with stable error codes |
465
+ | `scripts/daily-summary/{daily-summary,logger}.ts` | ccusage + git-history orchestration helpers for `sp:daily-summary` |
466
+ | `scripts/feature-sync-bounded.ts` | Bounded retry-suppression wrapper for `spur feature sync` during batch/wrap-up runs — suppresses identical L4-blocked repeats |
467
+ | `scripts/stage-registry-adapter.ts` | dev-next golden-path adapter over the canonical stage registry — TABLE A/B/C resolution bridge for the status-aware facade |
468
+ | `scripts/task-size-precheck.ts` | Pipeline size precheck guard (R2) + size-vs-executor-capability gate (R3) — evaluates R-item/Plan-count limits to PASS/FAIL |
469
+ | `scripts/validate-flag-contracts.ts` | Mechanical consistency gate — compares flag claims across command files, flag-glossary, cross-cutting, dev-operations, and ADR; reports disagreements |
470
+ | `*.test.ts` | Unit suites — in `hooks/` for guards, in `tests/<skill>/` per ADR-031 pairing |
471
+
472
+ **Design principle:** Scripts are **deterministic enforcement**. Unlike skills (which are advisory
473
+ knowledge consumed by the LLM), scripts run as code and make binary allow/deny decisions. They are
474
+ the hard gate that the soft skill cannot enforce on its own.
475
+
476
+ ### Relationship diagram
477
+
478
+ ```mermaid
479
+ graph TB
480
+ subgraph "User entry points"
481
+ CMD["Commands<br/>37 slash commands<br/>/sp:dev-plan, /sp:dev-runall, /sp:dev-refineall, /sp:rule-add, ..."]
482
+ AGENT["Agents<br/>4 subagents<br/>expert-spur, super-coder, super-planner, super-reviewer"]
483
+ HOOK["PreToolUse hook<br/>Write|Edit matcher"]
484
+ end
485
+
486
+ subgraph "Knowledge layer"
487
+ SKILL_DEV["spur-dev<br/>thin orchestration spine"]
488
+ SKILL_CLI["spur-cli<br/>CLI noun facade"]
489
+ SKILL_IMPL["code-implementation<br/>implementation competency"]
490
+ SKILL_TEST["code-testing<br/>testing competency"]
491
+ SKILL_VERIFY["code-verification<br/>review + verify competency"]
492
+ SKILL_DECOMP["spec-decomposition<br/>feature/spec decomposition"]
493
+ SKILL_ARCH["sys-architecture<br/>architecture judgment"]
494
+ SKILL_BS["brainstorm<br/>structured ideation"]
495
+ SKILL_DS["daily-summary<br/>daily report generator"]
496
+ SKILL_DOC["doc-evolve<br/>document drift + sync"]
497
+ SKILL_DOG["dogfood-testing<br/>dogfood protocol + report"]
498
+ SKILL_TDD["test-driven-development<br/>TDD workflow companion"]
499
+ end
500
+
501
+ subgraph "Execution layer"
502
+ CLI["spur CLI<br/>task · feature · rule · workflow<br/>· agent · history · team · message"]
503
+ SCRIPT["hooks/task-write-guard.ts"]
504
+ end
505
+
506
+ subgraph "Corpus layer"
507
+ CORPUS["docs/tasks/ + docs/features/<br/>markdown planning corpus"]
508
+ RULES[".spur/rules/<br/>YAML constraint rules"]
509
+ WFS[".spur/workflows/<br/>YAML workflow definitions"]
510
+ end
511
+
512
+ CMD -->|"Skill(sp:spur-dev, ...)"| SKILL_DEV
513
+ CMD -->|"Skill(sp:code-implementation, ...)"| SKILL_IMPL
514
+ CMD -->|"Skill(sp:code-testing, ...)"| SKILL_TEST
515
+ CMD -->|"Skill(sp:code-verification, ...)"| SKILL_VERIFY
516
+ CMD -->|"Skill(sp:spur-cli, ...)"| SKILL_CLI
517
+ CMD -->|"Skill(sp:doc-evolve, ...)"| SKILL_DOC
518
+ CMD -->|"Skill(sp:brainstorm, ...)"| SKILL_BS
519
+ CMD -->|"Skill(sp:dogfood-testing, ...)"| SKILL_DOG
520
+
521
+ AGENT -->|"skills: [sp:spur-cli]"| SKILL_CLI
522
+ AGENT -->|"skills: [sp:spur-dev, sp:dogfood-testing]"| SKILL_DEV
523
+
524
+ HOOK -->|"superskill hook run"| SCRIPT
525
+ SCRIPT -->|"spur task resolve"| CLI
526
+
527
+ SKILL_DEV -->|"spur task/feature/workflow"| CLI
528
+ SKILL_CLI -->|"spur task/feature/rule/workflow"| CLI
529
+ SKILL_IMPL -->|"spur task update --section"| CLI
530
+ SKILL_VERIFY -->|"spur task check/verdict/record"| CLI
531
+ SKILL_TDD -->|"spur task"| CLI
532
+ SKILL_DOG -->|"spur workflow run"| CLI
533
+ SKILL_DOC -->|"spur task/feature"| CLI
534
+
535
+ CLI -->|"reads + validates + writes"| CORPUS
536
+ CLI -->|"reads + runs"| RULES
537
+ CLI -->|"reads + runs"| WFS
538
+ ```
539
+
540
+ ### Delegation flow by example
541
+
542
+ **Planning a feature end-to-end.**
543
+
544
+ 1. User types `/sp:dev-plan "add task body write API"`.
545
+ 2. **Command** (`dev-plan.md`) parses `$ARGUMENTS` and calls
546
+ `Skill(skill="sp:spur-dev", args="plan $ARGUMENTS")`.
547
+ 3. **Skill** (`spur-dev/SKILL.md`) drives the planning half: intake → `spur feature create` → AC
548
+ generation → `spur feature check` gate → decomposition → `spur task batch-create`.
549
+ 4. **CLI** validates each step before writing — feature IDs are race-safe, WBS allocation is atomic,
550
+ `check` is the readiness matrix.
551
+ 5. Result: validated feature file + decomposed task batch in `docs/features/` and `docs/tasks/`.
552
+
553
+ **Running a task through the pipeline.**
554
+
555
+ 1. User types `/sp:dev-run 0090`.
556
+ 2. **Command** delegates to `sp:spur-dev` skill (execution half).
557
+ 3. **Skill** reads the task, loads `.spur/workflows/task-pipeline.yaml`, and runs
558
+ `spur workflow run` with HITL surfacing.
559
+ 4. **CLI** executes the workflow engine (`@gobing-ai/ts-dual-workflow-engine`), pauses at HITL gates,
560
+ persists run state.
561
+ 5. Result: task driven through implement → check → fix → verify lifecycle.
562
+
563
+ **Task-corpus write protection.**
564
+
565
+ 1. The agent attempts a raw `Write`/`Edit` to a file under `docs/tasks/`.
566
+ 2. **PreToolUse hook** (`hooks.json`) fires, executing `superskill hook run sp task-write-guard`.
567
+ 3. **Runtime** reads the tool payload from stdin and resolves task ownership through the installed
568
+ hook runtime.
569
+ 4. If the path is owned by a task → emit `permissionDecision: deny` with a system message directing
570
+ to `spur task update --section`.
571
+ 5. If not owned → emit `permissionDecision: allow`; the tool call proceeds.
572
+
573
+ ### Workflow pipelines
574
+
575
+ The plugin ships workflow YAMLs under `.spur/workflows/`. Each
576
+ pipeline owns one lifecycle phase:
577
+
578
+ | Workflow | Phase | Entry command |
579
+ | --------------------------- | --------------------------------- | --------------------------------- |
580
+ | `basic.yaml` | Generic implement/check/fix | direct `spur workflow run` |
581
+ | `feature-lifecycle.yaml` | Feature status FSM | `spur feature update` |
582
+ | `task-lifecycle.yaml` | Task status FSM | `spur task update` |
583
+ | `planning-pipeline.yaml` | Planning/design from known slug | `/sp:dev-plan` |
584
+ | `task-pipeline.yaml` | Single-task execution | `/sp:dev-run` |
585
+ | `feature-dev.yaml` | Feature umbrella execution | `/sp:dev-runall --feature` |
586
+ | `idea-pipeline.yaml` | Idea to feature + AC + task batch | `/sp:dev-idea` |
587
+ | `wrapup-pipeline.yaml` | Post-execution wrap-up | `/sp:dev-wrap`, `/sp:dev-wrapall` |
588
+ | `docs-pipeline.yaml` | Docs-only task execution | `/sp:dev-run --mode implement` |
589
+ | `wayfinder-resolution.yaml` | Wayfinder ticket resolution loop | `spur workflow run` (free-form) |
590
+
591
+ ### Lifecycle operations
592
+
593
+ All planning entities (tasks and features) share a common lifecycle, managed by the `spur` CLI:
594
+
595
+ | Operation | Task verb | Feature verb | Quality gate |
596
+ | ----------- | ----------------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------- |
597
+ | **create** | `spur task create` / `batch-create` | `spur feature create` | Structural validation (WBS race-safe, ID hierarchical) |
598
+ | **check** | `spur task check` | `spur feature check` | 4-layer readiness matrix (schema, sections, traceability, AC) |
599
+ | **update** | `spur task update <wbs> [status]` | `spur feature update <id> [status]` | Lifecycle transition or scalar field set |
600
+ | **record** | `spur task record <wbs>` | — | Write Testing/Review from a verify verdict; optional Solution backfill (never transitions to `done`) |
601
+ | **refresh** | `spur task refresh` | `spur feature refresh` | Index + feature-tree roll-up regeneration |
602
+
603
+ The **workflow** and **rule** engines have their own lifecycles (author → validate → run → trace /
604
+ refine), documented in their respective `sp:spur-cli` references.
605
+
606
+ ### Platform compatibility
607
+
608
+ The `sp` plugin is authored in Claude Code native format. On other platforms (Codex, Gemini CLI,
609
+ Antigravity, pi, OpenCode, OpenClaw), translation scripts adapt plugin entities to platform-native
610
+ locations. OpenClaw is implicitly supported — it reads skills from `~/.agents/skills/`, the same
611
+ root codex/opencode use in global mode.
612
+
613
+ | Plugin entity | Claude Code | Other platforms |
614
+ | ------------------ | ---------------------------------------- | ----------------------------------------------------------------------------------------------- |
615
+ | `skills/*.md` | `~/.claude/skills/` | Adapted as Skills 2.0 skill directories — all platforms receive skills uniformly |
616
+ | `commands/*.md` | `~/.claude/commands/` | Adapted as Skills 2.0 skill entries (`disable-model-invocation: true`) |
617
+ | `agents/*.md` | `~/.claude/agents/` | Adapted as Skills 2.0 skill entries (model-invocable); Pi additionally gets native agent format |
618
+ | `hooks/hooks.json` | `~/.claude/hooks/` | Converted to target-native format (pi-hooks shim for pi/omp, HOOK.yaml for hermes) |
619
+ | `hooks/*.ts` | plugin hook runtime / compatibility copy | Copied alongside platform output only for environments that still invoke script paths directly |
620
+
621
+ Each skill declares its own platform support in `metadata.platforms` frontmatter.