$npx -y skills add iurykrieger/claude-bedrock --skill learnIngests an external data source into the Second Brain. Fetches content from Confluence, Google Docs, GitHub repositories, remote URLs, or any local file format supported by docling (DOCX, PPTX, XLSX, PDF, HTML, EPUB, images, Markdown, CSV, and more), converts non-markdown formats
| 1 | # /bedrock:learn — External Source Ingestion into the Second Brain |
| 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 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 learn. 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 source URL/path). |
| 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` 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 | - Graphify output: `<VAULT_PATH>/graphify-out/` |
| 57 | - When delegating to `/bedrock:preserve`, pass `--vault <VAULT_NAME>` |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Overview |
| 62 | |
| 63 | This skill receives an external source (URL or local path), fetches its content to a temporary |
| 64 | directory, converts non-markdown files to markdown via docling, runs the `/graphify` extraction |
| 65 | pipeline on the tmp content, and delegates entity persistence (plus graphify-output merge) to |
| 66 | `/bedrock:preserve`. |
| 67 | |
| 68 | **You are a fetcher and orchestrator agent.** Your job is to: |
| 69 | 1. Ensure docling is installed (auto-install if missing) |
| 70 | 2. Classify the input and fetch content to `/tmp` |
| 71 | 3. Convert fetched files to markdown via docling (when applicable) |
| 72 | 4. Invoke `/graphify` to extract a knowledge graph into a per-run temp directory |
| 73 | 5. Delegate graph merge and entity writes to `/bedrock:preserve` |
| 74 | 6. Clean up temporary files |
| 75 | |
| 76 | You do NOT classify entities, create vault files, write to the vault directly, or merge graph state. |
| 77 | All extraction is done by `/graphify`. All writes (including the graphify-output merge into the |
| 78 | vault's cumulative `graphify-out/`) are done by `/bedrock:preserve`. |
| 79 | |
| 80 | Follow the phases below in order, without skipping steps. |
| 81 | |
| 82 | --- |
| 83 | |
| 84 | ## Phase 0 — Ensure docling is installed |
| 85 | |
| 86 | Before any fetch or conversion, verify that the `docling` CLI is available. If missing, install |
| 87 | it silently using the same fallback chain `/bedrock:setup` uses for graphify, emitting a single |
| 88 | status line before proceeding. |
| 89 | |
| 90 | ```bash |
| 91 | if command -v docling >/dev/null 2>&1; then |
| 92 | echo "Phase 0: docling already installed — proceeding." |
| 93 | else |
| 94 | echo "Phase 0: docling not found — installing silently (one-time setup, m |