Update Dependencies
Run all 6 checks in order. Auto-fix safe issues, report risky ones.
Vault root: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents
1. Vault-rag index (AUTO-FIX)
import json, os
path = os.path.expanduser('~/Code/vault-rag/index_state.json')
vault = os.path.expanduser('~/Library/Mobile Documents/iCloud~md~obsidian/Documents')
with open(path) as f:
data = json.load(f)
before = len(data)
stale = [p for p in data if not os.path.exists(os.path.join(vault, p))]
for s in stale:
del data[s]
if stale:
with open(path, 'w') as f:
json.dump(data, f, indent=2)
Run this via python3 -c "...". Report: Removed N stale entries (M remaining).
2. Wikilinks (REPORT)
- Build a set of all
.md file stems (without extension) across the entire vault
- Grep for
\[\[([^\]]+)\]\] in 30_knowledge/, 50_areas/, 20_projects/, 00_inbox/
- For each wikilink, extract the target (before
| if aliased)
- Check if target exists in the file stems set
- Skip
books.md and papers.md — these have intentional unresolved refs
- Report broken links grouped by file, with count
3. Config file paths (REPORT)
Scan these files for dead paths:
~/.claude/CLAUDE.md
- Vault
CLAUDE.md
MEMORY.md (in the project memory dir)
- All
.md files in the project memory dir
For each file:
- Extract paths — look for backtick-wrapped paths (
`~/...`, `vault ...`), and bare paths starting with ~/, /Users/, or vault-relative paths
- Resolve
~ to home dir, vault-relative paths to vault root
- Check each path exists on filesystem
- Skip lines that are clearly historical — lines containing words like "Phase", "removed", "deleted", "renamed", "merged", "archived", "was", "were", "formerly", past-tense context
- Report dead paths as
file:line → dead_path
4. LaunchAgent plists (REPORT)
- Read all
~/Library/LaunchAgents/*.plist files
- For each, extract the script path from
<key>ProgramArguments</key> array
- Check if the script file exists on disk
- Skip paths that are system commands (
/bin/bash, /usr/bin/env, etc.)
- Report dead script paths as
plist_name → dead_path
5. Dir tree Quick Lookup (REPORT)
- Read
50_areas/personal/directory_tree.md
- Find the Quick Lookup table
- For each row, extract the path from the Location column
- Resolve vault-relative paths (e.g.,
vault 30_knowledge/) to full paths
- Check if the referenced file/dir exists
- Report any rows where the path doesn't resolve
6. Frontmatter compliance (REPORT)
- In
30_knowledge/: count files missing origin, type, or status (skip _index.md)
- In
00_inbox/: count files with no YAML frontmatter at all (skip _index.md)
- Report counts only (not individual files — keep it concise)
Output Format
Present results as:
## Dependency Sweep Results
### Auto-fixed
- Vault-rag: removed N stale entries (M remaining)
### Needs Attention
| Check | Issues | Details |
|-------------------|--------|----------------------------|
| Broken wikilinks | N | file1.md (2), file2.md (1) |
| Dead paths | N | source:line details |
| LaunchAgent | N | plist → dead_path |
| Dir tree drift | N | row details |
| Frontmatter gaps | N | 30_knowledge: X, inbox: Y |
### Summary
N issues auto-fixed, M issues need attention.
If a check finds 0 issues, show "Clean" in the Details column. Do NOT omit clean rows — show all 5 checks for completeness.
Rules
- NEVER edit LaunchAgent plists, CLAUDE.md, or MEMORY.md — only report
- NEVER delete vault files — only report
- Auto-fix is limited to: vault-rag
index_state.json stale entry removal
- Do NOT flag
books.md or papers.md wikilinks — those are intentionally unresolved
- Do NOT flag historical/past-tense references in MEMORY.md — those document what happened, not live paths
1---2name: update-dependencies3description: Sweep all dependency paths after vault structural changes (file moves, renames, deletions). Auto-fixes safe issues, reports risky ones. Use when user says 'update dependencies', 'check dependencies', 'sweep deps', or after bulk vault changes.4---56# Update Dependencies78Run all 6 checks in order. Auto-fix safe issues, report risky ones.910**Vault root:** `~/Library/Mobile Documents/iCloud~md~obsidian/Documents`1112## 1. Vault-rag index (AUTO-FIX)1314```python15import json, os16path = os.path.expanduser('~/Code/vault-rag/index_state.json')17vault = os.path.expanduser('~/Library/Mobile Documents/iCloud~md~obsidian/Documents')18with open(path) as f:19 data = json.load(f)20before = len(data)21stale = [p for p in data if not os.path.exists(os.path.join(vault, p))]22for s in stale:23 del data[s]24if stale:25 with open(path, 'w') as f:26 json.dump(data, f, indent=2)27```2829Run this via `python3 -c "..."`. Report: `Removed N stale entries (M remaining)`.3031## 2. Wikilinks (REPORT)32331. Build a set of all `.md` file stems (without extension) across the entire vault342. Grep for `\[\[([^\]]+)\]\]` in `30_knowledge/`, `50_areas/`, `20_projects/`, `00_inbox/`353. For each wikilink, extract the target (before `|` if aliased)364. Check if target exists in the file stems set375. **Skip** `books.md` and `papers.md` — these have intentional unresolved refs386. Report broken links grouped by file, with count3940## 3. Config file paths (REPORT)4142Scan these files for dead paths:43- `~/.claude/CLAUDE.md`44- Vault `CLAUDE.md`45- `MEMORY.md` (in the project memory dir)46- All `.md` files in the project memory dir4748For each file:491. Extract paths — look for backtick-wrapped paths (`` `~/...` ``, `` `vault ...` ``), and bare paths starting with `~/`, `/Users/`, or vault-relative paths502. Resolve `~` to home dir, vault-relative paths to vault root513. Check each path exists on filesystem524. **Skip lines that are clearly historical** — lines containing words like "Phase", "removed", "deleted", "renamed", "merged", "archived", "was", "were", "formerly", past-tense context535. Report dead paths as `file:line → dead_path`5455## 4. LaunchAgent plists (REPORT)56571. Read all `~/Library/LaunchAgents/*.plist` files582. For each, extract the script path from `<key>ProgramArguments</key>` array593. Check if the script file exists on disk604. **Skip** paths that are system commands (`/bin/bash`, `/usr/bin/env`, etc.)615. Report dead script paths as `plist_name → dead_path`6263## 5. Dir tree Quick Lookup (REPORT)64651. Read `50_areas/personal/directory_tree.md`662. Find the Quick Lookup table673. For each row, extract the path from the Location column684. Resolve vault-relative paths (e.g., `vault 30_knowledge/`) to full paths695. Check if the referenced file/dir exists706. Report any rows where the path doesn't resolve7172## 6. Frontmatter compliance (REPORT)73741. In `30_knowledge/`: count files missing `origin`, `type`, or `status` (skip `_index.md`)752. In `00_inbox/`: count files with no YAML frontmatter at all (skip `_index.md`)763. Report counts only (not individual files — keep it concise)7778## Output Format7980Present results as:8182```83## Dependency Sweep Results8485### Auto-fixed86- Vault-rag: removed N stale entries (M remaining)8788### Needs Attention89| Check | Issues | Details |90|-------------------|--------|----------------------------|91| Broken wikilinks | N | file1.md (2), file2.md (1) |92| Dead paths | N | source:line details |93| LaunchAgent | N | plist → dead_path |94| Dir tree drift | N | row details |95| Frontmatter gaps | N | 30_knowledge: X, inbox: Y |9697### Summary98N issues auto-fixed, M issues need attention.99```100101If a check finds 0 issues, show "Clean" in the Details column. Do NOT omit clean rows — show all 5 checks for completeness.102103## Rules104105- NEVER edit LaunchAgent plists, CLAUDE.md, or MEMORY.md — only report106- NEVER delete vault files — only report107- Auto-fix is limited to: vault-rag `index_state.json` stale entry removal108- Do NOT flag `books.md` or `papers.md` wikilinks — those are intentionally unresolved109- Do NOT flag historical/past-tense references in MEMORY.md — those document what happened, not live paths