$npx -y skills add iurykrieger/claude-bedrock --skill askAdaptive vault reader skill. Receives a natural language question, uses graph.json as the primary index (Phase 2.0) before any glob/grep, then self-assesses whether more context is needed. Escalates to live /graphify only when graph coverage is insufficient, or to /bedrock:learn
| 1 | # /bedrock:ask — Adaptive Vault Reader |
| 2 | |
| 3 | ## Plugin Paths |
| 4 | |
| 5 | Entity definitions and templates are in the plugin directory, not at the vault root. |
| 6 | Use the "Base directory for this skill" provided at invocation to resolve the 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 automatically injected 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 query. 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 (the remaining text is the question). |
| 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. |
| 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`. |
| 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`. |
| 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` 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 | - Graphify output: `<VAULT_PATH>/graphify-out/` |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Overview |
| 62 | |
| 63 | This skill receives a natural language question and answers it using an adaptive, |
| 64 | vault-first approach. It always reads vault content first, then decides whether |
| 65 | to escalate to graphify or /learn ased on what's actually needed — not what the |
| 66 | question looks like in isolation. |
| 67 | |
| 68 | **You are an adaptive context orchestrator agent. You only READ — never write, edit, or delete files directly.** |
| 69 | |
| 70 | Writes happen exclusively through `/bedrock:learn` delegation (which flows through `/bedrock:preserve`). |
| 71 | If the query reveals outdated or missing information and no remote source is available to ingest, |
| 72 | suggest that the user run `/bedrock:preserve` or `/bedrock:learn` to update the vault. |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Phase 0 — Read Configuration |
| 77 | |
| 78 | ### 0.1 Load config |
| 79 | |
| 80 | Read `.bedrock/config.json` from the vault root: |
| 81 | |
| 82 | ```bash |
| 83 | if [ -f ".bedrock/config.json" ]; then |
| 84 | cat .bedrock/config.json |
| 85 | else |
| 86 | echo "config_not_found" |
| 87 | fi |
| 88 | ``` |
| 89 | |
| 90 | - **If config exists:** extract the value of `query.max_graphify_calls`. Store as `max_graphify_calls`. |
| 91 | - **If config does not exist or field is absent:** set `max_graphify_calls = 3` (default). |
| 92 | - **Valid range:** 1–5. If the value is outside this range, clamp to the nearest bound and log a warning. |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## Phase 1 — Analyze the Question |
| 97 | |
| 98 | ### 1.1 Classify the question |
| 99 | |
| 100 | Read the user's question and identify: |
| 101 | |
| 102 | 1. **Mentioned entities** — names of systems, people, teams, topics, projects, or discussions. |
| 103 | They may appear as: |
| 104 | - Exact filename (e.g.: "billing-api", "squad-payments") |
| 105 | - Human-readable name (e.g.: "Billing API", "Squad Payments") |
| 106 | - Alias or acronym (e.g.: "BillingAPI", "BRB") |
| 107 | - Contextual reference (e.g.: "the billing service", "the notifications team") |
| 108 | |
| 109 | 2. **Relevant domain(s)** — `payments`, `notifications`, `orders`, `integrations`, `checkout`, `compliance`, `internal-tools`. |
| 110 | Infer from the ment |