@benjaminthomas/spec-driven-dev 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +150 -63
- package/bin/cli.mjs +76 -13
- package/package.json +3 -3
- package/{skills → plugin/skills}/spec-checkpoint/SKILL.md +23 -0
- package/{skills → plugin/skills}/spec-create/SKILL.md +18 -1
- package/plugin/skills/spec-create/references/log-template.md +27 -0
- package/{skills → plugin/skills}/spec-create/references/readme-template.md +12 -0
- package/{skills → plugin/skills}/spec-create/references/requirements-template.md +12 -4
- package/{skills → plugin/skills}/spec-create/references/task-template.md +12 -0
- package/{skills → plugin/skills}/spec-implement/SKILL.md +25 -6
- package/{skills → plugin/skills}/spec-investigate/SKILL.md +29 -5
- package/{skills → plugin/skills}/spec-investigate/references/report-template.md +7 -0
- package/plugin/skills/spec-review/SKILL.md +131 -0
- package/plugin/skills/spec-review/references/report-template.md +44 -0
- package/{skills → plugin/skills}/spec-setup/SKILL.md +34 -9
- package/plugin/skills/spec-setup/references/audit.md +71 -0
- package/{skills → plugin/skills}/spec-setup/references/config-template.yml +7 -2
- package/plugin/skills/spec-setup/references/context-template.md +83 -0
- package/{skills → plugin/skills}/spec-ship/SKILL.md +10 -0
- package/{skills → plugin/skills}/spec-verify/SKILL.md +10 -2
- /package/{skills → plugin/skills}/generative-seo/SKILL.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/citation-log-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/competitor-analysis-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/content-plan-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/geo-config-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/geo-playbook-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/assets/social-queue-template.md +0 -0
- /package/{skills → plugin/skills}/generative-seo/references/geo-methodology.md +0 -0
- /package/{skills → plugin/skills}/spec-create/references/action-required-template.md +0 -0
- /package/{skills → plugin/skills}/spec-create/references/complexity-rubric.md +0 -0
- /package/{skills → plugin/skills}/spec-implement/references/coder-prompt-template.md +0 -0
- /package/{skills → plugin/skills}/spec-implement/references/fix-prompt-template.md +0 -0
- /package/{skills → plugin/skills}/spec-implement/references/review-prompt-template.md +0 -0
- /package/{skills → plugin/skills}/spec-verify/references/report-template.md +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-review
|
|
3
|
+
description: >
|
|
4
|
+
Review the whole change before it ships: checks the branch diff against the spec (every
|
|
5
|
+
requirement R1… delivered, nothing out of scope), the project's recorded conventions and
|
|
6
|
+
off-limits areas, and the code itself (correctness, security, error handling, tests,
|
|
7
|
+
performance). Writes a ranked review.md with file:line evidence and blocks spec-ship on
|
|
8
|
+
blockers. Use after spec-verify, when the user says "review this", "code review", "review the
|
|
9
|
+
branch", "review PR #42", "is this ready to merge", or "/spec-review". Also works with no spec
|
|
10
|
+
folder, on any branch, diff, or pull request, including a teammate's. Reports findings and offers
|
|
11
|
+
fixes; it changes code only after the user says yes, through spec-implement's fix loop.
|
|
12
|
+
license: MIT
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Review the change
|
|
16
|
+
|
|
17
|
+
`spec-implement` reviews each batch as it's built. This skill reviews the **finished whole**, the
|
|
18
|
+
way a careful human reviewer would before merge: does it do what was asked, does it follow how this
|
|
19
|
+
project works, and is the code sound? Every finding is checked against the code before it's
|
|
20
|
+
reported. A short list of real problems beats a long list of guesses.
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
investigate → create → approve → implement → verify → review → checkpoint → ship
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Project config (read first)
|
|
27
|
+
|
|
28
|
+
Load `.spec-driven.yml`: walk up from the current directory to the home folder, and the first one
|
|
29
|
+
found wins (a `multi-repo` config only applies inside the repos it lists). If none is found, check
|
|
30
|
+
`~/.spec-driven/workspaces.json`, which maps each multi-repo config to its repo paths. Use the config
|
|
31
|
+
whose repos contain the current directory. Its values beat anything you would detect or assume. This
|
|
32
|
+
skill uses `git` (base branch, PR target), `commands` (lint/typecheck/test), `models`/`effort`,
|
|
33
|
+
`layout`/`repos`, and `specs_dir`.
|
|
34
|
+
|
|
35
|
+
**Multi-repo:** review each listed repo that has changes on this branch, and write one review.md
|
|
36
|
+
covering all of them. **No config?** Work from the repo itself and say what you assumed.
|
|
37
|
+
|
|
38
|
+
## Step 1: Work out what to review
|
|
39
|
+
|
|
40
|
+
| The user gave | Diff to review | Spec |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| nothing, on a spec's branch | `git diff <merge-base with pr_target>...HEAD`, plus uncommitted changes | `{specs_dir}/{feature}/` matched by branch or ticket |
|
|
43
|
+
| a PR number or URL | `gh pr diff <n>` and `gh pr view <n>` | the PR's linked spec, if any |
|
|
44
|
+
| a branch, commit range, or paths | that diff | none, unless one matches |
|
|
45
|
+
|
|
46
|
+
No spec? Review against the PR or commit description and the code alone, and say so in the report.
|
|
47
|
+
|
|
48
|
+
## Step 2: Load only what the review needs
|
|
49
|
+
|
|
50
|
+
Keep it cheap, because the diff is the expensive part:
|
|
51
|
+
|
|
52
|
+
1. The README's **Resume here** block, `requirements.md` (requirements R1… and Coverage), and the
|
|
53
|
+
investigation's **Relevant Context**. Without a spec, read `{specs_dir}/CONTEXT.md` and only the
|
|
54
|
+
`context/<area>.md` files the diff touches. Never the archive.
|
|
55
|
+
2. `git diff --stat` first, then the diff itself. Open a full file only around a suspected finding,
|
|
56
|
+
to confirm it.
|
|
57
|
+
3. **Optional graph.** If `context.graph` isn't `off` and graphify is available, use
|
|
58
|
+
`graphify query "callers of <changed function>" --budget 1000` to find callers the diff didn't
|
|
59
|
+
update. Treat INFERRED edges as hints to check.
|
|
60
|
+
|
|
61
|
+
**Model.** Review on at least the `standard` tier (`models.<tool>.standard`), and on `deep` when the
|
|
62
|
+
spec's hardest task is deep or the diff touches auth, payments, personal data, or migrations. A
|
|
63
|
+
review on a weaker model than the code was written with misses things.
|
|
64
|
+
|
|
65
|
+
## Step 3: Review in four passes
|
|
66
|
+
|
|
67
|
+
1. **Against the spec.** For each requirement R1…, point to the code that delivers it, or report it
|
|
68
|
+
as missing. Flag changes no task asked for (scope creep) and task-listed files that weren't
|
|
69
|
+
touched. Non-goals that got built count as findings.
|
|
70
|
+
2. **Against the project's memory.** Conventions, off-limits areas, and pitfalls from Step 2. A
|
|
71
|
+
broken recorded convention is a finding. Quote the convention and its source. Check the
|
|
72
|
+
**commits** too, not just the diff: `git log --format='%h %an <%ae>%n%B' <base>..HEAD` against
|
|
73
|
+
any recorded rule on commit format, authorship, or trailers.
|
|
74
|
+
3. **The code.** Correctness (logic, edge cases, error paths, races), security (injection, authz,
|
|
75
|
+
secrets, unsafe input), data safety (migrations, deletes, irreversible writes), tests (behaviour
|
|
76
|
+
without a test, tests weakened, skipped or deleted), and performance on hot paths only.
|
|
77
|
+
4. **Run the checks.** Run `commands.lint`, `typecheck`, and `test` once if verify didn't just run
|
|
78
|
+
them on this exact commit. A failing check is a blocker.
|
|
79
|
+
|
|
80
|
+
**Verify every finding before reporting it.** Re-read the code around it and ask "what concrete
|
|
81
|
+
input or state makes this go wrong?" If you can't name one, drop it or mark it a question. Don't
|
|
82
|
+
report style the linter would catch, or personal taste.
|
|
83
|
+
|
|
84
|
+
## Step 4: Write the report
|
|
85
|
+
|
|
86
|
+
Write `{specs_dir}/{feature}/review.md` using `references/report-template.md`. With no spec, write
|
|
87
|
+
`review.md` in the current directory only if the user wants a file; otherwise report in chat.
|
|
88
|
+
|
|
89
|
+
| Severity | Meaning | Effect |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| **blocker** | wrong behaviour, a missing requirement, a security or data-loss risk, a failing check | `spec-ship` and run-through stop |
|
|
92
|
+
| **should-fix** | a real problem that's safe to ship but shouldn't stay: a missing test, a broken convention, fragile code | listed in the PR |
|
|
93
|
+
| **nit** | small and optional | listed once, never blocks |
|
|
94
|
+
| **question** | needs the author's intent to judge | asked, never blocks |
|
|
95
|
+
|
|
96
|
+
Then append one line to `log.md` (counts per severity) and overwrite the README's **Resume here**:
|
|
97
|
+
`Stage: reviewed (B blockers, S should-fix)`, `Next: fix blockers` or `Next: spec-checkpoint`.
|
|
98
|
+
|
|
99
|
+
## Step 5: Offer fixes (only on a yes)
|
|
100
|
+
|
|
101
|
+
Tell the user the result:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
Reviewed {feature}: {B} blockers · {S} should-fix · {N} nits · {Q} questions → specs/{feature}/review.md
|
|
105
|
+
Fix the blockers and should-fix items now? (y / pick numbers / n)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- **On a yes,** hand the chosen findings to `spec-implement`'s fix loop: grouped by task, one
|
|
109
|
+
fix agent each, tests run, then review again. Log each fix. After the fixes, re-review only the
|
|
110
|
+
changed lines and update review.md.
|
|
111
|
+
- **On a no,** stop. Blockers stay open, and `spec-ship` will refuse to open a PR until they're
|
|
112
|
+
fixed or the user explicitly accepts each one, which is recorded in review.md.
|
|
113
|
+
- **Someone else's PR:** never push to their branch. Offer to post the findings as PR review
|
|
114
|
+
comments (`gh pr review`), and do it only after the user says yes and has seen the text.
|
|
115
|
+
|
|
116
|
+
## Run-through
|
|
117
|
+
|
|
118
|
+
In run-through mode (see `spec-implement`), this runs after verify passes. **Any blocker stops the
|
|
119
|
+
run-through** at this stage with the report. should-fix items don't stop it, but they are listed in
|
|
120
|
+
the final summary. Fixes still need a yes.
|
|
121
|
+
|
|
122
|
+
## Boundaries
|
|
123
|
+
|
|
124
|
+
- Reports and asks. Never edits code, commits, or pushes on its own.
|
|
125
|
+
- Writing `review.md`, the log line, and **Resume here** is part of the review, not a code change.
|
|
126
|
+
Do it even when the user says "don't change anything". Without the file, `spec-ship` can't see
|
|
127
|
+
the result. Skip it only if the user explicitly says not to write files, and then say the result
|
|
128
|
+
won't gate shipping.
|
|
129
|
+
- Never posts to a PR, issue, or chat without the user's yes on the exact text.
|
|
130
|
+
- Never weakens a finding to get a pass, and never re-labels a blocker to unblock shipping. Only the
|
|
131
|
+
user can accept a blocker.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Review Report Template
|
|
2
|
+
|
|
3
|
+
Copy this structure into `specs/{feature}/review.md`.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# Review: {feature}
|
|
7
|
+
|
|
8
|
+
**Result:** {B} blockers · {S} should-fix · {N} nits · {Q} questions
|
|
9
|
+
**Reviewed:** {base}...{head short sha} ({files} files, +{add}/−{del}) on {date}, model {model}
|
|
10
|
+
**Checks:** lint {PASS/FAIL/skipped} · typecheck {…} · test {…}
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
| Req | Delivered by | Status |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| R1 | `src/x.ts:40` | ✅ delivered |
|
|
17
|
+
| R2 | — | ❌ missing → finding 1 |
|
|
18
|
+
|
|
19
|
+
## Findings
|
|
20
|
+
|
|
21
|
+
### 1. [blocker] {one-line title}
|
|
22
|
+
- **Where:** `path/to/file.ts:123`
|
|
23
|
+
- **Problem:** {what's wrong}
|
|
24
|
+
- **Failure:** {the concrete input or state that makes it go wrong}
|
|
25
|
+
- **Fix:** {the suggested change}
|
|
26
|
+
- **Status:** open <!-- open | fixed in {sha} | accepted by {user} on {date}: {reason} -->
|
|
27
|
+
|
|
28
|
+
### 2. [should-fix] …
|
|
29
|
+
|
|
30
|
+
## Scope
|
|
31
|
+
|
|
32
|
+
- Unrequested changes: {files or "none"}
|
|
33
|
+
- Task-listed files not touched: {files or "none"}
|
|
34
|
+
|
|
35
|
+
## Conventions checked
|
|
36
|
+
|
|
37
|
+
- {convention} ({source}): {followed / broken → finding n}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Key Points
|
|
41
|
+
|
|
42
|
+
- Number findings once and never renumber them, so "fix 1 and 3" stays unambiguous across fix rounds.
|
|
43
|
+
- **Status** is how a blocker gets cleared: `fixed in <sha>` after a fix round, or `accepted by <user>` when the user explicitly takes the risk. `spec-ship` refuses while any blocker is `open`.
|
|
44
|
+
- Leave out sections that don't apply, such as Requirements when there's no spec.
|
|
@@ -4,17 +4,22 @@ description: >
|
|
|
4
4
|
One-time discovery that teaches the spec-driven-dev pipeline how THIS project works, and saves
|
|
5
5
|
the answers to .spec-driven.yml — project layout (single repo, monorepo, or multiple repos),
|
|
6
6
|
issue tracker, base branch, PR target, branch naming, commit style, and the lint/typecheck/test/
|
|
7
|
-
build/dev commands.
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
7
|
+
build/dev commands. It also builds the project's memory: for an existing repo a shallow audit
|
|
8
|
+
plus one round of questions, for a new one the intended stack and conventions, saved to a small
|
|
9
|
+
specs/CONTEXT.md that later skills load cheaply. Use when the user says "set up spec-driven",
|
|
10
|
+
"configure the pipeline", "spec-setup", "audit this repo", "refresh the project context",
|
|
11
|
+
"change our branch rules", or when any other spec-* skill finds no .spec-driven.yml or no
|
|
12
|
+
CONTEXT.md. Detects everything it can first and only asks about what is ambiguous. Writes config
|
|
13
|
+
and context files only — never changes code, branches, or commits.
|
|
11
14
|
license: MIT
|
|
12
15
|
---
|
|
13
16
|
|
|
14
17
|
# spec-setup
|
|
15
18
|
|
|
16
|
-
Learn this project's rules once, save them, and let every other `spec-*` skill reuse
|
|
17
|
-
rules live in a config file the team can review and change — never in the skills
|
|
19
|
+
Learn this project's rules and context once, save them, and let every other `spec-*` skill reuse
|
|
20
|
+
them. Team rules live in a config file the team can review and change — never in the skills
|
|
21
|
+
themselves. What the project *knows* (areas, conventions, decisions) lives in
|
|
22
|
+
`{specs_dir}/CONTEXT.md`, kept small so loading it is cheap.
|
|
18
23
|
|
|
19
24
|
## Where the config lives
|
|
20
25
|
|
|
@@ -73,8 +78,10 @@ Read, don't guess. Collect a draft of every field in `references/config-template
|
|
|
73
78
|
has for each tool they installed, only if they want to tune it: the Claude defaults (haiku /
|
|
74
79
|
sonnet / opus) work as-is, and `default` is safe for the rest.
|
|
75
80
|
7. **After approval.** Ask whether an approved spec should stop after each stage (`stop`), or
|
|
76
|
-
run implement → verify → checkpoint in one go (`run-through`), stopping at any failure and never
|
|
81
|
+
run implement → verify → review → checkpoint in one go (`run-through`), stopping at any failure and never
|
|
77
82
|
pushing. Store it as `pipeline.after_approval`.
|
|
83
|
+
8. **New or existing project.** Detect it (commit and file counts) and confirm in one line. Store
|
|
84
|
+
it as `context.project`. This decides what Step 4 does.
|
|
78
85
|
|
|
79
86
|
## Step 2 — Confirm in one round
|
|
80
87
|
|
|
@@ -103,6 +110,21 @@ for the rest.
|
|
|
103
110
|
4. Report: the file path, a one-line summary per section, and "re-run spec-setup any time these
|
|
104
111
|
change".
|
|
105
112
|
|
|
113
|
+
## Step 4 — Project context
|
|
114
|
+
|
|
115
|
+
Skip if `{specs_dir}/CONTEXT.md` already exists (offer a refresh instead, see `references/audit.md`).
|
|
116
|
+
|
|
117
|
+
1. Read `references/audit.md` and follow it: a shallow audit for an existing project, or the
|
|
118
|
+
intended stack and conventions for a new one. One round of questions, no more.
|
|
119
|
+
2. Write `{specs_dir}/CONTEXT.md` (and any area files) using `references/context-template.md`.
|
|
120
|
+
Keep the index to 60 lines and area files to 150.
|
|
121
|
+
3. **Offer, don't do:** ask whether to add this one line to `CLAUDE.md` / `AGENTS.md` (whichever
|
|
122
|
+
the project uses), so hosts reload the pointer after compaction and in every new session:
|
|
123
|
+
`For spec work, read specs/CONTEXT.md first, then the "Resume here" block of any unfinished spec.`
|
|
124
|
+
Add it only on a yes.
|
|
125
|
+
4. Re-run `npx -y @benjaminthomas/spec-driven-dev doctor` if available. It checks the size limits
|
|
126
|
+
and flags context lines that point to files which no longer exist.
|
|
127
|
+
|
|
106
128
|
## Updating
|
|
107
129
|
|
|
108
130
|
Re-running `spec-setup` with an existing config: load it, re-detect, and show only what changed or
|
|
@@ -111,7 +133,10 @@ a value the user set by hand.
|
|
|
111
133
|
|
|
112
134
|
## Boundaries
|
|
113
135
|
|
|
114
|
-
- Writes `.spec-driven.yml` and
|
|
115
|
-
-
|
|
136
|
+
- Writes `.spec-driven.yml`, `{specs_dir}/CONTEXT.md` and `{specs_dir}/context/*.md`, plus the
|
|
137
|
+
one-line pointer in `CLAUDE.md` / `AGENTS.md` only if the user says yes. No branches, commits,
|
|
138
|
+
pushes, installs, or code. Never installs graphify or anything else.
|
|
139
|
+
- Never put secrets, tokens, or credentials in the config or context files. Ask before saving
|
|
140
|
+
sensitive business details.
|
|
116
141
|
- A value in the config beats a detected value. If the config looks wrong mid-run (a base
|
|
117
142
|
branch that doesn't exist), the other skills stop and point back here rather than overriding it.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Repository audit
|
|
2
|
+
|
|
3
|
+
Builds the first `{specs_dir}/CONTEXT.md`. It is deliberately **shallow**: map the project now,
|
|
4
|
+
and let each feature add detail for the areas it touches. Use the **light** model tier
|
|
5
|
+
(`models.<tool>.light`) where the host can choose a model for a subagent, because this is
|
|
6
|
+
summarising, not reasoning.
|
|
7
|
+
|
|
8
|
+
## 1. New or existing project?
|
|
9
|
+
|
|
10
|
+
Use `context.project` from `.spec-driven.yml` if it's set (the npm CLI asks this). Otherwise
|
|
11
|
+
detect it, then confirm in one line instead of asking blind:
|
|
12
|
+
|
|
13
|
+
- `git rev-list --count HEAD` (commits) and `git ls-files | wc -l` (tracked files).
|
|
14
|
+
- **Existing** if there are 20 or more commits or 50 or more tracked files. **New** otherwise.
|
|
15
|
+
- Ask outright only when it's unclear, for example a fresh repo created from a large template.
|
|
16
|
+
|
|
17
|
+
Example: "This looks like an existing project (412 commits, 1,830 files). I'll audit it. OK?"
|
|
18
|
+
|
|
19
|
+
## 2a. Existing project: audit with small outputs
|
|
20
|
+
|
|
21
|
+
Prefer commands whose output is short over opening files. For a multi-repo workspace, run them per
|
|
22
|
+
repo and give each repo its own row in **Areas**.
|
|
23
|
+
|
|
24
|
+
| What | How (cheap) |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Layout and size | `git ls-files \| cut -d/ -f1-2 \| sort \| uniq -c \| sort -rn \| head -30` |
|
|
27
|
+
| Stack and commands | manifests (`package.json`, `go.mod`, `pyproject.toml`, …), CI workflow files |
|
|
28
|
+
| Busy areas | `git log --since=6.months --name-only --format= \| cut -d/ -f1-2 \| sort \| uniq -c \| sort -rn \| head -15` |
|
|
29
|
+
| Written rules | `README*`, `CLAUDE.md`, `AGENTS.md`, `CONTRIBUTING.md`, `docs/adr*`, PR templates |
|
|
30
|
+
| Conventions | read 2–3 representative files in the busiest areas, not every file |
|
|
31
|
+
|
|
32
|
+
**Graph (optional).** If `context.graph` isn't `off` and `graphify-out/graph.json` exists, or
|
|
33
|
+
`graphify` is on the PATH: use it for structure instead of reading code. Prefer
|
|
34
|
+
`graphify query "<question>" --budget 1500` and `graphify path "<A>" "<B>"`, and never load
|
|
35
|
+
`GRAPH_REPORT.md` in full. Treat INFERRED or AMBIGUOUS edges as hints to check, not facts. Never
|
|
36
|
+
install graphify yourself. If it isn't installed and the repo is large (more than about 2,000
|
|
37
|
+
tracked files), mention once: "Optional: graphify (`uv tool install graphifyy`) makes code
|
|
38
|
+
navigation cheaper on big repos." Record the answer as `context.graph: off` if they decline, so you
|
|
39
|
+
never ask again.
|
|
40
|
+
|
|
41
|
+
## 3. Discovery questions (one round)
|
|
42
|
+
|
|
43
|
+
Show the draft map first, with each line marked **detected** (with its source) or **guess**. Then
|
|
44
|
+
ask only what the code can't answer, in one message:
|
|
45
|
+
|
|
46
|
+
- What does the product do, and who uses it?
|
|
47
|
+
- Which areas are legacy, frozen, or off-limits?
|
|
48
|
+
- Known fragile spots or recurring pain?
|
|
49
|
+
- Where is it heading in the next few months?
|
|
50
|
+
- Rules that live in people's heads (e.g. "every API change needs versioning")?
|
|
51
|
+
|
|
52
|
+
Anything they skip stays out. Don't guess to fill gaps.
|
|
53
|
+
|
|
54
|
+
## 2b. New project: record intent
|
|
55
|
+
|
|
56
|
+
There's nothing to audit. Ask about the intended stack, conventions, and architecture choices, and
|
|
57
|
+
save them as the first entries under **Conventions** and **Decisions**, marked `(you told me)`.
|
|
58
|
+
|
|
59
|
+
## 4. Write and record
|
|
60
|
+
|
|
61
|
+
- Write `CONTEXT.md` from `context-template.md`, within 60 lines. Create an area file only where
|
|
62
|
+
you learned more than fits in one line. Most areas start with none.
|
|
63
|
+
- Put the audited commit on the index's header line (`audited at <short sha> (<date>)`).
|
|
64
|
+
- Never write secrets. Ask before saving sensitive business details.
|
|
65
|
+
- Report: the file path, the number of areas, and what was skipped.
|
|
66
|
+
|
|
67
|
+
## Refresh (re-running the audit)
|
|
68
|
+
|
|
69
|
+
Never start over. Read the commit on the index's header line, then look at
|
|
70
|
+
`git diff --stat <that commit>..HEAD` and re-check only the areas whose files changed. Update those
|
|
71
|
+
lines, move superseded ones to `context/archive.md`, and update the header commit.
|
|
@@ -77,8 +77,13 @@ effort:
|
|
|
77
77
|
|
|
78
78
|
pipeline:
|
|
79
79
|
# stop — every stage waits for you (default)
|
|
80
|
-
# run-through — after you approve a spec: implement → verify → checkpoint in one go,
|
|
81
|
-
# stopping at any failure. Pushing / opening the PR (spec-ship) always asks first.
|
|
80
|
+
# run-through — after you approve a spec: implement → verify → review → checkpoint in one go,
|
|
81
|
+
# stopping at any failure or review blocker. Pushing / opening the PR (spec-ship) always asks first.
|
|
82
82
|
after_approval: stop
|
|
83
83
|
|
|
84
|
+
# Project memory: {specs_dir}/CONTEXT.md (index, ≤60 lines) + {specs_dir}/context/<area>.md (≤150 each).
|
|
85
|
+
context:
|
|
86
|
+
project: existing # existing (audited) | new (intent recorded) — set by setup
|
|
87
|
+
graph: auto # auto = use graphify if installed or graphify-out/ exists | off
|
|
88
|
+
|
|
84
89
|
specs_dir: specs # where specs/<feature>/ folders go (relative to this file)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Project context templates
|
|
2
|
+
|
|
3
|
+
What the project knows, kept small so it can be loaded cheaply. Two levels:
|
|
4
|
+
|
|
5
|
+
- `{specs_dir}/CONTEXT.md`: the **index**. **60 lines or fewer.** Read once per stage, only during
|
|
6
|
+
spec work.
|
|
7
|
+
- `{specs_dir}/context/<area>.md`: details for one area. **150 lines or fewer each.** Read only when
|
|
8
|
+
a task touches that area.
|
|
9
|
+
- `{specs_dir}/context/archive.md`: old or superseded entries. Never loaded by default.
|
|
10
|
+
|
|
11
|
+
`spec-driven-dev context` prints the index, and `spec-driven-dev context --areas=billing,auth`
|
|
12
|
+
prints only those area files, with no model needed. `spec-driven-dev doctor` checks the size limits
|
|
13
|
+
and flags paths that no longer exist.
|
|
14
|
+
|
|
15
|
+
## Rules for writing context
|
|
16
|
+
|
|
17
|
+
- **Only what the code can't tell you quickly:** decisions and their reasons, conventions, places
|
|
18
|
+
that are off-limits, pitfalls, product intent. Don't paste code. Point to it as `path:line`.
|
|
19
|
+
- **Every entry gets a date and a source:** `(2026-11-10, spec stp-123)`, `(audit, a1b2c3d)`, or
|
|
20
|
+
`(you told me)`.
|
|
21
|
+
- **Add at the end of a section.** Don't reorder or reformat what's already there. The start of the
|
|
22
|
+
file then stays the same, and the host's prompt cache can reuse it.
|
|
23
|
+
- **Over the limit?** Merge duplicates. Move anything superseded or older than about a year to
|
|
24
|
+
`archive.md`. Never delete a decision without archiving it.
|
|
25
|
+
- **No secrets, keys, tokens, or personal data.** Ask before writing sensitive business details
|
|
26
|
+
such as customer names or pricing. These files are usually committed.
|
|
27
|
+
- **The code wins.** If code and context disagree, say so in the report and suggest a fix. Never
|
|
28
|
+
silently rewrite context to match a guess.
|
|
29
|
+
|
|
30
|
+
## CONTEXT.md (index)
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# Project context
|
|
34
|
+
<!-- Index only, 60 lines max. Details live in context/<area>.md. Maintained by spec-* skills. -->
|
|
35
|
+
Project: existing · audited at a1b2c3d (2026-11-10) · graph: none
|
|
36
|
+
|
|
37
|
+
## Product
|
|
38
|
+
{2–3 lines: what it does, who uses it.}
|
|
39
|
+
|
|
40
|
+
## Areas
|
|
41
|
+
| Area | Where | What it does | Details |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| billing | `api/src/billing/` | invoices, Stripe webhooks | [billing](context/billing.md) |
|
|
44
|
+
| web | `web/` | React customer app | — |
|
|
45
|
+
|
|
46
|
+
## Conventions
|
|
47
|
+
- {The handful of rules that apply everywhere, e.g. "errors go through `AppError`" (audit, a1b2c3d)}
|
|
48
|
+
|
|
49
|
+
## Off-limits / handle with care
|
|
50
|
+
- {e.g. `legacy/` is frozen, no changes without approval (you told me)}
|
|
51
|
+
|
|
52
|
+
## Decisions
|
|
53
|
+
- {One line each, newest last: decision, reason, (date, source). Long ones go in an area file.}
|
|
54
|
+
|
|
55
|
+
## Specs
|
|
56
|
+
- {stp-123: retry failed webhooks, touched billing (2026-11-10)}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## context/<area>.md
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
# {Area}
|
|
63
|
+
<!-- 150 lines max. Loaded only when a task touches this area. -->
|
|
64
|
+
Where: `{paths}` · last checked {date} at {commit}
|
|
65
|
+
|
|
66
|
+
## How it works
|
|
67
|
+
{A few lines plus `path:line` pointers. Entry points, main flow, data it owns.}
|
|
68
|
+
|
|
69
|
+
## Conventions
|
|
70
|
+
- {rule} ({date}, {source})
|
|
71
|
+
|
|
72
|
+
## Decisions
|
|
73
|
+
- {decision}: {why} ({date}, {source})
|
|
74
|
+
|
|
75
|
+
## Pitfalls
|
|
76
|
+
- {what bit someone, and how to avoid it} ({date}, {source})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Per-feature: Resume here and log.md
|
|
80
|
+
|
|
81
|
+
These live in each spec folder. Their templates are readme-template.md and log-template.md in
|
|
82
|
+
the installed `spec-create` skill folder's references/. The README's **Resume here** block (about 10 lines)
|
|
83
|
+
is what a new session reads first. `log.md` is append-only and is never read in full.
|
|
@@ -70,6 +70,12 @@ Verify tooling before doing anything else.
|
|
|
70
70
|
git remote add origin https://github.com/{user}/{repo}.git
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
4. **Review blockers?** If this branch belongs to a spec and `specs/{feature}/review.md` exists,
|
|
74
|
+
stop while any finding is `[blocker]` with `Status: open`. Show those findings and offer: fix them
|
|
75
|
+
(spec-review's fix step), or have the user accept each one, which is recorded in review.md. If
|
|
76
|
+
there's no review.md for a spec branch, say so and offer to run `spec-review` first. The user
|
|
77
|
+
may skip it, and that choice goes in the PR description. List should-fix items in the PR body.
|
|
78
|
+
|
|
73
79
|
### Step 1: Detect the Environment
|
|
74
80
|
|
|
75
81
|
Run these commands to understand the current state:
|
|
@@ -193,6 +199,10 @@ EOF
|
|
|
193
199
|
)"
|
|
194
200
|
```
|
|
195
201
|
|
|
202
|
+
If this branch belongs to a spec, overwrite its README's **Resume here** (`Stage: PR open`,
|
|
203
|
+
`Next: review`, the PR URL) and append one line to `log.md`. Commit that only if the user
|
|
204
|
+
agrees; otherwise leave it for the next checkpoint.
|
|
205
|
+
|
|
196
206
|
### Step 8: Report
|
|
197
207
|
|
|
198
208
|
Display the result clearly:
|
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
— and checking off every acceptance criterion from its specs/{feature}/ folder one by one. Use
|
|
6
6
|
this after /spec-implement finishes a spec, when the user says "test this end to end",
|
|
7
7
|
"verify this feature actually works", "did we actually build this right", or "/spec-verify",
|
|
8
|
-
and before /spec-ship or opening a PR. This is the spec-aware sibling of the generic /verify and
|
|
8
|
+
and before /spec-review, /spec-ship, or opening a PR. This is the spec-aware sibling of the generic /verify and
|
|
9
9
|
/run skills — /verify checks an arbitrary diff's runtime behavior and /run just launches the
|
|
10
10
|
app, but this skill specifically reads a spec's requirements.md and task files, builds a master
|
|
11
11
|
checklist of acceptance criteria, and reports pass/fail per criterion with real evidence
|
|
@@ -38,6 +38,14 @@ isn't, detect what this skill needs from the repo, ask about anything ambiguous,
|
|
|
38
38
|
the answers to `.spec-driven.yml` (keys: `layout`, `repos`, `tracker`, `git`, `commands`,
|
|
39
39
|
`specs_dir`).
|
|
40
40
|
|
|
41
|
+
## Project context and memory
|
|
42
|
+
|
|
43
|
+
- Read the README's **Resume here** block first.
|
|
44
|
+
- Where requirements.md numbers its criteria (R1…), group the checklist by requirement and report
|
|
45
|
+
pass/fail per requirement number.
|
|
46
|
+
- Append each failure and how you confirmed it to `log.md`. When you finish, overwrite
|
|
47
|
+
**Resume here** (`Verified X/Y`, `Next: spec-checkpoint`, or what to fix first).
|
|
48
|
+
|
|
41
49
|
## When there's no spec folder
|
|
42
50
|
|
|
43
51
|
If the user asks to verify a feature that wasn't built through `spec-create`, don't refuse —
|
|
@@ -144,7 +152,7 @@ Then tell the user directly:
|
|
|
144
152
|
```
|
|
145
153
|
Verified {feature}: {X}/{Y} criteria passed.
|
|
146
154
|
|
|
147
|
-
{If all pass:}
|
|
155
|
+
{If all pass:} Next: spec-review (reviews the whole change before checkpoint and ship).
|
|
148
156
|
{If failures:} {N} failing — see specs/{feature}/verification-report.md for exact repro steps.
|
|
149
157
|
Options: loop back to /spec-implement to fix, or fix manually.
|
|
150
158
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|