From david-skills
Renames Obsidian wiki page slugs while updating wikilinks, source files, indexes, and git commits to maintain referential integrity. For renaming pages, bulk renames, normalizing filenames, or moving folders.
How this skill is triggered — by the user, by Claude, or both
Slash command
/david-skills:wiki-slug-renameThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Rename wiki page slugs while updating all cross-references, source files, and indexes.
Rename wiki page slugs while updating all cross-references, source files, and indexes.
[[wikilink]] syntaxgrep and sed (or patch tool) available in the environmentkebab-case)mv wiki/{section}/{old-slug}.md wiki/{section}/{new-slug}.md
Source files (images, attachments, exports) often embed the slug in their filename. Find and rename them to prevent broken links.
# Find all source files matching the old slug
find sources/ -name "*{old-slug}*"
# Rename each to use the new slug
mv sources/identity/{old-slug}-passport.pdf sources/identity/{new-slug}-passport.pdf
Search for all references to the old slug:
grep -rn "\[\[{old-slug}" wiki/ --include="*.md"
Replace every occurrence:
[[old-slug]] → [[new-slug]][[old-slug|Display Name]] → [[new-slug|Display Name]]![[sources/identity/old-slug-*.pdf]] — embedded media referencesIf the vault maintains an index page (index.md or similar):
[[old-slug]] with [[new-slug]]Run the vault's audit script or check for broken links:
# Option A: if you have an audit script
node scripts/vault-audit.mjs
# Option B: manual grep for remaining old-slug references
grep -rn "{old-slug}" wiki/ sources/ --include="*.md"
If the audit passes with zero broken links, commit the change atomically:
git add -A && git commit -m "rename: {old-slug} → {new-slug}"
Atomic commits only. Do not split a rename across multiple commits. A partial rename leaves the vault in a broken state.
For bulk changes (e.g., normalizing 100+ slugs):
references/batch-script-template.py)grep — catch any missed referencesAfter renaming, present a summary:
Renamed: {old-slug} → {new-slug}
Updated:
- 1 wiki page file
- 3 source files
- 14 wikilink references across 7 pages
- 1 index entry
Audit: PASSED (0 broken links)
sources/chats/*.txt, sources/notes-import/) may also embed slugs in filenames — search broadly, not just .md files.bu vs. name jia, 吕 as lyu) cannot be resolved by generic pinyin libraries. Always verify character context manually.name- prefix pattern: If source files use name-{slug}.md, the prefix must follow the new slug exactly or links break.references/batch-script-template.py — Python template for bulk slug renamingnpx claudepluginhub thedavidweng/skillsAudits an Obsidian wiki vault for broken links, orphan pages, tag compliance, duplicate pages, and content hygiene. Useful for maintaining Wikipedia-style wikis.
Ingests files and URLs into an Obsidian vault by extracting entities and concepts, creating or updating wiki pages with cross-references. Supports batch mode and multiple transport methods (CLI, MCP, filesystem).