vault-correct
Skill18 starsChanged 12 days agoApache-2.0View on GitHub
Sweeps a corrected fact through the OKF v0.2 knowledge vault by updating the single authoritative note, refactoring stale restatements into wikilinks, and preserving historical records byte-for-byte. Use when the user invokes /vault-correct, asks to correct a vault fact or update an obsolete claim, or when superseded claims are detected during /distill-session or /ingest. Don't use for creating new notes from raw files (use ingest) or read-only vault searches (use vault-query).
In this repository10 other files it gives its agents.
- rules/AGENTS.mdAGENTS.md
- distill-sessionSkill
- ingestSkill
- knowledge-compilerSkill
- vault-graphSkill
- vault-lintSkill
- vault-pullSkill
- vault-querySkill
- vault-shareSkill
- wikiskillSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
/ingest: When a newly ingested document or proposal carries a newer timestamp and directly contradicts an older claim in an entity or … - Very specific: line 28
/distill-session: When an active session empirically disproves a previous assumption (always run Plan preview first, verify --stale … - Very specific: line 92
Run the vault correction utility without --apply first to inspect classifications and diffs:
- Distinctive: line 106
When invoking from Python or tests:
- Very specific: line 125
Run python3 <plugin_dir>/scripts/vault_lint.py "${OBSIDIAN_VAULT_PATH:-$HOME/ObsidianVault}" to confirm that all newly inserted wikilinks …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 Correct & Write-Correctness Sweep (/vault-correct)
This skill sweeps a corrected fact through the central Knowledge Compiler Obsidian Vault ($OBSIDIAN_VAULT_PATH or ~/ObsidianVault). It implements the Write-Correctness Laws to eradicate knowledge staleness and contradiction drift while strictly guarding historical decision ledgers, frontmatter, code blocks, links, and instruction files.
🚀 Triggers & Invocations
1. Explicit User Command
/vault-correct "<the corrected fact, stated as it is now true>" --stale "<old claim>" [--target "<authoritative note>"] [--replacement "<exact body substitution>"] [--apply]Examples:
- Preview Plan/Diff (safe default, writes 0 files):
/vault-correct "Cloud Run supports 32GiB RAM" --stale "16GiB RAM" --target "Cloud Run Limits" - Apply changes atomically after reviewing the diff:
/vault-correct 'AcmeCorp MySQL spend is $25,000/mo across 20 Aurora clusters' --stale '$30k+/mo' --target "AcmeCorp" --apply
2. Autonomous Trigger (Zero-Toil Mode)
Triggered during:
/ingest: When a newly ingested document or proposal carries a newer timestamp and directly contradicts an older claim in an entity or concept note./distill-session: When an active session empirically disproves a previous assumption (always run Plan preview first, verify--stale "<old>", then pass--apply).
📐 Execution Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ VAULT CORRECT EXECUTION PIPELINE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ [Step 1: Exact Sweep (--stale required)] │
│ Scan living vault notes while excluding reserved/instruction/symlink paths │
│ │ │
│ ▼ │
│ [Step 2: Tri-State Classification] │
│ Classify every matching note into: │
│ 1. AUTHORITATIVE: Single source of truth (wiki/entities/ or wiki/concepts)│
│ 2. RESTATEMENT: Living notes asserting the stale claim │
│ 3. HISTORICAL: Past records (raw/, wiki/sources/, dated, log.md) │
│ │ │
│ ▼ │
│ [Step 3: Plan / Diff Preview (Default)] │
│ • Inspect unified diff across body prose only │
│ • Frontmatter, fenced code, inline code, and [[wikilinks]] are masked │
│ • Reserved paths (GEMINI.md, AGENTS.md, index.md, skills/, rules/) excluded│
│ │ │
│ ▼ │
│ [Step 4: Atomic Apply with SHA-256 CAS (--apply)] │
│ • Verify pre-write SHA-256 hashes (exit code 2 on concurrent modification) │
│ • Write temp + fsync + os.replace atomically; append audit entry to log.md │
│ │
└─────────────────────────────────────────────────────────────────────────────┘🛡️ The Hard Rails (Safety Invariants)
- Plan-by-Default & Explicit
--stale:- Running
vault_correct.pywithout--applyruns a read-only Plan/Diff preview (0files modified;--dry-runis also accepted as an explicit preview flag). --stale "<old>"is required whenever refactoring restatements or doing in-place phrase replacement. No heuristic keyword guessing is performed.
- Running
- Historical & Reserved Files are Untouchable:
- Notes under
raw/,archive/,meetings/,1-1/,journal/,incidents/, andwiki/sources/are never edited. - Reserved instruction, index, and config paths (
GEMINI.md,AGENTS.md,CLAUDE.md,.agents/,.gemini/,rules/,skills/,hooks.json,plugin.json,index.md,wiki/skill-impact.md) and symlinks are hard-excluded from mutation. - Any note whose filename carries explicit date provenance (
YYYY-MM-DDor(YYYY-MM)) or whose frontmatterstatusissuperseded,archived,completed,deprecated, ordoneis never edited. log.mdpast entries are never edited (only a new audit entry is appended upon--apply).
- Notes under
- Frontmatter, Code & Link Masking:
- YAML frontmatter (
title,tags,aliases,sources,generated,verified) is separated before any body replacement and never altered (onlyupdated:is bumped when body bytes change). - Fenced code blocks, inline backtick code spans, and existing
[[wikilinks]]are masked so they are never corrupted or double-wrapped.
- YAML frontmatter (
- SHA-256 CAS & Atomic Writes:
- Writes verify pre-write SHA-256 digests (
exit 2on CAS conflict) and persist via temporary file +fsync+os.replace.
- Writes verify pre-write SHA-256 digests (
- Table Pipe Invariant:
- In Markdown tables, never escape the pipe character within a wikilink alias (always
[[Target|Alias]], never[[Target\|Alias]]).
- In Markdown tables, never escape the pipe character within a wikilink alias (always
⚡ Step-by-Step Procedure
Step 1: Preview the Plan & Unified Diff (Default)
Run the vault correction utility without --apply first to inspect classifications and diffs:
python3 <plugin_dir>/scripts/vault_correct.py "<corrected fact>" --stale "<old>" --target "<authoritative note>"(--dry-run is accepted as an explicit synonym for Plan preview.)
Step 2: Apply Atomically (--apply)
Once the Plan/Diff looks clean, re-run with --apply (and optional --replacement if the authoritative note needs a custom inline phrase):
python3 <plugin_dir>/scripts/vault_correct.py "<corrected fact>" --stale "<old>" --target "<authoritative note>" --applyExit codes: 0 on success, 1 on validation/missing-vault error, 2 on SHA-256 CAS conflict.
Step 3: Programmatic Python Usage
When invoking from Python or tests:
from scripts.vault_correct import execute_vault_correction
results = execute_vault_correction(
vault_root=vault_path,
fact="Cloud Run A2A agents natively persist session memory via Vertex AI Memory Bank",
stale_claim="in-memory Cloud Run storage",
target_authoritative="Agent Memory & Vertex AI Memory Bank",
apply=True,
auto=True,
)Step 4: Verify & Audit
- Inspect the terminal output for:
AUTHORITATIVE: Target note confirmed and updated.RESTATEMENTS: Redundant claims replaced with wikilinks.HISTORICAL RECORDS: Preserved notes clearly listed with reason.
- Run
python3 <plugin_dir>/scripts/vault_lint.py "${OBSIDIAN_VAULT_PATH:-$HOME/ObsidianVault}"to confirm that all newly inserted wikilinks resolve cleanly with zero pipe violations.
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.

