| name | ref-reconcile |
| description | 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. |
| automation | gated |
| allowed-tools | ["Read","Write","Edit","Bash","Glob","Grep","AskUserQuestion","Skill"] |
| user-invocable | true |
| argument-hint | [scope=Company] [--issue links|duplicates|conflicts|all] |
| metadata | {"version":"1.1","created":"2026-07-08T00:00:00.000Z","author":"Cornelius","changelog":["1.2: Two fixes (validated 2026-07-08) — (a) the Step 1 relation-verb grep was case-sensitive with a 5-verb space-only set and matched 4 of ~28 real mutual relations (the family uses lowercase colon-form: `client:`, `Partner of:`, `Security vendor for:`); replaced with a case-insensitive, connector-agnostic, BSD-portable regex. (b) Step 2 merge could self-inflict a dangling link — a `## Change Log` line naming the hard-removed duplicate as `[[wiki-link]]` dangles; now plain-text the merged name (or use the tombstone path).","1.1: Fix — Step 1 wrongly attributed conflict + back-link-asymmetry detection to ref-audit (which computes neither); those now detected in-skill, with a relations-vs-references scope so directional links aren't false-flagged","1.0: Initial version — sense (composes ref-audit) + gated fix (back-link repair, dangling-link fix, duplicate merge); reindex after writes"]} |
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.changelog above — 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 flags and compare their bodies.