Fixed setups
This commit is contained in:
@@ -16,11 +16,12 @@ research or study notes).
|
||||
### 1. Check configuration (always first)
|
||||
|
||||
Configuration lives in `~/.agent-skills/obsidian-vault-kb/config.json`. Before any
|
||||
substantive action, check whether this file exists:
|
||||
|
||||
```bash
|
||||
cat ~/.agent-skills/obsidian-vault-kb/config.json 2>/dev/null
|
||||
```
|
||||
substantive action, check whether this file exists using the Read file
|
||||
tool, not `cat`/Bash — the whitelisted permission for this file is
|
||||
`Read(~/.agent-skills/obsidian-vault-kb/config.json)`, which covers the
|
||||
Read file tool, not a Bash `cat` invocation of the same path (those are
|
||||
separate permission checks in Claude Code, even though they access the
|
||||
same file).
|
||||
|
||||
**If the file exists:** Use the configuration from it (vault path(s), mode)
|
||||
and go straight to step 2 (search). Do not ask again.
|
||||
@@ -65,26 +66,35 @@ especially when using tags/frontmatter/wikilinks.
|
||||
Short version of the approach:
|
||||
|
||||
1. Get an overview of the vault structure:
|
||||
`<skill-dir>/scripts/vault_index.sh [vault-name]` — returns folders as
|
||||
`~/.agent-skills/obsidian-vault-kb/bin/vault_index.sh [vault-name]` — returns folders as
|
||||
rough categories, note counts, existing frontmatter tags, and possible
|
||||
index/MOC files.
|
||||
2. Targeted full-text search with
|
||||
`<skill-dir>/scripts/vault_search.sh "<query>" [vault-name] [subfolder]`
|
||||
`~/.agent-skills/obsidian-vault-kb/bin/vault_search.sh "<query>" [vault-name] [subfolder]`
|
||||
— scoped to the most plausible subfolder from step 1 where useful.
|
||||
3. For a specific note, follow backlinks with
|
||||
`<skill-dir>/scripts/vault_backlinks.sh "<note-name>" [vault-name]` to
|
||||
`~/.agent-skills/obsidian-vault-kb/bin/vault_backlinks.sh "<note-name>" [vault-name]` to
|
||||
find related notes that link to it.
|
||||
4. Open matching files (via the `view`/read tool, not a shell command) to
|
||||
read their frontmatter (tags, `status`, `aliases`) and content in full
|
||||
once a promising candidate has been found.
|
||||
|
||||
These three scripts always resolve the vault path from
|
||||
`~/.agent-skills/obsidian-vault-kb/config.json` themselves and refuse to operate
|
||||
outside the configured vault — they never take a raw filesystem path as an
|
||||
argument. This is intentional: it's what allows them (and only them) to be
|
||||
safely whitelisted in Claude Code's permissions without granting broader
|
||||
shell/filesystem access. See "Setup and permissions" below and
|
||||
`references/search-strategy.md` for manual fallback commands (`find`, `rg`,
|
||||
These three scripts (permanently installed at
|
||||
`~/.agent-skills/obsidian-vault-kb/bin/` by this plugin's setup, not run
|
||||
from wherever this skill's own files happen to live) always resolve the
|
||||
vault path from `~/.agent-skills/obsidian-vault-kb/config.json` themselves
|
||||
and refuse to operate outside the configured vault — they never take a raw
|
||||
filesystem path as an argument. This is intentional: it's what allows them
|
||||
(and only them) to be safely whitelisted in Claude Code's permissions
|
||||
without granting broader shell/filesystem access. Don't pre-check whether
|
||||
`~/.agent-skills/obsidian-vault-kb/bin/` exists with a separate command
|
||||
(e.g. `test -d ... && ...`) before calling one of these scripts — that's
|
||||
exactly the kind of chained command this design exists to avoid, and it'll
|
||||
trigger the anti-chaining hook if installed. Just invoke the script
|
||||
directly. If it fails with "No such file or directory" (or similar), setup
|
||||
hasn't been run for this tool yet — tell the user to run it first (for
|
||||
Claude Code: `/obsidian-vault-kb:setup`). See "Setup and permissions" below
|
||||
and `references/search-strategy.md` for manual fallback commands (`find`, `rg`,
|
||||
`grep`) for cases the scripts don't cover — those are not whitelisted and
|
||||
will prompt for confirmation, by design.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user