agentleFS
mhmtsrfglumhmtsrfglu/superwiki/skills/sw-lint/SKILL.md

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.

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
  1. Very specific:

    Run node docs/.sw/sw.mjs lint from the project root.

    line 12
  2. Distinctive:

    Run lint again and state the before and after counts.

    line 37
  3. Very specific:

    Read index.md. Collect follow-ups that ingests deferred: find the last lint entry with grep -n '^## \[.*\] lint' docs/log.md | tail -1 and …

    line 43
  4. Very specific:

    Read the wiki pages. Up to about twenty pages, read them all.

    line 44
  5. Very specific:

    Run node docs/.sw/sw.mjs lint once more if you edited anything after the last run.

    line 55

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

  1. Run node docs/.sw/sw.mjs lint from the project root. Read only its output, not the vault. It exits with code 1 while errors remain; that is expected.
  2. Fix broken links first, then run lint again, because one rename produces several findings (broken-link in every page that linked the old name, plus not-in-index and orphan-page for the new one).
    • A rename is established when exactly one page is reported not-in-index or orphan-page and its name is a variation of the broken target. Re-point every [[old]] to [[new]] in the files lint named, including index.md and task files.
    • Two candidates, or no resemblance: do not guess. Report it.
  3. Fix what else has one correct answer:

    FindingFix
    stale-board, missing-boardnode docs/.sw/sw.mjs board: it rewrites the task list in index.md from the task files. Never edit that list by hand
    not-in-indexadd - [[page]]: summary to index.md, using the page's summary:
    missing-field summarycopy it from the page's line in index.md; if there is none, read the page and write it
    missing-field typeread 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 unambiguous
  4. Report the rest and let the user decide. Do not change a task's status or deps to silence a finding.

    FindingWhy 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 done but its ## Summary holds an unverified or failed item. Run sw-summarize for it; do not edit a verdict by hand
    missing-date you 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-link with 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
  5. 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:

  1. Read index.md. Collect follow-ups that ingests deferred: find the last lint entry with grep -n '^## \[.*\] lint' docs/log.md | tail -1 and read the log from that line to the end (the whole log only if there is no lint entry and it is short; otherwise tail -60).
  2. 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 in raw/ only to settle whether two pages really contradict each other. Look for:
    • claims that contradict each other;
    • a decision page 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.
  3. 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

  1. Run node docs/.sw/sw.mjs lint once more if you edited anything after the last run.
  2. 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]].

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.