$npx -y skills add iurykrieger/claude-bedrock --skill vaultsManage registered Bedrock vaults. List all vaults, set a default vault, or remove a vault from the registry. The registry lives in the plugin directory and maps vault names to filesystem paths. Use when: "bedrock vaults", "bedrock-vaults", "/bedrock:vaults", "list vaults", "set d
| 1 | # /bedrock:vaults — Vault Management |
| 2 | |
| 3 | ## Plugin Paths |
| 4 | |
| 5 | The vault registry lives in the plugin root directory, not in any vault. |
| 6 | Use the "Base directory for this skill" provided at invocation to resolve paths: |
| 7 | |
| 8 | - Vault registry: `<base_dir>/../../vaults.json` |
| 9 | - Plugin CLAUDE.md: `<base_dir>/../../CLAUDE.md` (auto-injected into context) |
| 10 | |
| 11 | Where `<base_dir>` is the path shown in "Base directory for this skill". |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Overview |
| 16 | |
| 17 | This skill manages the global vault registry — the file that maps vault names to |
| 18 | filesystem paths and tracks which vault is the default. |
| 19 | |
| 20 | **You are a management agent.** This skill is read-only with respect to vaults themselves — |
| 21 | it never reads or modifies vault entities, never runs git operations inside vaults, and |
| 22 | never touches `.bedrock/config.json`. It only reads and writes the registry file (`vaults.json`). |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ## Phase 0 — Parse Input |
| 27 | |
| 28 | Parse the user's input to determine the command mode: |
| 29 | |
| 30 | | Input pattern | Mode | Variables | |
| 31 | |---|---|---| |
| 32 | | No flags / empty / `list` | **list** | — | |
| 33 | | `--set-default <name>` | **set-default** | `TARGET_NAME = <name>` | |
| 34 | | `--remove <name>` | **remove** | `TARGET_NAME = <name>` | |
| 35 | |
| 36 | If the input doesn't match any pattern, default to **list** mode. |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## Phase 1 — Read Registry |
| 41 | |
| 42 | Resolve the registry path: |
| 43 | |
| 44 | ``` |
| 45 | REGISTRY_PATH = <base_dir>/../../vaults.json |
| 46 | ``` |
| 47 | |
| 48 | Read the registry file: |
| 49 | |
| 50 | ```bash |
| 51 | cat <REGISTRY_PATH> 2>/dev/null |
| 52 | ``` |
| 53 | |
| 54 | **If the file does not exist or is empty:** |
| 55 | - For **list** mode: display "No vaults registered. Run `/bedrock:setup` in a vault directory to register your first vault." |
| 56 | - For **set-default** and **remove** modes: display "No vaults registered. Nothing to modify." and exit. |
| 57 | |
| 58 | **If the file exists:** parse the JSON. Expected schema: |
| 59 | |
| 60 | ```json |
| 61 | { |
| 62 | "vaults": [ |
| 63 | { |
| 64 | "name": "<string>", |
| 65 | "path": "<absolute-path>", |
| 66 | "default": true | false |
| 67 | } |
| 68 | ] |
| 69 | } |
| 70 | ``` |
| 71 | |
| 72 | Store the parsed vaults array as `VAULTS`. |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Phase 2 — Execute Command |
| 77 | |
| 78 | ### 2.1 List Mode |
| 79 | |
| 80 | For each vault in `VAULTS`, check if the path still exists on disk: |
| 81 | |
| 82 | ```bash |
| 83 | test -d "<vault_path>" && echo "exists" || echo "missing" |
| 84 | ``` |
| 85 | |
| 86 | Present a table: |
| 87 | |
| 88 | ``` |
| 89 | ## Registered Vaults |
| 90 | |
| 91 | | Name | Path | Default | Status | |
| 92 | |---|---|---|---| |
| 93 | | my-vault | /Users/me/vaults/my-vault | * | ok | |
| 94 | | team-vault | /Users/me/vaults/team-vault | | ok | |
| 95 | | old-vault | /Users/me/vaults/old-vault | | missing | |
| 96 | ``` |
| 97 | |
| 98 | - The `Default` column shows `*` for the default vault |
| 99 | - The `Status` column shows `ok` if the directory exists, `missing` if it does not |
| 100 | |
| 101 | If any vault has status `missing`, add a note: |
| 102 | |
| 103 | ``` |
| 104 | > Vaults marked as "missing" have paths that no longer exist on disk. |
| 105 | > Run `/bedrock:vaults --remove <name>` to clean up, or re-create the vault at the registered path. |
| 106 | ``` |
| 107 | |
| 108 | ### 2.2 Set-Default Mode |
| 109 | |
| 110 | 1. Find the vault with `name == TARGET_NAME` in `VAULTS` |
| 111 | 2. If not found: display "Vault `<TARGET_NAME>` is not registered. Available vaults:" followed by a list of names. Exit. |
| 112 | 3. If found: |
| 113 | - Set `"default": false` on all vaults |
| 114 | - Set `"default": true` on the matching vault |
| 115 | - Write the updated registry back to `REGISTRY_PATH` |
| 116 | - Display: "Default vault set to `<TARGET_NAME>` (<path>)." |
| 117 | |
| 118 | ### 2.3 Remove Mode |
| 119 | |
| 120 | 1. Find the vault with `name == TARGET_NAME` in `VAULTS` |
| 121 | 2. If not found: display "Vault `<TARGET_NAME>` is not registered. Available vaults:" followed by a list of names. Exit. |
| 122 | 3. If found: |
| 123 | - Remove the entry from `VAULTS` |
| 124 | - If the removed vault was the default AND other vaults remain, mark the first remaining vault as default and inform the user |
| 125 | - Write the updated registry back to `REGISTRY_PATH` |
| 126 | - Display: "Vault `<TARGET_NAME>` removed from registry. Files on disk were NOT deleted (<path>)." |
| 127 | |
| 128 | --- |
| 129 | |
| 130 | ## Phase 3 — Write Registry |
| 131 | |
| 132 | When writing the registry (set-default or remove modes), use the Write tool to overwrite `REGISTRY_PATH` with the updated JSON: |
| 133 | |
| 134 | ```json |
| 135 | { |
| 136 | "vaults": [ |
| 137 | { "name": "...", "path": "...", "default": true }, |
| 138 | { "name": "...", "path": "...", "default": false } |
| 139 | ] |
| 140 | } |
| 141 | ``` |
| 142 | |
| 143 | Format the JSON with 2-space indentation for readability. |
| 144 | |
| 145 | --- |
| 146 | |
| 147 | ## Critical Rules |
| 148 | |
| 149 | | # | Rule | |
| 150 | |---|---| |
| 151 | | 1 | **NEVER modify vault files** — this skill only touches `vaults.json` | |
| 152 | | 2 | **NEVER run git operations** — no git pull, commit, push, or any git command | |
| 153 | | 3 | **NEVER delete files on disk** — `--remove` only removes the registry entry | |
| 154 | | 4 | **ALWAYS validate vault name exists** before set-default or remove | |
| 155 | | 5 | **ALWAYS check path |