sw-plan
Skill4 starsChanged 57 days agoMITView on GitHub
Use when the user wants to plan a task or a piece of work in a Superwiki project before building it, asks what to work on next, or invokes sw-plan or sw:plan, with or without a task id.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sw-boardSkill
- sw-configSkill
- sw-doctorSkill
- sw-doSkill
- sw-explainSkill
- sw-implementSkill
- sw-ingestSkill
- sw-initSkill
- sw-lintSkill
- sw-migrateSkill
- sw-runSkill
- sw-statsSkill
- sw-summarizeSkill
- sw-triageSkill
- sw-visualizeSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
No id, existing work: node docs/.sw/sw.mjs ready, and let the user choose.
- Very specific: line 18
write docs/tasks/<ID>.md from docs/.sw/templates/task.md with status: todo, a "Goal" and a "Done when" list.
- Very specific: line 20
run node docs/.sw/sw.mjs board, so the task list in index.md shows it.
- Very specific: line 51
Stop: Do not start implementing.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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-plan
Produces docs/plans/<ID>-plan.md for one task. You clarify with the user and get approval; a planner subagent, running the model set in sw-config, reads the code and writes the plan file. You never read the code and never hold the plan text: that is what keeps planning cheap.
Needs the task module (docs/tasks/). If it is missing, say so and offer sw-init with --tasks. Run commands from the project root. <skill-dir> is the directory this SKILL.md is in.
Steps
- Pick the task.
- Id given:
node docs/.sw/sw.mjs check <ID>, then readdocs/tasks/<ID>.md. Statusdoneorcancelled: stop and ask what the user wants. A plan already exists: this run revises it; say so. Open deps do not prevent planning. - No id, existing work:
node docs/.sw/sw.mjs ready, and let the user choose. - New work: agree on title, area and dependencies with the user, and get the id from
node docs/.sw/sw.mjs next-id <AREA>. Then:- write
docs/tasks/<ID>.mdfromdocs/.sw/templates/task.mdwithstatus: todo, a "Goal" and a "Done when" list; - append
## [date] task | <ID> createdtodocs/log.md; - run
node docs/.sw/sw.mjs board, so the task list inindex.mdshows it.
- write
- Id given:
- Does it need a plan? Judge from the task file alone. A task is small when all of these hold: one area, three "Done when" items or fewer, nothing left open in its notes, and the change it describes is confined to a few files. A small task needs no plan: say so and offer
sw-implement <ID>directly. Go on with planning only if the user wants a plan anyway, or the task is not small. Called from sw-do: the route is already chosen; skip this step. - Clarify. Ask the user only what the task file leaves open about scope or intent, one question at a time, each with your recommendation. Add the answers to the task's "Notes" now. Do not read code to find questions; the planner surfaces the technical ones. Skip this when nothing is open.
Dispatch the planner. Its prompt is: the task id, today's date, the project root if it is not your working directory, and, from the second round on, what the user's reply changed: the answers that differ from the ones the plan assumed, the feedback, the ids of the tasks a split created, or
split declined. It writes the plan file as a draft and returns a short message.A second round goes to the planner that wrote the draft where the tool can continue it (a further message to that agent), otherwise to a fresh one.
Tool How Claude Code agent sw-planner. If it is not among your agent types, use a general-purpose agent, tell it to read<skill-dir>/../sw-config/assets/planner.mdfirst and follow it, and pass the model frommodels.plan.claudeindocs/.sw/config.jsonif setCodex spawn the custom agent sw_plannerCopilot CLI tasktool with agentsw-plannerNo subagents available, or the agent is not defined follow planner.mdyourself, in this session, and tell the user the configured model was not usedPresent the plan and get approval. Show the user, in a normal message, the planner's
Approach, itsQuestions(each with the assumed answer as your recommendation), itsSplit, and the path of the plan file so they can read it. Plan mode is not used: a reply can need files written before the plan is shown again. Read the plan file into your own context only if the user asks you about its content.Handle the reply in this order:
- The user agrees to a split: carry it out first, as "An agreed split" below says.
- An answer differs from the one the plan assumed, the user wants changes, or the user declines a split: dispatch the planner again (step 4) with all of it in one prompt, and with the ids of any tasks the split created. Then present the revised plan the same way and wait for the reply again.
- The user accepts the plan as presented, with nothing left to change: that is the approval; go to step 6. A split agreed in the same reply needs no second round, since the plan already covers only the items that stay.
- The user drops the plan: delete the draft file and stop. Tasks a split already created stay; say so.
Called from sw-do, every presentation up to the approval belongs to its one planned stop.
Record, after approval:
- in the plan file, change
status: drafttostatus: approved: read only its frontmatter (the first lines, up to the closing---) and change that line with your edit tool; - in the task's "Done when", the mark: end each item that
Marks:in the planner's latest return quotes with " (test)", unless it already ends so. Only that return counts, andMarks: nonemarks nothing; - in the task's "Notes", the answers given in step 5;
- in the area guide, if
node docs/.sw/sw.mjs explain <ID>names one, the planner'sGuide:lines, one line per fact; - in
docs/log.md, a new entry## [date] plan | <ID>, in the layout the log's last entries use.
Then run
node docs/.sw/sw.mjs lint. If it reportsstale-board, a task's title, milestone or dependencies changed along the way: runnode docs/.sw/sw.mjs board.- in the plan file, change
- Stop. Do not start implementing. Tell the user the plan is approved and that sw-implement
<ID>runs it. Called from sw-do: return to it; it continues with sw-implement.
An agreed split
The planner's Split: names, per new task, its title, its dependencies and the "Done when" items of <ID> it takes over. Once the user agrees:
- For each new task:
- its id from
node docs/.sw/sw.mjs next-id <AREA>, where<AREA>is the id prefix of<ID>(TforT-11); docs/tasks/<NEW>.mdfromdocs/.sw/templates/task.md, without the template's comment:status: todo; the title anddepstheSplit:line names;review:,milestone:andpriority:copied from<ID>;soft_deps:empty; a "Goal" of one or two lines drawn from the items it takes over; under "Done when" those items, word for word; under "Sources" every link of<ID>'s "Sources"; in "Notes"- Split from [[<ID>]] on <date>., then a copy of every note of<ID>and every answer the user gave in this round that bears on the moved items, so that the new task is later planned on them;- in
docs/log.md,## [date] task | <NEW> created.
- its id from
- In
docs/tasks/<ID>.md: remove the moved items from "Done when"; add todepseach new task theSplit:line says<ID>must wait for; add to "Notes"- Split <date>: "Done when" items <n, ...> moved to [[<NEW>]]., numbered as the items stood before the split, one line per new task. - Run
node docs/.sw/sw.mjs board.
Common mistakes
- Planning a small task. The plan costs more than the work.
- Exploring the codebase before dispatching, or reading the plan back. You pay for it twice.
- Editing the plan yourself. If something in it is wrong, send it back to the planner.
- Setting the task to
in-progress. Planning does not change status; only sw-run marks a task started before planning it. - Creating the tasks of a proposed split before the user agrees to it.
- Approving a revised plan the user has not been shown.
- Planning several tasks in one plan file. One task, one plan; shared design goes to a
type: decisionwiki page that the plans link. - Adding the new task to the list in
index.mdby hand.boardwrites that list from the task files.
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.

