From david-skills
Protects markdown wiki Sources sections during batch operations by auditing inbox links, migrating files to permanent sources/, and ensuring identity file links on entity pages.
npx claudepluginhub thedavidweng/skillsThis skill uses the workspace's default tool permissions.
Maintain clean, permanent Sources sections. Never link to temporary directories.
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.
Maintain clean, permanent Sources sections. Never link to temporary directories.
inbox/ (temporary) and sources/ (permanent)## Sources section linking to identity filesFind all pages that link to inbox/:
grep -rn "inbox/" wiki/ --include="*.md"
Also identify pages that should have identity file links but do not:
# List all identity files in sources/
find sources/identity/ -type f
# List all pages that currently link to sources/identity/
grep -rl "sources/identity/" wiki/ --include="*.md"
For every file referenced from inbox/:
sources/ subdirectorysources/ instead of inbox/inbox/ only after verifying the copyEvery identity file in sources/identity/ (passport scans, ID cards, work permits) must be linked from the corresponding entity page's ## Sources section.
Match files to pages by filename prefix or slug:
# Example: sources/identity/alice-smith-passport.pdf
# Should be linked from wiki/people/alice-smith.md as:
# ![[sources/identity/alice-smith-passport.pdf]]
If a page is missing its identity link, add it:
## Sources
- ![[sources/identity/alice-smith-passport.pdf]]
- ![[sources/identity/alice-smith-id-card.pdf]]
After removing inbox links, check that no page's ## Sources section is empty:
grep -A 5 "^## Sources$" wiki/**/*.md | grep -B 1 "^$"
If a Sources section is empty, either:
## Sources heading if no sources exist for that pageCheck the final state:
# Count of identity files vs. pages linking to them
identity_count=$(find sources/identity/ -type f | wc -l)
linked_count=$(grep -rl "sources/identity/" wiki/ --include="*.md" | wc -l)
echo "Identity files: $identity_count | Pages with identity links: $linked_count"
Both counts should match (or the linked count should be ≥ identity count if some files are shared).
After cleanup, present a summary:
Sources Integrity Report
━━━━━━━━━━━━━━━━━━━━━━━━
Inbox links removed: 7
Inbox files migrated to sources/: 7
Identity links added: 3
Identity links already present: 12
Pages with empty Sources sections fixed: 1
Audit: PASSED
inbox/ from Sources. Inbox is temporary — content gets deleted after distillation. Sources must reference sources/ paths only.sources/identity/ must be linked from the corresponding entity page.contacts.vcf or similar export in sources/identity/ should be linked from every person page that contains data from that file.{slug}-passport.pdf) so they can be matched to pages automatically.references/cleanup-checklist.md — Step-by-step checklist for batch source cleanup