ref-reconcile
Skill109 starsChanged 37 days agoMITView on GitHub
Keep a reference scope canonical and internally consistent. SENSE phase (auto) detects issues by invoking ref-audit; FIX phase (human-gated) resolves conflicts, repairs bidirectional link integrity (A cites [[B]] as client → does B back-link?), fixes/removes dangling links, and MERGES duplicate entities into one canonical note. Every write is human-gated — merge and delete stay human even in market/. Company is the default scope.
In this repository61 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adviseSkill
- ai-crystallizeSkill
- analyze-kbSkill
- auto-discoverySkill
- benchmark-memorySkill
- brain-mergeSkill
- changelog-protocolSkill
- coherence-sweepSkill
- compute-lifecycleSkill
- create-articleSkill
- create-explanatory-imageSkill
- decideSkill
- deep-researchSkill
- detect-tensionsSkill
- dialecticSkill
- domain-watchSkill
- elicitation-techniquesSkill
- epistemic-classificationSkill
- epub-chapter-extractorSkill
- extract-document-insightsSkill
- extract-insightsSkill
- find-connectionsSkill
- first-runSkill
- get-perspective-onSkill
- get-youtube-transcriptSkill
- git-commit-pushSkill
- graduate-insightsSkill
- incubation-loopSkill
- ingest-sourceSkill
- insight-capture-formatSkill
- insight-interviewSkill
- integrate-recent-notesSkill
- learn-new-thingsSkill
- manage-reference-dataSkill
- manage-thinking-topicsSkill
- manage-watching-domainsSkill
- multi-format-book-extractorSkill
- nano-banana-image-generatorSkill
- propagate-changeSkill
- quick-searchSkill
- reasoning-checksSkill
- recallSkill
- ref-auditSkill
- ref-bridgeSkill
- ref-ingestSkill
- ref-querySkill
- ref-refreshSkill
- refresh-indexSkill
- ref-supersedeSkill
- scheduled-runSkill
- scope-mountSkill
- search-vaultSkill
- self-diagnosticSkill
- start-hereSkill
- synthesize-insightsSkill
- talkSkill
- test-memory-systemSkill
- think-about-itSkill
- update-changelogSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 64
Bidirectional link repair: if A lists [[B]] (e.g. "Client of [[Ability AI]]") but B has no reciprocal relation, propose adding the …
- Very specific: line 71
remove the duplicate note only after step 3 leaves zero inbound [[links]] to it.
- Distinctive: line 84
After a back-link repair: the reciprocal relation exists on both notes.
- Very specific: line 86
Every edited note carries a new ## Change Log line.
- Distinctive: line 90
Write any fix without explicit human approval of that specific edit (sense is auto.
≈ “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
Ref Reconcile
ℹ️ First, set expectations: before anything else, print one short line with this skill's version and its most recent change — the top entry of
metadata.changelogabove — e.g.ref-reconcile v1.0 — recent: initial version. Then proceed.
The act on top of ref-audit's report. ref-audit senses (read-only, autonomous); ref-reconcile fixes (human-gated). It protects the property that makes a reference scope a source of truth: one canonical note per real-world entity, with consistent bidirectional links and no dangling references.
Read first: resources/layered-brains/COMPANY-BRAIN-SCHEMA.md → "Canonical source of truth" + "The update model"; resources/layered-brains/REFERENCE-SCOPE-SCHEMA.md.
Composes
/ref-audit— the sense/detection pass (do not re-implement the scan here).
State Dependencies
| Source | Location | Read | Write | Description |
| Company family | Brain/Company/*/*.md | ✓ | ✓ (gated) | Entity notes reconciled |
| Audit report | resources/company-brain/reports/ | ✓ | Consumed for detection | |
| LBS index | resources/local-brain-search/data/ | ✓ | ✓ (reindex) | Rebuilt after any write |
Process
Step 1 — SENSE (auto)
Detection has two sources — don't attribute to ref-audit what it doesn't compute:
From /ref-audit (structural, single-authored there — do not re-implement): dangling links, orphan entities, duplicate candidates, plus the frontmatter/provenance/enum/partition/as_of violations. Invoke it (or read its latest report).
In this skill (relational, needs the references-vs-relations judgment ref-audit deliberately avoids):
- Conflicts — two notes asserting contradictory facts about one entity. Read the duplicate/near-name clusters
ref-auditflags and compare their bodies. - Bidirectional-link asymmetry — but only for relation links, never reference links. A
## Relationsentry that names a mutual tie (client: [[B]],Partner of: [[B]],Engagement: [[B]]) should reciprocate; a directional reference (built on [[Trinity]],competitor of [[X]],runs on [[Y]]) must not be forced to back-link.ref-auditreports the family CLEAN despite dozens of such directional links precisely because a blanket A→B⇒B→A check would be almost all false positives — so scope the reciprocity check to relation verbs only:
(The old space-only, capitalized set —cd Brain/Company # Mutual-tie relation links whose reciprocal is worth checking. # Case-insensitive (-i) and connector-agnostic: matches BOTH "Client of [[..]]" and the colon # form "client: [[..]]" the migrated notes actually use. The verb must LEAD the label (~12 chars) # so prose bullets that merely contain a verb word (e.g. "…problem owners…") aren't flagged. # No \b — BSD/macOS grep does not support it. TUNE THE VERB SET to the scope's real vocabulary. grep -rniE '^- [^[]{0,12}(client|partner|vendor|counsel|owner|owns|engagement|collaborat|advis)[^[]*\[\[' */*.mdClient of|Vendor to|…— matched only 4 of the family's ~28 mutual relations; the family is predominantly lowercase colon-form.) For each match, confirm the named target carries the reciprocal relation; if not, it's a repair candidate (Step 2).
Step 2 — FIX (every write gated)
For each issue, propose the concrete edit, show the before/after, and get explicit approval (AskUserQuestion) before writing. CRM and market alike — merge/delete are human in every scope.
- Bidirectional link repair: if
Alists[[B]](e.g. "Client of [[Ability AI]]") butBhas no reciprocal relation, propose adding the back-link toB's## Relations. Append a## Change Logline on the edited note. - Dangling link: the target note doesn't exist → propose either (a) correct the link to the real entity, or (b) remove it, or (c) create the missing entity via
/ref-ingest. Ask which. - Conflict: two notes assert contradictory facts about one entity → present both, ask which is current; the loser is either corrected (overwrite via the note body) or, if a validity window closed, handed to
/ref-supersede. - Duplicate MERGE (the canonical act): two notes are the same real-world entity →
- choose the canonical note (usually the better-linked / more complete),
- fold the duplicate's unique facts +
[[relations]]into it, - repoint every inbound link:
grep -rl "\[\[<Duplicate Name>\]\]" Brain/Company/→ rewrite each to[[<Canonical Name>]], - remove the duplicate note only after step 3 leaves zero inbound
[[links]]to it; if history or lingering references matter, keep astatus: superseded+superseded_by: [[Canonical]]tombstone instead (which keeps the name resolvable), - append a
## Change Logline on the canonical note noting the merge + source — name the merged duplicate as plain text, NOT a[[wiki-link]]. A wiki-link to a hard-removed note is itself a fresh dangling link (it would fail the very check this skill enforces); a[[Duplicate]]reference may remain only on the tombstone path, where the note still exists.
Step 3 — Reindex after any write
cd resources/local-brain-search && ./run_index.sh && ./run_daemon.sh restart # :7437, RESTART not reload(No BDG bootstrap — reference notes are BDG-excluded.) If nothing was written (all issues declined), skip.
Verification
- After a merge:
grep -ril "<duplicate name>" Brain/Company/returns only the canonical note (or a tombstone); no inbound[[link]]still points at the removed duplicate — including the canonical note's own Change Log line (reference the merged name as plain text, so the merge does not re-introduce the dangling link it just resolved). - After a back-link repair: the reciprocal relation exists on both notes.
- Re-running
/ref-auditshows the fixed issues cleared and no new dangling links introduced by the edits. - Every edited note carries a new
## Change Logline.
This skill must refuse to
- Write any fix without explicit human approval of that specific edit (sense is auto; every fix is gated).
- Merge/delete on a hunch — a merge requires confirmed same-entity identity.
- Set any provenance but
reference, or crystallize/lifecycle-classify/promote a record into a cognitive insight.
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.

