@gobing-ai/spur 0.3.40 → 0.3.42
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.
- package/.claude-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +103 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +80 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +30 -0
- package/plugins/sp/commands/dev-wrapall.md +33 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +176 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +424 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +121 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +100 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +278 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +664 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +727 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +350 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +88 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6093 -5180
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remediation-routing
|
|
3
|
+
description: "Confirmed, owner-routed remediation for sp:conflict-finding — audit-mode write guard, --resolve proposal/confirmation workflow, freshness revalidation, owner routing table, partial-failure and idempotency semantics."
|
|
4
|
+
see_also:
|
|
5
|
+
- conflict-finding
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Remediation routing — confirmed, owner-routed repair
|
|
9
|
+
|
|
10
|
+
`sp:conflict-finding` is, first and foremost, an **audit** capability. Remediation is a separate,
|
|
11
|
+
opt-in, gated workflow. This file is the SSOT for *when a write is allowed*, *who may perform it*,
|
|
12
|
+
*how the operator confirms it*, and *what happens when a repair fails midway*.
|
|
13
|
+
|
|
14
|
+
The governing rule, carried through everything below: **no mutation in audit mode, and no automatic
|
|
15
|
+
mutation merely because `--resolve` is present.** Every write requires (a) a presented repair set,
|
|
16
|
+
(b) explicit operator confirmation, (c) a freshness revalidation of the supporting evidence, and
|
|
17
|
+
(d) dispatch through the artifact owner's verified harness surface. Ambiguity or partial failure is
|
|
18
|
+
reported, never silently continued.
|
|
19
|
+
|
|
20
|
+
## Core invariants
|
|
21
|
+
|
|
22
|
+
| Invariant | Guarantee |
|
|
23
|
+
|-----------|-----------|
|
|
24
|
+
| Audit mode is read-only | Without `--resolve`, no source, corpus (task/feature), or numbered-document mutation of any kind. |
|
|
25
|
+
| `--resolve` is not a write | It only *opens* the proposal → confirmation → owner-routed workflow. It never authorizes automatic repair. |
|
|
26
|
+
| Confirmation precedes every write | No repair executes until the operator explicitly approves the specific proposed repair set. |
|
|
27
|
+
| Freshness precedes mutation | The supporting evidence anchors are re-read and compared against the finding's fingerprint before any write. |
|
|
28
|
+
| Owner surface, not raw edits | Each approved repair routes through the artifact's owner (Spur CLI, `sp:doc-evolve`, Spur dev lifecycle, Superskill lifecycle) — never a direct file write where an owner surface exists. |
|
|
29
|
+
| Idempotent and partial-failure aware | Already-matching artifacts resolve without a write; one repair's failure neither marks others successful nor silently rolls forward. |
|
|
30
|
+
|
|
31
|
+
## 1. Audit mode — the read-only guarantee
|
|
32
|
+
|
|
33
|
+
Without `--resolve`, the run performs **no mutation** of:
|
|
34
|
+
|
|
35
|
+
- **Source** — implementations, contracts, tests, config, registrations.
|
|
36
|
+
- **Corpus** — task files and feature files.
|
|
37
|
+
- **Numbered docs and projections** — `docs/00`–`05`, `docs/99_PROJECT_CONSTITUTION.md`, and
|
|
38
|
+
`AGENTS.md` / template projections.
|
|
39
|
+
|
|
40
|
+
Everything the audit produces — findings, evidence, authority provenance, coverage, unresolved
|
|
41
|
+
items, proposed repairs, recommended owner — is an **envelope**, not a change. The report may
|
|
42
|
+
describe what *would* be repaired and by whom, but nothing is applied.
|
|
43
|
+
|
|
44
|
+
The only permitted writes in audit mode are transient and internal (temp files for composing a
|
|
45
|
+
repair payload, `.spur/context/` note files when the operator explicitly opts into indexed-context
|
|
46
|
+
reuse). These never touch governed artifacts.
|
|
47
|
+
|
|
48
|
+
## 2. The `--resolve` workflow — proposal, confirm, revalidate, route
|
|
49
|
+
|
|
50
|
+
`--resolve` changes one thing: it enables the remediation workflow. It does **not** change the
|
|
51
|
+
write guard. The full workflow is:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
--resolve
|
|
55
|
+
→ 1. PRESENT REPAIR SET enumerate proposed repairs keyed by finding ID + evidence fingerprint,
|
|
56
|
+
each with repair_owner and the owner surface that will apply it
|
|
57
|
+
→ 2. OBTAIN CONFIRMATION operator explicitly approves the selected set (or a subset, or none)
|
|
58
|
+
→ 3. REVALIDATE FRESHNESS re-read each artifact anchor; compare against the finding fingerprint;
|
|
59
|
+
stale anchors return to audit (see §4)
|
|
60
|
+
→ 4. ROUTE BY OWNER dispatch each approved repair through its owner surface (§3)
|
|
61
|
+
→ 5. REPORT OUTCOMES completed / failed / untouched sets; never silently roll forward (§5)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2.1 Present the repair set
|
|
65
|
+
|
|
66
|
+
Before anything is applied, present a complete, itemized repair set. Each item is keyed by its
|
|
67
|
+
finding `id` plus an **evidence fingerprint** — a stable digest of the artifact anchors (path +
|
|
68
|
+
line/heading/symbol/WBS/feature ID) and the claim paraphrase that the finding was built on. The
|
|
69
|
+
fingerprint lets the workflow detect that the world changed between audit and remediation.
|
|
70
|
+
|
|
71
|
+
Each proposed item states:
|
|
72
|
+
|
|
73
|
+
- **Finding ID** — links back to the audit report.
|
|
74
|
+
- **Claim type + conflict type** — e.g. `stale` / `source↔authority`.
|
|
75
|
+
- **Artifact(s) to change** — exact path and anchor.
|
|
76
|
+
- **Repair owner + surface** — the owner and the exact command/skill that will apply it (§3).
|
|
77
|
+
- **Proposed change** — the concrete edit the owner surface is expected to perform.
|
|
78
|
+
|
|
79
|
+
Nothing in §2.1 is a mutation; it is a proposal. Only the confirmed subset in §2.2 proceeds.
|
|
80
|
+
|
|
81
|
+
### 2.2 Obtain explicit confirmation
|
|
82
|
+
|
|
83
|
+
The operator must explicitly approve the repair set — in whole, in part, or decline. Confirmation
|
|
84
|
+
is:
|
|
85
|
+
|
|
86
|
+
- **Explicit** — a clear affirmative ("yes", "apply these N", selection of specific findings), never
|
|
87
|
+
inferred from the mere presence of `--resolve`.
|
|
88
|
+
- **Per-set** — the operator confirms the specific artifacts and changes presented, not a blanket
|
|
89
|
+
"fix everything."
|
|
90
|
+
- **Recorded** — the chosen subset (approved / declined / deferred) is carried into the
|
|
91
|
+
remediation report so the audit trail shows exactly what was authorized.
|
|
92
|
+
|
|
93
|
+
A declined or deferred repair is left **untouched** and reported as such; it is not re-attempted
|
|
94
|
+
implicitly in the same run.
|
|
95
|
+
|
|
96
|
+
### 2.3 Revalidate evidence freshness
|
|
97
|
+
|
|
98
|
+
Between the audit and any write, the world may have changed. Immediately before dispatching each
|
|
99
|
+
approved repair:
|
|
100
|
+
|
|
101
|
+
1. Re-read the artifact at the anchor the finding recorded.
|
|
102
|
+
2. Recompute (or re-compare) the evidence fingerprint.
|
|
103
|
+
3. If the anchor content still matches the fingerprint → proceed to route.
|
|
104
|
+
4. If the anchor has moved, the text changed, the file was deleted, or the referenced symbol/WBS/AC
|
|
105
|
+
no longer resolves → mark the item `stale-evidence` and **return to audit**. Do not "repair" a
|
|
106
|
+
stale finding on hunches; re-run the relevant audit step to re-establish evidence.
|
|
107
|
+
|
|
108
|
+
Freshness is per-finding, checked at dispatch time — not once up front. This is what closes the gap
|
|
109
|
+
between "the audit said X" and "the file now says Y."
|
|
110
|
+
|
|
111
|
+
## 3. Owner routing table
|
|
112
|
+
|
|
113
|
+
Each approved repair is dispatched through the artifact's **owner surface** — the harness path that
|
|
114
|
+
owns writes to that artifact — not a direct file write. Authority for a repair is the same
|
|
115
|
+
authority model as the audit ([./authority-resolution.md](./authority-resolution.md)): for a given
|
|
116
|
+
subject + claim type, one artifact is normative; derived projections are updated only after their
|
|
117
|
+
authority.
|
|
118
|
+
|
|
119
|
+
| Owner | Repair route | Never |
|
|
120
|
+
|-------|--------------|-------|
|
|
121
|
+
| Task/feature corpus | `sp:spur-cli` — `spur task` / `spur feature` (with `--section`, `--from-file`, `--json` as needed) | Direct file writes to task/feature files. |
|
|
122
|
+
| Numbered docs and AGENTS projections | `sp:doc-evolve` — **authority first, derived projections second** (see below) | Editing `docs/05_FEATURES.md` or an `AGENTS.md` projection before its authoritative source is fixed. |
|
|
123
|
+
| Source / tests | Create or use a **Spur task** and route through `sp:spur-dev` / build competencies (`sp:code-implementation`, `sp:code-testing`), **unless** the active session already has explicit implementation authority for the change. | Bare in-place edits to source/tests without a task or explicit authority. |
|
|
124
|
+
| Command/skill capability source | Superskill command/skill **lifecycle** (`superskill command …` / `superskill skill …` scaffold/validate/evaluate/refine) in the owning plugin source. | Hand-editing capability source outside the Superskill lifecycle. |
|
|
125
|
+
| Ambiguous authority | **Stop for an operator decision.** Do not mutate either side. | Choosing a winner, editing both sides, or forcing a global ranking. |
|
|
126
|
+
|
|
127
|
+
### 3.1 Task/feature corpus
|
|
128
|
+
|
|
129
|
+
Corpus writes go through Spur CLI verbs — `spur task` / `spur feature` with the appropriate
|
|
130
|
+
sub-verb (`update`, `--section`, `--from-file`, `--json`). This keeps task/feature files under the
|
|
131
|
+
harness's write-guard and section/schema contracts. Never `Write`/`Edit` a task or feature file
|
|
132
|
+
directly; the corpus is CLI-gated.
|
|
133
|
+
|
|
134
|
+
**`--section` is not addressable at every heading level.** It resolves **`##` sections in feature
|
|
135
|
+
files** and **`###` sections in task files**. A repair proposing `--section Tasks` against a feature
|
|
136
|
+
whose roster sits at `###` fails with `does not contain section` and lists the `##` headings it did
|
|
137
|
+
find. Before proposing a section-scoped repair, confirm the target heading exists **at the
|
|
138
|
+
addressable level** — `spur feature show <id> --json` / `spur task show <wbs> --json` enumerate what
|
|
139
|
+
is actually addressable. When the content is a subsection, the repair is either the enclosing `##`
|
|
140
|
+
section (which rewrites the whole body, so weigh it against blast radius and any load-bearing
|
|
141
|
+
evidence inside) or a different owner verb; do not silently widen the write to make the flag fit.
|
|
142
|
+
|
|
143
|
+
**Frontmatter is validated before the write.** `spur task update` rejects the whole operation when
|
|
144
|
+
required frontmatter (`schema_version`, `created_at`, `updated_at`, a valid `status` enum) is
|
|
145
|
+
missing — the file is left byte-identical. That is an **owner-surface failure**, not
|
|
146
|
+
`stale-evidence`: the finding stands and stays re-dispatchable. Report it as `failed` and stop that
|
|
147
|
+
item; never route around it with a direct write.
|
|
148
|
+
|
|
149
|
+
### 3.2 Numbered docs and AGENTS projections
|
|
150
|
+
|
|
151
|
+
Documentation repairs follow **authority first, derived projections second**. If a derived
|
|
152
|
+
projection (`docs/04_DESIGN.md`, `docs/05_FEATURES.md`, `AGENTS.md`, templates) has drifted from its
|
|
153
|
+
authority (`docs/00_ADR.md`, `docs/01_PRD.md`, `docs/03_ARCHITECTURE.md`,
|
|
154
|
+
`docs/99_PROJECT_CONSTITUTION.md`), the repair fixes the **authority** first, then re-derives the
|
|
155
|
+
projection via `sp:doc-evolve`. Editing a projection without its authority is a prohibited
|
|
156
|
+
anti-pattern (see §6).
|
|
157
|
+
|
|
158
|
+
`sp:doc-evolve` owns the numbered-doc/projection lifecycle: sync checks, contract verification,
|
|
159
|
+
frontmatter checks, and derived-doc refresh. A doc repair is dispatched to it; it is not hand-applied.
|
|
160
|
+
|
|
161
|
+
### 3.3 Source / tests
|
|
162
|
+
|
|
163
|
+
Source and test repairs are **real implementation work**. By default they are dispatched as a Spur
|
|
164
|
+
task routed through `sp:spur-dev` and the build competencies (`sp:code-implementation`,
|
|
165
|
+
`sp:code-testing`) — so the change gets a Requirements/AC envelope, a lifecycle, and verification.
|
|
166
|
+
|
|
167
|
+
The one exception: if the **active session already has explicit implementation authority** for the
|
|
168
|
+
change (e.g. the operator is already inside a task implementation, or explicitly delegated the
|
|
169
|
+
source edit), the repair may be applied directly in that session. When in doubt, prefer the Spur
|
|
170
|
+
task route.
|
|
171
|
+
|
|
172
|
+
### 3.4 Command/skill capability source
|
|
173
|
+
|
|
174
|
+
A repair to a command or skill's own source (the capability being audited) goes through the
|
|
175
|
+
**Superskill lifecycle** in the owning plugin source — `superskill command …` / `superskill skill …`
|
|
176
|
+
for scaffold/validate/evaluate/refine. This keeps capability artifacts canonical and validated.
|
|
177
|
+
Do not commit generated per-platform adapters.
|
|
178
|
+
|
|
179
|
+
### 3.5 Ambiguous authority
|
|
180
|
+
|
|
181
|
+
If routing cannot determine an owner — authority is ambiguous, incomparable, or missing for the
|
|
182
|
+
subject + claim type — the workflow **stops for an operator decision**. It does not pick a winner,
|
|
183
|
+
does not edit both sides, and does not fall back to a global ranking. The item remains
|
|
184
|
+
`needs-authority-decision` (or `stale-evidence`/`unresolved` as appropriate) and is reported as
|
|
185
|
+
untouched.
|
|
186
|
+
|
|
187
|
+
## 4. Repairs keyed by finding ID + evidence fingerprint
|
|
188
|
+
|
|
189
|
+
Every repair in the set is keyed by two things:
|
|
190
|
+
|
|
191
|
+
- **Finding `id`** — the stable identifier from the audit report.
|
|
192
|
+
- **Evidence fingerprint** — the digest of the anchors (path + line/heading/symbol/WBS/feature ID)
|
|
193
|
+
and the claim paraphrase the finding rests on.
|
|
194
|
+
|
|
195
|
+
This key drives the freshness check (§2.3) and the outcome bookkeeping (§5). Concretely:
|
|
196
|
+
|
|
197
|
+
| Condition at dispatch | Outcome |
|
|
198
|
+
|-----------------------|---------|
|
|
199
|
+
| Anchor content matches the fingerprint | Route the repair through its owner surface. |
|
|
200
|
+
| Anchors changed (moved, edited, deleted; symbol/WBS/AC gone) | Mark `stale-evidence`, **return to audit** — re-run the affected audit step to re-establish evidence before any further repair. |
|
|
201
|
+
| Artifact already matches the proposed outcome | **Resolved without a write** (idempotent). The finding is marked `resolved`; no mutation occurs. |
|
|
202
|
+
| Owner surface reports a failure | Mark the item `failed`; do not mark siblings successful or roll forward (§5). |
|
|
203
|
+
|
|
204
|
+
### 4.1 Idempotent resolution
|
|
205
|
+
|
|
206
|
+
If, at dispatch time, the artifact already matches the repair's target state — the drift was already
|
|
207
|
+
fixed by someone else, or the finding was stale in the "no longer wrong" direction — the item is
|
|
208
|
+
**resolved without a write**. Idempotency is an explicit outcome, not an accident: the workflow
|
|
209
|
+
recognizes "already correct" and records it as `resolved` rather than re-applying a no-op edit or
|
|
210
|
+
worse, applying an edit that re-introduces a conflict.
|
|
211
|
+
|
|
212
|
+
## 5. Partial failure, retry, and outcome reporting
|
|
213
|
+
|
|
214
|
+
Remediation is **per-item**, not all-or-nothing. A failure in one repair:
|
|
215
|
+
|
|
216
|
+
- Does **not** mark other repairs successful.
|
|
217
|
+
- Does **not** silently roll forward to the remaining repairs as if nothing happened.
|
|
218
|
+
- Is **reported** as a distinct outcome.
|
|
219
|
+
|
|
220
|
+
The final remediation report always separates the outcome sets:
|
|
221
|
+
|
|
222
|
+
| Set | Meaning |
|
|
223
|
+
|-----|---------|
|
|
224
|
+
| **Completed** | Owner surface confirmed the repair applied (or artifact already matched — idempotent `resolved`). |
|
|
225
|
+
| **Failed** | The owner surface rejected/errored, or dispatch could not complete. |
|
|
226
|
+
| **Untouched** | Declined/deferred by the operator, or blocked on `stale-evidence` / `needs-authority-decision`. |
|
|
227
|
+
|
|
228
|
+
These sets are mutually exclusive and together account for every item in the approved set. The
|
|
229
|
+
report surfaces the exact failed items and the reason, so the operator can decide to retry — in a
|
|
230
|
+
fresh run with re-validated evidence — rather than being told, or assuming, that everything was
|
|
231
|
+
applied.
|
|
232
|
+
|
|
233
|
+
### 5.1 Retry
|
|
234
|
+
|
|
235
|
+
Retry is the operator's decision after reading the failed set. The workflow never auto-retries
|
|
236
|
+
within a run; it stops, reports, and lets the operator re-invoke with a fresh audit (and thus a
|
|
237
|
+
fresh freshness check). A retry must revalidate evidence rather than blindly re-attempting the same
|
|
238
|
+
stale repair.
|
|
239
|
+
|
|
240
|
+
## 6. Anti-patterns
|
|
241
|
+
|
|
242
|
+
These are the explicit boundaries for remediation. Each is a hard violation, not a style choice.
|
|
243
|
+
|
|
244
|
+
| Anti-pattern | Why it is prohibited |
|
|
245
|
+
|--------------|----------------------|
|
|
246
|
+
| **Automatic mutation merely because `--resolve` is present** | `--resolve` only opens the workflow; it never authorizes automatic repair. Confirmation + freshness + owner surface are all required. |
|
|
247
|
+
| **Editing a derived projection before its authority** | A projection (`docs/04`/`docs/05`, `AGENTS.md`, templates) is not the source of truth; fixing it without its authority (`ADR`/`PRD`/constitution) leaves the real conflict in place. Authority first. |
|
|
248
|
+
| **Broad cleanup outside confirmed findings** | Only the artifacts named by confirmed, freshness-checked findings are touched. No opportunistic refactors or doc "improvements" while repairing. |
|
|
249
|
+
| **Ambiguity silently resolved** | Ambiguous/missing authority stops for an operator decision; it is never forced through a global ranking or a guessed owner. |
|
|
250
|
+
| **Partial failure silently continued** | A failed repair is reported, not papered over; siblings are not marked successful and the run does not roll forward silently. |
|
|
251
|
+
| **Direct corpus writes** | Task/feature files are CLI-gated (`spur task`/`spur feature`); never raw `Write`/`Edit`. |
|
|
252
|
+
| **Direct numbered-doc or capability edits** | Numbered-doc/projection writes go through `sp:doc-evolve`; capability source through the Superskill lifecycle. |
|
|
253
|
+
| **Source edits without authority** | Source/test repairs default to a Spur task + dev lifecycle unless the active session already has explicit implementation authority. |
|
|
254
|
+
| **Repairing stale evidence** | Changed anchors return to audit; never "repair" a finding whose evidence is no longer current. |
|
|
255
|
+
|
|
256
|
+
## 7. Checklist — safe remediation
|
|
257
|
+
|
|
258
|
+
Before dispatching any write, confirm each of the following:
|
|
259
|
+
|
|
260
|
+
- [ ] Audit mode performed **no** governed mutation; the report is a pure envelope.
|
|
261
|
+
- [ ] `--resolve` was present, and the **repair set was presented** (keyed by finding ID + fingerprint).
|
|
262
|
+
- [ ] The operator **explicitly confirmed** the specific selected repair set.
|
|
263
|
+
- [ ] Evidence **freshness revalidated** per finding at dispatch; `stale-evidence` items returned to audit.
|
|
264
|
+
- [ ] Each approved repair routed through its **owner surface** (§3), never a raw write where an owner exists.
|
|
265
|
+
- [ ] **Idempotent** already-matching items marked `resolved` without a write.
|
|
266
|
+
- [ ] **Completed / failed / untouched** sets reported; failures surfaced, not silently continued.
|
|
267
|
+
- [ ] Ambiguous authority **stopped for an operator decision**; neither side mutated.
|
|
268
|
+
- [ ] No broad cleanup outside confirmed findings.
|
|
269
|
+
|
|
270
|
+
## Related
|
|
271
|
+
|
|
272
|
+
- Skill entry: [../SKILL.md](../SKILL.md) (Step 10 — Remediate)
|
|
273
|
+
- Authority model and ambiguity protocol: [./authority-resolution.md](./authority-resolution.md)
|
|
274
|
+
- Finding schema, status values, and evidence rules: [./finding-contract.md](./finding-contract.md)
|
|
275
|
+
- Comparison and candidate-graph construction: [./comparison-protocol.md](./comparison-protocol.md)
|
|
276
|
+
- Owner surfaces: `sp:spur-cli`, `sp:spur-dev`, `sp:doc-evolve`
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: daily-summary
|
|
3
|
+
description: "Generate a daily summary report from agent usage, git history, and your notes."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
created_at: 2026-04-17
|
|
8
|
+
updated_at: 2026-04-17
|
|
9
|
+
platform: sp
|
|
10
|
+
tags: [summary, daily, analytics, reporting, engineering-core]
|
|
11
|
+
metadata:
|
|
12
|
+
author: cc-agents
|
|
13
|
+
platforms: "claude-code,codex,antigravity,opencode,openclaw"
|
|
14
|
+
category: engineering-core
|
|
15
|
+
interactions:
|
|
16
|
+
- pipeline
|
|
17
|
+
- inversion
|
|
18
|
+
pipeline_steps:
|
|
19
|
+
- data-collection
|
|
20
|
+
- user-input
|
|
21
|
+
- generate-summary
|
|
22
|
+
- validate-output
|
|
23
|
+
openclaw:
|
|
24
|
+
emoji: "📊"
|
|
25
|
+
see_also:
|
|
26
|
+
- sp:dev-handover
|
|
27
|
+
- sp:dev-changelog
|
|
28
|
+
- sp:spur-cli
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# sp:daily-summary — Daily Summary Report Generator
|
|
32
|
+
|
|
33
|
+
Generate daily summary reports for personal review and AI infrastructure optimization. Combines token usage data (via ccusage), git history, and user annotations into a structured markdown report.
|
|
34
|
+
|
|
35
|
+
## When to Use
|
|
36
|
+
|
|
37
|
+
**Trigger phrases:** "daily summary", "end of day", "wrap up", "daily report", "what did I do today"
|
|
38
|
+
|
|
39
|
+
This command is designed to be run at the end of the workday or first thing the next morning to review previous day's activity.
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
The daily-summary skill:
|
|
44
|
+
1. Collects token usage from ccusage CLI (Claude Code, Codex, etc.)
|
|
45
|
+
2. Extracts git history (commits, changes) for the day
|
|
46
|
+
3. Prompts user for learnings, issues fixed, and pending tasks
|
|
47
|
+
4. Generates a timestamped markdown summary
|
|
48
|
+
5. Outputs to `docs/daily/summary_yyyymmdd.md`
|
|
49
|
+
6. Surfaces the newest history report path when a nightly `spur history daily` artifact exists (R7)
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Generate summary for today
|
|
55
|
+
bun plugins/sp/scripts/daily-summary/daily-summary.ts
|
|
56
|
+
|
|
57
|
+
# Generate summary for a specific date
|
|
58
|
+
bun plugins/sp/scripts/daily-summary/daily-summary.ts --date 2026-04-17
|
|
59
|
+
|
|
60
|
+
# Show summary without writing file
|
|
61
|
+
bun plugins/sp/scripts/daily-summary/daily-summary.ts --dry-run
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Workflows
|
|
65
|
+
|
|
66
|
+
### Phase 1: Data Collection
|
|
67
|
+
|
|
68
|
+
1. **Parse arguments** — Extract `--date` (default: today) and `--dry-run`
|
|
69
|
+
2. **Collect token usage** — Run `ccusage daily --json` for the date range
|
|
70
|
+
3. **Collect git history** — Run `git log --since` and `git diff --stat`
|
|
71
|
+
4. **Detect AI-related commits** — Parse commit messages for feat/fix/refactor patterns
|
|
72
|
+
|
|
73
|
+
### Phase 2: User Input
|
|
74
|
+
|
|
75
|
+
**Ask one question at a time.** Do not start generating the summary until all three prompts have been answered (empty answers allowed — press Enter to skip). The skill blocks on stdin; each question must be answered before the next is shown.
|
|
76
|
+
|
|
77
|
+
Interactive prompts for annotations:
|
|
78
|
+
```
|
|
79
|
+
Daily Summary — 2026-04-17
|
|
80
|
+
|
|
81
|
+
Please provide the following (press Enter to skip):
|
|
82
|
+
|
|
83
|
+
1. What did you learn today? (optional)
|
|
84
|
+
>
|
|
85
|
+
|
|
86
|
+
2. What issues did you fix? (optional)
|
|
87
|
+
>
|
|
88
|
+
|
|
89
|
+
3. What's pending for tomorrow? (optional)
|
|
90
|
+
>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Phase 3: Generate Summary
|
|
94
|
+
|
|
95
|
+
Assemble sections into `docs/daily/summary_yyyymmdd.md`
|
|
96
|
+
|
|
97
|
+
### Phase 4: Validate & Output
|
|
98
|
+
|
|
99
|
+
- Verify file written successfully
|
|
100
|
+
- Display output path to user
|
|
101
|
+
- Show summary statistics
|
|
102
|
+
|
|
103
|
+
## Input Modes
|
|
104
|
+
|
|
105
|
+
| Input Pattern | Behavior |
|
|
106
|
+
|---------------|----------|
|
|
107
|
+
| `--date YYYY-MM-DD` | Generate summary for specified date |
|
|
108
|
+
| `--date yesterday` | Generate summary for previous day |
|
|
109
|
+
| `--dry-run` | Show summary without writing file |
|
|
110
|
+
| `--output <path>` | Write to custom path instead of default |
|
|
111
|
+
| `--no-git` | Skip git history collection |
|
|
112
|
+
| `--no-ccusage` | Skip token usage collection |
|
|
113
|
+
|
|
114
|
+
## Output
|
|
115
|
+
|
|
116
|
+
**File:** `docs/daily/summary_yyyymmdd.md`
|
|
117
|
+
|
|
118
|
+
**Sections:**
|
|
119
|
+
|
|
120
|
+
| Section | Mandatory | Source |
|
|
121
|
+
|---------|-----------|--------|
|
|
122
|
+
| Meta | Yes | Auto-detected (date, platforms) |
|
|
123
|
+
| Token Usage | If ccusage available | ccusage CLI |
|
|
124
|
+
| Git Activity | If git available | git log/diff |
|
|
125
|
+
| Commits | Yes | git log |
|
|
126
|
+
| Issues Fixed | If provided | User input |
|
|
127
|
+
| Learnings | If provided | User input |
|
|
128
|
+
| Pending | If provided | User input |
|
|
129
|
+
| History Report | If a nightly history artifact exists | `.spur/reports/history/latest.json` pointer (R7) |
|
|
130
|
+
|
|
131
|
+
## Data Sources
|
|
132
|
+
|
|
133
|
+
| Source | Tool | Data Retrieved |
|
|
134
|
+
|--------|------|---------------|
|
|
135
|
+
| Claude Code usage | ccusage daily | Tokens, cost, conversations |
|
|
136
|
+
| Git history | git log/diff | Commits, files changed |
|
|
137
|
+
| User annotations | Interactive prompt | Learnings, issues, pending |
|
|
138
|
+
|
|
139
|
+
## Integration
|
|
140
|
+
|
|
141
|
+
This skill orchestrates existing tools:
|
|
142
|
+
- **ccusage** for token usage data (must be installed)
|
|
143
|
+
- **git** for version control history
|
|
144
|
+
- **User input** for qualitative annotations
|
|
145
|
+
|
|
146
|
+
## Required Permissions
|
|
147
|
+
|
|
148
|
+
The skill shells out to external tools. Ensure these are allowed in the agent's permission profile:
|
|
149
|
+
|
|
150
|
+
| Command | Purpose | Required |
|
|
151
|
+
|---------|---------|----------|
|
|
152
|
+
| `ccusage daily --json` | Token usage telemetry | Optional (skipped with `--no-ccusage`) |
|
|
153
|
+
| `git log`, `git diff`, `git status` | Commit history | Optional (skipped with `--no-git`) |
|
|
154
|
+
| File write to `docs/daily/` | Output markdown report | Required unless `--dry-run` |
|
|
155
|
+
|
|
156
|
+
## Platform Notes
|
|
157
|
+
|
|
158
|
+
### Claude Code (primary)
|
|
159
|
+
```bash
|
|
160
|
+
skill(skill="sp:daily-summary", args="--date 2026-04-17")
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Other Platforms
|
|
164
|
+
Read the skill file and follow the workflow manually.
|
|
165
|
+
|
|
166
|
+
## Additional Resources
|
|
167
|
+
|
|
168
|
+
- **Script source:** [scripts/daily-summary/daily-summary.ts](../../scripts/daily-summary/daily-summary.ts) — CLI implementation
|
|
169
|
+
- **Tests:** [tests/daily-summary.test.ts](tests/daily-summary.test.ts) — unit coverage for parsing, date ranges, markdown output
|
|
170
|
+
- **Related skills:** `sp:dev-handover` (blocker handoff), `sp:dev-changelog` (commit-based changelog), `sp:spur-cli` (task management)
|
|
171
|
+
- **Upstream CLI:** [ccusage](https://github.com/ryoppippi/ccusage) — AI agent token usage reporter
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: daily-summary
|
|
2
|
+
description: Generate daily summary reports from AI coding agent usage data, git
|
|
3
|
+
history, and user annotations. Orchestrates ccusage CLI and git commands to
|
|
4
|
+
produce structured markdown summaries.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
icon: 📊
|
|
7
|
+
category: debugging
|
|
8
|
+
tags:
|
|
9
|
+
- summary
|
|
10
|
+
- daily
|
|
11
|
+
- analytics
|
|
12
|
+
- reporting
|
|
13
|
+
- engineering-core
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc-evolve
|
|
3
|
+
description: "Evolve docs/00-05 + AGENTS.md per docs/99_PROJECT_CONSTITUTION.md: drift audits, same-commit sync checks, frontmatter-contract verification, lesson-append. Triggers: \"doc evolve\", \"doc drift\", \"sync docs\", \"drift audit\", \"are the docs stale\", \"append a lesson\"."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: spur
|
|
7
|
+
version: "1.0"
|
|
8
|
+
platforms: "claude-code,codex,openclaw,opencode,antigravity"
|
|
9
|
+
interactions:
|
|
10
|
+
- reviewer
|
|
11
|
+
- inversion
|
|
12
|
+
operations:
|
|
13
|
+
- customize
|
|
14
|
+
- drift-audit
|
|
15
|
+
- sync-check
|
|
16
|
+
- contract-verify
|
|
17
|
+
- lesson-append
|
|
18
|
+
openclaw:
|
|
19
|
+
emoji: "📐"
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Spur Doc-Evolve
|
|
23
|
+
|
|
24
|
+
`sp:doc-evolve` keeps the **key documents** honest: `docs/00_ADR`, `01_PRD`, `02_ROADMAP`,
|
|
25
|
+
`03_ARCHITECTURE`, `04_DESIGN`, `05_FEATURES`, the `99_PROJECT_CONSTITUTION`, and the root
|
|
26
|
+
`AGENTS.md`. It is a **constitution-native** driver — every operation enforces a rule that already
|
|
27
|
+
lives in `docs/99_PROJECT_CONSTITUTION.md`, and every proposed edit cites the section it enforces.
|
|
28
|
+
It is *not* a generic doc generator and it does not invent process: the constitution is the law;
|
|
29
|
+
this skill applies it.
|
|
30
|
+
|
|
31
|
+
**Read `docs/99_PROJECT_CONSTITUTION.md` first.** It is the single source of truth for *how* these
|
|
32
|
+
files are maintained (authority §2, doc map §4.1, frontmatter contracts §4.3, sync triggers §5,
|
|
33
|
+
per-file edit rules §6, the audit §7, lessons §8). This skill is a runbook for executing §5/§7/§8;
|
|
34
|
+
when the two disagree, the constitution wins and this skill is the bug.
|
|
35
|
+
|
|
36
|
+
## Operations
|
|
37
|
+
|
|
38
|
+
| Operation | What it does | Constitution authority | Deterministic helper |
|
|
39
|
+
| --------- | ------------ | ---------------------- | -------------------- |
|
|
40
|
+
| **drift-audit** | Reality (code/shipped) vs. what a key file says, and cross-doc contradictions | §7 (the 8-item checklist) | `rg` the real CLI/config surface; diff vs `04`/`AGENTS.md`/`00` |
|
|
41
|
+
| **sync-check** | Did a change touch the docs its trigger obligates in the same commit? | §5 (triggers T1–T8) | git diff of code/config vs. the matching doc edit |
|
|
42
|
+
| **contract-verify** | Each doc's frontmatter matches its §4.1 row; `updated_at` is plausible | §4.3 | parse frontmatter; compare `owns`/`authority` vs §4.1; `git log` recency |
|
|
43
|
+
| **lesson-append** | Append a dated lesson; dedup; promote recurring ones to a rule | §8 | format-check the line; `rg` for an equivalent before adding |
|
|
44
|
+
|
|
45
|
+
No thin `dev-docs` command wrapper exists (`dev-operations.md §7`). Invoke this skill directly for
|
|
46
|
+
an audit or a lesson, or reach it via `/sp:dev-plan`'s docs step and `/sp:spur-init`'s `customize`.
|
|
47
|
+
|
|
48
|
+
## Operating principle (R2): detect deterministically, judge with the LLM
|
|
49
|
+
|
|
50
|
+
Split every operation into a **deterministic detection** half and a **judgment** half:
|
|
51
|
+
|
|
52
|
+
- **Detection** is `rg` / `git` / `spur` CLI / frontmatter parsing — it finds candidate drift
|
|
53
|
+
mechanically and is the part that must not hallucinate (a missed surface or a phantom finding
|
|
54
|
+
both erode trust). Prefer a command that lists facts over prose that asserts them.
|
|
55
|
+
- **Judgment** is the LLM deciding whether a candidate is real drift, which doc is authoritative,
|
|
56
|
+
and what the minimal repair is. This is where the skill earns its keep.
|
|
57
|
+
|
|
58
|
+
Never assert "the docs are in sync" from reading alone — run the detection commands and show their
|
|
59
|
+
output. A zero-finding audit must be backed by the commands that produced zero.
|
|
60
|
+
|
|
61
|
+
## customize
|
|
62
|
+
|
|
63
|
+
**Purpose:** Customize a freshly-initialized Spur project's doc templates to match the
|
|
64
|
+
project's actual stack and scope. Invoked by `sp:spur-init` after scaffolding.
|
|
65
|
+
|
|
66
|
+
**Procedure:**
|
|
67
|
+
1. Read the project's `package.json`, `tsconfig.json`, `biome.json`, and any existing config.
|
|
68
|
+
2. Read each doc in `docs/00`–`05` for any remaining template markers.
|
|
69
|
+
3. For **`AGENTS.md`**, use the **`{kebab-case}`** token scheme only (task 0242). Do **not** use
|
|
70
|
+
`{{ MUSTACHE }}` for AGENTS:
|
|
71
|
+
- `{project-name}` / `{project-description}` — already filled by `spur init` when scaffolding a
|
|
72
|
+
fresh file; do not leave these braces after customize.
|
|
73
|
+
- Project-specific body slots (`## Stack & layout`, build commands, conventions) use HTML
|
|
74
|
+
comments + human stubs in the **bundled AGENTS seed** (spur init template) — replace those
|
|
75
|
+
stubs with stack/layout and lint/test/build commands detected from the project manifests.
|
|
76
|
+
4. Keep portable harness sections aligned with the bundled AGENTS seed (H2 set + Harness tool
|
|
77
|
+
routing Need keys — see `apps/cli/tests/fixtures/agents-md-portable-contract.ts`).
|
|
78
|
+
|
|
79
|
+
**Done when:** no residual `{project-name}` / `{project-description}` in AGENTS.md; stack/build
|
|
80
|
+
stubs filled or deliberately documented; `bun run lint` passes where applicable.
|
|
81
|
+
|
|
82
|
+
## drift-audit (§7)
|
|
83
|
+
|
|
84
|
+
Walk the §7 checklist. Each item pairs a detection command with the doc it validates:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Real CLI surface vs. what 04 / AGENTS.md / 00 claim
|
|
88
|
+
rg -n "\.command\('" apps/cli/src/commands/ # the true verb list
|
|
89
|
+
rg -n '^#### `spur ' docs/04_DESIGN.md # documented commands
|
|
90
|
+
# → diff the two sets; a verb in code but not in 04 is T3 drift.
|
|
91
|
+
|
|
92
|
+
# 05 status rows vs. reality
|
|
93
|
+
rg -n '✅|🔶|⏳|💤' docs/05_FEATURES.md # claimed states
|
|
94
|
+
# → spot-check each ✅/🔶 against code; confirm no ⏳ quietly shipped.
|
|
95
|
+
|
|
96
|
+
# 02 phase bullets name real things (no dead names)
|
|
97
|
+
# 03 module descriptions vs. the real tree
|
|
98
|
+
fd -t d -d 2 . apps packages # real modules
|
|
99
|
+
# Frontmatter contracts (see contract-verify) + updated_at recency
|
|
100
|
+
git log -1 --format='%ci' -- docs/04_DESIGN.md # last touch vs. recent surface changes
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Repair protocol (§7, always this order):** fix the **authoritative** doc first (append-only files
|
|
104
|
+
by dated amendment, never rewrite), then the derived docs that restate/sequence it, then
|
|
105
|
+
`AGENTS.md`, then **flag what drifted and why** in the commit/task (a silent fix hides the systemic
|
|
106
|
+
cause). Anything systemic becomes a §8 lesson — or, if it recurs, a new §6 rule.
|
|
107
|
+
|
|
108
|
+
Output a **drift report**: per finding, `{ doc, what code says, what the doc says, authority, repair
|
|
109
|
+
}`. A clean report lists the checks run and that each returned no delta.
|
|
110
|
+
|
|
111
|
+
## sync-check (§5)
|
|
112
|
+
|
|
113
|
+
Given a change (a diff, or a just-finished task), check the same-commit obligations:
|
|
114
|
+
|
|
115
|
+
| If the change… | Trigger | …the same commit must touch |
|
|
116
|
+
| -------------- | ------- | --------------------------- |
|
|
117
|
+
| adds/changes a command, flag, config key, env var, schema, DTO | **T3** | `04_DESIGN` + the `AGENTS.md` surface block |
|
|
118
|
+
| ships a feature or changes its state | **T4** | its `05` row (+ a `01` scope row if new surface) |
|
|
119
|
+
| makes a new cross-cutting decision (or reverses one) | **T1** | `00` first (dated), then `03`, `01` if scope shifts |
|
|
120
|
+
| would contradict an existing ADR | **T2** | **stop** — add the superseding ADR entry first |
|
|
121
|
+
| completes/reorders a phase | **T5** | `02` (the real shipped name) |
|
|
122
|
+
| adds/cuts/defers scope | **T6** | `01` + placement in `02` |
|
|
123
|
+
| changes the doc map or process | **T7** | this file → re-sync `AGENTS.md` (§4.4) → siblings |
|
|
124
|
+
| plans a multi-wave batch | **T8** | schedule "doc sync" as an explicit work item |
|
|
125
|
+
|
|
126
|
+
Detection is a diff read: list the changed code/config paths, map each to its trigger, then confirm
|
|
127
|
+
the obligated doc was edited in the same change. A surface change with no `04` edit is the canonical
|
|
128
|
+
miss (the one this whole §5 table exists to prevent).
|
|
129
|
+
|
|
130
|
+
## contract-verify (§4.3)
|
|
131
|
+
|
|
132
|
+
For each key doc, confirm its YAML frontmatter is the instantiated §4.1 row:
|
|
133
|
+
|
|
134
|
+
- `owns` / `authority` match the §4.1 table **verbatim in meaning** (on mismatch, §4.1 wins).
|
|
135
|
+
- `edit_rules` points to the owning §6 subsection (a pointer, never restated prose).
|
|
136
|
+
- `updated_at` is not older than a change it should reflect (cross-check `git log`).
|
|
137
|
+
|
|
138
|
+
This is mostly mechanical (parse + compare); the judgment is only "is this `updated_at` plausibly
|
|
139
|
+
stale given recent commits?"
|
|
140
|
+
|
|
141
|
+
## lesson-append (§8)
|
|
142
|
+
|
|
143
|
+
Append a lesson to the right per-file section of §8:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
- [YYYY-MM-DD] <project>: <lesson — what went wrong / what to do instead>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- **Low threshold** — when in doubt, append. **Check for an equivalent first** (`rg` the section);
|
|
150
|
+
bump its date instead of duplicating.
|
|
151
|
+
- **Promotion is the only sanctioned deletion:** a lesson that recurs or hardens into practice is
|
|
152
|
+
promoted into a §6 rule (or §5 trigger) and removed from §8. Lessons are the inbox; §5/§6 are the
|
|
153
|
+
law.
|
|
154
|
+
- Lessons carry project provenance (this file is byte-identical across projects except §8 + the §3
|
|
155
|
+
tool column) — a lesson from one project is a warning, not yet a law, for the others.
|
|
156
|
+
|
|
157
|
+
## What this skill is NOT
|
|
158
|
+
|
|
159
|
+
- **Not a doc generator** — it doesn't author new prose from nothing; it audits, syncs, and repairs
|
|
160
|
+
against the constitution.
|
|
161
|
+
- **Not the authority** — it never overrides `00`/`01`/§2; on any conflict the authoritative doc
|
|
162
|
+
wins and the skill defers.
|
|
163
|
+
- **Not a generic doc tool** — this is constitution-native (every operation cites a §). Behaviors
|
|
164
|
+
without constitution backing are intentionally absent.
|
|
165
|
+
|
|
166
|
+
## References
|
|
167
|
+
|
|
168
|
+
| Reference | Covers |
|
|
169
|
+
| --------- | ------ |
|
|
170
|
+
| [references/operations.md](references/operations.md) | The mini-spec: each operation's detection commands, the §-mapping table, and the drift-report shape |
|
|
171
|
+
|
|
172
|
+
## See also
|
|
173
|
+
|
|
174
|
+
- **`docs/99_PROJECT_CONSTITUTION.md`** — the law this skill enforces. Always the tiebreaker.
|
|
175
|
+
- **`dev-operations.md §7`** — the `docs` operation entry (no thin command wrapper; invoke this skill directly).
|