$npx -y skills add iurykrieger/claude-bedrock --skill compressVault alignment engine. Detects and fixes 5 types of structural misalignments: broken backlinks, concept fragmentation, entity miscategorization, duplicated entities, and misnamed entities. Delegates all writes to /bedrock:preserve. Supports interactive mode (user confirmation) a
| 1 | # /bedrock:compress — Vault Alignment Engine |
| 2 | |
| 3 | ## Plugin Paths |
| 4 | |
| 5 | Entity definitions and templates are in the plugin directory, not the vault root. |
| 6 | Use the "Base directory for this skill" provided at invocation to resolve paths: |
| 7 | |
| 8 | - Entity definitions: `<base_dir>/../../entities/` |
| 9 | - Templates: `<base_dir>/../../templates/{type}/_template.md` |
| 10 | - Plugin CLAUDE.md: `<base_dir>/../../CLAUDE.md` (already injected automatically into context) |
| 11 | |
| 12 | Where `<base_dir>` is the path provided in "Base directory for this skill". |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Vault Resolution |
| 17 | |
| 18 | Resolve which vault to compress. This skill can be invoked from any directory. |
| 19 | |
| 20 | **Step 1 — Parse `--vault` flag:** |
| 21 | Check if the input arguments include `--vault <name>`. If found, extract the vault name and remove it from the arguments before parsing `--mode`. |
| 22 | |
| 23 | **Step 2 — Resolve vault path:** |
| 24 | |
| 25 | 1. **If `--vault <name>` was provided:** |
| 26 | Read the vault registry at `<base_dir>/../../vaults.json`. Find the entry matching the name. |
| 27 | If not found: error — "Vault `<name>` is not registered. Run `/bedrock:vaults` to see available vaults." |
| 28 | If found: set `VAULT_PATH` to the entry's `path` value. Store the resolved vault name as `VAULT_NAME`. |
| 29 | |
| 30 | 2. **If no `--vault` flag — CWD detection:** |
| 31 | Read `<base_dir>/../../vaults.json`. Check if the current working directory is inside any registered vault path |
| 32 | (CWD starts with a registered vault's absolute path). If multiple match, use the longest path (most specific). |
| 33 | If found: set `VAULT_PATH` to the matching vault's `path`. Store its name as `VAULT_NAME`. |
| 34 | |
| 35 | 3. **If CWD detection fails — default vault:** |
| 36 | From the registry, find the vault with `"default": true`. |
| 37 | If found: set `VAULT_PATH` to the default vault's `path`. Store its name as `VAULT_NAME`. |
| 38 | |
| 39 | 4. **If no resolution:** |
| 40 | Error — "No vault resolved. Available vaults:" followed by the registry listing. |
| 41 | "Use `--vault <name>` to specify, or run `/bedrock:setup` to register a vault." |
| 42 | |
| 43 | **Step 3 — Validate vault path:** |
| 44 | ```bash |
| 45 | test -d "<VAULT_PATH>" && echo "exists" || echo "missing" |
| 46 | ``` |
| 47 | If missing: error — "Vault path `<VAULT_PATH>` does not exist on disk. Run `/bedrock:setup` to re-register." |
| 48 | |
| 49 | **Step 4 — Read vault config:** |
| 50 | ```bash |
| 51 | cat <VAULT_PATH>/.bedrock/config.json 2>/dev/null |
| 52 | ``` |
| 53 | Extract `language`, `git.strategy`, and other relevant fields for use in later phases. |
| 54 | |
| 55 | **From this point forward, ALL vault file operations use `<VAULT_PATH>` as the root.** |
| 56 | - Entity directories: `<VAULT_PATH>/actors/`, `<VAULT_PATH>/people/`, etc. |
| 57 | - Git operations: `git -C <VAULT_PATH> <command>` |
| 58 | - When delegating to `/bedrock:preserve`, pass `--vault <VAULT_NAME>` |
| 59 | |
| 60 | --- |
| 61 | |
| 62 | ## Overview |
| 63 | |
| 64 | This skill scans all entities in the vault, detects 5 types of structural misalignments, |
| 65 | proposes fixes to the user, and delegates all writes to `/bedrock:preserve`. |
| 66 | |
| 67 | **You are an execution agent.** Follow the phases below in order, without skipping steps. |
| 68 | |
| 69 | ### Execution modes |
| 70 | |
| 71 | The skill accepts an optional `--mode` argument: |
| 72 | |
| 73 | - **`interactive`** (default): all 5 capabilities prompt the user for confirmation before execution. |
| 74 | - **`cron`**: capabilities 1 and 4 (mechanical, deterministic) execute autonomously without confirmation. |
| 75 | Capabilities 2, 3, and 5 (semantic, judgment-dependent) are detected but written as a proposal to a |
| 76 | fleeting note for human review — they are NOT executed. |
| 77 | |
| 78 | Parse the mode from the invocation arguments. If no `--mode` is specified, default to `interactive`. |
| 79 | |
| 80 | ### Five alignment capabilities |
| 81 | |
| 82 | | # | Capability | Type | Cron behavior | |
| 83 | |---|---|---|---| |
| 84 | | 1 | Broken backlinks | Mechanical | Autonomous — fix without confirmation | |
| 85 | | 2 | Concept match | Semantic | Queued — write proposal to fleeting note | |
| 86 | | 3 | Entity misalignment | Semantic | Queued — write proposal to fleeting note | |
| 87 | | 4 | Duplicated entities | Mechanical | Autonomous — fix without confirmation | |
| 88 | | 5 | Misnamed entities | Semantic | Queued — write proposal to fleeting note | |
| 89 | |
| 90 | **Critical rules:** |
| 91 | - **NEVER** write entity files directly — all mutations go through `/bedrock:preserve` |
| 92 | - **NEVER** execute semantic capabilities (2, 3, 5) without confirmation in interactive mode |
| 93 | - **NEVER** execute semantic capabilities (2, 3, 5) autonomously in cron mode — always queue |
| 94 | - **NEVER** remove existing wikilinks |
| 95 | - **NEVER** delete entities (compress aligns, it does not delete) |
| 96 | - People/Teams/Concepts/Topics: **append-only** — never delete co |