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.
npx claudepluginhub thedavidweng/skillsThis skill uses the workspace's default tool permissions.
Rename wiki page slugs while updating all cross-references, source files, and indexes.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Processes PDFs: extracts text/tables/images, merges/splits/rotates pages, adds watermarks, creates/fills forms, encrypts/decrypts, OCRs scans. Activates on PDF mentions or output requests.
Share bugs, ideas, or general feedback.
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 renaming