sw-lint
Skill4 starsChanged 57 days agoMITView on GitHub
Use when the user asks to check, lint, health-check, clean up or audit the Superwiki vault or wiki, after bulk edits or a migration, or invokes sw-lint or sw:lint.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sw-boardSkill
- sw-configSkill
- sw-doctorSkill
- sw-doSkill
- sw-explainSkill
- sw-implementSkill
- sw-ingestSkill
- sw-initSkill
- sw-migrateSkill
- sw-planSkill
- sw-runSkill
- sw-statsSkill
- sw-summarizeSkill
- sw-triageSkill
- sw-visualizeSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Run node docs/.sw/sw.mjs lint from the project root.
- Distinctive: line 37
Run lint again and state the before and after counts.
- Very specific: line 43
Read index.md. Collect follow-ups that ingests deferred: find the last lint entry with grep -n '^## \[.*\] lint' docs/log.md | tail -1 and …
- Very specific: line 44
Read the wiki pages. Up to about twenty pages, read them all.
- Very specific: line 55
Run node docs/.sw/sw.mjs lint once more if you edited anything after the last run.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
sw-lint
Two passes. The first is a script and costs almost nothing. The second reads pages and costs tokens, so it runs only when the user approves it.
Pass 1: structure (always)
- Run
node docs/.sw/sw.mjs lintfrom the project root. Read only its output, not the vault. It exits with code 1 while errors remain; that is expected. - Fix broken links first, then run lint again, because one rename produces several findings (
broken-linkin every page that linked the old name, plusnot-in-indexandorphan-pagefor the new one).- A rename is established when exactly one page is reported
not-in-indexororphan-pageand its name is a variation of the broken target. Re-point every[[old]]to[[new]]in the files lint named, includingindex.mdand task files. - Two candidates, or no resemblance: do not guess. Report it.
- A rename is established when exactly one page is reported
Fix what else has one correct answer:
Finding Fix stale-board,missing-boardnode docs/.sw/sw.mjs board: it rewrites the task list inindex.mdfrom the task files. Never edit that list by handnot-in-indexadd - [[page]]: summarytoindex.md, using the page'ssummary:missing-fieldsummarycopy it from the page's line in index.md; if there is none, read the page and write itmissing-fieldtyperead that page, write the field missing-datefill from git log --follow --format=%ad --date=short -- <file>when the project is under git and the date is unambiguousReport the rest and let the user decide. Do not change a task's
statusordepsto silence a finding.Finding Why it needs a human started-before-deps,done-before-deps,dep-cycle,cancelled-depeither the status or the dependency is wrong; only the user knows which done-unverifiedthe task is donebut its## Summaryholds an unverified or failed item. Run sw-summarize for it; do not edit a verdict by handmissing-dateyou could not fillno history to take it from, or it hangs on a finding above duplicate-nameone of the pages must be renamed and every link to it re-pointed broken-linkwith no clear target,orphan-plan,unknown-depthe page may be missing or the reference stale orphan-pagemay be fine; may want a link from a related page - Run lint again and state the before and after counts.
Pass 2: meaning (ask first)
Offer it with its size: "The wiki has N pages; a semantic review reads them. Run it?" (N from node docs/.sw/sw.mjs status). If approved:
- Read
index.md. Collect follow-ups that ingests deferred: find the last lint entry withgrep -n '^## \[.*\] lint' docs/log.md | tail -1and read the log from that line to the end (the whole log only if there is no lint entry and it is short; otherwisetail -60). - Read the wiki pages. Up to about twenty pages, read them all; beyond that, go group by group (same
type, or linked to each other). Open a file inraw/only to settle whether two pages really contradict each other. Look for:- claims that contradict each other;
- a
decisionpage superseded by a later one without saying so; - concepts named on several pages that have no page of their own;
- pages that should link to each other and do not;
- summaries or titles that no longer match the page;
- each collected follow-up: still needed, or already handled.
- Present the findings as a numbered list with the pages involved, and say which ones you recommend applying now. Apply only what the user agrees to.
Finish
- Run
node docs/.sw/sw.mjs lintonce more if you edited anything after the last run. Append to
docs/log.md, in the layout its last entries use:## [YYYY-MM-DD] lint | <N> fixed, <M> open Fixed: <what>. Open: <findings left for the user>. Follow-up: <semantic findings and ingest follow-ups not yet handled>.Carry every unhandled follow-up into this entry: the next lint reads only from here on. Name a page that was renamed or removed in backticks, not as a
[[link]].
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

