vault-clean
Skill372 starsChanged 8 months agoMITView on GitHub
Detect and resolve orphaned notes in the vault. Use during heartbeat maintenance or when vault status shows orphans. Finds notes with no inbound wikilinks and either connects them to the graph or flags them for cleanup.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- install-rhoSkill
- auto-memorySkill
- code-assistSkill
- codebase-summarySkill
- code-task-generatorSkill
- create-sopSkill
- evalSkill
- memory-consolidateSkill
- pdd-buildSkill
- pddSkill
- release-changelogSkill
- rho-cloud-emailSkill
- rho-cloud-onboardSkill
- session-searchSkill
- small-improvementSkill
- update-piSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run the detection script to get the current orphan list:
- Very specific: line 37
Add a [[slug]] wikilink from the parent to the orphan
- Very specific: line 38
If the orphan's own ## Connections section is missing links, add those too
- Very specific: line 44
Delete the orphan file: rm ~/.rho/vault/<type>/<slug>.md
- Very specific: line 48
Add it to the appropriate section in _index.md (Projects, References, Concepts, Patterns, Logs)
- Very specific: line 49
Ensure the note has a proper ## Connections section linking back
- Distinctive: line 53
Verify it's truly not needed (check if any task or active project references it)
- Distinctive: line 59
After processing, rerun the detection script.
- Distinctive: line 64
When running during heartbeat, process max 5 orphans per cycle to stay lightweight.
- Distinctive: line 79
Never delete a note without reading it first
- Distinctive: line 80
If unsure whether to delete, connect it instead (safe default)
- Very specific: line 81
Always update _index.md when promoting
- Very specific: line 82
After edits, verify the note renders correctly with vault read
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Vault Orphan Cleanup
Resolve orphaned notes in ~/.rho/vault/ -- notes that exist but have no inbound [[wikilinks]] from any other note.
Step 1: Detect Orphans
Run the detection script to get the current orphan list:
TMPDIR="$PREFIX/tmp"
# All note slugs
find ~/.rho/vault -name "*.md" -not -name "_inbox.md" | while read f; do
basename "$f" .md
done | sort -u > "$TMPDIR/vault-slugs.txt"
# All wikilink targets
rg -oN '\[\[([^\]]+)\]\]' ~/.rho/vault --no-filename -r '$1' | sort -u > "$TMPDIR/vault-links.txt"
# Orphans: notes with zero inbound links
comm -23 "$TMPDIR/vault-slugs.txt" "$TMPDIR/vault-links.txt" | grep -v "^_index$"Step 2: Triage Each Orphan
For each orphaned note, read it with vault read and classify it:
A. Connect It (most common)
The note has value but nobody links to it. Fix by:
- Find the right MOC or parent note (check
_index, project notes, topic MOCs) - Add a
[[slug]]wikilink from the parent to the orphan - If the orphan's own
## Connectionssection is missing links, add those too
B. Merge It
The note duplicates content already in another note. Fix by:
- Identify the canonical note
- Move any unique content from the orphan into the canonical note
- Delete the orphan file:
rm ~/.rho/vault/<type>/<slug>.md
C. Promote It
The note is important enough to be a new section in _index.md. Fix by:
- Add it to the appropriate section in
_index.md(Projects, References, Concepts, Patterns, Logs) - Ensure the note has a proper
## Connectionssection linking back
D. Delete It
The note is stale, empty, or no longer relevant. Fix by:
- Verify it's truly not needed (check if any task or active project references it)
- Delete:
rm ~/.rho/vault/<type>/<slug>.md - Clean up any outbound links from _index or other notes that might reference it
Step 3: Verify
After processing, rerun the detection script. Orphan count should decrease. Report: how many connected, merged, promoted, deleted.
Batch Processing
When running during heartbeat, process max 5 orphans per cycle to stay lightweight. Prioritize by:
- Notes linked from
_index.mdthat don't exist yet (broken links) -- create stubs - Recently created orphans (likely just missed during initial capture)
- Older orphans (may be stale, more likely to delete)
Common Orphan Patterns
- Date-prefixed notes (e.g.
2026-02-05-email-rollback): Usually operational runbooks. Connect to the relevant project note. - Draft content (e.g.
reddit-localllama-draft,x-drafts): Connect to a drafts MOC or the project they support. - Generic names (
BACKLOG,TODO,ENGINEERING): Often subdirectory artifacts from project imports. Usually merge into the project note or delete if redundant. - Newly captured notes: Just need a link from
_index.mdor the relevant MOC.
Guardrails
- Never delete a note without reading it first
- If unsure whether to delete, connect it instead (safe default)
- Always update
_index.mdwhen promoting - After edits, verify the note renders correctly with
vault read
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.

