commune-dump
Intake and connect. Two files out, no note written, no edit to src/content/.
Run every command from the wiki root — the directory holding src/content and
node_modules. Pass no --root. $COMMUNE is the executable path step 1
prints; run it directly, with no node in front. <slug> below always means
<yyyy-mm-dd>-<target-slug>, the dump file's own stem, where <target-slug> is
the target's title lowercased with every run of non-alphanumerics turned into
one hyphen. Create dumps/ if the wiki has none.
Rules
- Write the dump verbatim, as plain paragraphs, never fenced and never
indented as code:
graph relatedstrips code before matching, so a fenced dump has zero mentions. Verbatim includes the sentence that told you where the note goes; it stays in the body and is also recorded intarget:. mentions,unmatchedandunreferencedare candidates for the human, never targets. The draft is never scored on them.- Deciding what counts as a subject is your judgement. Deciding whether a note exists for it is the CLI's. Never filter graph results in prose.
- Never install anything. Never run
npx @dmthepm/commune.
Steps
Preflight. Run
node scripts/preflight.mjs. On success it prints one line, the CLI path; call it$COMMUNE. Any non-zero exit is a stop: show its line, install nothing. Read every--jsonpayload through... --json | node scripts/preflight.mjs --schema, which passes the document through unchanged and stops the skill on any other schema.Write the dump file. Input: the text the user gave. If it is a Monologue note id rather than text, read
references/monologue.mdfirst. Ask one question, covering only what the text does not answer: which note is this for — an existing file, or a new one in which collection — and, for a new one, what it is called. Never invent the title. It is what step 3 compares against and what every later path is named from. Output:dumps/<slug>.md, frontmatter perreferences/handoffs.md, body verbatim. If that path already exists, stop and say so; a dump is never overwritten.Baseline, and the name collision. Run
$COMMUNE check --jsonand keepsummaryfields inbaseline, plusbaseline.findings: every finding projected to(rule, file, target), usingnullfor an absent target. Two collision cases, one stop:- The target exists: any
duplicate-namefinding naming its title or an alias. - The target is new:
checkcannot see a file that is not there, so compare the answered title and aliases against everytitleandaliasesentry in$COMMUNE graph query --json, case-insensitively. Either way, write.connect.mdwithstatus: blockedand the collision induplicate_name, stop, and name the two files. The link lookup is last-wins: a colliding note silently steals the older note's inbound links, and no later step catches it.
- The target exists: any
Connect. Input: the dump file. In order:
$COMMUNE graph related - --json < dumps/<slug>.md→mentions.- If the target file already exists,
$COMMUNE graph related <target> --json→target.inboundandtarget.outbound; then one$COMMUNE graph query --json, where every entry carries its owninboundarray — its length is the countat_riskneeds for each resolved outbound link. - List the dump's subjects yourself — the proper nouns, projects and claims a
reader would expect a note for — one phrase per line, and pipe that list to
$COMMUNE graph related - --json. You wrote the list, so you carry each phrase's sentence across yourself; the CLI only answers whether a note exists. A subject is matched when it equals a returned mention'smatchedortitle, ignoring case and spacing; the rest isunmatched. $COMMUNE graph query --unreferenced --json→unreferenced. Tag every mention and unmatched phrase with the sentence that produced it and its tense, perreferences/handoffs.md.
Write the connect file. Output:
dumps/<slug>.connect.md, keys exactly asreferences/handoffs.mdgives them,status: ready,files:seeded with the target path. A new note follows the naming its collection already uses — read one existing filename before you guess it. Body:## What I ran(the commands, verbatim),## Candidates(each with its sentence, in the human's words, and what linking or not linking it would do to the graph),## Handoff.Hand off. Print the two paths and say: "Run
commune-write." Do not draft. Do not editsrc/content/. Do not commit.
Stop conditions
- Preflight failed, or a payload is not schema 1 → show the line, stop.
- A name collision on the target →
status: blocked, stop. - The dump file already exists → stop; never overwrite a dump.
- The dump names no target and the user does not answer → stop; the target is the one thing every later step needs.
checkerrors that already existed → not a stop. They are the baseline;commune-shipdiffs against it.