@benjaminthomas/spec-driven-dev 1.8.0 → 1.11.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 +220 -63
- package/bin/cli.mjs +203 -19
- package/bin/risk-eval.mjs +152 -0
- package/bin/risk.mjs +137 -0
- package/package.json +4 -3
- package/plugin/.claude-plugin/icon.png +0 -0
- package/plugin/.claude-plugin/plugin.json +20 -0
- package/{skills → plugin/skills}/spec-checkpoint/SKILL.md +25 -0
- package/{skills → plugin/skills}/spec-create/SKILL.md +30 -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 +18 -0
- package/{skills → plugin/skills}/spec-implement/SKILL.md +25 -6
- package/{skills → plugin/skills}/spec-implement/references/review-prompt-template.md +2 -1
- package/{skills → plugin/skills}/spec-investigate/SKILL.md +45 -5
- package/{skills → plugin/skills}/spec-investigate/references/report-template.md +12 -0
- package/plugin/skills/spec-review/SKILL.md +135 -0
- package/plugin/skills/spec-review/references/report-template.md +44 -0
- package/{skills → plugin/skills}/spec-setup/SKILL.md +54 -9
- package/plugin/skills/spec-setup/references/audit.md +71 -0
- package/{skills → plugin/skills}/spec-setup/references/config-template.yml +19 -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-verify/references/report-template.md +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ without guessing.** It first investigates the problem, then writes a plan you ap
|
|
|
9
9
|
in parallel with tests and review, then checks the real running app, and finally commits and opens
|
|
10
10
|
the PR.
|
|
11
11
|
|
|
12
|
-
It's a set of
|
|
12
|
+
It's a set of nine [Agent Skills](https://agentskills.io), plain Markdown instruction files that
|
|
13
13
|
AI coding tools load on demand. It works with Claude Code, Codex CLI, Cursor, and Google Antigravity,
|
|
14
14
|
in any language or framework, and in a single repo, a monorepo, or several repos that change
|
|
15
15
|
together, even when those repos live in different folders. To set it up, run
|
|
@@ -45,6 +45,9 @@ Asking an AI agent to "just build it" tends to fail in predictable ways:
|
|
|
45
45
|
| A big plan won't fit in the agent's context, or is too vague to act on | **`spec-create`** splits the work into small, self-contained task files, so each agent reads only its own |
|
|
46
46
|
| One agent working alone is slow | **`spec-implement`** runs several coder agents in parallel, each in its own copy of the repo |
|
|
47
47
|
| "It compiles" gets treated as "it works" | **`spec-verify`** drives the real running app and checks every acceptance criterion, with evidence |
|
|
48
|
+
| Problems slip through because nobody reviews the whole change | **`spec-review`** checks the finished branch against the spec, your conventions, and the code, and blocks shipping on real problems |
|
|
49
|
+
| The agent treats a file that broke five times like any other | **GitRisk** scores files from git history (churn, bug fixes, dependents, security fixes), so risky files get a deeper look, a higher tier and targeted tests. Switch it on or off any time |
|
|
50
|
+
| A new session forgets what was decided last time | **Project memory**: a small `specs/CONTEXT.md`, plus a "Resume here" block and a log in every spec, kept short so reloading them is cheap |
|
|
48
51
|
| Broken code gets committed, or a PR is pushed by accident | **`spec-checkpoint`** commits only once lint, types, tests, and build all pass. **`spec-ship`** asks before it pushes |
|
|
49
52
|
|
|
50
53
|
Each stage writes its result to a file, so you can stop at any point, hand over to a teammate, or
|
|
@@ -89,6 +92,7 @@ words in quotes.
|
|
|
89
92
|
|
|
90
93
|
/spec-implement "implement the spec"
|
|
91
94
|
/spec-verify "does it actually work?"
|
|
95
|
+
/spec-review "review this"
|
|
92
96
|
/spec-checkpoint "checkpoint"
|
|
93
97
|
/spec-ship "ship it"
|
|
94
98
|
```
|
|
@@ -123,9 +127,9 @@ contracts, unclear requirements). `spec-implement` then runs each task on the mo
|
|
|
123
127
|
newer model for `deep`.
|
|
124
128
|
|
|
125
129
|
**Fewer stops:** after reviewing the spec, say **"approved, run it through"**. The workflow then
|
|
126
|
-
implements, verifies, and commits in one go. It stops at the first failure
|
|
127
|
-
before pushing or opening a PR. To make this the default after approval,
|
|
128
|
-
setup (`pipeline.after_approval` in `.spec-driven.yml`).
|
|
130
|
+
implements, verifies, reviews, and commits in one go. It stops at the first failure or review
|
|
131
|
+
blocker, and always asks before pushing or opening a PR. To make this the default after approval,
|
|
132
|
+
choose `run-through` during setup (`pipeline.after_approval` in `.spec-driven.yml`).
|
|
129
133
|
|
|
130
134
|
That's the whole workflow. Every stage can be used on its own as well: use `/spec-create` straight
|
|
131
135
|
from a planning chat, or `/spec-checkpoint` on any work in progress.
|
|
@@ -205,28 +209,111 @@ example, from inside `/Projects/frontend`:
|
|
|
205
209
|
Every question also has a flag, for scripts and CI:
|
|
206
210
|
`--layout=multi-repo --repos=~/Projects/frontend,~/Work/backend --workspace=~/Projects`,
|
|
207
211
|
`--layout=monorepo --packages=apps/web,packages/ui`, `--after-approval=run-through`,
|
|
208
|
-
`--tools=cursor,codex`, `--global`, `--yes` (accept everything detected), and `--version`.
|
|
212
|
+
`--project=new|existing`, `--tools=cursor,codex`, `--global`, `--yes` (accept everything detected), and `--version`.
|
|
209
213
|
|
|
210
214
|
To change the rules later, edit the file or run setup again, then run `spec-driven-dev doctor`
|
|
211
215
|
to confirm the file still matches your repos. Setup never overwrites the file without
|
|
212
|
-
asking. See [`config-template.yml`](skills/spec-setup/references/config-template.yml) for every field.
|
|
216
|
+
asking. See [`config-template.yml`](plugin/skills/spec-setup/references/config-template.yml) for every field.
|
|
217
|
+
|
|
218
|
+
### Project memory: so context isn't lost between sessions and features
|
|
219
|
+
|
|
220
|
+
Setup asks whether this is a **new or existing project** and detects the likely answer from the
|
|
221
|
+
commit and file counts. Then "run spec-setup" in your AI tool builds the project's memory:
|
|
222
|
+
|
|
223
|
+
- **Existing project:** a shallow audit using cheap commands (folder sizes, manifests, CI, busy areas
|
|
224
|
+
from git log, your README/CLAUDE.md/ADRs), then one round of questions the code can't answer
|
|
225
|
+
(what the product does, off-limits areas, fragile spots, where it's heading, unwritten rules).
|
|
226
|
+
- **New project:** it asks about the stack and conventions you want and saves them as the first
|
|
227
|
+
decisions.
|
|
228
|
+
|
|
229
|
+
Everything is kept small on purpose, because loading context costs tokens:
|
|
230
|
+
|
|
231
|
+
| File | Size limit | Loaded when |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| `specs/CONTEXT.md`, the index: product, area map, top conventions, decisions | 60 lines | once per stage, only during spec work |
|
|
234
|
+
| `specs/context/<area>.md`, details for one area | 150 lines | only when a task touches that area |
|
|
235
|
+
| `specs/context/archive.md`, superseded entries | none | never by default |
|
|
236
|
+
| `specs/<feature>/README.md`, its **Resume here** block | ~10 lines | first thing in a new or compacted session |
|
|
237
|
+
| `specs/<feature>/log.md`, decisions, deviations, review findings | append-only | rarely; read in full only once, at checkpoint |
|
|
238
|
+
|
|
239
|
+
Each stage passes on a digest instead of the files: the investigation keeps 10–20 relevant lines,
|
|
240
|
+
and each task file gets only the 3–5 conventions it needs, so parallel coders never load the
|
|
241
|
+
context. When a feature is finished, `spec-checkpoint` adds its lasting lessons to the right area
|
|
242
|
+
file. Requirements are numbered (R1, R2…) and traced from investigation to tasks to verification.
|
|
243
|
+
|
|
244
|
+
`spec-driven-dev context` prints the index, and `spec-driven-dev context --areas=billing,api`
|
|
245
|
+
prints just those areas, with no model involved. `doctor` checks the size limits and flags context
|
|
246
|
+
lines that point to files that no longer exist. If you install
|
|
247
|
+
[graphify](https://github.com/Graphify-Labs/graphify), the skills use it for cheaper code
|
|
248
|
+
navigation. It's optional (`context.graph: off` turns it off), and nothing is installed for you.
|
|
249
|
+
|
|
250
|
+
### GitRisk: which files have a history of breaking
|
|
251
|
+
|
|
252
|
+
`spec-driven-dev risk` scores every tracked code file from git history alone, with no model and no
|
|
253
|
+
tokens, and writes the top files to `specs/context/risk.md`:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
Risk = 0.30 × Churn + 0.35 × Bug Density + 0.20 × Fan-out + 0.15 × Security (each factor 0–100)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
| Factor | Weight | What it measures |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| Churn | 30% | how often the file changes, against the repo's 90th percentile |
|
|
262
|
+
| Bug Density | 35% | share of its commits that were bug fixes (`fix:` type or fix-like wording) |
|
|
263
|
+
| Fan-out | 20% | how many other files import it, against the repo's 90th percentile |
|
|
264
|
+
| Security | 15% | share of its commits that were security fixes (security, CVE, XSS, injection…) |
|
|
265
|
+
|
|
266
|
+
Tiers: critical ≥ 75, high ≥ 50, medium ≥ 25. When `risk.enabled` is on, the skills use it:
|
|
267
|
+
- `spec-investigate` digs into high and critical files in the change surface (past fix commits,
|
|
268
|
+
dependents) and lists them as **Risk Hotspots**;
|
|
269
|
+
- `spec-create` raises those tasks one tier and requires a test aimed at each file's past failure
|
|
270
|
+
pattern;
|
|
271
|
+
- `spec-implement`'s reviewer and `spec-review` check those tests and read the risky files line
|
|
272
|
+
by line.
|
|
273
|
+
|
|
274
|
+
**Turning it on or off, no YAML needed:**
|
|
275
|
+
- **In your AI tool:** say "turn GitRisk off" or "turn GitRisk on". `spec-setup` changes just that
|
|
276
|
+
setting and tells you what it means.
|
|
277
|
+
- **In a terminal:** run `spec-driven-dev settings` and pick with the arrow keys. It also switches
|
|
278
|
+
run-through mode. For scripts, use `spec-driven-dev settings --risk=off`.
|
|
279
|
+
- **By hand:** set `risk.enabled: on` or `off` in `.spec-driven.yml`.
|
|
280
|
+
|
|
281
|
+
Off means every skill ignores risk completely.
|
|
282
|
+
|
|
283
|
+
`spec-driven-dev risk --files=a.ts,b.ts` prints scores for chosen files. The weights are a starting
|
|
284
|
+
hypothesis: change them under `risk.weights` in `.spec-driven.yml` once you've backtested them
|
|
285
|
+
against your own past bugs.
|
|
286
|
+
|
|
287
|
+
**Does it change what the agent does?** `spec-driven-dev risk-eval --tickets=tickets.md` runs each
|
|
288
|
+
ticket twice, in fresh clones with risk on and off, through investigate and create on the same
|
|
289
|
+
model. It then compares what the agent did:
|
|
290
|
+
- risky files read and named in the investigation;
|
|
291
|
+
- risky files in the plan, and whether tests were planned for them;
|
|
292
|
+
- task tiers;
|
|
293
|
+
- cost.
|
|
294
|
+
|
|
295
|
+
Results go to `experiments/` with the transcripts, and every run, including failures, is appended to
|
|
296
|
+
`experiments/LOG.md`. It needs Claude Code.
|
|
213
297
|
|
|
214
298
|
## How the workflow fits together
|
|
215
299
|
|
|
216
300
|
```
|
|
217
|
-
┌──────────────────┐ ┌─────────────┐ ┌──────────┐ ┌────────────────┐ ┌─────────────┐ ┌─────────────────┐ ┌───────────┐
|
|
218
|
-
│ spec-investigate │ → │ spec-create │ → │ YOU │ → │ spec-implement │ → │ spec-verify │ → │ spec-checkpoint │ → │ spec-ship │
|
|
219
|
-
│ understand │ │ plan │ │ approve │ │ build + test │ │ prove │ │ commit │ │ open PR │
|
|
220
|
-
└──────────────────┘ └─────────────┘ └──────────┘ └────────────────┘ └─────────────┘ └─────────────────┘ └───────────┘
|
|
221
|
-
investigation.md specs/<feature>/ code + tests, verification-
|
|
222
|
-
+ work branch task files one commit/batch report.md
|
|
301
|
+
┌──────────────────┐ ┌─────────────┐ ┌──────────┐ ┌────────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ ┌───────────┐
|
|
302
|
+
│ spec-investigate │ → │ spec-create │ → │ YOU │ → │ spec-implement │ → │ spec-verify │ → │ spec-review │ → │ spec-checkpoint │ → │ spec-ship │
|
|
303
|
+
│ understand │ │ plan │ │ approve │ │ build + test │ │ prove │ │ review │ │ commit │ │ open PR │
|
|
304
|
+
└──────────────────┘ └─────────────┘ └──────────┘ └────────────────┘ └─────────────┘ └─────────────┘ └─────────────────┘ └───────────┘
|
|
305
|
+
investigation.md specs/<feature>/ code + tests, verification- review.md local commit pushed branch
|
|
306
|
+
+ work branch task files one commit/batch report.md (blockers stop) + GitHub PR
|
|
223
307
|
```
|
|
224
308
|
|
|
225
309
|
- **The approval step is yours.** Nothing builds until you've read the spec and run `spec-implement`
|
|
226
310
|
yourself. `spec-investigate` never moves on to the next stage by itself.
|
|
227
311
|
- **Each stage reads the previous stage's files.** `spec-create` uses `investigation.md` as its
|
|
228
|
-
evidence, `spec-implement` works through the task files,
|
|
229
|
-
acceptance criteria
|
|
312
|
+
evidence, `spec-implement` works through the task files, `spec-verify` checks against their
|
|
313
|
+
acceptance criteria, and `spec-review` checks the whole diff against the requirements before
|
|
314
|
+
anything is committed for shipping.
|
|
315
|
+
- **Every stage leaves a way back in.** Each one updates the spec's **Resume here** block and adds
|
|
316
|
+
to its `log.md`, so a new or compacted session continues from about 10 lines, not the chat history.
|
|
230
317
|
- **Stages can be skipped.** For new projects with nothing to investigate, start at `spec-create`.
|
|
231
318
|
For a quick fix, use only `spec-checkpoint` and `spec-ship`.
|
|
232
319
|
|
|
@@ -236,10 +323,13 @@ asking. See [`config-template.yml`](skills/spec-setup/references/config-template
|
|
|
236
323
|
|
|
237
324
|
### 0. `spec-setup`: learn the project's rules
|
|
238
325
|
|
|
239
|
-
**Say:** "run spec-setup", "configure the pipeline", "
|
|
326
|
+
**Say:** "run spec-setup", "configure the pipeline", "audit this repo", "refresh the project context"
|
|
240
327
|
|
|
241
|
-
**What it does:** see [Project setup](#project-setup-your-teams-rules). It writes `.spec-driven.yml
|
|
242
|
-
|
|
328
|
+
**What it does:** see [Project setup](#project-setup-your-teams-rules). It writes `.spec-driven.yml`, then
|
|
329
|
+
builds the [project memory](#project-memory-so-context-isnt-lost-between-sessions-and-features): a
|
|
330
|
+
shallow audit and one round of questions for an existing repo, or your intended stack and conventions
|
|
331
|
+
for a new one, saved to `specs/CONTEXT.md`. It adds a one-line pointer to `CLAUDE.md`/`AGENTS.md`
|
|
332
|
+
only if you say yes. No branches, commits, or code.
|
|
243
333
|
|
|
244
334
|
### 1. `spec-investigate`: understand before planning
|
|
245
335
|
|
|
@@ -269,8 +359,16 @@ You can add `--context ./notes.md` to supply extra background, such as meeting n
|
|
|
269
359
|
4. Sorts the work into **required / supporting / optional / out of scope**, and lists risks, security
|
|
270
360
|
and performance concerns, and existing tests.
|
|
271
361
|
|
|
362
|
+
It starts from the project memory (`specs/CONTEXT.md` and only the area files the ticket touches),
|
|
363
|
+
treats it as a lead rather than evidence, and notes where the code contradicts it. If graphify is
|
|
364
|
+
installed, it uses it to map the code more cheaply.
|
|
365
|
+
|
|
366
|
+
With GitRisk on, it also looks harder at high-risk files in the change surface (their past fix
|
|
367
|
+
commits and dependents) and lists them as **Risk Hotspots**.
|
|
368
|
+
|
|
272
369
|
**You get:** `specs/<feature>/investigation.md`, with every finding labelled **VERIFIED**,
|
|
273
|
-
**INFERRED**, **ASSUMPTION**, or **UNKNOWN
|
|
370
|
+
**INFERRED**, **ASSUMPTION**, or **UNKNOWN**, a short **Relevant Context** digest for the next
|
|
371
|
+
stages, and requirements numbered R1, R2… so they can be traced through to verification and review.
|
|
274
372
|
|
|
275
373
|
**It won't:** write code, write tests, or start `spec-create` without being asked.
|
|
276
374
|
|
|
@@ -285,7 +383,12 @@ each other and don't touch the same files, so they can be built at the same time
|
|
|
285
383
|
|
|
286
384
|
**You get:** a `specs/<feature>/` folder (see [What ends up in your repo](#what-ends-up-in-your-repo)).
|
|
287
385
|
Each task file is complete on its own: description, files to change, implementation steps, **tests
|
|
288
|
-
to write**, and
|
|
386
|
+
to write**, acceptance criteria, the requirements it **covers**, and the few **project conventions**
|
|
387
|
+
that apply to it. Every requirement must map to a task, and the spec isn't finished until it does.
|
|
388
|
+
It also starts the spec's `log.md` and **Resume here** block.
|
|
389
|
+
|
|
390
|
+
With GitRisk on, a task that touches a high-risk file goes up one tier and must include a test
|
|
391
|
+
aimed at that file's past failures.
|
|
289
392
|
|
|
290
393
|
**Then:** read it, edit anything you disagree with, and only then run `spec-implement`.
|
|
291
394
|
|
|
@@ -302,10 +405,14 @@ to write**, and acceptance criteria.
|
|
|
302
405
|
4. A **separate reviewer agent** runs lint, typecheck, and tests and checks every acceptance
|
|
303
406
|
criterion. If anything fails, fix agents are sent in, for up to 3 rounds before it stops and
|
|
304
407
|
asks you.
|
|
305
|
-
5.
|
|
408
|
+
5. Logs decisions and deviations to `log.md`, updates **Resume here**, then commits the batch and
|
|
409
|
+
ticks it off in the spec's README.
|
|
306
410
|
|
|
307
|
-
|
|
308
|
-
|
|
411
|
+
Each coder gets only its task file, which already carries the 3–5 project conventions that task
|
|
412
|
+
needs, so parallel coders don't each load the project memory.
|
|
413
|
+
|
|
414
|
+
**It can resume:** if you stop halfway, or the conversation gets compacted, run it again. It reads
|
|
415
|
+
the spec's **Resume here** block and carries on from the first unfinished batch. If your tool can't run agents in parallel, it does the tasks one at a time instead.
|
|
309
416
|
|
|
310
417
|
### 4. `spec-verify`: prove it works
|
|
311
418
|
|
|
@@ -316,10 +423,26 @@ each one the way a user would: clicking through the UI, calling real API routes,
|
|
|
316
423
|
database only to confirm the result.
|
|
317
424
|
|
|
318
425
|
**You get:** `specs/<feature>/verification-report.md`, with pass or fail for each criterion and the
|
|
319
|
-
evidence (screenshots, responses, data). If there's no spec, it asks you what "working" means and
|
|
426
|
+
evidence (screenshots, responses, data), grouped by requirement number (R1…) where the spec has them. If there's no spec, it asks you what "working" means and
|
|
320
427
|
checks that instead.
|
|
321
428
|
|
|
322
|
-
### 5. `spec-
|
|
429
|
+
### 5. `spec-review`: review the whole change
|
|
430
|
+
|
|
431
|
+
**Say:** "review this", "code review", "review PR #42", "is this ready to merge?"
|
|
432
|
+
|
|
433
|
+
**What it does:** It reviews the finished branch against the spec (every requirement R1… delivered,
|
|
434
|
+
nothing out of scope), the project's recorded conventions, and the code itself: correctness,
|
|
435
|
+
security, error handling, tests, and hot-path performance. It checks each finding against the code
|
|
436
|
+
before reporting it, and reads the diff rather than the whole repo.
|
|
437
|
+
|
|
438
|
+
With GitRisk on, high-risk files get a line-by-line read of their error paths and callers.
|
|
439
|
+
|
|
440
|
+
**You get:** `specs/<feature>/review.md`, with findings ranked blocker, should-fix, nit, or question,
|
|
441
|
+
each with `file:line` and a suggested fix. Blockers stop `spec-ship` and run-through. It then asks
|
|
442
|
+
whether to fix them, and fixes go through `spec-implement`'s fix loop only after you say yes. It also
|
|
443
|
+
reviews any branch or a teammate's PR, and posts PR comments only after you approve the text.
|
|
444
|
+
|
|
445
|
+
### 6. `spec-checkpoint`: commit safely
|
|
323
446
|
|
|
324
447
|
**Say:** "checkpoint", "commit everything", "save my progress"
|
|
325
448
|
|
|
@@ -328,9 +451,13 @@ finds them in `package.json`, `Makefile`, `pyproject.toml`, CI config, and so on
|
|
|
328
451
|
Then it stages everything and commits in your configured style (`feat: …` or `STP-123: …`). In a
|
|
329
452
|
multi-repo setup, it makes one commit in each repo that changed.
|
|
330
453
|
|
|
454
|
+
When a spec is finished, it also adds the feature's lasting lessons (decisions and why, conventions
|
|
455
|
+
found, pitfalls) to the right `specs/context/<area>.md`, and shows you those changes so you can
|
|
456
|
+
correct them. It follows any commit rules recorded in the project memory.
|
|
457
|
+
|
|
331
458
|
**It won't:** push. Committing is a local step.
|
|
332
459
|
|
|
333
|
-
###
|
|
460
|
+
### 7. `spec-ship`: open the PR
|
|
334
461
|
|
|
335
462
|
**Say:** "ship it", "push this", "open a PR"
|
|
336
463
|
|
|
@@ -340,6 +467,9 @@ against your configured PR target, with a written description. In a multi-repo s
|
|
|
340
467
|
PR per repo, each linking the others. If a PR already exists for the branch, it pushes the new commits to that PR
|
|
341
468
|
instead of opening another one.
|
|
342
469
|
|
|
470
|
+
It won't open a PR while `review.md` has an open blocker, unless you accept it. Any should-fix
|
|
471
|
+
items are listed in the PR description.
|
|
472
|
+
|
|
343
473
|
**Needs:** the [GitHub CLI](https://cli.github.com) (`gh`), logged in.
|
|
344
474
|
|
|
345
475
|
### Bonus: `generative-seo`, a separate skill for SEO
|
|
@@ -348,7 +478,7 @@ This one isn't part of the workflow. It runs SEO and **GEO** (Generative Engine
|
|
|
348
478
|
your content cited by ChatGPT, Perplexity, and Google AI Overviews) for any website codebase. It has
|
|
349
479
|
seven modes: `audit`, `content`, `optimize`, `competitors`, `citations`, `report`, and `social`. The
|
|
350
480
|
first time, it asks a few questions about your brand, domain, and framework, and remembers the
|
|
351
|
-
answers. See `skills/generative-seo/SKILL.md`.
|
|
481
|
+
answers. See `plugin/skills/generative-seo/SKILL.md`.
|
|
352
482
|
|
|
353
483
|
---
|
|
354
484
|
|
|
@@ -360,12 +490,18 @@ specs/
|
|
|
360
490
|
├── investigation.md ← spec-investigate: what's true today, with evidence
|
|
361
491
|
├── requirements.md ← spec-create: what we're building and why
|
|
362
492
|
├── action-required.md ← spec-create: things only a human can do (API keys, DNS, accounts)
|
|
363
|
-
├── README.md ← spec-create: batches, dependency graph, progress checkboxes
|
|
493
|
+
├── README.md ← spec-create: "Resume here", batches, dependency graph, progress checkboxes
|
|
494
|
+
├── log.md ← every stage: decisions, deviations, review findings (append-only)
|
|
364
495
|
├── tasks/
|
|
365
496
|
│ ├── task-01-fix-pagination.md
|
|
366
497
|
│ ├── task-02-add-export-test-fixtures.md
|
|
367
498
|
│ └── …
|
|
368
|
-
|
|
499
|
+
├── verification-report.md ← spec-verify: pass/fail per acceptance criterion
|
|
500
|
+
└── review.md ← spec-review: ranked findings; open blockers stop spec-ship
|
|
501
|
+
specs/CONTEXT.md ← spec-setup / spec-checkpoint: project memory index (≤60 lines)
|
|
502
|
+
specs/context/<area>.md ← details per area, loaded only when needed (≤150 lines)
|
|
503
|
+
specs/context/risk.md ← spec-driven-dev risk: GitRisk scores (regenerate; don't edit)
|
|
504
|
+
experiments/ ← spec-driven-dev risk-eval: on/off reports, transcripts, LOG.md
|
|
369
505
|
```
|
|
370
506
|
|
|
371
507
|
These are plain Markdown files, so you can review them in a PR, edit them, or hand them to a
|
|
@@ -384,7 +520,13 @@ Built into the skills, not left to the agent's judgment:
|
|
|
384
520
|
- **No guessing.** Gaps are marked UNKNOWN, and missing tickets are asked for rather than made up.
|
|
385
521
|
- **Tests can't be cheated.** Coders may not delete, skip, or weaken a test to make it pass, and the
|
|
386
522
|
reviewer checks for this.
|
|
387
|
-
- **Pushing needs an explicit "yes".**
|
|
523
|
+
- **Pushing needs an explicit "yes".** `spec-ship` also refuses while `review.md` has an open
|
|
524
|
+
blocker, unless you accept it, and that is recorded.
|
|
525
|
+
- **Reviews are checked, not guessed.** `spec-review` confirms each finding against the code before
|
|
526
|
+
reporting it, never edits code without your yes, and never posts PR comments without your yes on
|
|
527
|
+
the exact text.
|
|
528
|
+
- **Context costs stay small.** Project memory has hard size limits, is loaded only for the areas a
|
|
529
|
+
task touches, and is passed between stages as short digests.
|
|
388
530
|
- **Investigation stays in scope.** Ideas that come up along the way go under "optional" or "out of
|
|
389
531
|
scope" instead of being folded into the work.
|
|
390
532
|
|
|
@@ -392,6 +534,11 @@ Built into the skills, not left to the agent's judgment:
|
|
|
392
534
|
|
|
393
535
|
## FAQ
|
|
394
536
|
|
|
537
|
+
**How do I turn GitRisk off (or on)?**
|
|
538
|
+
Say "turn GitRisk off" in your AI tool, or run `spec-driven-dev settings` and pick from the menu.
|
|
539
|
+
Off means every skill ignores risk scores. Turning it on again offers to score the files if that
|
|
540
|
+
hasn't been done yet.
|
|
541
|
+
|
|
395
542
|
**Do I need Jira?**
|
|
396
543
|
No. Use GitHub Issues, Linear, a transcript, a document, or a sentence of plain text. Jira is just
|
|
397
544
|
one of the options.
|
|
@@ -408,8 +555,8 @@ config sits outside any repo, so it stays on your machine.
|
|
|
408
555
|
Yes. No skill assumes a language or framework. Each one finds the repo's own commands.
|
|
409
556
|
|
|
410
557
|
**Do I have to start every stage myself?**
|
|
411
|
-
No. After you approve a spec, say "approved, run it through": implement, verify, and checkpoint then
|
|
412
|
-
run one after another, stopping at the first failure. Two steps always wait for you: approving the
|
|
558
|
+
No. After you approve a spec, say "approved, run it through": implement, verify, review, and checkpoint then
|
|
559
|
+
run one after another, stopping at the first failure or review blocker. Two steps always wait for you: approving the
|
|
413
560
|
spec, and pushing or opening the PR. You don't need slash commands either. Saying "investigate
|
|
414
561
|
STP-123" or "ship it" picks the right skill.
|
|
415
562
|
|
|
@@ -439,14 +586,14 @@ Yes. Progress is saved in the spec's `README.md` checkboxes and the commit for e
|
|
|
439
586
|
**How do I update?**
|
|
440
587
|
Run `npm install -g @benjaminthomas/spec-driven-dev@latest`, then `spec-driven-dev` in your project.
|
|
441
588
|
Claude Code plugin users run
|
|
442
|
-
`/plugin marketplace update spec-driven-dev` and then update the plugin. Your config is never
|
|
589
|
+
`/plugin marketplace update spec-driven-dev` and then update the `ticket-to-pr` plugin. Your config is never
|
|
443
590
|
touched by an update.
|
|
444
591
|
|
|
445
592
|
**Can I trust the npm package?**
|
|
446
593
|
Releases are published by this repo's GitHub Actions workflow, not from anyone's laptop, through
|
|
447
594
|
npm [trusted publishing](https://docs.npmjs.com/trusted-publishers). Each version's npm page shows
|
|
448
595
|
a provenance badge linking it to the exact commit and workflow run that built it. The package has
|
|
449
|
-
one small dependency (`prompts`, for the setup menus), and it contains only `bin/` and the `skills/`
|
|
596
|
+
one small dependency (`prompts`, for the setup menus), and it contains only `bin/` and the `plugin/skills/`
|
|
450
597
|
folder.
|
|
451
598
|
|
|
452
599
|
**Something isn't working. Where do I start?**
|
|
@@ -480,7 +627,12 @@ spec-driven-dev --tools=cursor,codex # pick tools without being ask
|
|
|
480
627
|
spec-driven-dev --skills=spec-create,spec-ship # install only some skills
|
|
481
628
|
spec-driven-dev --yes # accept every detected default (CI-friendly)
|
|
482
629
|
spec-driven-dev doctor # check .spec-driven.yml against the real repos
|
|
483
|
-
spec-driven-dev status # list specs
|
|
630
|
+
spec-driven-dev status # list unfinished specs and each one's next step
|
|
631
|
+
spec-driven-dev context --areas=billing # print the project memory (index, or chosen areas)
|
|
632
|
+
spec-driven-dev settings # switch GitRisk and run-through on/off from a menu
|
|
633
|
+
spec-driven-dev risk # GitRisk: score files from git history → specs/context/risk.md
|
|
634
|
+
spec-driven-dev risk-eval --tickets=tickets.md # compare agent behaviour with the risk signal on vs off
|
|
635
|
+
# (--runs=3 --arms=on --timeout=20 --model=sonnet)
|
|
484
636
|
spec-driven-dev --help # show all of the above
|
|
485
637
|
```
|
|
486
638
|
|
|
@@ -505,25 +657,26 @@ try an unreleased commit on `main`.
|
|
|
505
657
|
installer has one small dependency, [`prompts`](https://www.npmjs.com/package/prompts), for its menus.
|
|
506
658
|
CI tests it on Node 14, 16, 18, 20, 22, and 24, and on Windows and macOS.
|
|
507
659
|
|
|
508
|
-
### Claude Code (plugin
|
|
660
|
+
### Claude Code (plugin `ticket-to-pr`, with automatic updates)
|
|
509
661
|
|
|
510
662
|
```
|
|
511
663
|
/plugin marketplace add https://github.com/benjaminthomas/spec-driven-dev.git
|
|
512
|
-
/plugin install
|
|
664
|
+
/plugin install ticket-to-pr@spec-driven-dev
|
|
513
665
|
```
|
|
514
666
|
|
|
515
667
|
To update, run `/plugin marketplace update spec-driven-dev`, then update the plugin from `/plugin`.
|
|
516
668
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
669
|
+
Installed it before 1.9.0? The plugin was called `spec-driven-dev` then. Uninstall that one and
|
|
670
|
+
install `ticket-to-pr@spec-driven-dev`; the old name no longer gets updates.
|
|
671
|
+
|
|
672
|
+
To see unfinished specs and their next step at any time, run `spec-driven-dev status`
|
|
673
|
+
(for example, `specs/stp-123: 3/5 tasks done → next: spec-implement`). If
|
|
521
674
|
you use the plugin, `spec-driven-dev` skips Claude Code so you don't get every skill twice. Run
|
|
522
675
|
`spec-driven-dev setup` for the project config.
|
|
523
676
|
|
|
524
677
|
### By hand
|
|
525
678
|
|
|
526
|
-
Copy the `skills/<name>/` folders you want. Each one is self-contained. Where each tool looks for
|
|
679
|
+
Copy the `plugin/skills/<name>/` folders you want. Each one is self-contained. Where each tool looks for
|
|
527
680
|
skills:
|
|
528
681
|
|
|
529
682
|
| Tool | This project | All projects |
|
|
@@ -537,8 +690,8 @@ Codex CLI and Antigravity share the project path, so installing for one covers b
|
|
|
537
690
|
|
|
538
691
|
### Fallback: MCP server (for tools without Agent Skills support)
|
|
539
692
|
|
|
540
|
-
If your tool supports MCP but not Agent Skills, `mcp-server/` serves the same
|
|
541
|
-
tools. It reads `skills/` directly, so there's nothing to keep in sync.
|
|
693
|
+
If your tool supports MCP but not Agent Skills, `mcp-server/` serves the same nine skills as MCP
|
|
694
|
+
tools. It reads `plugin/skills/` directly, so there's nothing to keep in sync.
|
|
542
695
|
|
|
543
696
|
```bash
|
|
544
697
|
cd mcp-server && npm install
|
|
@@ -559,6 +712,7 @@ Each skill becomes a tool that returns its instructions, and supporting files ar
|
|
|
559
712
|
| `spec-create` | ✅ | ✅ | ✅ | ✅ | Planning and writing files only |
|
|
560
713
|
| `spec-implement` | ✅ | ✅ | ✅ | ✅ | Parallel agents and worktrees where the tool supports them; otherwise one task at a time |
|
|
561
714
|
| `spec-verify` | ✅ | ⚠️ | ⚠️ | ⚠️ | UI checks need browser automation; API and database checks work everywhere |
|
|
715
|
+
| `spec-review` | ✅ | ✅ | ✅ | ✅ | git diff, or `gh` for pull requests |
|
|
562
716
|
| `spec-checkpoint` | ✅ | ✅ | ✅ | ✅ | Plain git plus your repo's own check commands |
|
|
563
717
|
| `spec-ship` | ✅ | ✅ | ✅ | ✅ | git plus the GitHub CLI (`gh`) |
|
|
564
718
|
| `generative-seo` | ✅ | ✅ | ✅ | ✅ | Web search and writing files |
|
|
@@ -572,20 +726,21 @@ skips that step rather than failing.
|
|
|
572
726
|
|
|
573
727
|
| Skill | Stage | SKILL.md lines | Words | Supporting files |
|
|
574
728
|
|---|---|---:|---:|---:|
|
|
575
|
-
| `spec-setup` | 0 · configure |
|
|
576
|
-
| `spec-investigate` | 1 · understand |
|
|
577
|
-
| `spec-create` | 2 · plan |
|
|
578
|
-
| `spec-implement` | 3 · build |
|
|
579
|
-
| `spec-verify` | 4 · prove |
|
|
580
|
-
| `spec-
|
|
581
|
-
| `spec-
|
|
729
|
+
| `spec-setup` | 0 · configure | 162 | 1,534 | 3 |
|
|
730
|
+
| `spec-investigate` | 1 · understand | 370 | 3,152 | 1 |
|
|
731
|
+
| `spec-create` | 2 · plan | 195 | 1,746 | 6 |
|
|
732
|
+
| `spec-implement` | 3 · build | 322 | 2,683 | 3 |
|
|
733
|
+
| `spec-verify` | 4 · prove | 163 | 1,557 | 1 |
|
|
734
|
+
| `spec-review` | 5 · review | 135 | 1,270 | 1 |
|
|
735
|
+
| `spec-checkpoint` | 6 · commit | 133 | 1,046 | 0 |
|
|
736
|
+
| `spec-ship` | 7 · PR | 230 | 1,388 | 0 |
|
|
582
737
|
| `generative-seo` | standalone | 255 | 2,209 | 7 |
|
|
583
|
-
| **Total** | | **1,
|
|
738
|
+
| **Total** | | **1,965** | **16,585** | **22** |
|
|
584
739
|
|
|
585
740
|
- **8** skills: **1** setup + **6** workflow stages + **1** standalone
|
|
586
741
|
- **4** tools supported natively (Claude Code, Codex CLI, Cursor, Antigravity), plus an MCP fallback
|
|
587
742
|
- **3** layouts: single repo, monorepo, multi-repo
|
|
588
|
-
- **1** npm package, `@benjaminthomas/spec-driven-dev`, plus the Claude Code plugin and an MCP fallback
|
|
743
|
+
- **1** npm package, `@benjaminthomas/spec-driven-dev`, plus the Claude Code plugin `ticket-to-pr` and an MCP fallback
|
|
589
744
|
- **0** stack assumptions: lint, typecheck, test, build, and dev commands come from your repo
|
|
590
745
|
|
|
591
746
|
_The table is generated by `python3 scripts/check.py --fix`; CI fails if it goes out of date._
|
|
@@ -595,29 +750,31 @@ _The table is generated by `python3 scripts/check.py --fix`; CI fails if it goes
|
|
|
595
750
|
## Working on this repo
|
|
596
751
|
|
|
597
752
|
```
|
|
598
|
-
skills/<name>/SKILL.md
|
|
599
|
-
skills/<name>/references/
|
|
600
|
-
.claude-plugin/ Claude Code
|
|
753
|
+
plugin/skills/<name>/SKILL.md the skill itself (frontmatter: name, description, license)
|
|
754
|
+
plugin/skills/<name>/references/ templates and prompts the skill loads when needed
|
|
755
|
+
.claude-plugin/ Claude Code marketplace manifest
|
|
756
|
+
plugin/ the Claude Code plugin (manifest + skills only, no scripts or hooks)
|
|
601
757
|
.agents/skills/ symlinks so Codex/Antigravity pick the skills up inside this repo
|
|
602
758
|
bin/spec-driven-dev.cjs launcher (runs on any Node, explains if it's too old)
|
|
603
|
-
bin/cli.mjs the `spec-driven-dev` CLI: installer, setup menus, doctor, status
|
|
604
|
-
|
|
759
|
+
bin/cli.mjs the `spec-driven-dev` CLI: installer, setup menus, doctor, status, context, risk
|
|
760
|
+
bin/risk.mjs GitRisk scoring (churn, bug density, fan-out, security)
|
|
761
|
+
bin/risk-eval.mjs risk on/off experiment harness
|
|
762
|
+
package.json npm package (ships bin/ and plugin/skills/)
|
|
605
763
|
mcp-server/ MCP fallback server
|
|
606
|
-
hooks/hooks.json Claude Code session-start hook (runs `cli.mjs status`)
|
|
607
764
|
CHANGELOG.md what changed in each version
|
|
608
765
|
scripts/check.py consistency checks + metrics generator
|
|
609
766
|
scripts/test-cli.mjs installer self-test (fake HOME, throwaway repos)
|
|
610
767
|
.github/workflows/check.yml CI: consistency checks + installer self-test on every push and PR
|
|
611
768
|
.github/workflows/publish.yml publishes to npm when a vX.Y.Z tag is pushed
|
|
612
|
-
evals/
|
|
769
|
+
plugin/evals/ `claude plugin eval` cases
|
|
613
770
|
```
|
|
614
771
|
|
|
615
|
-
- **Adding a skill:** create `skills/<name>/SKILL.md`, then add the name to the two manifests, a `.agents/skills/<name>` symlink, the `STAGES` map in
|
|
772
|
+
- **Adding a skill:** create `plugin/skills/<name>/SKILL.md`, then add the name to the two manifests, a `.agents/skills/<name>` symlink, the `STAGES` map in
|
|
616
773
|
`scripts/check.py`, and this README. `python3 scripts/check.py` lists anything you missed.
|
|
617
774
|
- **Before pushing:** run `python3 scripts/check.py --fix`, then `npm test` (which runs the checks
|
|
618
775
|
and the installer self-test). CI (`.github/workflows/check.yml`) runs
|
|
619
776
|
the same checks, the installer self-test, and a syntax check on the MCP server.
|
|
620
|
-
- **Evals:** `claude plugin eval
|
|
777
|
+
- **Evals:** `claude plugin eval plugin --runs 1` checks that skills trigger on their phrases and stay
|
|
621
778
|
within their own stage. These runs use your Claude credentials, so they aren't part of CI.
|
|
622
779
|
- **Skill rules** (from [Anthropic's skill authoring guide](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices),
|
|
623
780
|
enforced by `scripts/check.py`):
|
|
@@ -627,10 +784,10 @@ evals/ `claude plugin eval` cases
|
|
|
627
784
|
- `SKILL.md` stays under 500 lines, with detail in `references/` one link deep.
|
|
628
785
|
- Facts are read from the repo, not assumed.
|
|
629
786
|
- **Releasing:**
|
|
630
|
-
1. Increase `version` in both `package.json` and
|
|
787
|
+
1. Increase `version` in both `package.json` and `plugin/.claude-plugin/plugin.json` (the check fails if
|
|
631
788
|
they differ).
|
|
632
789
|
2. Add a `CHANGELOG.md` entry, then commit and push.
|
|
633
|
-
3. Tag the release and push the tag: `git tag v1.
|
|
790
|
+
3. Tag the release and push the tag: `git tag v1.11.0 && git push origin v1.11.0`.
|
|
634
791
|
4. Watch the **publish** run in the repo's Actions tab. When it's green, the new version is on
|
|
635
792
|
npm. Claude Code plugin users get it from the marketplace once the commit is on `main`.
|
|
636
793
|
|