Work an increment task by task through the ledger. State lives in
.specweave/increments/<id>/ledger.jsonl (append-only); tasks.md holds the
definitions. Never hand-edit status lines — specweave task done renders them.
Usage
sw:do [<increment-id>] # id optional when exactly one increment is active
Loop (repeat until task next returns nothing)
Pick: specweave task next <id> — prints the first open task whose deps are done and whose Files are not held by another agent. If several increments are active, pass the id.
Claim: specweave task claim T-NN <id>. Exit 3 = someone else owns it (pick another), 4 = its Files overlap a live claim, 6 = deps not done. Never edit before claiming.
Read: the task's AC: ids in spec.md and its Files:; open plan.md (or spec.md Approach) only for that scope.
Implement inside the task's Files only. Need another file → claim the task that owns it, or add a task (### T-NN Title + - AC: … | Files: … | Test: …).
Commit with the increment id in the subject: git commit -m "<id>: <what>".
Done with evidence: specweave task done T-NN <id> --run "<Test command>" (uses the task's Test: when --run is omitted). Exit 5 = the command failed → task stays open; fix and re-run. No Test: → --evidence "<sha + what you ran>". Never claim completion without a fresh, passing run.
Stuck?specweave task block T-NN <id> --reason "<what is missing>"; not needed? specweave task skip T-NN <id> --reason "<why>" (terminal).
Go to 1.
Rules
One agent per worktree when 2+ agents share the increment; branch name contains the increment id.
Append only: never edit or delete ledger lines, never touch another task's state line.
If a claim older than 2h (config tasks.leaseHours) has no done, it is stale — task next offers it again; task claim --force takes it over.
Stopping for any reason: specweave task release --all-mine then sw:handoff.
No CLI? Append the line yourself: echo '{"t":"T-01","e":"claim","by":"<agent>","at":"<ISO>"}' >> ledger.jsonl (PowerShell: [IO.File]::AppendAllText). by = SPECWEAVE_AGENT or <tool>@<host>.
Increment selection (no id given)
Exactly one metadata.json with status: active → use it.
Several → specweave task list errors listing candidates; ask which, or take the one named in the auto-mode context / stop-hook feedback.
None active but exactly one planned → the CLI uses it, and task claim starts it (planned → active). specweave start <id> does it explicitly.
None at all → sw:increment first.
Finish (mandatory, never stop to ask)
When task next says nothing is claimable and every task is done or skipped:
1---2name: do3description: Do Increment4---56# Do Increment78Work an increment task by task through the ledger. State lives in9`.specweave/increments/<id>/ledger.jsonl` (append-only); `tasks.md` holds the10definitions. Never hand-edit status lines — `specweave task done` renders them.1112## Usage1314```15sw:do [<increment-id>] # id optional when exactly one increment is active16```1718## Loop (repeat until `task next` returns nothing)19201. **Pick**: `specweave task next <id>` — prints the first open task whose deps are done and whose `Files` are not held by another agent. If several increments are active, pass the id.212. **Claim**: `specweave task claim T-NN <id>`. Exit 3 = someone else owns it (pick another), 4 = its Files overlap a live claim, 6 = deps not done. Never edit before claiming.223. **Read**: the task's `AC:` ids in spec.md and its `Files:`; open plan.md (or spec.md Approach) only for that scope.234. **Implement** inside the task's `Files` only. Need another file → claim the task that owns it, or add a task (`### T-NN Title` + `- AC: … | Files: … | Test: …`).245. **Commit** with the increment id in the subject: `git commit -m "<id>: <what>"`.256. **Done with evidence**: `specweave task done T-NN <id> --run "<Test command>"` (uses the task's `Test:` when `--run` is omitted). Exit 5 = the command failed → task stays open; fix and re-run. No `Test:` → `--evidence "<sha + what you ran>"`. Never claim completion without a fresh, passing run.267. **Stuck?** `specweave task block T-NN <id> --reason "<what is missing>"`; not needed? `specweave task skip T-NN <id> --reason "<why>"` (terminal).278. Go to 1.2829## Rules3031- One agent per worktree when 2+ agents share the increment; branch name contains the increment id.32- Append only: never edit or delete ledger lines, never touch another task's state line.33- If a claim older than 2h (config `tasks.leaseHours`) has no `done`, it is stale — `task next` offers it again; `task claim --force` takes it over.34- Stopping for any reason: `specweave task release --all-mine` then `sw:handoff`.35- No CLI? Append the line yourself: `echo '{"t":"T-01","e":"claim","by":"<agent>","at":"<ISO>"}' >> ledger.jsonl` (PowerShell: `[IO.File]::AppendAllText`). `by` = `SPECWEAVE_AGENT` or `<tool>@<host>`.3637## Increment selection (no id given)3839- Exactly one `metadata.json` with `status: active` → use it.40- Several → `specweave task list` errors listing candidates; ask which, or take the one named in the auto-mode context / stop-hook feedback.41- None active but exactly one `planned` → the CLI uses it, and `task claim` starts it (`planned → active`). `specweave start <id>` does it explicitly.42- None at all → `sw:increment` first.4344## Finish (mandatory, never stop to ask)4546When `task next` says nothing is claimable and every task is done or skipped:47481. `specweave verify <id>` → `reports/verify.json` (project test/lint/build + AC table + ledger).492. Invoke `Skill({ skill: "sw:done" })` with the id. It runs the optional review and `specweave complete`.5051Anti-pattern: "All tasks are complete. Should I close?" — close it.5253## Resources5455- [Official Documentation](https://verified-skill.com/docs/reference/skills#do)
Run npx skillmds@latest add anton-abyzov/do in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Do Increment It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
anton-abyzov (@anton-abyzov) published this skill. Their other Agent Skills are listed on their SkillMD profile.