$npx -y skills add pssah4/vault-operator --skill vault-health-batchAutonomous batch mode for Vault Health findings. Works through orphans, missing backlinks, and tags in batches without asking on every fix.
| 1 | # Vault Health Batch Mode |
| 2 | |
| 3 | You work through Vault Health findings AUTONOMOUSLY in batches. |
| 4 | Ask the user ONLY at real decision points, NOT on every single fix. |
| 5 | All changes are reversible via the undo bar (checkpoints are created automatically). |
| 6 | |
| 7 | ## Phase 1: TRIAGE |
| 8 | |
| 9 | 1. Call `vault_health_check` |
| 10 | 2. Read the findings and group them by type |
| 11 | 3. Give the user a short overview (3-5 lines): |
| 12 | ``` |
| 13 | Vault Health: X findings |
| 14 | - N orphaned notes (M of them with context) |
| 15 | - N missing backlinks |
| 16 | - N broken links |
| 17 | - N inconsistent tags |
| 18 | - N weak clusters |
| 19 | |
| 20 | I will start with the mechanical fixes (backlinks, tags). |
| 21 | For broken links and isolated orphans I will ask you. |
| 22 | ``` |
| 23 | 4. Start Phase 2 IMMEDIATELY -- do NOT wait for confirmation |
| 24 | |
| 25 | ## Phase 2: BATCH FIX |
| 26 | |
| 27 | Work through the types in this order. |
| 28 | |
| 29 | ### 2a: Missing backlinks + orphans with context (ONE TOOL CALL) |
| 30 | |
| 31 | These are mechanical fixes: entities that are referenced but do not link back. |
| 32 | |
| 33 | Steps: |
| 34 | 1. Call `vault_health_check` with `action: "fix_backlinks"` |
| 35 | 2. The tool fixes ALL missing backlinks in one batch (pure code, 0 LLM cost) |
| 36 | 3. Show the user the result: "X entities updated, Y backlinks added" |
| 37 | |
| 38 | NO read_file, NO update_frontmatter, NO sub-agent. ONE tool call does everything. |
| 39 | |
| 40 | ### 2c: Inconsistent tags (AUTONOMOUS) |
| 41 | |
| 42 | Tags that differ only in upper/lower case. |
| 43 | |
| 44 | Steps: |
| 45 | 1. Pick the more frequent variant |
| 46 | 2. Change all occurrences of the rarer variant via `update_frontmatter` |
| 47 | 3. NO questions |
| 48 | |
| 49 | ### 2d: Broken links (USER DECISION) |
| 50 | |
| 51 | Links that point to notes that do not exist. |
| 52 | |
| 53 | Steps: |
| 54 | 1. Show ALL broken links together (not one by one) |
| 55 | 2. STOP -- ask the user: |
| 56 | ``` |
| 57 | N broken links found: |
| 58 | - [[Note A]] (referenced by 3 notes) |
| 59 | - [[Note B]] (referenced by 1 note) |
| 60 | |
| 61 | Options: |
| 62 | a) Create stub notes (with basic content) |
| 63 | b) Remove the links |
| 64 | c) Decide one by one |
| 65 | d) Skip |
| 66 | ``` |
| 67 | 3. Continue only after the answer |
| 68 | |
| 69 | ### 2e: Orphaned notes WITHOUT context (USER DECISION) |
| 70 | |
| 71 | Completely isolated notes without any MOC links. |
| 72 | |
| 73 | Steps: |
| 74 | 1. Show the first 10 isolated notes |
| 75 | 2. STOP -- ask the user: |
| 76 | ``` |
| 77 | N isolated notes (no MOC properties, no incoming links): |
| 78 | - Note A |
| 79 | - Note B |
| 80 | - ... |
| 81 | |
| 82 | Should I use semantic_search to find and suggest matching topics? |
| 83 | Or should these notes be ignored? |
| 84 | ``` |
| 85 | 3. If yes: for each note run semantic_search, suggest a topic, update_frontmatter |
| 86 | |
| 87 | ### 2f: Weak clusters (TOP 5 ONLY) |
| 88 | |
| 89 | Semantically similar notes without explicit links. |
| 90 | |
| 91 | Steps: |
| 92 | 1. Only the top 5 pairs (highest similarity) |
| 93 | 2. Read both notes with `read_file` |
| 94 | 3. Suggest to the user: "Should I link [[A]] and [[B]]?" |
| 95 | 4. Wait for confirmation |
| 96 | |
| 97 | ## Phase 3: REFRESH + WRAP-UP |
| 98 | |
| 99 | After all fixes: call `vault_health_check` with `refresh: true`. |
| 100 | This re-extracts the graph and rebuilds the ontology so the findings |
| 101 | reflect the current vault state (not the stale state from before the fixes). |
| 102 | |
| 103 | Then give a compact summary: |
| 104 | ``` |
| 105 | Vault Health batch finished: |
| 106 | - X missing backlinks fixed |
| 107 | - Y orphan backlinks added |
| 108 | - Z tags unified |
| 109 | - N broken links: [status] |
| 110 | - M isolated orphans: [status] |
| 111 | - Findings remaining after refresh: N |
| 112 | |
| 113 | All changes are reversible via the undo bar (top of the chat). |
| 114 | ``` |
| 115 | |
| 116 | ## Token efficiency rules (follow STRICTLY) |
| 117 | |
| 118 | 1. NO `read_file` for orphans when the finding data already provides the context |
| 119 | 2. NO `semantic_search` for notes that already have MOC links |
| 120 | 3. Work in batches of 10 fixes of the same kind |
| 121 | 4. After 20 iterations: give a summary and ask "Continue?" |
| 122 | 5. IGNORE the fix rules in the vault_health_check output -- follow THESE rules |
| 123 | |
| 124 | ## Autonomy rules (follow STRICTLY) |
| 125 | |
| 126 | AUTONOMOUS (NO questions): |
| 127 | - Backlink entries (missing backlinks, orphans with context) |
| 128 | - Tag unification |
| 129 | |
| 130 | WITH USER DECISION (ALWAYS ask): |
| 131 | - Broken links (create vs. remove) |
| 132 | - Orphans without context (classify vs. ignore) |
| 133 | - Weak clusters (link yes or no) |
| 134 | - Creating new entities (topics, concepts) |