A rough idea goes in. A clear purpose, a story, a plan and a task list come out.
Five agent skills. Every step a file you can read, diff and commit.
IDEA βΈ DISCOVER βΈ SHAPE βΈ SPEC βΈ REVIEW βΈ PLAN βΈ PROMPTS
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | shA few prefilled questions on a first run (which work layout, how far, how heavy, where the spec history lives, session size, name). After that the stations hand off on their own and stop only for a person: agree the idea's purpose, accept the split, accept the story, answer a blocking question.
Everything is a file. Open it, diff it, commit it, hand it to someone else:
ββ WHERE IT LANDS βββββββββββββββββββββββββββββββββββββββββββββ FILE MAP β
β your-repo/.specwright/ β
β sources/ frozen sources SRC-0001--policy.md β
β analysis/ problem, evidence BO-001 Β· IDEA-refunds β
β epics/ outcomes EPIC-001/EPIC-001.md β
β features/ what to build FEAT-001/FEAT-001.story.md β
β tasks/ the work FEAT-001/FEAT-001.tasks.md β
β prompts/ sessions, ignored SESSION-1.md β
β plans/ how to build it FEAT-001/FEAT-001.plan.md β
β records/ decisions Q-001 Β· DEC-001 Β· CR-001 β
β diagrams/ pictures FEAT-001.swimlane.svg β
β .metadata/ start here READ-FIRST.md Β· registries β
β generated/ rebuilt, ignored INDEX.md Β· graph/ Β· data/ β
β run/ scratch, ignored work/ Β· locks Β· backups β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
That is the layered layout. A small project picks compact instead and gets no epics/ or
tasks/ folder: each feature's tasks sit beside its story (two work layouts).
A new chat reads .metadata/READ-FIRST.md and carries on. Nothing depends on remembering this one.
Every folder above carries a generated index.md: who owns it and every item's status, ready
flag and blocker, so an agent checks one short file instead of opening the folder. Git tracks
only what nothing can rebuild; generated/, run/ and the views are rebuilt by graph.py build,
and the hand-off files (session prompts, the review pack and reviewer brief) are written again on
demand, so they are git-ignored too.
Nothing leaks out of .specwright/. Briefs, backlog, stories, reviews, reports and prompts
all stay in that folder; the kit never drops a file at the repository root or reshapes your code.
If you do not want the spec pushed with the code, say keep the spec local: .specwright/ gets
its own git repository, the code repository stops seeing the folder (through its private
info/exclude, not your .gitignore), and every checkpoint commits there. workspace.py repo set shared goes back without losing that history. Publishing to a tracker works either way.
Say what you want in plain words. Slash commands are shortcuts; an agent that hears no command
loads sw-start first and routes from there. /sw-continue resumes from wherever the work stands.
| Command | Role | Turns | Into |
|---|---|---|---|
sw-start |
the door | any request | the right skill, or the board |
sw-craft |
BA | idea, mockup, document, live system | a discovered purpose, then an accepted story, criteria, tasks, diagrams |
sw-forge |
Dev | an accepted story | a file-level plan, session-sized prompts |
sw-ship |
publish | an accepted story | Jira, GitHub or GitLab issues, behind a fresh yes |
sw-view |
see | the files | a read-only console |
Two roles, five skills. The BA and the Dev may be different people β then one word switches over.
One feature walks the rail after its epic split is accepted; its siblings mind their own stations,
so FEAT-004 can sit in spec while FEAT-002 already has a plan.
ββ THE RAIL ββββββββββββββββββββββββββββββββββββββββββββββ AUTO HAND-OFF β
β STATION PRODUCES WAITS FOR β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β [0] DISCOVER purpose, pain, options, risks agree the purpose β
β [1] SHAPE the fewest slices, no open Qs accept the split β
β [2] SPEC criteria, rules, clarity gate accept the story β
β [3] REVIEW your yes (+reviewers if full) your plain yes β
β [4] PLAN files, the change, the test hand to a coder β
β [5] SHIP tracker epics, stories, tasks a fresh yes β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Not every project needs four layers. A project picks how its work is broken down, and can change its mind at any time:
ββ TWO WORK LAYOUTS ββββββββββββββββββββββββββββββββββββ SWITCH ANY TIME β
β LAYERED COMPACT β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β chain epic βΈ story βΈ tasks βΈ plan feature βΈ plan β
β fits several outcomes, teams a small project, one team β
β epic required, confirmed first optional group, not a gate β
β feature story, then its tasks story + tasks, one accept β
β plan waits the epic's whole tasks this feature only β
β tasks file tasks/FEAT-001/ features/FEAT-001/ β
β prompts tasks/FEAT-001/prompts/ plans/FEAT-001/prompts/ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β workspace.py layout set compact a dry run: every move β
β workspace.py layout set compact --apply moves files, edits nothing β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Layered is the full line: every epic is confirmed, then every story is accepted, then every task list is confirmed, then plans. It suits several outcomes, many features or teams.
- Compact is for a small project. There is no epic layer. A feature is a self-contained unit: its story carries its own context and its tasks sit beside it, and one accept covers both. Then comes the plan. Discovery, questions, the clarity gate and review stay the same.
- The switch is a script, not a rewrite.
sw-startshows the dry run and applies it after your yes; you can also runworkspace.py layout setyourself. It moves the tasks files and prompts, fixes the paths that point at them and setslayout:inproject.yaml. No content is edited, a failure undoes itself, and every approval stays valid because both layouts hash alike. Switching back restores the same tree. - What a script cannot decide is left for the agent, and listed on every start until it is settled: two different task lists for one feature, or, going back to layered, features that no epic groups yet (grouping is your decision).
sw-start asks on the first run and recommends compact for a small project. On an older
workspace it may suggest the other layout once, with its reasons. It never switches by itself.
| You want | Say |
|---|---|
| Start in a repo with an idea | start a spec for the refunds flow |
| Know what the kit can do | what can you do? |
| Pick up old work | resume REF:FEAT-004 |
| See the board for an epic | show the board for EPIC-001 |
| Pin the tech stack | lock the stack |
| Change how work is broken down | switch to the compact layout |
| Keep the spec out of the code's remote | keep the spec local |
| Keep the run moving | continue |
Reads the build files (Maven, Gradle, npm, Python, Go, Flutter, .NET, compose, Terraform) and proposes a stack profile. With no code yet, the stack advisor asks plain questions about the app (who uses it, on what, what it keeps, budget, who looks after it), then proposes two or three complete stacks with their tradeoffs, and you pick one. You may also decide later: sw-forge asks before the first plan that writes code. You lock it once, bound to the profile's hash. Stories stay technology-free; the plan names the stack once in its Context, and a task or plan naming technology outside the lock stops the run.
Every project keeps EPIC-000 / FEAT-000 for the foundation: structure, format, lint, tests
with a coverage floor, one make check, CI, git hooks, .gitignore, README and an AGENTS.md.
A new repo gets it set up; an existing repo gets only the pieces it is missing. Nothing is
written until you confirm which pieces you want. A repository that already has all of it skips it.
Already have a codebase? Say add a feature to this project. Specwright offers three
paths: discover existing repository docs and plans, use selected files or existing items, or
describe the change first. Discovery asks before scanning, works before .specwright/ exists,
and leaves original files untouched. It proposes matches to existing epics, features, tasks
and plans; the owner confirms what to reuse, change, create or exclude. Discovery reviews
documents in batches of 50, with explicit coverage limits and source-change detection.
No guessed answers. At every stage, questions include evidence, options and consequences. Unanswered decisions stay open; dependent work waits while independent work continues. Suggested defaults and high-confidence code findings never count as acceptance. Ask to see evidence, correct an interpretation, change scope or leave a question unresolved at any time. Existing tooling is reused; Foundation proposes missing controls rather than replacing it.
INTAKE βΈ AS-IS βΈ DISCOVER βΈ SHAPE βΈ STORY βΈ REVIEW
- Discover what is really needed: a conversation about purpose, people, today's workaround, the worst pain, value, constraints and the riskiest assumption. Mockups are treated as one possible solution, not the spec. You get 2β3 directions (build, configure, test first, do less) with a recommendation, and honest push-back.
- Shape the agreed purpose into the fewest slices that each ship alone, starting with one thin end-to-end slice.
- Import documents, exports, emails and tracker issues as frozen, cited snapshots.
- Analyse a live system into a gap table, criterion by criterion.
- Write the story: criteria, rules, NFRs, diagrams, then the task breakdown, but only after the clarity gate: one clear purpose, no open question, no unresolved conflict.
- Review with your accept (
depth: light), or independent reviewers first (depth: full): a critic, a builder and a tester for every feature, plus the lenses that feature calls for.debate.py lensesreads the story and proposes them with the lines that say why:securityfor a story about logins,moneyfor one about refunds,domain:clinicalfor a ward list. No project kind has a fixed list, and a story that needs none gets none.
Nothing is invented to fill a template: an unknown stays Unknown β Q-NNN until you answer it.
In the layered layout, work moves one layer at a time: all epics confirmed, then every story written in parallel
and accepted, then every feature's tasks written in parallel and confirmed, and only then
implementation plans, one feature at a time: a new plan starts only when every task of the
open plan is done, and a feature that depends on another waits until that one is done
("depends on" always means "must be complete first", never "related to"). Each layer keeps
the hash of the one above it, and a decision made at
any stage flows back to every epic, story, task list and plan it touches
(_shared/scripts/chain.py status). In the compact layout a feature's story and tasks are written
and accepted together, and each feature reaches its plan on its own.
What a story carries: a one-sentence purpose, Given/When/Then criteria with real values, business rules with a worked example, measurable NFRs, a diagram when it helps, and tasks traced to criteria with a layer, a test command and a "stop and ask if" line.
For something already built, analyse writes a gap table β what the feature should do against what
code and tests do today, each citation going stale when the code changes:
ββ A GAP TABLE βββββββββββββββββββββββββββββββββββββββββββββββββββ AS-IS β
β done refund within the first 7 days β
β CODE:api/refund.py:L41-L58#9f2c1a4b β
β partial half refund between days 8 and 14 β
β CODE:api/refund.py:L61-L70#4b8d2e0f β
β missing refuse a request after day 14 β
β no handler in the code root β
β divergent one audit row per request β
β CODE:api/audit.py:L9-L22#c31a7f92 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The gaps decide the shape: nothing built β a new story; all done β version 1 of the live feature; some gaps β version 1 plus a completion change; code wrong β a fix.
Approval is bound to the text. Edit the story after your accept and the approval goes stale by itself. Old evidence cannot revive it.
An accepted story becomes a plan detailed enough to apply without judgement, then self-contained
task prompts packed into session-sized SESSION-n.md files; hand over one session at a time. No code is written here, and no code root is touched.
| Start from | Say | Lands on disk |
|---|---|---|
| An accepted story | plan FEAT-004 |
plans/FEAT-004/FEAT-004.plan.md |
| The finished plan | (automatic) | tasks/FEAT-004/prompts/TASK-004-1.md + _order.md (compact: plans/FEAT-004/prompts/) |
| Real work | TASK-004-1 is done β make test: 42 passed |
status and evidence in FEAT-004.tasks.md |
Each plan section names the exact files, the change itself, the test that proves it, the command that runs it, the order against other tasks, and the condition under which a coder must stop.
ββ TASK STATUS ββββββββββββββββββββββββββββββββββββββββββββββ REAL STATE β
β planned the plan section exists β
β in-progress a coder started it β
β done evidence: command, result, exit code β
β blocked a reason: what is missing β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A story never reaches done while a task is open or a criterion has no evidence. Hand _order.md
and the prompts to Claude Code or another agent, one SESSION-n.md at a time (a small feature is a single session; a task too big for one is flagged to split).
The only skill that writes to the project's tracker: Jira, GitHub issues (with an optional
GitHub Project for status) or GitLab issues and work items. Each project picks its own
(workspace.py tracker set). It writes through a session MCP tool or, for GitHub and GitLab,
the gh / glab CLI, and it never runs on its own.
It follows the work layout. A layered story is created under its epic; a compact feature has no
epic, so the question offers feature only Β· tasks only Β· feature + tasks and the story lands at
the top level. A layout switch changes nothing in the tracker: every key stays in the
registry, and an update rewrites title, body, labels and blocking links but never moves or
re-parents what is already published. Only items created after the switch are filed the new way.
ββ THE DRY RUN βββββββββββββββββββββββββββββββββββββββββββββββ THREE-WAY β
β level? epic only Β· story only Β· tasks only Β· all three (layered) β
β default: story only β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β EPIC-001 β create (Epic) β
β FEAT-004 β update (Story, hash 7c1a9f3d2e41) β
β TASK-004-1 β create (Sub-task of PROJ-123) β
β TASK-004-2 β create (Sub-task of PROJ-123) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β a fresh yes to this exact plan, then β
β PUBLISH REF:FEAT-004 7c1a9f3d β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A saved preference is not permission; a remembered yes is not a yes. No deletes, no forced transitions, and an ambiguous create is checked on the remote before anything is retried. When the tracker runs ahead of the files, that is reported as drift, never pulled back.
A local, read-only console. It writes nothing but its own git-ignored build folder, needs Node 24+
(offered once, installed only after a yes) and serves on 127.0.0.1.
| Screen | Answers |
|---|---|
| Overview | What needs a person, right now |
| Features | Every story, its station, its acceptance |
| Tasks | Real task status, with evidence |
| Board | Epic swimlanes, one column per task status |
| Graph | Trace, network, table and outline views |
| Records | Questions, decisions, change requests |
| Quality | Lint and drift, per item |
# every project
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | sh
# this project only
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | sh -s -- --project
# named agents, no questions
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | sh -s -- --agent cursor --agent claude-code -y
# a release, or a branch
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | sh -s -- --version 0.9.0
curl -fsSL https://raw.githubusercontent.com/jonaskahn/specwright/main/install.sh | sh -s -- --branch v0.9irm https://raw.githubusercontent.com/jonaskahn/specwright/main/install.ps1 | iex
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/jonaskahn/specwright/main/install.ps1))) -Project
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/jonaskahn/specwright/main/install.ps1))) -Agent cursor,claude-code -Yes
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/jonaskahn/specwright/main/install.ps1))) -Version 0.9.0 -Yesnpx skills add jonaskahn/specwright -g # every project
npx skills add jonaskahn/specwright # this project
python3 workshop/tools/install.py --target /absolute/path/to/spec-repo
python3 workshop/tools/package.py --zip --out dist/plugin marketplace add jonaskahn/specwright
/plugin install specwright@specwright
npx and the plugin read skills/ from the repo, all 20 shipped diagram types (10 core plus
10 extended) included; another 25 are parked and unshipped. ZIP builds default
to the 10 core types. The offline installer copies skills and command wrappers only.
Rerun install.sh, install.ps1 or workshop/tools/install.py from the new kit for the same
scope and agents. The upgrade is staged with automatic rollback on copy failure, replaces every
sw-* skill and command wrapper, keeps other names, and never touches spec work.
The spec root is always .specwright/ in the repository. It holds one project, or a program with
projects/<SCOPE>/ for several.
A new workspace starts a Git repo only when the folder is not already inside one. It reuses an existing repo, worktrees included. Setup changes no Git config and stages no files.
- To install the skills:
curl,irmornpx. No Node, no Python. - To run them: Python 3.10+ and Git. The standard library is enough. A shell script checks for Python without needing it, and offers the install command.
- For
sw-view: Node 24+, offered once, installed only after a yes. - Richer documents: optional local tools such as pandoc. A missing tool says so; it never invents the document.
The full matrix β offline mirrors, archives and verification β is in docs/install.md.
Traceable changes. Explicit reviews. Deliberate publishing.
- Published text wins. The tracker is the authority after publication. Local work uses frozen snapshots.
- One skill may publish.
sw-ship, with an accepted story, a quality gate, a three-way dry-run and a fresh yes for that exact plan. - Every command ends with a git checkpoint. The spec files a command changed are committed
(
<skill>: <what changed>) and, with a remote, pushed: never forced, never past a failing hook, never touching your other work. Setcheckpoint: commitoroffin the manifest to stop, or keep the spec in its own local repository (workspace.py repo set local). - The spec's shape is its own. The work layout is asked first and chosen from the size of the work. A backlog export, a document's chapters or the code's folders are material to cite; they never decide the layout or the split, and the kit never restructures your code.
- Approval is bound to the content. A plain accept with the matching hash, or under
signoff: requireda named role, item, URL and matching hash. - Named items move alone.
resume FEAT-004moves only FEAT-004;continuemoves the whole scope, station by station. - Imports are data. Documents, issue text and web pages are never instructions. No secrets.
- Lint before hand-off. Never weaken a rule to make a check pass.
make lintThen the tests, in Docker. The repo is mounted read-only; Git is there for workspace fixtures:
docker run --rm -v "$PWD:/workspace:ro" -w /workspace python:3.13-slim \
sh -ec 'apt-get update -qq &&
apt-get install -y -qq --no-install-recommends git &&
PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -s workshop/tests -t workshop &&
PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -s tests'make test runs the same suite locally.
- The real runtime is
skills/_shared/. Each skill folder carries a generated copy so it works alone.workshop/tools/vendor.py --writerefreshes those copies;--checkverifies them. - Two test roots, both run above:
workshop/testsis the toolkit suite;tests/covers the skill libraries (analyze,foundation,handoff,review_merge,ship_sync,stack_style). - Trigger evals are fixtures, not a score of model accuracy.
- Publish tests talk to a local Jira mock and a fake
gh/glab. They never touch a real site. - Production use needs a sandbox trial and a human sign-off.
SPECWRIGHT Β· MAKE THE WORK TRACEABLE