sw-init
Skill4 starsChanged 57 days agoMITView on GitHub
Use when the user asks to set up, initialize, scaffold or upgrade a second brain, LLM wiki or Superwiki vault in a project's docs folder, or invokes sw-init or sw:init.
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-lintSkill
- 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
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Upgrade or new?: If docs/.sw/config.json exists this is an upgrade: skip step 3 and run the script with no flags.
- Very specific: line 18
If on, the area prefixes for task ids (M-01, B-01).
- Very specific: line 30
Check: run node docs/.sw/sw.mjs lint.
≈ “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-init
Turns docs/ into a Superwiki vault: an LLM-maintained wiki that is also an Obsidian vault, with an optional task module. A script does the scaffolding; do not create the files by hand.
The vault is always <project root>/docs. Run every command below from the project root. <skill-dir> is the directory this SKILL.md is in.
Steps
- Check Node:
node --versionmust be 18 or newer. If not, go to "Without Node". - Upgrade or new? If
docs/.sw/config.jsonexists this is an upgrade: skip step 3 and run the script with no flags; it reuses the saved choices. - Ask the user, in one message (new vault only):
- Task module on or off. Recommend on when the project is mainly code, off for a pure knowledge base.
- If on, the area prefixes for task ids (
M-01,B-01). Recommend the single default areaTunless the project already has separately named parts. Area names are optional labels; do not ask for them separately. - 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.
Run the script, with the flags that match the answers.
--skillstakes the agents, comma-separated:claude,codex,copilotorall. Without it no skills are copied.node <skill-dir>/scripts/init.mjs --tasks # tasks on, default area T node <skill-dir>/scripts/init.mjs --tasks --areas "M=Mobile,B=Backend" # tasks on, named areas node <skill-dir>/scripts/init.mjs --no-tasks # wiki only node <skill-dir>/scripts/init.mjs --tasks --skills claude,codex # tasks on, skills in the repository for Claude Code and Codex node <skill-dir>/scripts/init.mjs # upgrade- Check: run
node docs/.sw/sw.mjs lint. A new vault reports0 errors, 0 warnings. On an upgrade, findings are about the user's existing pages: show them, do not fix them unasked. Report to the user from the script's output. Each line starts with a status:
Status Say created,updatedwhat is new or changed created,updatedfor.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 kept,unchangedthat user content and settings were not touched (one sentence, no list) 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 thatmissingthat this Superwiki build lacks the file; name it, and do not point the user at it noteaboutCLAUDE.mdoffer to add the @AGENTS.mdline. Add it only after the user agrees to that specific changenote"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 "docs/ already had content" that content is untouched and outside the vault; sw-migrate converts it End with how to look at the result: open
docs/as an Obsidian vault, or opendocs/viewer.htmlin Chrome or Edge and pick the project folder (only if the viewer was not reportedmissing).
What the script guarantees
| File | On re-run |
docs/index.md, docs/log.md, everything in raw/, wiki/, tasks/, plans/ | kept |
docs/.sw/sw.mjs, docs/.sw/templates/, docs/viewer.html | replaced with this version |
AGENTS.md | only the Superwiki block (from the sw:start comment to the sw:end comment) is replaced |
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 |
.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 |
Without Node
The script and docs/.sw/sw.mjs need Node 18 or newer. If node is missing or older, say so and stop; continue by hand only if the user asks for that. By hand: create docs/{raw/assets,wiki} (plus tasks, plans), copy assets/templates/ to docs/.sw/templates/ and assets/viewer.html to docs/, write index.md and log.md as the script would, and paste assets/agents-block.md into AGENTS.md with the {{...}} lines resolved. Tell the user the sw.mjs commands in that block will not work until Node is installed.
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.

