sw-implement
Use when the user wants to implement, build, execute, start or continue a Superwiki task or its plan, or invokes sw-implement, with or without a task id.
mhmtsrfglu · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add mhmtsrfglu/superwiki --skill sw-implementAbout this skill
name: sw-implement description: Use when the user wants to implement, build, execute, start or continue a Superwiki task or its plan, or invokes sw-implement, with or without a task id.
sw-implement
Runs one task. You keep the task's status true and judge the result. The work is done by subagents that start from a clean context, on the models set in sw-config: an implementer, and a reviewer when the task asks for one. You do not read the code or the plan: their reports are your input. Before the task is closed you verify it yourself, with a command run for every "Done when" item.
That split is what keeps a task cheap. A long session sends its whole context again on every step; work done in a fresh context does not carry yours, and yours stays small because the work never enters it.
Run commands from the project root. <skill-dir> is the directory this SKILL.md is in.
Steps
-
Pick the task. Id given: use it. Otherwise
node docs/.sw/sw.mjs readyand let the user choose; tasks already in progress come first. -
Gate:
node docs/.sw/sw.mjs check <ID>.checksaysDo can start: no open deps: ...stop. Tell the user which tasks block it and offer to run the first blocker instead; do not run it unasked. Do not start the task anyway, and do not edit depsto get past thiscan start: n/a, status is in-progressthis is a continuation; skip step 3 can start: n/a, status is doneorcancelledstop and ask what the user wants plan: ... (draft, not approved)stop; the plan needs the user's approval (sw-plan) plan: nonefine for a small task, by the rule below this table. Also fine when the task's "Notes" hold an Approach (sw-plan-implement, ...)note: sw-plan-implement chose the medium route. For anything else, recommend sw-plan first and let the user choosereview: required (...)remember it for step 7 can finish: noandsummary: noneexpected before the work: the summary is written in step 8 The rule for a small task, word for word as sw-plan-implement and sw-plan state it:
A task is small when its task file alone shows all four: one area, meaning its work belongs to the configured area its id prefix names and to no other (
areasindocs/.sw/config.json; with one configured area, every task is in one area); three "Done when" items or fewer, as thedone when:line ofnode docs/.sw/sw.mjs check <ID>counts them; nothing left open in its "Notes"; and the files that change, named in the task file, three or fewer. A task whose file does not show how many files change is medium at least, never small. -
Mark it started before any work. The status lives in the task file, under
docs/. When the host's plan mode, a memory tool or a rule of the host keeps this session from writing underdocs/or from running the shell, stop here, before the status changes: name the obstacle to the user, ask them to lift it (leave plan mode, allow the writes, give the session a shell), and wait; do not do the task's work in the meantime. Then:- in the frontmatter of
docs/tasks/<ID>.md,status: in-progressandstarted:today; - in
docs/log.md, a new entry## [date] task | <ID> started, in the layout its last entries use; node docs/.sw/sw.mjs index, so the task list inindex.mdshows it.
- in the frontmatter of
-
Checks that need the environment. A check needs the environment when it starts a service, needs a running stack or changes data. Keep one list of them, each
allowedornot allowed; it holds for the implementer, the reviewer and your own summary.- With a plan: each hit of
grep -n 'needs:' docs/plans/<ID>-plan.mdis such a check. Ask the user which may run; without a yes a check isnot allowed. - Without a plan the list starts empty; step 6 fills it.
- The question is asked also when the plan's approval was waived: a waiver of approval says nothing about checks. Only a standing answer in the user's first message ("the dev server may run", "none may run") replaces it, here and in step 6; a first message that gives none leaves the question to ask.
- With a plan: each hit of
-
Dispatch the implementer: the first row under "Dispatching".
-
Judge the report. Its
Requirements:list must name every requirement of the task by the id every role derives from position:D1toD<n>for the "Done when" items, n from thedone when:line of step 2'scheck, andN1toN<m>for the top-level bullets of "Notes", in order. Compare it with the task file.n/ais for a note that asks for nothing: a record or a piece of evidence, or a line the skills write about the task's course, which is anApproach (sw-plan-implement, ...)note (its work is the requirements it orders) or aRoute:,SplitorChangedline. An answer the user gave, or one assumed for them, asks for something when it bears on a "Done when" item of the task: it is met when the work follows it, shown by that item's check; an answer that bears on none of them asks for nothing. A note that asks for something and comes backn/aisnot met.metneeds evidence: a command or test and its result. You do not re-run it here; step 8 runs a command for every item.- An item marked "(test)" also needs a
red:line in the report: the run in which its test failed before the code. Keep each such line, from the first report and from each fix round's, for step 8. A line that is missing or saysnoneis no reason for a new implementer; the summary marks that itemunverified. built, not verified: the item's only check needs the environment and was not allowed. Ask the user once, in one question, whether each such check not yet answered may run, and add the answers to the list. Then go on either way, with no new implementer: the reviewer and your summary run what is allowed, and a check that cannot run leaves its itemunverifiedin the summary and the taskin-progress.