sw-do
Skill170 starsChanged 12 months agoMITView on GitHub
Work a SpecWeave increment task by task - claim, implement inside its Files, test, commit, done with evidence - alone, unattended or in lanes, then close. Use for "implement", "next task".
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 0 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Run the task's Test. Red means fix the code.
- Very specific: line 29
Test-first order is optional: follow it only when the user, testing.mode: TDD or the project's conventions ask.
- Very specific: line 32
Commit with the increment id first: git commit -m "0042: fold the ledger".
- Very specific: line 50
Start only when the spec has nothing under ## Decisions > ### Open and every task has Files and a Test.
- Very specific: line 79
When task next has nothing left, run sw-done: verify, review, complete, in the same session.
- Very specific: line 95
Read the tasks from spec.md and the state from ledger.jsonl: the next task is the lowest T-id nobody holds whose Files no live claim holds.
- Very specific: line 122
Never widen a task's Files or weaken a test to keep a loop moving.
- Very specific: line 123
Never edit .specweave/state/auto-mode.json by hand.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
sw-do: work an increment to done
Tasks are defined in spec.md under ## Tasks; their state lives only in the
increment's ledger.jsonl, which the CLI appends to. Never write state into spec.md.
Start
specweave pickup applies any handoff pushed from another tool or account, then prints
the open increment, the next task with its acceptance criteria, claims other agents
hold, and notes left for you. No increment yet? Run sw-increment first.
The loop
specweave task nextprints the next claimable task with its AC text.specweave task claim T-03 --line "Writing the ledger fold". Exit 3: someone holds it (your own earlier claim from a crashed session: say so, then--force); 4: its Files overlap a live claim; 6: its dependencies are not done. Otherwise pick another. Never edit before claiming.- Implement inside that task's
Filesonly. Need another file? Claim the task that owns it, or add a task to spec.md## Tasks. Use the words inGLOSSARY.md, if the project has one, for every new name. - Run the task's
Test. Red means fix the code; never skip, weaken or delete a test. Test-first order is optional: follow it only when the user,testing.mode: TDDor the project's conventions ask. Don't add unit tests the task did not ask for; check the AC end to end, the way a user would hit it. - Commit with the increment id first:
git commit -m "0042: fold the ledger". specweave task done T-03 --run "npm run test:e2e -- double-claim" --line "Wrote the ledger fold" --link <PR URL>. Exit 5: the command failed and the task stays open. NoTest?--evidence "<sha> + what you checked".--lineis the card text (one line, past tense when done, at most 100 characters);--linkis the PR, report or artifact behind it.- Stuck:
specweave task block T-03 --reason "<what is missing>". Not needed:specweave task skip T-03 --reason "<why>". Then back to 1.
Commands take the increment id last (specweave task next 0042) when more than one
increment is active. specweave task list shows the whole board. For a status, print
specweave cards --md: one ✓ / ✱ / ○ text (link) line per task. Work with no
increment: specweave card add "<text>", then card start|done|wait C-01.
Unattended (auto mode)
"Auto", "run until done", "ship this while I sleep": the same loop without stopping to ask. The bar does not drop.
- Start only when the spec has nothing under
## Decisions>### Openand every task hasFilesand aTest; otherwise fix the spec first. specweave auto 0042records the session (--dry-runpreviews,--resetclears stale state). A tool that runs SpecWeave's Stop hook hands you the remaining work after every turn; in any other tool, keep looping yourself.- Blocked (missing secret, ambiguous spec, outside dependency):
task blockand move on. When only blocked tasks remain,specweave cancel-autoand tell the user what each one needs, instead of looping to the turn limit. specweave auto-statusshows progress; one auto session per project.
Parallel lanes
Three or more disjoint lanes, or 15+ tasks: you are the lead. Split, start, watch, merge and close; do not implement.
- Group tasks into 2 to 5 lanes whose
Filesdo not overlap. Shared contracts (types, schema) go in an early task the others list under**Dependencies**: T-01. - One worktree and branch per lane agent (your tool's or app's worktree feature, or
git worktree add .worktrees/0042-api -b inc/0042-api, never../), withSPECWEAVE_AGENT=apiset. Brief each one: its tasks, this loop, "edit only their Files", and on finishspecweave task release --all-mineplusspecweave note "api: done" 0042. - Watch with
specweave task list 0042;blockedrows are your queue. A claim older than 2 hours with no progress may be taken with--force. - Merge the lane branches in dependency order (keep every
ledger.jsonlline from both sides), then close as below. Lane agents never runspecweave handoff.specweave teamopens agent panes for the same setup in tools that have them.
Finish without asking
When task next has nothing left, run sw-done: verify, review, complete, in the same
session. "All tasks are done, should I close?" is the anti-pattern.
Plan for it from the start: a progress checklist or status you keep for the user ends
with "Verify and close 0042", not with "merge" or "release". Work that shipped through
a PR still gets specweave task done T-03 --evidence "<commit sha>" first, or the ledger
never shows it finished. A session never ends with every task done and the increment
still open; if a close gate stops you (verify fails, a manual check only the user can
do), say which one in your report. A lane agent leaves the close to its lead.
Stopping early
Out of tokens, switching tool or account: specweave handoff --reason "<why>" (sw-handoff).
Manual path (no CLI)
Read the tasks from spec.md and the state from ledger.jsonl: the next task is the lowest
T-id nobody holds whose Files no live claim holds. Append one JSON object per line, keys
in this order, UTF-8, LF:
L=.specweave/increments/0042-ledger-fold/ledger.jsonl
printf '%s\n' '{"t":"T-01","e":"claim","by":"codex@mbp","at":"2026-09-02T10:00:00Z"}' >> "$L"$L = '.specweave\increments\0042-ledger-fold\ledger.jsonl'
$line = '{"t":"T-01","e":"done","by":"codex@win","at":"2026-09-02T11:30:00Z","evidence":"npm run test:e2e -- double-claim exit 0 / a1b2c3d"}'
[IO.File]::AppendAllText($L, $line + "`n", [Text.UTF8Encoding]::new($false))PowerShell never uses >> here: it writes UTF-16 and every other tool fails to read it.
Events: claim, done (needs evidence), release, block and skip (both need
note); any of them may carry "line" (card text) and "link", for example
{"t":"T-02","e":"skip","by":"codex@mbp","at":"2026-09-02T12:00:00Z","note":"covered by T-01"}.
by is SPECWEAVE_AGENT if set, else <tool>@<host>. Unattended or in lanes, follow
the same steps by hand: there is no hook and no session file.
Rules
- A claim older than 2 hours with no
doneis stale and may be taken over. - Append only: never edit, reorder or delete a ledger line. On a merge conflict in
ledger.jsonlkeep every line from both sides. - Never widen a task's
Filesor weaken a test to keep a loop moving. - Never edit
.specweave/state/auto-mode.jsonby hand;specweave auto --resetclears it.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sw-autoSkill
- sw-doneSkill
- sw-glossarySkill
- sw-grill-meSkill
- sw-handoffSkill
- sw-incrementSkill
- sw-jevSkill
- sw-projectSkill
- sw-reviewSkill
- sw-syncSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

