nguyenvanduocit/claude-code-vault-keeper/vault-fix
Claude Code and agent skill by nguyenvanduocit/claude-code-vault-keeper
- community
Checking that the SKILL.md file is still in the repository.
Apply deterministic, safe auto-fixes to vault documents — frontmatter key reordering, body section reordering per template, AC heading normalization, trailing whitespace, multi-blank-line collapse. Powered by `lib/canonical-formatter.js`. Only fixes that are 100% mechanical and information-preserving — never invents content, never changes field VALUES, never guesses missing required fields. After fixing, re-runs validate and reports residual issues that need human attention. Use when the user says 'fix vault', 'format vault docs', 'auto-fix', 'canonicalize', 'sửa vault', 'format lại docs', '/vault.fix'.
Install
npx vskill@latest install nguyenvanduocit/claude-code-vault-keeper/vault-fixSKILL.md
vault.fix — deterministic auto-fixes
This skill applies the canonical formatter (lib/canonical-formatter.js) to vault documents. The formatter is idempotent and information-preserving — it reorders, normalizes whitespace, and canonicalizes headings/bullets, but never invents content or changes values. Anything that requires judgment is reported as a residual issue for the user to handle.
Scope of safe fixes (what this skill DOES)
From canonical-formatter.js:
- Frontmatter YAML key ordering — priority keys first (
id,title,template,status,phase,owner,created,updated), then alphabetical. - Body section reordering per the template's
sections:list. - AC heading normalization →
### AC<n> — <Title>. - Relationship bullet normalization →
- **predicate** [...](...) — reason. - Trailing whitespace strip.
- Multi-blank-line collapse (max 1 inside a section, max 2 between sections).
- Final newline normalization.
Scope of UNSAFE fixes (what this skill REFUSES)
- Filling in a missing required field — that's authoring.
- Coercing an invalid
statusvalue into a legalenumvalue — that's a semantic guess. - Renaming a file to match the
$pathpattern — that affects links and history. - Adding missing required body sections — empty section is meaningless.
- Anything that depends on knowing what the user meant.
If the user explicitly asks for one of the above, refuse and explain: "That requires authoring judgment, not formatting. Open the file and decide."
Pre-flight (silent)
- Confirm clean git state —
git -C "${CLAUDE_PROJECT_DIR}" status --porcelain | head -5. If uncommitted changes exist, STOP and ask: "Working tree is dirty. Commit or stash first, or pass `--allow-dirty` to proceed. Auto-fixes touch many files; you want a clean diff to review." Never silently overwrite uncommitted work. - Resolve scope:
- No arg → fix entire vault.
- Arg path → fix only that file or subtree.
- Run
vault-keeper validate --jsonfirst to capture the before error count.
Step 1 — dry-run preview
Before writing, compute a diff preview:
(Use node -e one-liner via Bash if a JS environment is needed. Do NOT inline-bundle the formatter logic — always invoke lib/canonical-formatter.js.)
Show the user:
- Files that would change (count + list, cap list at 20).
- A representative diff (one file, max 30 lines).
- Estimated runtime if file count > 200.
Ask via AskUserQuestion: "Apply auto-fixes to N files?" with options yes, apply, no, abort, only files matching <subpath>. Do NOT proceed without explicit confirmation.
Step 2 — apply
For each file in scope, write the formatted output back. Preserve file mode. Do NOT touch files that the formatter returns unchanged (skip the write — keeps mtime stable for unaffected docs).
Step 3 — verify
Re-run vault-keeper validate --json. Capture the after error count. The expected outcome:
after.errors == 0→ success, vault is clean.0 < after.errors < before.errors→ partial success. Residual errors are non-deterministic (required field missing, etc.) — report them for human follow-up.after.errors >= before.errors→ formatter regression. STOP. Print the diff between before and after error lists, suggestgit restore .to roll back. This branch should be rare; if it fires, it's a formatter bug worth filing.
Output contract
Do NOT auto-commit. The user reviews the diff and commits themselves (or via /vault.sync).
Composition
- Pairs with
/vault.health— health diagnoses, fix repairs the mechanical subset. - Pairs with
/vault.sync— fix first, then sync, so the remote receives canonical docs. - Never invoked silently by
/vault.sync— sync runs validate, not fix. Fix is opt-in because it touches many files.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/vault.fix/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nguyenvanduocit/claude-code-vault-keeper/vault-fix)