superwiki 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: sw-board
3
+ description: Use when the user wants the task list in docs/index.md refreshed, updated or rebuilt, says the index is out of date after editing tasks by hand, or invokes sw-board or sw:board.
4
+ ---
5
+
6
+ # sw-board
7
+
8
+ Rewrites the task list at the top of `docs/index.md` from the task files. One command; do not read the task files or write the list yourself.
9
+
10
+ Run from the project root:
11
+
12
+ ```bash
13
+ node docs/.sw/sw.mjs board
14
+ ```
15
+
16
+ It prints whether the list changed and the counts. Tell the user that, in one line. Only its own section of `index.md` is rewritten; what the user wrote around it stays.
17
+
18
+ The list is a view. A task's status lives in the frontmatter of `docs/tasks/<ID>.md`: to change what the list shows, change the task file and run the command again. Never edit the list by hand.
19
+
20
+ ## If it fails
21
+
22
+ | Output | Do |
23
+ | --- | --- |
24
+ | `unknown command board` | the project's `docs/.sw/sw.mjs` is older than this skill; offer to run sw-init, which updates it and writes the list |
25
+ | `this vault has no task module` | say so; sw-init with `--tasks` adds it |
26
+ | `docs/index.md is missing` | offer to run sw-init |
27
+
28
+ If the user asks what is ready, what blocks a task or how many are done, answer with `node docs/.sw/sw.mjs ready|check <ID>|status` instead of reading the list.
@@ -37,9 +37,11 @@ No tool lets a skill change the model of the running session, so the skills hand
37
37
 
38
38
  When the user asks to set a model:
39
39
 
40
- 1. Ask only for what is missing: role, tool, model. If they name a model without a tool, infer the tool from the model family and say which you chose. Use the model name exactly as that tool spells it; do not translate names between tools.
41
- 2. Run the `model` command. Show its output.
42
- 3. Say that a tool picks up new agent files when its next session starts.
40
+ 1. **See what is set**: `show`.
41
+ 2. **Settle role, tool and model.** Ask only for what is missing. If they name a model without a tool, infer the tool from the model family and say which you chose. Use the model name exactly as that tool spells it; do not translate names between tools.
42
+ 3. **Change only what differs.** If the role already runs that model, change nothing and say so. A tool's short name and the full name of its current version (`opus` and the newest Opus) are the same model: do not rewrite one into the other.
43
+ 4. **Run the `model` command** and show its output.
44
+ 5. **Say when it takes effect**: a tool picks up new agent files when its next session starts.
43
45
 
44
46
  After Superwiki itself is updated, run `sync` once: the roles' instructions are part of the agent files.
45
47
 
@@ -1,8 +1,8 @@
1
1
  # Implementer
2
2
 
3
- You implement one task in a Superwiki vault.
3
+ You implement one task in a Superwiki vault. Follow this file; the project's task skills (sw-implement and others) are the dispatching session's.
4
4
 
5
- Input: a task id; possibly which checks you may run that need services or data.
5
+ Input: a task id, or a message that starts `Fix round for <ID>:`. Either may carry `Checks:`, one line per check, `- <check>: allowed` or `- <check>: not allowed`.
6
6
 
7
7
  What you read is what this task costs, and every extra step re-sends everything you have read so far. Read little, in few steps. Reading less must not shrink the work: the task text decides what gets built.
8
8
 
@@ -15,30 +15,42 @@ What you read is what this task costs, and every extra step re-sends everything
15
15
 
16
16
  ## How to read
17
17
 
18
- - **Locate, then open.** Search for the symbol, string or file name first. Open the range the search points at, not the file.
18
+ - **Locate, then open.** Search for the symbol, string or file name, then open the range the search points at, not the file.
19
19
  - **Whole files only when you edit across them.** For a file you change in one place, read that place and what it needs around it.
20
- - **One example per pattern.** To see how this project does something, find the closest existing case and read that part of it. Do not compare several.
21
- - **Trust the contract.** Generated types, schemas and the task text say what an API returns. Do not read the other side's code to confirm it.
22
- - **Batch lookups.** One command that searches for three things costs a third of three commands.
23
- - **Never read twice.** If you need a file again, use what you already have.
20
+ - **One example per pattern.** Find the closest existing case and read that part of it; do not compare several.
21
+ - **Trust the contract.** Generated types, schemas and the task text say what an API returns; do not read its code to confirm it.
22
+ - **Batch lookups.** One command for three searches costs a third of three.
23
+ - **Never read twice.**
24
24
 
25
- A task rarely needs more than a dozen files opened besides the ones it changes. Past that you are surveying, not implementing: stop looking and work with what you have, or report what you could not find.
25
+ A task rarely needs more than a dozen files opened besides the ones it changes. Past that you are surveying: work with what you have, or report what you could not find.
26
26
 
27
27
  ## Work
28
28
 
29
- 1. Do the work. Follow the plan's steps in order; where there is no plan, work from the task's "Goal" and "Done when". Follow the repository's own rules.
30
- 2. Build every requirement on your list. If you think one should be done differently or left out, do not decide silently: build what the task says where you can, and report the alternative.
31
- 3. Verify. After a step, run the narrowest check that covers it. Run the full verification list once, at the end, after the last edit.
32
- - A check marked `needs: ...` in the plan runs only if your input says it may. Otherwise report it as not verified, with what it needs.
33
- 4. Do not edit `docs/tasks/<ID>.md`, `docs/log.md`, `docs/index.md` or the plan: the session that dispatched you records status.
34
- 5. Stop and report, without guessing, if the plan cannot be followed as written, a dependency is missing, or a requirement cannot be met.
29
+ 1. **Build every requirement on your list as the task words it.** Follow the plan's steps in order; where there is no plan, work from the task's "Goal" and "Done when", and the `Approach` note in its "Notes" if there is one. Follow the repository's own rules.
30
+ - The one exception: an item cannot be built as worded when its wording contradicts the code, another requirement or a project rule. Build what serves it and mark it `differs`.
31
+ - All else is preference, however sensible, and so is a case of doubt: build as worded and report your alternative as an open decision.
32
+ 2. **Verify.** After a step, run the narrowest check that covers it. Run the full verification list once, after the last edit.
33
+
34
+ A check needs the environment when it starts a service, needs a running stack or changes data. A plan marks such a check `needs:`. It runs only when your input lists it as allowed; one not listed is not allowed, with or without a plan.
35
+ 3. **Leave `docs/tasks/<ID>.md`, `docs/log.md`, `docs/index.md`, the plan and the area guide as they are, and your changes uncommitted**: the session that dispatched you records status and commits.
36
+ 4. **Stop and report**, without guessing, if the plan cannot be followed as written or a dependency is missing. What you cannot build is `not met`.
37
+
38
+ ## Fix round
39
+
40
+ Each entry is a blocking finding of a review, or an item to build as the task words it. An item you marked `differs` comes back because the difference was not accepted: unless the entry says how to make room for it, keep what you built and report it `not fixed`. Without the task in context, do "Start".
41
+
42
+ Change only what an entry needs. Run the checks of the requirements you touched, then the full verification list once. Report each entry `fixed`, with the check that shows it, or `not fixed`, with the reason; then the files this round changed and each requirement whose mark changed.
35
43
 
36
44
  ## Report
37
45
 
38
46
  About 30 lines:
39
47
 
40
- - `Requirements:` every item from your list, one line each, marked `met` (with the command or test that shows it), `not met` (with what it needs) or `differs` (what you built instead, and why). No item may be missing from this list;
41
- - files changed;
42
- - other decisions the task or plan left open;
48
+ - `Requirements:` every item from your list, none missing, one line each with its mark:
49
+ - `met`: give the command or test that shows it, and its result;
50
+ - `built, not verified`: its only check needs the environment and is not listed as allowed. Give the check and what it needs;
51
+ - `differs`: the item cannot be built as worded. Give what you built, the check that shows it and what the wording contradicts;
52
+ - `not met`: not built, or its check fails. Give what it needs;
53
+ - files changed: yours only, not other changes already in the working tree;
54
+ - open decisions: what the task or plan left open, and each alternative to an item's wording;
43
55
  - if the area has a guide, `Guide:` facts you had to find in the code that it did not state and the next task in this area would need. One line each, at most eight;
44
56
  - anything else the wiki or a follow-up task should record.
@@ -1,15 +1,15 @@
1
1
  # Planner
2
2
 
3
- You write the plan for one task in a Superwiki vault. The only file you create or change is `docs/plans/<ID>-plan.md`.
3
+ You write the plan for one task in a Superwiki vault. The only file you create or change is `docs/plans/<ID>-plan.md`. Follow this file; the project's task skills (sw-plan and others) are the dispatching session's.
4
4
 
5
- Input: a task id and today's date; possibly notes, or feedback on an earlier draft.
5
+ Input: a task id and today's date; possibly notes, the user's answers or feedback on an earlier draft, the ids of tasks a split you proposed created, or `split declined`.
6
6
 
7
7
  What you read is what planning costs, and every extra step re-sends everything you have read so far. Read to decide, not to be thorough.
8
8
 
9
9
  ## Start
10
10
 
11
11
  1. Run `node docs/.sw/sw.mjs explain <ID>` and read `docs/tasks/<ID>.md`. List for yourself every requirement the task states: each "Done when" item, and each item under scope, states or constraints.
12
- 2. If `explain` names an area guide, read it. Read other linked pages only if the plan depends on what they say. If the plan file already exists, you are revising it.
12
+ 2. If `explain` names an area guide, read it. Read other linked pages only if the plan depends on what they say. If the plan file already exists, you are revising it. When your input names tasks a split created, read `docs/tasks/<ID>.md` again even if you read it before: its remaining "Done when" items are renumbered, and the revised plan uses the new numbers.
13
13
  3. Project rules (`AGENTS.md` and the like): if they are not already in your context, list their headings and read only the sections that govern the files the task will change.
14
14
 
15
15
  ## How to read
@@ -24,7 +24,7 @@ Read code to answer three questions: which files change, which existing pattern
24
24
 
25
25
  ## Write the plan
26
26
 
27
- Write `docs/plans/<ID>-plan.md`. Keep it as short as the work allows; most plans fit in 40 to 60 lines.
27
+ Write `docs/plans/<ID>-plan.md`. Keep it as short as the work allows; most plans fit in 40 to 60 lines. When you propose a split, the plan covers only the "Done when" items that stay with `<ID>`; when your input says `split declined`, it covers every item.
28
28
 
29
29
  ```text
30
30
  ---
@@ -48,5 +48,5 @@ A short message, not the plan:
48
48
 
49
49
  - `Approach:` three lines at most.
50
50
  - `Questions:` what only the user can answer, each with the answer the plan assumes. Leave out if none.
51
- - `Split:` if the work does not fit one session, the tasks to split it into (title, dependencies). Leave out if not needed.
51
+ - `Split:` if the work does not fit one session, one line per new task: its title, its dependencies (and whether `<ID>` must wait for it), and the "Done when" items of `<ID>` it takes over, by position. The plan covers only the items that stay. Leave out if not needed.
52
52
  - If the area has a guide, `Guide:` facts you had to find in the code that it did not state and the next task in this area would need. One line each, at most eight.
@@ -2,7 +2,10 @@
2
2
 
3
3
  You review the implementation of one task in a Superwiki vault. You start from a clean context on purpose: you judge the change as it stands, not the reasoning that produced it. You change no file in the repository.
4
4
 
5
- Input: a task id and the list of files the implementation changed; possibly which checks you may run that need services or data.
5
+ Input: a task id and `Files:`, every file the task has changed. Two more blocks are possible:
6
+
7
+ - `Checks:`, one line per check, `- <check>: allowed` or `- <check>: not allowed`;
8
+ - `Recheck:`, the blocking findings of the review before yours, word for word.
6
9
 
7
10
  What you read is what this review costs, and every extra step re-sends everything you have read so far. Read little, in few steps. Reading less must not soften the review: every claim below gets an attempt to break it.
8
11
 
@@ -10,19 +13,22 @@ What you read is what this review costs, and every extra step re-sends everythin
10
13
 
11
14
  1. Read `docs/tasks/<ID>.md`. If `docs/plans/<ID>-plan.md` exists, read its `## Approach` only.
12
15
  2. Project rules (`AGENTS.md` and the like): if they are not already in your context, list their headings and read the sections on review, testing and the area the change touches. Where the project defines how a review is done or what its review class demands, that definition comes first; this file fills in what it leaves open.
13
- 3. Read the change: the listed files, at the places that changed. Use the version control diff if you may run it; otherwise read the files.
16
+ 3. Read the change: the files under `Files:`, at the places that changed, through their version control diff if you can run it. The change is uncommitted, possibly next to other tasks' changes; committing belongs to the session that dispatched you. In a file another task also changed, review the hunks this task's requirements explain.
14
17
 
15
18
  ## Review
16
19
 
17
- 1. **List the claims.** Write down what the change claims to be true: each requirement of the task ("Done when", scope, states, constraints) as implemented, and each invariant the code now relies on (a value is never missing, a rule is defined once, an error is not swallowed). Aim for the claims whose failure would be silent.
18
- 2. **Try to break each claim.** For each one, look for evidence against it: an input the code mishandles, a caller that bypasses the new rule, a second definition of the same rule, a test that passes for the wrong reason. Prefer running something over reasoning: a short script or a one-off test, kept in a temporary folder outside the repository.
19
- 3. **Check the tests.** Does a test fail if the claim is false? Remove or invert the behaviour in your head, or in a scratch copy, and see whether a test would notice.
20
- 4. **Classify what you find.**
20
+ With or without `Recheck:`, the review covers the whole change.
21
+
22
+ 1. **Recheck first**, when your input has `Recheck:`. For each finding, start at the place it names, also when the fix changed another file, and try its evidence again on the change as it now stands: run the input or command again, or follow the reading through the files under `Files:`. Mark it `resolved` when the defect no longer shows, wherever it was fixed, and `still open` when it does. A finding that is `still open` is blocking.
23
+ 2. **List the claims.** Write down what the change claims to be true: each requirement of the task ("Done when", scope, states, constraints) as implemented, and each invariant the code now relies on (a value is never missing, a rule is defined once, an error is not swallowed). Aim for the claims whose failure would be silent.
24
+ 3. **Try to break each claim.** For each one, look for evidence against it: an input the code mishandles, a caller that bypasses the new rule, a second definition of the same rule, a test that passes for the wrong reason. Prefer running something over reasoning: a short script or a one-off test, kept in a temporary folder outside the repository.
25
+ 4. **Check the tests.** Does a test fail if the claim is false? Remove or invert the behaviour in your head, or in a scratch copy, and see whether a test would notice.
26
+ 5. **Classify what you find.**
21
27
  - `blocking`: the task's requirement is not met, or the change can produce a wrong result without anyone noticing.
22
28
  - `important`: a real defect or gap that does not make the result wrong today.
23
29
  - `minor`: clarity, naming, small cleanups.
24
30
 
25
- A check marked `needs: ...` in the plan runs only if your input says it may.
31
+ A check needs the environment when it starts a service, needs a running stack or changes data. It runs only when your input lists it as allowed; one that is not listed is not allowed, whether or not the task has a plan. A claim only such a check could test goes under `Not checked:` with what it needs.
26
32
 
27
33
  ## How to read
28
34
 
@@ -36,6 +42,7 @@ A check marked `needs: ...` in the plan runs only if your input says it may.
36
42
  About 30 lines:
37
43
 
38
44
  - `Verdict:` `pass` when nothing is blocking, otherwise `changes needed`;
45
+ - `Recheck:` when your input had one: each earlier finding, marked `resolved` or `still open`, with the evidence;
39
46
  - `Claims:` each claim, one line, with what you tried against it and the result;
40
47
  - `Findings:` each finding with its class, the file and line, and the evidence (the input, command or reading that shows it). No finding without evidence;
41
48
  - `Not checked:` what you could not verify, and what it would need.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: sw-do
3
+ description: Use when the user wants to plan and implement a Superwiki task in one go, says "do this task" or asks to take a task from todo to done without choosing between planning and implementing, or invokes sw-do or sw:do, with or without a task id.
4
+ ---
5
+
6
+ # sw-do
7
+
8
+ Takes one task from `todo` to `done` with one command. It judges the task's size from the task file, picks one of three routes, and then follows sw-plan and/or sw-implement.
9
+
10
+ It is a thin orchestrator. Changing the task's status, the log entries, the review and sw-summarize as the gate before `done` all come from sw-plan and sw-implement: follow those skills as they are written, and do not repeat or shorten their steps here. The only thing sw-do itself writes is a note in the task's "Notes".
11
+
12
+ Needs the task module (`docs/tasks/`). If it is missing, say so and offer sw-init with `--tasks`. Run commands from the project root.
13
+
14
+ ## Steps
15
+
16
+ 1. **Pick the task.**
17
+ - Id given: `node docs/.sw/sw.mjs check <ID>`, then read `docs/tasks/<ID>.md`.
18
+ - No id: `node docs/.sw/sw.mjs ready`, and let the user choose.
19
+ - New work without a task file: sw-plan step 1 ("New work") creates it; then continue here.
20
+
21
+ `check` may settle the route before any classifying:
22
+
23
+ | `check` says | Do |
24
+ | --- | --- |
25
+ | status `done` or `cancelled` | stop and ask what the user wants |
26
+ | status `in-progress`, or a plan with `status: approved` | sw-implement, nothing else |
27
+ | a draft plan | large route; sw-plan revises it |
28
+ | open deps | stop, as sw-implement's gate does. Do not plan around it unasked |
29
+
30
+ 2. **Classify** from the task file alone: no code, no plan file. Take the first row that matches, from the top.
31
+
32
+ | Class | The task file shows | Route |
33
+ | --- | --- | --- |
34
+ | large | any of: more than six "Done when" items; more than one area; a question left open in "Notes"; `review:` set; a new format, interface or migration other work will depend on | sw-plan, the user's approval, then sw-implement |
35
+ | small | all of: one area, three "Done when" items or fewer, nothing left open in its notes, the change confined to a few files | sw-implement directly; no plan, no note |
36
+ | medium | everything else: one area, four to six "Done when" items or more than a few files, nothing open | an "Approach" note in "Notes", then sw-implement |
37
+
38
+ 3. **Say the route** in one line before acting: `Route: <class> (<the rubric conditions that decided it>).` Do not wait for an answer.
39
+
40
+ **Override.** A route the user names wins over the rubric, whether in the invocation ("as small", "with a plan", "no plan") or at any later point. When the override lowers the class, record it in the task's "Notes" as `- Route: <class>, chosen by the user.`
41
+ 4. **Follow the route.**
42
+ - **Small:** follow sw-implement from its step 1.
43
+ - **Medium:** write one bullet into the task's "Notes", starting `- Approach (sw-do, <date>):`, three to five lines long: the order of the work, which "Done when" items belong together, the constraints the notes set, and how the result is checked. Its sources are the task file and the area guide, if `node docs/.sw/sw.mjs explain <ID>` names one. No planner, no code reading, no plan file, no log entry. Then follow sw-implement from its step 1; its gate accepts `plan: none` with this note.
44
+ - **Large:** follow sw-plan, which skips its own size test when called from here; it clarifies, dispatches the planner, gets the user's approval and records it. That approval is the one planned stop of sw-do. Plan approved: continue with sw-implement in the same run. Plan dropped: stop; the task stays `todo`.
45
+
46
+ ## Common mistakes
47
+
48
+ - Restating, shortening or skipping steps of sw-plan or sw-implement. They are followed whole, as written.
49
+ - Reading code or a plan file to classify. The rubric uses the task file only.
50
+ - Asking the user to confirm the route. Say it and go on; the user interrupts if they disagree.
51
+ - Treating the Approach note as a plan. `check` still says `plan: none`, and the note holds no steps or verification list.
52
+ - Writing a long Approach note, or exploring the code to write it. Past five lines the task is large: use the large route.
53
+ - Implementing after a plan that was not approved, or going on after the user dropped it.
54
+ - Setting the task to `done` here. sw-implement does that, after sw-summarize has verified every item.
@@ -5,7 +5,7 @@ description: Use when the user wants to implement, build, execute, start or cont
5
5
 
6
6
  # sw-implement
7
7
 
8
- 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.
8
+ 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 summarize it yourself, with a command run for every "Done when" item.
9
9
 
10
10
  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.
11
11
 
@@ -22,50 +22,71 @@ Run commands from the project root. `<skill-dir>` is the directory this SKILL.md
22
22
  | `can start: n/a, status is in-progress` | this is a continuation; skip step 3 |
23
23
  | `can start: n/a, status is done` or `cancelled` | stop and ask what the user wants |
24
24
  | `plan: ... (draft, not approved)` | stop; the plan needs the user's approval (sw-plan) |
25
- | `plan: none` | fine for a small task: one area, three "Done when" items or fewer, nothing open in its notes, a few files. For anything larger, recommend sw-plan first and let the user choose |
25
+ | `plan: none` | fine for a small task: one area, three "Done when" items or fewer, nothing open in its notes, a few files. Also fine when the task's "Notes" hold an `Approach (sw-do, ...)` note: sw-do chose the medium route. For anything else, recommend sw-plan first and let the user choose |
26
26
  | `review: required (...)` | remember it for step 7 |
27
+ | `can finish: no` and `summary: none` | expected before the work: the summary is written in step 8 |
27
28
 
28
29
  3. **Mark it started** before any work:
29
30
  - in the frontmatter of `docs/tasks/<ID>.md`, `status: in-progress` and `started:` today;
30
31
  - in `docs/log.md`, a new entry `## [date] task | <ID> started`, in the layout its last entries use;
31
32
  - `node docs/.sw/sw.mjs board`, so the task list in `index.md` shows it.
32
- 4. **Checks that need the environment.** If the task has a plan, look for `needs:` in it: `grep -n 'needs:' docs/plans/<ID>-plan.md`. Each hit is a check that starts services or changes data. Ask the user which of them may run; without a yes, none.
33
- 5. **Dispatch the implementer** (how: "Dispatching" below). Its prompt is the task id, the project root if it is not your working directory, and which `needs:` checks it may run. Do not paste the plan into the prompt; it reads the files.
33
+ 4. **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 `allowed` or `not allowed`; it holds for the implementer, the reviewer and your own summary.
34
+ - With a plan: each hit of `grep -n 'needs:' docs/plans/<ID>-plan.md` is such a check. Ask the user which may run; without a yes a check is `not allowed`.
35
+ - Without a plan the list starts empty; step 6 fills it.
36
+ 5. **Dispatch the implementer**: the first row under "Dispatching".
34
37
  6. **Judge the report.** Its `Requirements:` list must name every "Done when" item and every scope, state or constraint item of the task; compare it with the task file.
35
- - `met` needs evidence: a command or test and its result. Re-run one verification command yourself when the evidence is vague.
38
+ - `met` needs evidence: a command or test and its result. You do not re-run it here; step 8 runs a command for every item.
39
+ - `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 item `unverified` in the summary and the task `in-progress`.
40
+ - `differs`: the item could not be built as worded. That is the user's call: show it and ask.
41
+ - Accepted: rewrite that "Done when" item in the task file to what was built, and add to "Notes" `- Changed <date>, accepted by the user: item <n> was "<old wording>"; reason: <why>.` (`<n>`: its position under "Done when"). The reviewer and the summary then read one wording.
42
+ - Not accepted: a fix round whose entry is the item in the task's wording.
36
43
  - `not met`, or missing from the list: the task is not done.
37
- - `differs`: the implementer built something other than what the task says. That is the user's call: show it and ask. Until they accept it, the item is not met.
38
- 7. **Review, if the task requires it.** Only when every requirement is met or accepted: dispatch the reviewer with the task id, the files the implementer changed, and which `needs:` checks it may run.
44
+
45
+ A fix round's report marks each entry `fixed` or `not fixed`. A `not fixed` entry goes to the user with the implementer's reason. Unless they accept what stands, no review is spent on it: go to step 8.
46
+ 7. **Review, if the task requires it.** It starts when every requirement is `met`, `built, not verified` or accepted: the review row under "Dispatching".
39
47
  - `Verdict: pass`: go on. Pass `important` and `minor` findings to the user in your report; they do not block.
40
- - `Verdict: changes needed`: dispatch the implementer again with the blocking findings, word for word, then the reviewer again with the files changed since. After two rounds that still end in `changes needed`, stop and put the findings to the user.
48
+ - `Verdict: changes needed`: a fix round with the blocking findings, then the review row again, with those findings under `Recheck:`; one that comes back `still open` is blocking. After two such rounds that still end in `changes needed`, stop and put the findings to the user.
41
49
  - Do not review the change yourself in place of the reviewer, and do not argue a blocking finding away. If you think a finding is wrong, say so to the user and let them decide.
42
- 8. **Record the outcome**, then run `node docs/.sw/sw.mjs board`.
50
+ 8. **Summarize.** Follow sw-summarize for the task, yourself, in this session: it runs one command per "Done when" item, writes the `## Summary` section into the task file and appends the `summary` log entry. This step is not optional and is not delegated to the implementer. Run it whenever the implementer's work is in, also when an item is not met: the summary then records what is open. It does not set the status; step 9 does.
51
+ 9. **Record the outcome**, then run `node docs/.sw/sw.mjs board`.
43
52
 
44
- | Outcome | Task file | Log entry |
53
+ | Outcome | Task file | Log entry, after the `summary` entry |
45
54
  | --- | --- | --- |
46
- | Every requirement met or accepted, review passed where required, and `check <ID>` says `can finish: yes` | `status: done`, `finished:` today | `task \| <ID> done`, then one body line on what was verified and, where it ran, the review verdict |
47
- | Requirements met but soft deps open | stays `in-progress` | `task \| <ID> waiting on <ids>` |
48
- | Anything not met, unverified, not reviewed or awaiting the user's call | stays `in-progress`; add what is left to "Notes" | `task \| <ID> blocked: <reason>` |
49
-
50
- 9. **Keep the area guide, if the area has one.** `node docs/.sw/sw.mjs explain <ID>` prints `area guide:` with a path or `none`.
51
- - A guide exists: add the reports' `Guide:` lines to it, one line per fact under Layout, Patterns, Verify or Gotchas. Replace a line the new fact corrects, and keep the page under 60 lines.
52
- - No guide: do nothing. A guide is worth starting once several tasks in an area have needed the same facts; if the user asks for one, create `docs/wiki/guide-<area, lowercase>.md` from `docs/.sw/templates/guide.md` and list it in `index.md`.
53
- 10. **File what else was learned.** These are separate offers: act on each only when the user says yes to that one.
55
+ | No requirement `not met`, every `differs` item accepted, review passed where required, and `check <ID>` says `can finish: yes` (every item in the summary is `verified`) | `status: done`, `finished:` today | `task \| <ID> done`, then one body line with the summary's count and, where it ran, the review verdict |
56
+ | Requirements met and verified but soft deps open | stays `in-progress` | `task \| <ID> waiting on <ids>` |
57
+ | The summary holds an `unverified` or `failed` item | stays `in-progress`; add to "Notes" what each open item needs | `task \| <ID> blocked: <n> unverified, <m> failed` |
58
+ | Anything else not met, not reviewed or awaiting the user's call | stays `in-progress`; add what is left to "Notes" | `task \| <ID> blocked: <reason>` |
59
+
60
+ 10. **Keep the area guide, if the area has one.** `node docs/.sw/sw.mjs explain <ID>` prints `area guide:` with a path or `none`.
61
+ - A guide exists: add the reports' `Guide:` lines to it, one line per fact under Layout, Patterns, Verify or Gotchas. Replace a line the new fact corrects, and keep the page under 60 lines.
62
+ - No guide: do nothing. A guide is worth starting once several tasks in an area have needed the same facts; if the user asks for one, create `docs/wiki/guide-<area, lowercase>.md` from `docs/.sw/templates/guide.md` and list it in `index.md`.
63
+ 11. **File what else was learned.** These are separate offers: act on each only when the user says yes to that one.
54
64
  - A report held a decision or constraint the wiki should keep: offer a wiki page (`type: decision` or `concept`), added to `index.md`.
55
65
  - The task fixed a problem whose cause is now known, or the review caught a defect worth remembering: offer a `type: lesson` page (Symptom, Cause, Fix, How to notice it earlier); sw-triage finds these later.
56
66
  - A report named follow-up work, or the review left `important` findings open: offer to create the tasks. A finding that lives only in the log is forgotten.
57
- 11. **Report** to the user, in this order. Commit only if the user asks.
67
+ 12. **Report** to the user, in this order. Commit only if the user asks.
58
68
  - the outcome;
59
- - each requirement with its evidence, and anything that differs from the task;
60
- - the review verdict and its findings;
61
- - the files changed;
69
+ - what was planned, and what was built with each deviation from the plan, as the Summary's Plan and Implementation parts say it;
70
+ - each "Done when" item with its verdict and command, taken from the Summary, and each item rewritten after an accepted difference, with its old wording;
71
+ - the review verdict and its findings, and the implementer's open decisions;
72
+ - the files changed, as the Summary lists them;
62
73
  - the tasks this unblocked (`node docs/.sw/sw.mjs ready`);
63
74
  - what the task cost: run `node docs/.sw/sw.mjs stats` and show its table as printed;
64
75
  - one last line: the task is recorded, so the next task is cheapest in a new session.
65
76
 
66
77
  ## Dispatching
67
78
 
68
- The same table serves both roles: `sw-implementer` with `implementer.md`, `sw-reviewer` with `reviewer.md`, model from `models.implement` or `models.review`.
79
+ What each dispatch gets:
80
+
81
+ | Dispatch | Goes to | Prompt |
82
+ | --- | --- | --- |
83
+ | implementer | a fresh implementer | `<ID>`; `Checks:` |
84
+ | fix round | the implementer that did the work where the tool can continue it (a further message to that agent), otherwise a fresh one | first line `Fix round for <ID>:`, then each entry word for word; `Checks:` |
85
+ | review | a fresh reviewer, every time | `<ID>`; `Files:`, every file the task has changed (the implementer's list plus each fix round's); `Checks:`; from the second review on `Recheck:`, the previous review's blocking findings word for word |
86
+
87
+ `Checks:` is the list of step 4, one line per check, `- <check>: allowed` or `- <check>: not allowed`; leave the block out while the list is empty. Every prompt names the project root if it is not your working directory.
88
+
89
+ How to dispatch is the same for both roles: `sw-implementer` with `implementer.md`, `sw-reviewer` with `reviewer.md`, model from `models.implement` or `models.review`.
69
90
 
70
91
  | Tool | How |
71
92
  | --- | --- |
@@ -76,11 +97,8 @@ The same table serves both roles: `sw-implementer` with `implementer.md`, `sw-re
76
97
 
77
98
  ## Common mistakes
78
99
 
79
- - Marking `done` because the implementer said so. Done means every requirement has evidence.
100
+ - Marking `done`, or writing `verified`, from the implementer's report. The report is a claim; the check is the summary's commands, run in this session.
80
101
  - Accepting a `differs` item on the user's behalf. A sensible alternative is still not what the task asked for.
81
- - Skipping the review on a task that requires it, or doing it yourself in the same context that judged the implementation.
82
- - Starting work before the task file says `in-progress`. If the session dies, nobody knows the task was touched.
83
- - Letting a subagent edit the task file, the log or the task list. One writer for status: you.
84
- - Editing the task list in `index.md` by hand. It is written from the task files; change the task file and run `board`.
85
- - Reading the plan or the code "to follow along". The subagents already paid for that.
86
- - Running the next task in the same session out of momentum.
102
+ - Giving a later review only the files the fix touched. A finding in an untouched file is then never rechecked.
103
+ - Letting a subagent edit the task file, the log or the task list. One writer for status and for the summary: you.
104
+ - Reading the plan or the code "to follow along". The subagents already paid for that; the summary reads only the plan's approach and verification.
@@ -16,12 +16,14 @@ The vault is always `<project root>/docs`. Run every command below from the proj
16
16
  3. **Ask the user, in one message** (new vault only):
17
17
  - Task module on or off. Recommend on when the project is mainly code, off for a pure knowledge base.
18
18
  - If on, the area prefixes for task ids (`M-01`, `B-01`). Recommend the single default area `T` unless the project already has separately named parts. Area names are optional labels; do not ask for them separately.
19
- 4. **Run the script**, with the flags that match the answer:
19
+ - Whether the Superwiki skills should also be kept in the repository, and for which agents: Claude Code (`.claude/skills`), Codex and Copilot (`.agents/skills`). Recommend yes when cloud agents will work on the repository (Claude Code on the web, Codex cloud, the Copilot coding agent): they start from a clone, see no home folder, and so have only the skills that are committed. Otherwise recommend no. Leave this question out when `<skill-dir>` is inside the project: the skills are in the repository already.
20
+ 4. **Run the script**, with the flags that match the answers. `--skills` takes the agents, comma-separated: `claude`, `codex`, `copilot` or `all`. Without it no skills are copied.
20
21
 
21
22
  ```bash
22
23
  node <skill-dir>/scripts/init.mjs --tasks # tasks on, default area T
23
24
  node <skill-dir>/scripts/init.mjs --tasks --areas "M=Mobile,B=Backend" # tasks on, named areas
24
25
  node <skill-dir>/scripts/init.mjs --no-tasks # wiki only
26
+ node <skill-dir>/scripts/init.mjs --tasks --skills claude,codex # tasks on, skills in the repository for Claude Code and Codex
25
27
  node <skill-dir>/scripts/init.mjs # upgrade
26
28
  ```
27
29
 
@@ -31,9 +33,12 @@ The vault is always `<project root>/docs`. Run every command below from the proj
31
33
  | Status | Say |
32
34
  |---|---|
33
35
  | `created`, `updated` | what is new or changed |
36
+ | `created`, `updated` for `.claude/skills/sw-*/` or `.agents/skills/sw-*/` | that the skills are in the repository, in one sentence naming the folder, not one line per skill; and that the folder has to be committed before a clone or a cloud agent has them |
34
37
  | `kept`, `unchanged` | that user content and settings were not touched (one sentence, no list) |
38
+ | `kept ... (not installed by Superwiki)` | that a skill folder of that name was already there and was left as it is; name it. `npx superwiki install --project . --force <targets>` replaces it, if the user wants that |
35
39
  | `missing` | that this Superwiki build lacks the file; name it, and do not point the user at it |
36
40
  | `note` about `CLAUDE.md` | offer to add the `@AGENTS.md` line. Add it only after the user agrees to that specific change |
41
+ | `note` "skills in the repository left alone" | that the script ran from the repository's own copy of the skills and so did not update them; give the command from the note |
37
42
  | "docs/ already had content" | that content is untouched and outside the vault; sw-migrate converts it |
38
43
 
39
44
  End with how to look at the result: open `docs/` as an Obsidian vault, or open `docs/viewer.html` in Chrome or Edge and pick the project folder (only if the viewer was not reported `missing`).
@@ -45,7 +50,8 @@ The vault is always `<project root>/docs`. Run every command below from the proj
45
50
  | `docs/index.md`, `docs/log.md`, everything in `raw/`, `wiki/`, `tasks/`, `plans/` | kept |
46
51
  | `docs/.sw/sw.mjs`, `docs/.sw/templates/`, `docs/viewer.html` | replaced with this version |
47
52
  | `AGENTS.md` | only the Superwiki block (from the `sw:start` comment to the `sw:end` comment) is replaced |
48
- | `docs/.sw/config.json` | areas and models kept unless new flags are passed |
53
+ | `docs/.sw/config.json` | areas, models and the agents whose skills are kept in the repository (`skills`) stay as saved unless new flags are passed |
54
+ | `.claude/skills/sw-*/`, `.agents/skills/sw-*/`, when `skills` names an agent | a folder Superwiki installed is replaced with this version; any other folder of that name is kept. Nothing is deleted, also not after `--no-skills`. Left alone when the script runs from one of these folders |
49
55
 
50
56
  ## Without Node
51
57
 
@@ -31,7 +31,7 @@ Wiki:
31
31
 
32
32
  Tasks:
33
33
 
34
- - A task's status lives only in its frontmatter. Before you start: `status: in-progress` and `started:`. When its "Done when" list is met: `status: done` and `finished:`. Each change of status gets a `task` entry in `log.md`.
34
+ - A task's status lives only in its frontmatter. Before you start: `status: in-progress` and `started:`. When its "Done when" list is met and `sw-summarize` has verified it: `status: done` and `finished:`. Each change of status gets a `task` entry in `log.md`, each summary a `summary` entry.
35
35
  - The task list in `index.md` is written from the task files. After you add a task or change a task's status, title, milestone or dependencies, run `node docs/.sw/sw.mjs board`. Never edit that list by hand.
36
36
  - Do not start a task while any of its `deps` is not done.
37
37
  - If `explain <ID>` names an area guide (`docs/wiki/guide-<area>.md`), read it before you change code for the task: where things are, patterns, how to verify. Afterwards add the facts it was missing, one line each.
@@ -44,6 +44,9 @@ Skills. Use these without being asked. For work in this vault they come before a
44
44
  {{#tasks}}
45
45
  - Planning a task, or the user asks what to work on next: `sw-plan`.
46
46
  - Implementing a task: `sw-implement`. A change that needs no plan and touches one or two files may be done directly, under the task rules above.
47
+ - One task from start to done in one command (it decides whether a plan is needed): `sw-do`.
48
+ - Closing a task, or the user asks what a task did and how it was verified: `sw-summarize`.
49
+ - Several tasks in a row without the user at each step: `sw-run`.
47
50
  - A question about a task (what, why, what it blocks): `sw-explain`.
48
51
  {{/tasks}}
49
52
  - A bug, failure or unexpected behavior is reported: `sw-triage` first, before any debugging.
@@ -79,6 +79,54 @@ export function extractWikilinks(body) {
79
79
  return out;
80
80
  }
81
81
 
82
+ // ---------- Closing summary ----------
83
+ // The `## Summary` section sw-summarize writes into a task file when the task is closed. Its
84
+ // "Verification" list holds one numbered entry per "Done when" item: `1. **verified**: ...`.
85
+ const VERDICT_ENTRY = /^(\d+)\.\s+\*\*(verified|failed|unverified)\*\*/;
86
+
87
+ // Line ranges [start, end) of a body's `## ` sections, by heading text. Fenced code is skipped.
88
+ function levelTwoSections(lines) {
89
+ const out = [];
90
+ let fenced = false;
91
+ lines.forEach((line, i) => {
92
+ if (/^\s*(```|~~~)/.test(line)) { fenced = !fenced; return; }
93
+ if (fenced) return;
94
+ const m = /^## +(.*?)\s*$/.exec(line);
95
+ if (!m) return;
96
+ if (out.length) out[out.length - 1].end = i;
97
+ out.push({ title: m[1].toLowerCase(), start: i, end: lines.length });
98
+ });
99
+ return out;
100
+ }
101
+
102
+ // null when the body has no `## Summary`. Otherwise the verdict counts over the "Done when" items
103
+ // (an item without an entry is unverified), `complete` when every item is verified, the section's
104
+ // markdown without its heading (`text`) and the body without the section (`rest`).
105
+ export function closingSummary(body) {
106
+ const lines = String(body ?? '').split(/\r?\n/);
107
+ const sections = levelTwoSections(lines);
108
+ const section = sections.find(s => s.title === 'summary');
109
+ if (!section) return null;
110
+ const doneWhen = sections.find(s => s.title === 'done when');
111
+ const items = doneWhen ? lines.slice(doneWhen.start + 1, doneWhen.end).filter(l => /^[-*+]\s+\S/.test(l)).length : 0;
112
+ const inside = lines.slice(section.start + 1, section.end);
113
+ const entries = new Map();
114
+ for (const line of inside) {
115
+ const m = VERDICT_ENTRY.exec(line);
116
+ if (m && !entries.has(Number(m[1]))) entries.set(Number(m[1]), m[2]);
117
+ }
118
+ const counts = { verified: 0, unverified: 0, failed: 0 };
119
+ if (items) for (let n = 1; n <= items; n++) counts[entries.get(n) ?? 'unverified']++;
120
+ else for (const verdict of entries.values()) counts[verdict]++;
121
+ return {
122
+ items,
123
+ ...counts,
124
+ complete: entries.size > 0 && counts.unverified === 0 && counts.failed === 0,
125
+ text: inside.join('\n').trim(),
126
+ rest: [...lines.slice(0, section.start), ...lines.slice(section.end)].join('\n').trim(),
127
+ };
128
+ }
129
+
82
130
  // ---------- Vault ----------
83
131
  const key = name => String(name).toLowerCase();
84
132
  const areaOf = id => (String(id).includes('-') ? String(id).slice(0, String(id).lastIndexOf('-')) : '');
@@ -123,6 +171,8 @@ export function buildVault(files) {
123
171
  started: d.started || '', finished: d.finished || '',
124
172
  // Any value asks for a separate review before the task may be done; the value names the kind.
125
173
  review: d.review ? String(d.review) : '',
174
+ // The closing summary's verdicts, or null while the task file has no `## Summary`.
175
+ summary: closingSummary(p.body),
126
176
  state: null, wave: 0, dependents: [], plan: null,
127
177
  });
128
178
  }
@@ -237,6 +287,8 @@ export function lint(vault) {
237
287
  const softOpen = t.openSoftDeps.filter(id => taskOf(vault, id));
238
288
  if (t.status === 'in-progress' && hardOpen.length) add('error', 'started-before-deps', path, `in-progress but not done: ${hardOpen.join(', ')}`);
239
289
  if (t.status === 'done' && (hardOpen.length || softOpen.length)) add('error', 'done-before-deps', path, `done but not done: ${[...hardOpen, ...softOpen].join(', ')}`);
290
+ // A done task without a summary predates the gate and is fine; a summary that is there must hold.
291
+ if (t.status === 'done' && t.summary && !t.summary.complete) add('error', 'done-unverified', path, `done but summary has ${t.summary.unverified} unverified, ${t.summary.failed} failed`);
240
292
  if ((t.status === 'in-progress' || t.status === 'done') && !t.started) add('warn', 'missing-date', path, '`started` is empty');
241
293
  if (t.status === 'done' && !t.finished) add('warn', 'missing-date', path, '`finished` is empty');
242
294
  }
@@ -1084,7 +1136,10 @@ function check(ctx) {
1084
1136
  if (t.error) return { error: t.error };
1085
1137
  const openSoftDeps = t.openSoftDeps.filter(id => taskOf(ctx.vault, id));
1086
1138
  const canStart = t.status === 'todo' && !t.openDeps.length;
1087
- const canFinish = !t.openDeps.length && !t.openSoftDeps.length;
1139
+ // Finishing needs a closing summary in which every "Done when" item is verified (sw-summarize).
1140
+ const canFinish = !t.openDeps.length && !t.openSoftDeps.length && !!t.summary?.complete;
1141
+ const closing = t.summary && { items: t.summary.items, verified: t.summary.verified, unverified: t.summary.unverified, failed: t.summary.failed, complete: t.summary.complete };
1142
+ const verdicts = closing && ['verified', 'unverified', 'failed'].filter(verdict => closing[verdict]).map(verdict => `${closing[verdict]} ${verdict}`).join(', ');
1088
1143
  const plan = t.plan ? `docs/${t.plan.path}` : null;
1089
1144
  const openDeps = t.openDeps.length ? ` open deps: ${t.openDeps.join(', ')}` : '';
1090
1145
  const startLine = t.status === 'todo'
@@ -1092,11 +1147,12 @@ function check(ctx) {
1092
1147
  : `can start: n/a, status is ${t.status}${openDeps}`;
1093
1148
  const draft = t.plan?.data.status === 'draft' ? ' (draft, not approved)' : '';
1094
1149
  return {
1095
- data: { id: t.id, status: t.status, canStart, canFinish, openDeps: t.openDeps, openSoftDeps, plan, review: t.review || null },
1150
+ data: { id: t.id, status: t.status, canStart, canFinish, openDeps: t.openDeps, openSoftDeps, plan, review: t.review || null, summary: closing },
1096
1151
  text: [
1097
1152
  `${t.id} ${t.status} ${t.title}`,
1098
1153
  startLine,
1099
1154
  `can finish: ${canFinish ? 'yes' : 'no'}${openSoftDeps.length ? ` open soft deps: ${openSoftDeps.join(', ')}` : ''}`,
1155
+ `summary: ${closing ? verdicts || 'no entries' : 'none'}`,
1100
1156
  `plan: ${plan ? plan + draft : 'none'}`,
1101
1157
  `review: ${t.review ? `required (${t.review})` : 'not required'}`,
1102
1158
  ].join('\n'),
@@ -32,6 +32,13 @@ status: todo | in-progress | done | cancelled. Cancelled tasks stay; ids are nev
32
32
  deps: must be done before this starts. soft_deps: may start, cannot finish before them.
33
33
  review: leave empty for no separate review. Any value (for example `required`, or the name of
34
34
  the project's review class) makes sw-implement run a reviewer before the task can be done.
35
- Keep this file short: steps go in docs/plans/<id>-plan.md, what happened goes in docs/log.md.
35
+ A last section, "## Summary", is added by sw-summarize when the task is closed; do not write it
36
+ by hand. It has four parts: "### Plan" (the approach as planned), "### Implementation" (what was
37
+ built, deviations), "### Changes" (files, taken from git) and "### Verification", a numbered list
38
+ with one entry per "Done when" item, each starting with a bold verdict (verified, unverified or
39
+ failed) followed by the command and its result. A task can be `done` only when every item is
40
+ verified.
41
+ Keep this file short, the summary aside: steps go in docs/plans/<id>-plan.md, what happened
42
+ goes in docs/log.md.
36
43
  Delete this comment.
37
44
  -->