examples / single-repo feature

A single-repo feature, end to end

The everyday loop — bootstrap once, then take a feature from idea to reviewed diff. This is the walkthrough to do first: it shows you where every gate is.

0 Bootstrap the project (once)

cd ~/code/notes-api
sdd

sdd setup first asks the default model for this project, then runs evidence-based passes and stops at a review gate (↵ to write, q to abort):

  • Operational — detects your stack and the test / build / lint / typecheck commands, and actually runs the safe ones to record a real green/red baseline.
  • Purpose — drafts PRODUCT.md from the code, then asks you the 3–5 sharpest questions to correct it. A greenfield repo is interviewed instead — what the product is, the problem, its users, the first feature, non-goals, and the stack — and PRODUCT.md is written from your answers.
  • Process — infers how you ship (branching, merge style, feature flags) or proposes editable defaults.
  • Domain experts — advisors convened at the spec + review gates. sdd suggests 3 from your PRODUCT.md (a "transit operations planner", a "clinical safety" lens…); keep them, or describe any expert in your own words and it fleshes one out. Each becomes an editable experts/<name>.md.

It writes CLAUDE.md (an sdd-framework block), PRODUCT.md, .sdd/config.json, and one experts/<name>.md per expert — all committed, all safe to hand-edit. A greenfield project is git init-ed so builds can branch + track changes. Re-running never clobbers your edits.

From now on, a bare sdd drops you into a live navigator instead of re-running setup — arrow through your features and run each one's next stage inline:

The sdd navigator: a keyboard-driven list of features with their pipeline stage and recommended next step, and a stage running inline with a live spinner
Bare sdd once you're set up — pick a feature, press ↵, the stage runs right there.

1 Spec — describe what, get interrogated

sdd spec "let users tag notes and filter by tag"

The agent drafts the spec, then the expert panel (product, UX, security + any domain experts in your roster) and the draft's own questions are put to you one at a time — each with a few suggested answers you can pick with a digit or type over. Answered questions stay on screen as a transcript:

model: sonnet · root: ~/code/notes-api

✓ 1. Only your own notes, or shared?
     → only your own

Question 2/5
[security] How long should a tag be?
  1 1–32 chars   2 1–64 chars   3 no limit
› pick a number, type your own_
↵ answer · a digit picks · esc goes back a question

The spec streams in live as the model writes it (no dead spinner). Nothing is written blind: at the gate sdd previews the actual spec (scrollable) with a clickable path, and you can refine it in plain English — press e and say "add rate-limiting to the acceptance criteria" — before it's written. Then ↵ writes specs/tag-notes/spec.md: summary, behaviour & acceptance criteria, edge cases, non-goals, open questions.

The spec interrogation: a model preamble, a transcript of answered questions, the current question with numbered suggestions and an input line, and a preview of the spec at the write gate

Starting from an empty repo? The very first question is which platform/stack to build on, and plan task 1 scaffolds the project — so build always has real files to change.

2 Plan — decompose into tasks

sdd plan tag-notes

Reads the spec and drafts plan.md as an ordered task list — each task a ### N. heading with what / which files / how to verify, and every task changes code (no "confirm" or "research" filler). The plan is the decomposition; there's no separate "break it down" step. Same guided flow, live streaming, and e to refine — but the plan's questions are strictly about implementation, sequencing, and technology; it never re-asks what the spec already settled. Re-planning a feature that already has a plan confirms before overwriting.

3 Build — implement + verify, safely

sdd build tag-notes        # task 1; --task N for one, --all for the rest
model: sonnet · root: ~/code/notes-api
sdd build — tag-notes · task 1 of 4
✓ spec ─ ✓ plan ─ ▸ build ─ · review ─ · ship
→ on branch sdd/tag-notes (moved off the trunk before editing)
⠹ building — implementing… · 8s
  ↳ editing routes/tags.ts
✓ 1. Tag model + filter — verified (1 attempt)

plan · 1/4 task(s) built this run
  ✓ 1. Tag model + filter
  ○ 2. Tag input UI            — outstanding
  ○ 3. Filter endpoint         — outstanding
  ○ 4. Empty-state + a11y      — outstanding
changed files (click to open):
  routes/tags.ts | 14 ++++++++++
Next: sdd build tag-notes --task 2

The build streams live (editing routes/tags.ts) so you see it working, and the result shows the whole plan as a done/outstanding checklist with the changed files as clickable links — no more guessing what's left. Progress is tracked, so running sdd build again advances to the first unbuilt task rather than redoing task 1; --all (or a at the gate) does the rest. A live panel adds per-task tokens, cost, and your Claude usage; the build runs in the background (step away and a chip tracks it), and --agents N builds independent tasks in parallel (how that stays correct →). Three safety properties are working for you:

  • On a trunk branch it moves to sdd/tag-notes first — your main stays clean (--no-branch opts out).
  • The agent edits files but cannot run shell commands — the CLI runs your test suite itself and feeds failures back into the bounded fix loop.
  • Build never commits, and a task that changes nothing is a loud ⚠ warning, never a false ✓. You own the diff.

4 Review — a second pair of eyes

sdd review tag-notes
sdd review — tag-notes
3 finding(s) from 6 lenses (1 refuted on verification).
[HIGH] Tag filter is not scoped to the current user (tag.ts:22)
[MED]  Empty-tag input creates a blank tag (tag.ts:8)

Every lens reviews the diff independently against the spec; findings are merged, deduped, and adversarially verified — a skeptic pass drops what it can refute, so what reaches you is worth your time. Findings land in specs/tag-notes/review.md; add --comment (and optionally --pr N) to post them on a PR instead.

sdd review output showing verified findings from the multi-lens panel

5 Ship

Review the diff, commit, open your PR, merge. sdd gates the decisions — the merge is always your gesture. sdd status shows every feature's position at any time:

sdd status output showing pipeline positions of features

The one-shot version

sdd feature "let users tag notes and filter by tag"

Chains spec → plan → build (all tasks) → review, branching first, and prints each stage's result. Use the step-by-step loop above while you're calibrating trust; switch to sdd feature once you have.

sdd feature running the whole pipeline in one command
← All examples Next: the board runner →