agentleFS
hosaypenghosaypeng/claude-skills/update-dependencies/SKILL.md

update-dependencies

Skill0 starsChanged 9 days agoMITView on GitHub

After moving, renaming or deleting notes or folders in the Obsidian vault, find everything that still points at the old paths: AGENTS/CLAUDE files, hooks, scripts, LaunchAgents, memory and wikilinks. Use when user says 'update vault dependencies', 'I moved notes', 'I renamed notes', 'sweep vault deps', or 'after vault restructure'.

20 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not re-implement them:

    line 29
  2. Very specific:

    Never auto-fix external files.

    line 49
  3. Very specific:

    Ask before deleting a note.

    line 52

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update Vault Dependencies

Finds what still references vault paths that moved or were deleted. Report first. The only vault edit this skill makes is a wikilink rewrite, and only after the user confirms. Files outside the vault are never edited.

1. Find what moved and what points at it

python3 -B -I ~/.claude/skills/update-dependencies/scripts/find_moved_refs.py [options]

Show the report as printed. The script is read-only (git plumbing only, it never touches the index) and compares the vault's git history plus the working tree, so a move is seen whether or not it was committed. Always run it as python3 -B -I (stdlib only, system Python 3.9, no __pycache__).

  • The default base is the last commit older than 2 days, because the vault auto-commits every 6 hours and a move is soon buried under later commits. If it is unclear when the restructure began, ask the user, then pass --since <date> (or --ref <rev>) to start before it. The report header prints the commit range.
  • --ref <rev> sets the base commit (--ref HEAD = uncommitted changes only).
  • --move OLD NEW adds a move git cannot see (repeatable). NEW of - means deleted. An absolute OLD covers a relocated vault root.
  • --all lifts the 60-line cap on long lists. --vault <dir> points at another checkout.

Sections: What moved; External references (file:line in AGENTS/CLAUDE files, hooks, settings.json, other skills, agent-config/bin, LaunchAgent plists, memory); Wikilinks to update (including bare [[name]] links that now silently resolve to a different note); Duplicate-basename risks; Standing checks (informational, shown on every run: leftover paths of the old iCloud vault). All clear ignores the standing checks.

2. Run the existing audits

Do not re-implement them:

bash ~/.claude/skills/audit-vault/scripts/audit_all.sh links
bash ~/.claude/skills/audit-paths/scripts/audit_paths.sh all

links reports broken wikilinks and duplicate basenames across the whole vault. audit-paths reports dead paths in CLAUDE.md, memory and LaunchAgent plists.

3. Rewrite wikilinks (only after explicit confirmation)

Show the "Wikilinks to update" list and ask first. Proposals marked [ambiguous] need the user's pick. Then:

  1. Run the checkpoint: bash ~/.claude/skills/update-dependencies/scripts/checkpoint_vault.sh. It refuses to run from 10 minutes before to 20 minutes after 00:00, 06:00, 12:00 or 18:00 (auto-sync can start late and would commit a half-edited tree), then stages everything and tags checkpoint-<timestamp> on a snapshot (or on HEAD if the tree is clean). Finish all rewrites before the next window; it prints the minutes left.
  2. Rewrite each link with the Edit tool, keeping !, #heading and |alias.
  3. Re-run find_moved_refs.py and audit_all.sh links. The wikilink list should be empty.
  4. Roll back one file with git -C ~/Documents/obsidian checkout <tag> -- <path>.

Rules

  • Never auto-fix external files. Report file:line with the proposed edit and let the user decide.
  • A hit tagged [line also mentions the new path] usually narrates the move (a memory note). It is history, not a stale reference.
  • The vault's 10_journal/ (alias ~/Documents/journal/) is read-only: never rewrite links or move files in it.
  • Ask before deleting a note. Private files listed by exact path in the vault .gitignore (such as mac_disaster_recovery.md) stay where they are: a moved copy is no longer ignored and the next auto-sync pushes it.
  • This skill sits in a public repo: keep secrets and personal data out of it.

Troubleshooting

  • error: unknown revision or not a git repository: the --ref commit does not exist, or --vault is not a repo root.
  • A moved file is missing from "What moved": git cannot see moves of gitignored files, and the move may predate the base. A heavy edit during a move can show as delete plus add. Pass the pair with --move OLD NEW, or an earlier --since.
  • Too many hits: narrow the base (--ref HEAD). Basename-only matches are skipped when the old filename still exists elsewhere.
  • skipped or missing lines under Notes: that source was not checked (absent, binary or over 1 MB). Add its new path to SOURCE_PATTERNS in the script.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.