superwiki 0.1.2 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +3 -3
- package/package.json +1 -1
- package/skills/sw-config/SKILL.md +19 -8
- package/skills/sw-config/assets/reviewer.md +41 -0
- package/skills/sw-config/scripts/config.mjs +6 -1
- package/skills/sw-implement/SKILL.md +32 -20
- package/skills/sw-init/assets/sw.mjs +5 -1
- package/skills/sw-init/assets/templates/task.md +5 -1
- package/skills/sw-init/assets/viewer.html +2 -0
- package/skills/sw-init/scripts/init.mjs +178 -99
- package/skills/sw-migrate/SKILL.md +36 -25
- package/skills/sw-migrate/scripts/migrate.mjs +422 -180
|
@@ -5,7 +5,7 @@ description: Use when the user wants to convert an existing docs folder, task in
|
|
|
5
5
|
|
|
6
6
|
# sw-migrate
|
|
7
7
|
|
|
8
|
-
Converts a project that tracks work in markdown tables into a Superwiki vault: one file per task, wikilinks, an append-only log. A script does the
|
|
8
|
+
Converts a project that tracks work in markdown tables into a Superwiki vault: one file per task, wikilinks, an append-only log. A script inspects the existing files and does the conversion from a mapping you write. You never read the index yourself; it can be hundreds of kilobytes.
|
|
9
9
|
|
|
10
10
|
Run everything from the project root. `<skill-dir>` is this skill's directory; `<init-dir>` is the sw-init skill's directory (a sibling folder).
|
|
11
11
|
|
|
@@ -19,43 +19,54 @@ Stop and tell the user if any of these fails; do not work around them.
|
|
|
19
19
|
|
|
20
20
|
## Steps
|
|
21
21
|
|
|
22
|
-
1. **Branch
|
|
23
|
-
2. **
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
- `
|
|
27
|
-
- The status values in use: `grep -o '| *[A-Za-z ✅]* *|' ... | sort | uniq -c` on the status column, or read ten rows.
|
|
28
|
-
3. **Write the mapping** to a temporary file outside the repo. `node <skill-dir>/scripts/migrate.mjs --help` prints the format. Decide:
|
|
29
|
-
- which columns are id, title, status, dependencies, milestone, order, dates;
|
|
30
|
-
- every status value → `todo`, `in-progress`, `done` or `cancelled`;
|
|
22
|
+
1. **Branch.** The conversion belongs on its own branch. If the project lets you run git, `git switch -c sw-migrate`; if it does not, or you are already on a branch the user made for this, ask the user to confirm the branch and stay on it. Never merge, push or delete a branch yourself.
|
|
23
|
+
2. **Inspect**: `node <skill-dir>/scripts/migrate.mjs --inspect`. It prints, for every file that lists tasks: the tables with their line, row count and columns, the values of status-like columns with their counts, and how many per-task headings a file has. It also warns when `docs/wiki/`, `docs/tasks/` or `docs/plans/` already exist. This output is all you need for the mapping; do not open the files.
|
|
24
|
+
3. **Write the mapping** to a temporary file outside the repo. `node <skill-dir>/scripts/migrate.mjs --help` prints the format. Decide, from the inspect output:
|
|
25
|
+
- the index file, and which columns are id, title, status, dependencies, milestone, order and dates;
|
|
26
|
+
- every status value → `todo`, `in-progress`, `done` or `cancelled`. Write the value as inspect shows it; decoration such as a check mark is already stripped;
|
|
31
27
|
- the marker for soft dependencies, if the project has them;
|
|
32
|
-
-
|
|
28
|
+
- other columns worth keeping: as frontmatter (`fields`, for short values such as a review class) or as a body section (`sections`, for prose such as sources and notes);
|
|
33
29
|
- where per-task detail sections live and their heading prefix;
|
|
34
|
-
- the
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
- the table that is the changelog, if any. It may be in the index file itself;
|
|
31
|
+
- `archiveAlso`: anything in `docs/wiki/`, `docs/tasks/` or `docs/plans/` that the mapping does not consume. Superwiki owns those folders.
|
|
32
|
+
4. **Dry run**: `node <skill-dir>/scripts/migrate.mjs --mapping <file> --dry-run`. The report has two parts:
|
|
33
|
+
- `PROBLEMS`: each one must be fixed, in the mapping or in the files, and the dry run repeated until it says `no problems`. An unknown status is a question for the user, not a guess.
|
|
34
|
+
- "For information": files whose links were rewritten, detail sections without a row, links that now point into the archive. Nothing to fix; pass the counts on.
|
|
35
|
+
5. **Show the user the mapping and the dry-run report, and wait for approval.** Put the task counts per status next to the project's own numbers (inspect's status counts, or the project's summary table). If they differ, find out why before going on.
|
|
36
|
+
6. **Convert**: the same command without `--dry-run`, then the `init.mjs` command the report prints, with real area names in place of the repeated ids, then `node docs/.sw/sw.mjs status` and `node docs/.sw/sw.mjs lint`.
|
|
37
|
+
7. **Verify.** `status` shows `ready` and `blocked` where the report said `todo`: their sum must equal the todo count, and the other counts must match as they are. `lint` must have 0 errors. An error here is a real inconsistency in the source (a task started before its dependency finished, a dependency cycle): report it; do not edit task files to make it pass.
|
|
39
38
|
8. **Report** what moved where, the counts, the lint result, and what is left for a human decision (next section). Commit only if the user asks.
|
|
40
39
|
|
|
41
|
-
## What the
|
|
40
|
+
## What the conversion does
|
|
41
|
+
|
|
42
|
+
So that you can tell the user without looking:
|
|
43
|
+
|
|
44
|
+
- every row of the task tables becomes `docs/tasks/<ID>.md`, with its detail section and the kept columns as the body;
|
|
45
|
+
- the changelog becomes `docs/log.md`, oldest entry first;
|
|
46
|
+
- the index, the detail files, the changelog and everything in `archiveAlso` move to `docs/legacy/`, keeping their layout;
|
|
47
|
+
- links to tasks become wikilinks everywhere under `docs/`, so other documents are edited too; the report lists them;
|
|
48
|
+
- `init.mjs` then adds `docs/index.md`, the viewer, the CLI and the Superwiki block in `AGENTS.md`.
|
|
49
|
+
|
|
50
|
+
## What it leaves for the user
|
|
42
51
|
|
|
43
52
|
Tell the user about each of these; act only on what they choose.
|
|
44
53
|
|
|
45
54
|
| Left over | Where it is | Options |
|
|
46
|
-
|
|
47
|
-
| Rules and conventions written in the old index | `docs/legacy/` | most are replaced by the Superwiki block in `AGENTS.md`; project-specific ones go to `AGENTS.md` outside
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Rules and conventions written in the old index | `docs/legacy/` | most are replaced by the Superwiki block in `AGENTS.md`; project-specific ones go to `AGENTS.md` outside that block |
|
|
48
57
|
| Milestones, glossaries, decision records in the old index | `docs/legacy/` | turn into `docs/wiki/` pages with `type:` and `summary:`, and list them in `index.md` |
|
|
49
|
-
| Research, specs, decisions in other folders |
|
|
50
|
-
| Plans written by other tools |
|
|
51
|
-
| The old viewer or scripts that parse the old index |
|
|
52
|
-
| Instructions in `AGENTS.md` / `CLAUDE.md` that
|
|
58
|
+
| Research, specs, decisions in other folders | in place, outside the vault | leave, or move into `raw/` (sources) or `wiki/` (maintained pages) |
|
|
59
|
+
| Plans written by other tools | in place, or in the archive if they were under `docs/plans/` | leave, or turn one into `docs/plans/<ID>-plan.md` when it belongs to exactly one task |
|
|
60
|
+
| The old viewer or scripts that parse the old index | in place | delete once `docs/viewer.html` shows the same numbers |
|
|
61
|
+
| Instructions in `AGENTS.md` / `CLAUDE.md`, and links in files outside `docs/`, that point at the old index | in place | rewrite to point at the Superwiki rules and the new task files; show the diff first |
|
|
62
|
+
| Task files that carry a long history (plan, review record, daily notes in one section) | `docs/tasks/` | leave; new tasks keep the plan in `docs/plans/` and history in the log |
|
|
53
63
|
|
|
54
64
|
`docs/legacy/` is an archive, not part of the vault. Delete it only when the user says so.
|
|
55
65
|
|
|
56
66
|
## Common mistakes
|
|
57
67
|
|
|
58
|
-
-
|
|
68
|
+
- Opening the index or the detail files to "understand them first". Inspect and the dry run tell you what is there and what did not parse.
|
|
59
69
|
- Mapping a status the script reported as unknown to `todo` without asking. Ask what it means.
|
|
70
|
+
- Leaving a line under `PROBLEMS` and converting anyway.
|
|
60
71
|
- Fixing lint errors by changing statuses. The old data was inconsistent; the user decides which side is right.
|
|
61
|
-
- Hand-editing
|
|
72
|
+
- Hand-editing links. If the script missed a link shape, report it.
|