check-links
3
总安装量
2
周安装量
#55792
全站排名
安装命令
npx skills add https://github.com/ballred/obsidian-claude-pkm --skill check-links
Agent 安装分布
mcpjam
2
gemini-cli
2
claude-code
2
junie
2
windsurf
2
zencoder
2
Skill 文档
Check Links Skill
Finds broken [[wiki-links]] across your vault by extracting link targets and verifying that each target file exists. Read-only â never modifies files.
Usage
/check-links
Or ask:
- “Check for broken links in my vault”
- “Find dead wiki-links”
- “Are there any broken links?”
How to Execute
Step 1: Extract all wiki-links
Use Grep to find all [[...]] patterns in markdown files:
Grep:
pattern: "\\[\\[([^\\]|]+)"
glob: "*.md"
output_mode: content
-n: true
This captures the link target (before any | alias). Exclude .claude/ and .obsidian/ directories from results.
Step 2: Build unique target list
From the grep results, extract the unique link targets. For each match like [[My Note]] or [[My Note|display text]], the target is My Note.
Strip:
- Heading anchors:
[[Note#heading]]â target isNote - Block references:
[[Note^block-id]]â target isNote - Aliases:
[[Note|alias]]â target isNote
Step 3: Verify each target exists
For each unique target, use Glob to check if a matching file exists:
Glob:
pattern: "**/<target>.md"
A link is broken if no file matches. A link is valid if at least one file matches.
Step 4: Report results
Group broken links by source file:
## Broken Links Report
### Daily Notes/2024-01-15.md
- [[Projet Alpha]] â no matching file found
- [[Old Goal]] â no matching file found
### Projects/Project Beta.md
- [[Meeting Notes Jan]] â no matching file found
---
**Summary:** 3 broken links across 2 files (out of 45 total links checked)
Step 5: Suggest fixes
For each broken link, try to find a close match:
- Use Glob with a partial pattern:
**/*<partial-target>*.md - If a similar filename exists, suggest it:
- [[Projet Alpha]] â Did you mean [[Project Alpha]]? - If no close match, just report “no matching file found”
Edge Cases
- Embedded images (
![[image.png]]) â skip these, they reference attachments - External links (
[text](https://...)) â skip these, they are not wiki-links - Template placeholders (
[[{{date}}]]) â skip anything with{{in the target - Empty links (
[[]]) â report as malformed, not broken
No Broken Links
If all links are valid:
â
All wiki-links verified â no broken links found across X files (Y links checked)
Tips
- Run
/check-linksperiodically to catch link rot - After renaming files, run this to find links that need updating
- Combine with
/searchto find notes that reference deleted content