Projectspeckit-xref
SubjectSpec-to-code traceability and an autopilot for GitHub Spec Kit in Claude Code
Revisionv0.12.0
LicenseMIT
SourceGitHub

Keep the code on the spec.

speckit-xref traces every requirement of a GitHub Spec Kit feature to the tasks, files and tests that implement it, and flags drift the moment it happens. Its autopilot works through Spec Kit's whole workflow by itself and stops only for decisions that are yours.

A Claude Code mod, a Spec Kit extension, a preset and a GitHub Action, sharing one record per feature.

  1. specs/001-magic-link-login/spec.md
    FR-002 System MUST send a single-use link that expires after 15 minutes.
  2. specs/001-magic-link-login/tasks.md
    T004 Issue and store the token in src/auth/token.ts (FR-002)
  3. src/auth/token.ts
    // @spec 001-magic-link-login/FR-002
    export function issueToken(email: string) { … }
  4. tests/auth/token.test.ts
    ✓ FR-002 issues a single-use token passing
src/ui/theme.ts
+ export const dark = true
▲ not planned for any task
  1. The requirement, in your words, with its id.
  2. The task that implements it, mapped once and kept on record.
  3. The code, anchored to the requirement; every edit is booked against the task in progress.
  4. The test that proves it, for the requirement's current text.
  5. An edit no task planned. Claude is told at once; you link it to a task, accept it, or take it back.

Why it exists

Spec Kit gives an agent a spec. Nothing keeps the agent on it while it works.

Requests never reach the spec

Halfway through you add “also allow passwords”. The code gets it; spec.md never does. Next week nobody knows which version is the contract.

Files appear that no task planned

An agent fixes something on the side, renames a module, adds a dependency. tasks.md names a user story per task, but not the requirement it serves, so nobody can tell.

Done means the boxes are checked

Checked tasks are not proof. Drift tools that run afterwards report it once the code has settled. speckit-xref works while the code is written and keeps the record for CI.

The whole workflow, one step at a time

The autopilot hands Claude the next Spec Kit step after every turn, so nobody has to answer “next is X, shall I go on?”. This is the strip the pane shows. Pick a phase to see what happens there and where it waits for you.

It stops for you, and only for you

Claude decides what you left open and records it as an assumption you can keep or change. What only you can decide comes to you, in the pane or a dialog.

Your decisions

  • Build the idea
  • Approve roadmap
  • Approve spec
  • Approve design
  • Call it done
  • Ship it

Each approval holds for the text you approved. Change the spec afterwards and it asks again. A question the spec leaves open, or a request that contradicts it, also comes to you; everything else does not.

Held until you say yes

  • git pushYour call. With allowPush on, a plain push of a feature branch after green tests goes through; never main, never forced.
  • rm -rf, reset --hardDestructive commands wait for you, and so does every write to a .env file.
  • wrangler deploy, eas submitDeploys, store builds, submissions and publishes, also through MCP tools. Only Ship it opens them, and only the commands you approved, as written.

Proof, not checkboxes

Every requirement climbs a ladder. The pane, the dashboard and the pull request show how far each one is proven.

  1. Specified

    It is in spec.md, with an id.

  2. Planned

    A task names it, or the map lists one.

  3. Implemented

    Its task is done and non-test code anchors, links or touches it.

  4. Tested

    A file with real tests anchors it. test.todo does not count.

  5. Passing

    Its tests passed for the text the requirement has now.

  6. Accepted

    A driver played its scenario through as a person would. Only a fresh report counts.

When a requirement's text changes, it drops back to planned until it is proven again. Tests prove requirements, not tasks: one per requirement or scenario, where its behaviour shows. Scripted acceptance, when you ask for it, runs in your installed Chrome with Playwright and with Maestro on a simulator or emulator; a flow that taps by screen coordinates proves nothing.

Use cases

Where speckit-xref earns its place, and which parts do the work.

Use caseWhat happensParts
A new app from a one-line ideaValidate researches the idea: who has the problem, what exists, the riskiest assumption. Shape settles the first version with you. Then the autopilot carries it through spec, design, build, verify and acceptance.mod
A product from the PRD you already wroteThe PRD is imported, reviewed for gaps and contradictions, and cut into a roadmap of features. Each spec carries the PRD's own ids, so the trace runs from PRD to spec to code.mod, extension
An existing codebase, kept honestBring the project under Spec Kit, map requirements to tasks once, and every later edit is checked against the plan as it happens.mod, preset
Every pull request, tracedThe Action writes requirement, tasks, files and tests into the job summary and fails the job on red drift or a failing acceptance scenario.action, extension
A release with a checklist and your yesShip checks store fields, permission texts, privacy and tracked secrets, builds locally, writes the exact release commands, and runs them only after Ship it.mod
A cheaper, faster buildEach phase runs in a subagent with a fresh context and the model it needs, so the session's context stays small and the expensive model does what needs it: the spec, the reviews, verify.mod
An overnight run/xref auto night works through the steps while you sleep. Reviews and real decisions still wait for you, and a briefing says what happened.mod
Any agent Spec Kit supportsThe extension's commands (validate, prd, design, accept, ship, check, verify and more) run wherever Spec Kit runs, and in CI.extension

Four parts, one record

Spec Kit's files stay untouched. Each feature gets one committed record, specs/NNN-feature/xref.json, and one local file for your prompts and the run.

Claude Code mod

Live in the agent loop: the trace, drift checks after every turn, the autopilot, a band above the prompt, a pane and a local dashboard.

Claude Code in the terminal, the desktop app and claude -p

Spec Kit extension

/speckit.xref.* commands and hooks after plan, tasks and implement, plus a deterministic check for CI.

Every agent Spec Kit supports

Spec Kit preset

Spec Kit's own tasks and implement commands, told to name each task's files and requirements and to prove each task with tests.

Spec Kit 1.1.2 or later

GitHub Action

The check on every pull request, with a job summary from requirement to tasks to files, and how far each is proven.

GitHub Actions

What you see while it works

Tagesinspiration gegen Freizeitstress
✓setup ✓const ✓spec ✓plan ✓tasks ✓impl ✓verify ✓ship
Now     every task is checked
Status  ██████████ 74/74 tasks · FR 25/25
Phase   ✓1 ✓2 ✓3 ✓4 ✓5 ✓6 ✓7 ✓8 ✓9 ✓10 ✓11 ✓12 ✓13 ✓14 ✓15
Accept  12/12 accepted · 5 your part
Ship    v1.0.0 → web, ios, android · 17 pass · 4 your part
Done    Every task is checked, converged and verified.
        What comes next?
        [ New feature ] [ Change ] [ Bug ] [ Ship ]
Drift   ● ok · intent 95/100
The pane on a finished feature of a real test app: 74 tasks, 25 requirements passing, 12 scenarios accepted, a release checked.
  • The band above the prompt shows the task in progress, coverage and drift, and the autopilot's question when it waits.
  • The pane shows where the feature stands, the review cards with their buttons, and every unplanned file with Link to task and Accept this.
  • The dashboard (/xref web) opens a local page with your words, the traceability matrix, the design mocks, acceptance evidence and the run log.
  • The transcript gets a chip under each edit: T004 · FR-002, or ▲ unplanned.

Install

Start with the mod. Add the extension and the preset in a Spec Kit project, and the Action for pull requests.

Claude Code mod

In a terminal, with Claude Code 2.1.295 or later; the marketplace is added on the way. Then, in a Spec Kit project, /xref pane opens the pane and /xref auto on starts the autopilot.

claude plugin install speckit-xref --marketplace moinsen-dev/speckit-xref

Spec Kit extension

In a Spec Kit project (Spec Kit 0.12.17 or later, Python 3).

specify extension add xref --from https://github.com/moinsen-dev/speckit-xref/releases/latest/download/speckit-xref-extension.zip

Spec Kit preset

Optional, recommended (Spec Kit 1.1.2 or later): tasks then name their files and requirements, so nothing has to be guessed.

specify preset add --from https://github.com/moinsen-dev/speckit-xref/releases/latest/download/speckit-xref-preset.zip

GitHub Action

In a workflow on pull_request.

- uses: actions/checkout@v4
  with: { fetch-depth: 0 }
- uses: moinsen-dev/speckit-xref/action@v0.12.0