superwiki 0.1.1 → 0.1.3

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sw",
3
3
  "description": "An LLM-maintained wiki and task tracker in docs/ for coding agents. Obsidian friendly, with a static viewer.",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "wiki",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sw",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "An LLM-maintained wiki and task tracker in docs/ for coding agents. Obsidian friendly, with a static viewer.",
5
5
  "license": "MIT",
6
6
  "skills": "./skills/",
package/README.md CHANGED
@@ -24,7 +24,7 @@ It is built to be cheap for the agent. One small index to read, one file per tas
24
24
  Measured on a real project with 165 tasks, converted from a single markdown index:
25
25
 
26
26
  | | Before | After |
27
- |---|---|---|
27
+ | --- | --- | --- |
28
28
  | Read at the start of every session | 197 KB index | 94-byte catalog + 1.7 KB of rules |
29
29
  | Read to start one task | the index, then the task's section | one file, 2 KB at the median |
30
30
  | Marking a task done | a status cell, plus a ✅ at every reference to it (median 12 places) | one frontmatter line |
@@ -33,7 +33,7 @@ Measured on a real project with 165 tasks, converted from a single markdown inde
33
33
 
34
34
  ## What you get
35
35
 
36
- ```
36
+ ```text
37
37
  docs/
38
38
  index.md catalog of the wiki, one line per page
39
39
  log.md append-only history
@@ -57,7 +57,7 @@ npx superwiki install claude
57
57
  This copies the skills into the folder your agent reads. Name one or more targets:
58
58
 
59
59
  | Target | Installs into | For |
60
- |---|---|---|
60
+ | --- | --- | --- |
61
61
  | `claude` | `~/.claude/skills` | [Claude Code](#claude-code) |
62
62
  | `codex` | `~/.agents/skills` | [Codex CLI](#codex-cli) |
63
63
  | `copilot` | `~/.copilot/skills` | [GitHub Copilot CLI](#github-copilot-cli) |
@@ -159,12 +159,12 @@ A project's `docs/` folder is plain markdown and keeps working as an Obsidian va
159
159
  | `sw-migrate` | convert an existing table-based task index, on a new git branch |
160
160
  | `sw-ingest` | file a source into the wiki |
161
161
  | `sw-plan` | plan a task with the planner subagent and get your approval |
162
- | `sw-implement` | run a task with the implementer subagent and record the result |
162
+ | `sw-implement` | run a task with the implementer subagent, have it reviewed if the task asks for that, and record the result |
163
163
  | `sw-explain` | explain a task: what, why, dependencies, what it unblocks |
164
164
  | `sw-triage` | for a problem: seen before? lessons, likely causes |
165
165
  | `sw-lint` | structural checks by script, semantic review on request |
166
166
  | `sw-visualize` | open the viewer |
167
- | `sw-config` | the model each tool uses for planning and implementing; task areas |
167
+ | `sw-config` | the model each tool uses for planning, implementing and reviewing; task areas |
168
168
 
169
169
  ### Examples
170
170
 
@@ -188,7 +188,7 @@ Shown as typed in Claude Code. In Codex, write `$sw-plan` instead of `/sw-plan`.
188
188
  /sw-ingest ~/Downloads/interview-notes.md
189
189
  file a source and summarise it into the wiki
190
190
 
191
- /sw-config plan with opus, implement with sonnet
191
+ /sw-config plan with opus, implement with sonnet, review with opus
192
192
  /sw-lint check links, frontmatter and task dependencies
193
193
  /sw-visualize open the task board and the wiki in the browser
194
194
  ```
@@ -226,7 +226,7 @@ node docs/.sw/sw.mjs snapshot # or: freeze the vault into docs/vie
226
226
  npm test # builds skills/sw-init/assets/sw.mjs, then runs the tests
227
227
  ```
228
228
 
229
- Releases are cut by the `Release` workflow (Actions → Release → Run workflow): it tests, bumps the version in `package.json` and the plugin manifests, publishes to npm, tags, and creates a GitHub release. It needs the repository secret `NPM_TOKEN`.
229
+ Releases are cut by the `Release` workflow (Actions → Release → Run workflow): it tests, bumps the version in `package.json` and the plugin manifests, publishes to npm, tags, and creates a GitHub release. It publishes through npm trusted publishing, so no token is stored: the package's settings on npmjs.com name this repository and `release.yml` as its trusted publisher.
230
230
 
231
231
  `node scripts/build-demo.mjs` builds the public demo into `site/` (the viewer with the example vault baked in); the Pages workflow deploys it on every push to `main`.
232
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superwiki",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Agent skills that turn docs/ into an LLM-maintained wiki and task tracker. Obsidian-friendly. Works with Claude Code, Codex and Copilot CLI.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sw-config
3
- description: Use when the user wants to choose or change which model plans or implements Superwiki tasks (opus, sonnet, gpt and so on), add task areas, see the Superwiki configuration, or invokes sw-config or sw:config.
3
+ description: Use when the user wants to choose or change which model plans, implements or reviews Superwiki tasks (opus, sonnet, gpt and so on), add task areas, see the Superwiki configuration, or invokes sw-config or sw:config.
4
4
  ---
5
5
 
6
6
  # sw-config
@@ -10,7 +10,8 @@ Settings live in `docs/.sw/config.json`. Change them with the script, from the p
10
10
  ```bash
11
11
  node <skill-dir>/scripts/config.mjs show
12
12
  node <skill-dir>/scripts/config.mjs model plan claude opus
13
- node <skill-dir>/scripts/config.mjs model implement codex gpt-6
13
+ node <skill-dir>/scripts/config.mjs model implement claude sonnet
14
+ node <skill-dir>/scripts/config.mjs model review codex gpt-6
14
15
  node <skill-dir>/scripts/config.mjs model plan copilot --unset
15
16
  node <skill-dir>/scripts/config.mjs areas "M=Mobile,B=Backend"
16
17
  node <skill-dir>/scripts/config.mjs sync --tools claude,codex,copilot
@@ -18,13 +19,21 @@ node <skill-dir>/scripts/config.mjs sync --tools claude,codex,copilot
18
19
 
19
20
  ## Models
20
21
 
21
- A model is chosen per role (`plan`, `implement`) and per tool (`claude`, `codex`, `copilot`), because each tool can only run its own models. No tool lets a skill change the model of the running session, so sw-plan and sw-implement hand the work to a subagent, and the subagent's file carries the model.
22
+ A model is chosen per role and per tool, because each tool can only run its own models.
22
23
 
23
- | Tool | Files the script writes |
24
- |---|---|
25
- | Claude Code | `.claude/agents/sw-planner.md`, `sw-implementer.md` |
26
- | Codex | `.codex/agents/sw-planner.toml`, `sw-implementer.toml` |
27
- | Copilot CLI | `.github/agents/sw-planner.agent.md`, `sw-implementer.agent.md` |
24
+ | Role | Does | Used by |
25
+ | --- | --- | --- |
26
+ | `plan` | writes the plan file for a task | sw-plan |
27
+ | `implement` | does the work of a task | sw-implement |
28
+ | `review` | reviews the implementation from a clean context, for tasks whose frontmatter has `review:` | sw-implement |
29
+
30
+ No tool lets a skill change the model of the running session, so the skills hand the work to a subagent, and the subagent's file carries the model. The script writes one file per role:
31
+
32
+ | Tool | Folder | Files |
33
+ | --- | --- | --- |
34
+ | Claude Code | `.claude/agents/` | `sw-planner.md`, `sw-implementer.md`, `sw-reviewer.md` |
35
+ | Codex | `.codex/agents/` | `sw-planner.toml`, `sw-implementer.toml`, `sw-reviewer.toml` |
36
+ | Copilot CLI | `.github/agents/` | `sw-planner.agent.md`, `sw-implementer.agent.md`, `sw-reviewer.agent.md` |
28
37
 
29
38
  When the user asks to set a model:
30
39
 
@@ -32,6 +41,8 @@ When the user asks to set a model:
32
41
  2. Run the `model` command. Show its output.
33
42
  3. Say that a tool picks up new agent files when its next session starts.
34
43
 
44
+ After Superwiki itself is updated, run `sync` once: the roles' instructions are part of the agent files.
45
+
35
46
  Do not edit the generated agent files or `config.json` by hand; the next `sync` overwrites agent files.
36
47
 
37
48
  ## Areas
@@ -1,20 +1,44 @@
1
+ # Implementer
2
+
1
3
  You implement one task in a Superwiki vault.
2
4
 
3
5
  Input: a task id; possibly which checks you may run that need services or data.
4
6
 
5
- 1. Read `docs/tasks/<ID>.md` and, if it exists, `docs/plans/<ID>-plan.md`.
6
- - With a plan: open the files under its "Read first", then work. Do not explore beyond what a step turns out to need.
7
- - Without a plan: run `node docs/.sw/sw.mjs explain <ID>`, read the area guide it names if any, then find the files to change.
8
- - Do not re-read instruction files that are already in your context. Read linked pages only when a step needs them.
9
- 2. 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.
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
+
9
+ ## Start
10
+
11
+ 1. Read `docs/tasks/<ID>.md` and, if it exists, `docs/plans/<ID>-plan.md`. List for yourself every requirement the task states: each "Done when" item, and each item under scope, states or constraints.
12
+ - With a plan: open what it lists under "Read first", then work.
13
+ - Without a plan: run `node docs/.sw/sw.mjs explain <ID>`. If it names an area guide, read it.
14
+ 2. 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 you will change.
15
+
16
+ ## How to read
17
+
18
+ - **Locate, then open.** Search for the symbol, string or file name first. Open the range the search points at, not the file.
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.
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.
26
+
27
+ ## Work
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.
10
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.
11
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.
12
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.
13
- 5. Stop and report, without guessing, if the plan cannot be followed as written, a dependency is missing, or a "Done when" item cannot be met.
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.
35
+
36
+ ## Report
37
+
38
+ About 30 lines:
14
39
 
15
- Report, in about 25 lines:
16
- - each "Done when" item: met or not, with the command you ran and its result;
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;
17
41
  - files changed;
18
- - deviations from the plan, and why;
19
- - `Guide:` facts you had to find in the code that neither the plan nor the area guide stated and the next task in this area would need. One line each, at most eight;
42
+ - other decisions the task or plan left open;
43
+ - 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;
20
44
  - anything else the wiki or a follow-up task should record.
@@ -1,32 +1,52 @@
1
+ # Planner
2
+
1
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`.
2
4
 
3
5
  Input: a task id and today's date; possibly notes, or feedback on an earlier draft.
4
6
 
5
- Planning is paid for in what you read. Read to decide, not to be thorough.
6
-
7
- 1. Run `node docs/.sw/sw.mjs explain <ID>` and read `docs/tasks/<ID>.md`. If `explain` names an area guide, read it: it records where things are, the patterns to follow and how to verify, so you need not rediscover them. Read other linked pages only if the plan depends on what they say. If the plan file already exists, you are revising it.
8
- 2. Read code to answer three questions: which files change, which existing pattern to copy, how the result is verified. Stop when you can answer them.
9
- - Search first, then open the part you need; open a whole file only when you must edit across it.
10
- - Do not re-read instruction files that are already in your context.
11
- - Trust what the task and the guide state. Check a stated fact in code only where the plan would be wrong if the fact were false.
12
- 3. Write `docs/plans/<ID>-plan.md`. Keep it as short as the work allows; most plans fit in 40 to 60 lines.
13
-
14
- ```
15
- ---
16
- type: plan
17
- task: <ID>
18
- status: draft
19
- updated: <today>
20
- ---
21
- ```
22
-
23
- - `## Approach`: the chosen approach and every assumption you made, in a few lines. Mention a rejected option only if someone would otherwise try it.
24
- - `## Read first`: the files the implementer must open, each with the part that matters (function, section or line range). After these, nothing should need exploring.
25
- - `## Steps`: in order. Each step names its files, says the change in one or two sentences, and gives its check. Write exact text only where exactness matters: keys, user-facing strings, signatures, test cases (as a table). Leave out code the implementer can write from the description, and leave out status bookkeeping (task file, log): the dispatching session does that.
26
- - `## Verification`: each "Done when" item with the command or check that proves it. Put `needs: running stack` or `needs: data change` on a check that cannot run from a clean checkout without starting services or altering data.
27
- - Link vault pages as `[[file-name]]`; refer to code by plain path. Verify any current output you quote by running or tracing the code.
28
- 4. Return a short message, not the plan:
29
- - `Approach:` three lines at most.
30
- - `Questions:` what only the user can answer, each with the answer the plan assumes. Leave out if none.
31
- - `Split:` if the work does not fit one session, the tasks to split it into (title, dependencies). Leave out if not needed.
32
- - `Guide:` facts you had to find in the code that the area guide did not state and the next task in this area would need (where something lives, a convention, a verification command). One line each, at most eight.
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
+
9
+ ## Start
10
+
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.
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
+
15
+ ## How to read
16
+
17
+ Read code to answer three questions: which files change, which existing pattern to copy, how the result is verified. Stop when you can answer them.
18
+
19
+ - **Locate, then open.** Search for the symbol, string or file name first. Open the range the search points at, not the file.
20
+ - **One example per pattern.** Find the closest existing case and read that part of it. Do not compare several.
21
+ - **Trust what is stated.** The task, the guide, generated types and schemas say what exists. Check a stated fact in code only where the plan would be wrong if the fact were false.
22
+ - **Batch lookups.** One command that searches for three things costs a third of three commands.
23
+ - **Never read twice.**
24
+
25
+ ## Write the plan
26
+
27
+ Write `docs/plans/<ID>-plan.md`. Keep it as short as the work allows; most plans fit in 40 to 60 lines.
28
+
29
+ ```text
30
+ ---
31
+ type: plan
32
+ task: <ID>
33
+ status: draft
34
+ updated: <today>
35
+ ---
36
+ ```
37
+
38
+ - `## Approach`: the chosen approach and every assumption you made, in a few lines. Mention a rejected option only if someone would otherwise try it.
39
+ - `## Read first`: the files the implementer must open, each with the part that matters (function, section or line range). After these, nothing should need exploring.
40
+ - `## Steps`: in order. Each step names its files, says the change in one or two sentences, and gives its check. Every requirement on your list is covered by a step. Write exact text only where exactness matters: keys, user-facing strings, signatures, test cases (as a table). Leave out code the implementer can write from the description, and leave out status bookkeeping (task file, log): the dispatching session does that.
41
+ - `## Verification`: each "Done when" item with the command or check that proves it. Put `needs: running stack` or `needs: data change` on a check that cannot run from a clean checkout without starting services or altering data.
42
+
43
+ Link vault pages as `[[file-name]]`; refer to code by plain path. Verify any current output you quote by running or tracing the code.
44
+
45
+ ## Return
46
+
47
+ A short message, not the plan:
48
+
49
+ - `Approach:` three lines at most.
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.
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.
@@ -0,0 +1,41 @@
1
+ # Reviewer
2
+
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
+
5
+ Input: a task id and the list of files the implementation changed; possibly which checks you may run that need services or data.
6
+
7
+ 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
+
9
+ ## Start
10
+
11
+ 1. Read `docs/tasks/<ID>.md`. If `docs/plans/<ID>-plan.md` exists, read its `## Approach` only.
12
+ 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.
14
+
15
+ ## Review
16
+
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.**
21
+ - `blocking`: the task's requirement is not met, or the change can produce a wrong result without anyone noticing.
22
+ - `important`: a real defect or gap that does not make the result wrong today.
23
+ - `minor`: clarity, naming, small cleanups.
24
+
25
+ A check marked `needs: ...` in the plan runs only if your input says it may.
26
+
27
+ ## How to read
28
+
29
+ - **Locate, then open.** Search for the symbol or string first; open the range the search points at.
30
+ - **Follow the change outward only as far as a claim needs.** A caller matters when a claim depends on how it calls.
31
+ - **Batch lookups.** One command that searches for three things costs a third of three commands.
32
+ - **Never read twice.**
33
+
34
+ ## Report
35
+
36
+ About 30 lines:
37
+
38
+ - `Verdict:` `pass` when nothing is blocking, otherwise `changes needed`;
39
+ - `Claims:` each claim, one line, with what you tried against it and the result;
40
+ - `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
+ - `Not checked:` what you could not verify, and what it would need.
@@ -21,6 +21,11 @@ const ROLES = {
21
21
  instructions: 'implementer.md',
22
22
  description: 'Implements one Superwiki task from its task and plan files. Use from sw-implement.',
23
23
  },
24
+ review: {
25
+ name: 'sw-reviewer',
26
+ instructions: 'reviewer.md',
27
+ description: 'Reviews the implementation of one Superwiki task from a clean context. Use from sw-implement.',
28
+ },
24
29
  };
25
30
 
26
31
  // How each tool wants an agent defined: where the file goes and what it looks like.
@@ -81,7 +86,7 @@ function loadConfig(root) {
81
86
  const path = join(root, 'docs/.sw/config.json');
82
87
  if (!existsSync(path)) throw new UsageError('no docs/.sw/config.json here; run sw-init first');
83
88
  const config = JSON.parse(readFileSync(path, 'utf8'));
84
- config.models = { plan: {}, implement: {}, ...config.models };
89
+ config.models = { ...Object.fromEntries(ROLE_NAMES.map(role => [role, {}])), ...config.models };
85
90
  config.tools ??= [];
86
91
  return { config, save: () => writeFileSync(path, JSON.stringify(config, null, 2) + '\n') };
87
92
  }
@@ -5,7 +5,9 @@ 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; an implementer subagent, running the model set in sw-config, does the work from the task and plan files. You do not read the code or the plan: the report is 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.
9
+
10
+ That split is what keeps a task cheap. A long session re-sends its whole context on every step; work done in a fresh context does not carry yours, and yours stays small because the work never enters it.
9
11
 
10
12
  Run commands from the project root. `<skill-dir>` is the directory this SKILL.md is in.
11
13
 
@@ -18,34 +20,49 @@ Run commands from the project root. `<skill-dir>` is the directory this SKILL.md
18
20
  - `can start: n/a, status is done` or `cancelled`: stop and ask what the user wants.
19
21
  - `plan: ... (draft, not approved)`: stop; the plan needs the user's approval (sw-plan).
20
22
  - `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.
23
+ - `review: required (...)`: remember it for step 7.
21
24
  3. **Mark it started** before any work: in the frontmatter of `docs/tasks/<ID>.md` set `status: in-progress` and `started:` today. Append `## [date] task | <ID> started` to `docs/log.md`, in the layout its last entries use.
22
- 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 the implementer may run; without a yes, none.
23
- 5. **Dispatch the implementer.** 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.
25
+ 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.
26
+ 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.
27
+ 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.
28
+ - `met` needs evidence: a command or test and its result. Re-run one verification command yourself when the evidence is vague.
29
+ - `not met`, or missing from the list: the task is not done.
30
+ - `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.
31
+ 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.
32
+ - `Verdict: pass`: go on. Pass `important` and `minor` findings to the user in your report; they do not block.
33
+ - `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.
34
+ - 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.
35
+ 8. **Record the outcome.**
36
+
37
+ | Outcome | Task file | Log entry |
38
+ | --- | --- | --- |
39
+ | 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 |
40
+ | Requirements met but soft deps open | stays `in-progress` | `task \| <ID> waiting on <ids>` |
41
+ | 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>` |
24
42
 
25
- | Tool | How |
26
- |---|---|
27
- | Claude Code | agent `sw-implementer`. If it is not among your agent types, use a general-purpose agent, put the content of `<skill-dir>/../sw-config/assets/implementer.md` at the top of its prompt, and pass the model from `models.implement.claude` in `docs/.sw/config.json` if set |
28
- | Codex | spawn the custom agent `sw_implementer` |
29
- | Copilot CLI | `task` tool with agent `sw-implementer` |
30
- | No subagents available, or the agent is not defined | follow `implementer.md` yourself, in this session, and tell the user the configured model was not used |
43
+ 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`.
44
+ - 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.
45
+ - 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`.
46
+ 10. **File what else was learned.** If a report held a decision or constraint the wiki should keep, offer to save it as a wiki page (`type: decision` or `concept`) and add it to `index.md`. If 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. If a report named follow-up work, offer to create the tasks. These are separate offers: act on each only when the user says yes to that one.
47
+ 11. **Report** to the user: outcome, each requirement with its evidence, the review verdict and findings, anything that differs from the task, files changed, and which tasks this unblocked (`node docs/.sw/sw.mjs ready`). Commit only if the user asks. End with one line: the task is recorded, so the next task is cheapest in a new session.
31
48
 
32
- 6. **Judge the report** against the task's "Done when" list. Every item needs evidence: a command and its result. Re-run one verification command yourself when the report is vague. An item without evidence is not met.
33
- 7. **Record the outcome.**
49
+ ## Dispatching
34
50
 
35
- | Outcome | Task file | Log entry |
36
- |---|---|---|
37
- | Every item met, and `check <ID>` says `can finish: yes` | `status: done`, `finished:` today | `task \| <ID> done`, then one body line on what was verified |
38
- | Items met but soft deps open | stays `in-progress` | `task \| <ID> waiting on <ids>` |
39
- | Blocked or partly done | stays `in-progress`; add what is left to "Notes" | `task \| <ID> blocked: <reason>` |
51
+ The same table serves both roles: `sw-implementer` with `implementer.md`, `sw-reviewer` with `reviewer.md`, model from `models.implement` or `models.review`.
40
52
 
41
- 8. **Keep the area guide.** Add the report's `Guide:` lines to the guide of the task's area, `docs/wiki/guide-<area, lowercase>.md` (`type: guide`, `area: <AREA>`; `node docs/.sw/sw.mjs explain <ID>` prints its path). No guide yet: create it from `docs/.sw/templates/guide.md` and list it in `index.md`. One line per fact under Layout, Patterns, Verify or Gotchas; replace a line the new fact corrects; keep the page under 60 lines. Do this without asking: the guide is what makes the next task in this area cheaper, because planners and implementers read it instead of exploring.
42
- 9. **File what else was learned.** If the implementer reported a decision or constraint the wiki should hold, offer to save it as a wiki page (`type: decision` or `concept`) and add it to `index.md`. If the task fixed a problem whose cause is now known, offer a `type: lesson` page (Symptom, Cause, Fix, How to notice it earlier); sw-triage finds these later. If it reported follow-up work, offer to create the tasks. These are separate offers: act on each only when the user says yes to that one.
43
- 10. **Report** to the user: outcome, evidence per "Done when" item, files changed, deviations from the plan, and which tasks this unblocked (`node docs/.sw/sw.mjs ready`). Commit only if the user asks.
53
+ | Tool | How |
54
+ | --- | --- |
55
+ | Claude Code | the agent by name. If it is not among your agent types, use a general-purpose agent, tell it to read `<skill-dir>/../sw-config/assets/<role file>` first and follow it, and pass the model from `docs/.sw/config.json` (`models.<role>.claude`) if set |
56
+ | Codex | spawn the custom agent `sw_implementer` or `sw_reviewer` |
57
+ | Copilot CLI | `task` tool with the agent name |
58
+ | No subagents available, the agent is not defined, or the project's rules forbid subagents | follow the role file yourself, in this session, and tell the user the configured model and the clean context were not used. A review done this way is weaker: say so |
44
59
 
45
60
  ## Common mistakes
46
61
 
47
- - Marking `done` because the implementer said so. Done means every "Done when" item has evidence.
62
+ - Marking `done` because the implementer said so. Done means every requirement has evidence.
63
+ - Accepting a `differs` item on the user's behalf. A sensible alternative is still not what the task asked for.
64
+ - Skipping the review on a task that requires it, or doing it yourself in the same context that judged the implementation.
48
65
  - Starting work before the task file says `in-progress`. If the session dies, nobody knows the task was touched.
49
- - Letting the implementer edit the task file or the log. One writer for status: you.
50
- - Reading the plan or the code "to follow along". The implementer already paid for that.
51
- - Skipping the guide update. Every fact left out is explored again by the next task.
66
+ - Letting a subagent edit the task file or the log. One writer for status: you.
67
+ - Reading the plan or the code "to follow along". The subagents already paid for that.
68
+ - Running the next task in the same session out of momentum.
@@ -28,7 +28,7 @@ Tasks:
28
28
 
29
29
  - 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`.
30
30
  - Do not start a task while any of its `deps` is not done.
31
- - Before you change code for a task, read the area guide that `explain <ID>` names (`docs/wiki/guide-<area>.md`): where things are, patterns, how to verify. Afterwards add the facts it was missing, one line each.
31
+ - 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.
32
32
  - Work that belongs to no task (a quick fix, a small request) needs no task file. Append one `change` entry to `log.md` instead: what changed and why, in a line.
33
33
  - `node docs/.sw/sw.mjs status|ready|check <ID>|explain <ID>|search <words>|next-id <AREA>|lint` answers overview, startable tasks, blockers, a task's place in the chain, where something is mentioned, new ids and structural checks without reading files. Run `lint` after you add, rename or relink pages.
34
34
  {{/tasks}}
@@ -115,6 +115,8 @@ export function buildVault(files) {
115
115
  deps: asList(d.deps).map(String), softDeps: asList(d.soft_deps).map(String),
116
116
  milestone: d.milestone || '', priority: d.priority == null || d.priority === '' ? null : Number(d.priority),
117
117
  started: d.started || '', finished: d.finished || '',
118
+ // Any value asks for a separate review before the task may be done; the value names the kind.
119
+ review: d.review ? String(d.review) : '',
118
120
  state: null, wave: 0, dependents: [], plan: null,
119
121
  });
120
122
  }
@@ -436,12 +438,13 @@ function check(ctx) {
436
438
  : `can start: n/a, status is ${t.status}${openDeps}`;
437
439
  const draft = t.plan?.data.status === 'draft' ? ' (draft, not approved)' : '';
438
440
  return {
439
- data: { id: t.id, status: t.status, canStart, canFinish, openDeps: t.openDeps, openSoftDeps, plan },
441
+ data: { id: t.id, status: t.status, canStart, canFinish, openDeps: t.openDeps, openSoftDeps, plan, review: t.review || null },
440
442
  text: [
441
443
  `${t.id} ${t.status} ${t.title}`,
442
444
  startLine,
443
445
  `can finish: ${canFinish ? 'yes' : 'no'}${openSoftDeps.length ? ` open soft deps: ${openSoftDeps.join(', ')}` : ''}`,
444
446
  `plan: ${plan ? plan + draft : 'none'}`,
447
+ `review: ${t.review ? `required (${t.review})` : 'not required'}`,
445
448
  ].join('\n'),
446
449
  };
447
450
  }
@@ -466,6 +469,7 @@ function explain(ctx) {
466
469
  t.priority != null && `priority: ${t.priority}`,
467
470
  t.started && `started: ${t.started}`,
468
471
  t.finished && `finished: ${t.finished}`,
472
+ t.review && `review: ${t.review}`,
469
473
  ].filter(Boolean);
470
474
  return {
471
475
  data: {
@@ -24,8 +24,9 @@ updated: YYYY-MM-DD
24
24
  - What went wrong before and how to avoid it.
25
25
 
26
26
  <!--
27
- One guide per task area: docs/wiki/guide-<area, lowercase>.md, listed in index.md.
28
- Planners and implementers read it instead of exploring, and report what it was missing;
29
- sw-implement adds those lines. One line per fact, 60 lines at most: replace stale lines,
30
- do not append forever. Delete this comment.
27
+ Optional. At most one guide per task area: docs/wiki/guide-<area, lowercase>.md, listed in index.md.
28
+ Start one when several tasks in an area have needed the same facts. Where a guide exists,
29
+ planners and implementers read it first and report what it was missing, and sw-implement
30
+ adds those lines. One line per fact, 60 lines at most: replace stale lines, do not append
31
+ forever. Delete this comment.
31
32
  -->
@@ -7,6 +7,7 @@ deps: []
7
7
  soft_deps: []
8
8
  milestone:
9
9
  priority:
10
+ review:
10
11
  started:
11
12
  finished:
12
13
  ---
@@ -29,5 +30,8 @@ What exists when this is done, and why it matters.
29
30
  id: from `node docs/.sw/sw.mjs next-id <AREA>`; the file is docs/tasks/<id>.md.
30
31
  status: todo | in-progress | done | cancelled. Cancelled tasks stay; ids are never reused.
31
32
  deps: must be done before this starts. soft_deps: may start, cannot finish before them.
32
- Steps go in docs/plans/<id>-plan.md, not here. Delete this comment.
33
+ review: leave empty for no separate review. Any value (for example `required`, or the name of
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.
36
+ Delete this comment.
33
37
  -->
@@ -494,6 +494,8 @@ function buildVault(files) {
494
494
  deps: asList(d.deps).map(String), softDeps: asList(d.soft_deps).map(String),
495
495
  milestone: d.milestone || '', priority: d.priority == null || d.priority === '' ? null : Number(d.priority),
496
496
  started: d.started || '', finished: d.finished || '',
497
+ // Any value asks for a separate review before the task may be done; the value names the kind.
498
+ review: d.review ? String(d.review) : '',
497
499
  state: null, wave: 0, dependents: [], plan: null,
498
500
  });
499
501
  }