validate-wiki-links
Validates all [[wiki links]] and
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Validates all [[wiki links]] and
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| description | Validates all [[wiki links]] and |
Command Purpose: Ensure knowledge base integrity by:
[[wiki links]] and #[[tag links]] in the Logseq repositoryWhen Invoked: This command executes directly using the logseq-validate-links CLI tool (from stapler_logseq_tools package).
Objective: Scan all Logseq files and validate internal link references.
Actions:
Scan Logseq directories:
~/Documents/personal-wiki/logseq/pages/*.md~/Documents/personal-wiki/logseq/journals/*.md[[Page Name]] and #[[Tag Name]] referencesValidate each link:
Execute validation tool:
cd ~/Documents/personal-wiki
logseq-validate-links validate
Success Criteria:
Validation Output Format:
๐ Broken Links Found
โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Missing Page โ Referenced In โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ New Concept โ 2025_10_13.md โ
โ Technical Topic โ Some Page.md, Another.md โ
โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Link Validation Summary
โโโโโโโโโโโโโโโโโโณโโโโโโโโ
โ Metric โ Count โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Total Pages โ 156 โ
โ Files Validatedโ 89 โ
โ Valid Links โ 423 โ
โ Broken Links โ 2 โ
โ Tag Links โ 78 โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโ
Objective: Interpret validation results and provide actionable recommendations.
Actions:
Categorize broken links:
Analyze patterns:
Generate recommendations:
## Link Validation Report
**Status**: [โ All links valid] OR [โ Broken links found]
**Broken Links Summary**:
- High priority (multiple references): [count]
- Medium priority (journals): [count]
- Low priority (single reference): [count]
- Potential typos: [count]
**Recommendations**:
1. Create pages for high-priority concepts: [[Concept 1]], [[Concept 2]]
2. Fix potential typos:
- [[Kuberntes]] โ [[Kubernetes]] (referenced in file.md)
3. Review orphaned references: [[Old Topic]] (may no longer be relevant)
Success Criteria:
Objective: Create placeholder pages for missing links to restore reference integrity.
When to Use:
Actions:
Determine stub creation strategy:
${2} (auto_fix) is "true" or "all": Create stubs for all broken links${2} is "selective": Create stubs only for high-priority (multi-referenced)${2} is unset or "false": Report only, don't create stubsExecute stub creation:
Automatic mode:
logseq-validate-links validate --create-missing
Manual mode (create specific stubs): For each missing page:
~/Documents/personal-wiki/logseq/pages/[Page Name].mdStub template structure:
- **Core Definition**: [Page Name]
## Background/Context
- TODO: Add context and background information
## Key Characteristics/Principles
- TODO: Add key characteristics
## Related Concepts
- TODO: Add related concept links
## Significance
- TODO: Add significance and importance
**Related Topics**: #[[TODO]]
Verify stub creation:
Success Criteria:
Objective: Confirm validation results and guide user on follow-up actions.
Actions:
Re-validate if stubs created:
logseq-validate-links validate
Provide next steps:
If stubs created:
โ Created [count] stub pages for broken links.
**Next Steps**:
1. Review stub pages and add comprehensive content:
- [[Page 1]] - Referenced in [file1.md, file2.md]
- [[Page 2]] - Referenced in [file3.md]
2. Consider using /knowledge/process-journal-zettels to generate
research-backed content for these pages.
3. Run validation again after content updates to ensure quality.
If only reporting:
โ Found [count] broken links.
**Next Steps**:
1. Decide whether to create stub pages:
- Run: `/knowledge/validate-links all true` to auto-create all stubs
- Run: `/knowledge/validate-links selective true` for high-priority only
2. Fix potential typos manually:
- [[Typo]] โ [[Correct Name]] in [file.md]
3. Remove obsolete references if concepts are no longer relevant.
Generate completion summary:
## Validation Complete
**Initial State**:
- Broken links: [count]
- Files affected: [count]
**Actions Taken**:
- Stubs created: [count] (or "None - report only")
- Typos identified: [count]
**Final State**:
- Broken links remaining: [count]
- Validation status: [โ Pass / โ Review needed]
**Files Created**:
- ~/Documents/personal-wiki/logseq/pages/[Page1].md
- ~/Documents/personal-wiki/logseq/pages/[Page2].md
Success Criteria:
Purpose: Get high-level wiki health metrics without detailed validation.
Usage:
logseq-validate-links stats
Output:
๐ Wiki Statistics
Overall Health:
- Total pages: 156
- Total journals: 245
- Unique links: 423
- Unique tags: 78
- Broken links: 2 (0.5%)
Most Connected Pages (outbound links):
1. [[Platform Engineering]] - 45 links
2. [[Database Design]] - 32 links
3. [[Incident Management]] - 28 links
Link Health Status: โ Excellent (99.5% valid)
When to Use:
Purpose: Quick scan for broken links without full validation output.
Usage:
logseq-validate-links missing
Output:
Missing Pages:
- [[New Concept]]
- [[Technical Topic]]
- [[Research Area]]
When to Use:
Issue: logseq-validate-links command not available
Action:
which logseq-validate-linkscd ~/Documents/personal-wiki && uv install -e .logseq-validate-links --helpIssue: No markdown files found in pages/journals Action:
ls ~/Documents/personal-wiki/logseq/pages/Issue: Cannot read files or create stubs Action:
ls -la ~/Documents/personal-wiki/logseq/pages/chmod commands or running with appropriate permissionsIssue: Stub would overwrite existing file (rare edge case) Action:
Issue: Links contain characters invalid for filenames Action:
[[Page/Name]] โ Page_Name.mdCommand: /knowledge/validate-links
Execution:
cd ~/Documents/personal-wiki
logseq-validate-links validate
Output:
Scanning 245 files...
๐ Broken Links Found (3):
High Priority (multiple references):
- [[Database Sharding]] โ Referenced in: Performance.md, Scaling.md, 2025_10_15.md
Medium Priority (journals):
- [[Incident Response Playbook]] โ Referenced in: 2025_10_20.md
Low Priority (single reference):
- [[Old Framework]] โ Referenced in: Archive.md
Potential Typos:
- [[Kuberntes]] โ Did you mean [[Kubernetes]]? (in Infrastructure.md)
๐ Summary:
- Total links: 423
- Valid: 420 (99.3%)
- Broken: 3 (0.7%)
- Potential typos: 1
โ Validation complete. Run with auto_fix to create stubs.
Claude Response:
## Link Validation Results
Found 3 broken links in your wiki:
**High Priority**:
- [[Database Sharding]] - Create this page (referenced in 3 files)
**Medium Priority**:
- [[Incident Response Playbook]] - Recent journal reference
**Low Priority**:
- [[Old Framework]] - Appears in archived content
**Potential Typo**:
- [[Kuberntes]] โ [[Kubernetes]] in Infrastructure.md
**Recommendations**:
1. Create [[Database Sharding]] page (high value, multiple references)
2. Fix [[Kuberntes]] typo manually
3. Consider if [[Old Framework]] is still relevant
Run `/knowledge/validate-links all true` to auto-create stubs for all broken links.
Command: /knowledge/validate-links all true
Execution:
cd ~/Documents/personal-wiki
logseq-validate-links validate --create-missing
Output:
Scanning 245 files...
Found 3 broken links.
Creating stub pages...
โ Created: Database Sharding.md
โ Created: Incident Response Playbook.md
โ Created: Old Framework.md
Re-validating...
โ All links now valid!
๐ Summary:
- Stubs created: 3
- Broken links resolved: 3
- Remaining issues: 0
Next steps:
- Review stub pages and add content
- Consider using /process-journal-zettels for research-backed content
Claude Response:
## Stubs Created Successfully
Created 3 stub pages to resolve broken links:
1. **Database Sharding.md**
- Referenced in: Performance.md, Scaling.md, 2025_10_15.md
- High priority - add comprehensive content
2. **Incident Response Playbook.md**
- Referenced in: 2025_10_20.md
- Recent work - fill in details
3. **Old Framework.md**
- Referenced in: Archive.md
- Low priority - review if still relevant
**Next Steps**:
1. Review these stubs and add meaningful content
2. Use `/knowledge/process-journal-zettels 2025_10_15` to research Database Sharding
3. Consider creating Incident Response Playbook based on recent experiences
All links now validate successfully โ
Command: /knowledge/validate-links selective true
Execution:
# Run validation first
logseq-validate-links validate
# Manually create only high-priority stubs (multi-referenced)
# Create stub for Database Sharding (3 references)
Output:
Scanning 245 files...
Found 3 broken links.
Creating selective stubs (high-priority only)...
โ Created: Database Sharding.md (3 references)
โ Skipped: Incident Response Playbook.md (1 reference)
โ Skipped: Old Framework.md (1 reference)
Re-validating...
โ 2 broken links remain (low-priority)
๐ Summary:
- High-priority stubs created: 1
- Remaining broken links: 2 (low priority)
Claude Response:
## Selective Stubs Created
Created stubs for high-priority links only:
**Created**:
- [[Database Sharding]] (3 references) - Priority: High
**Remaining Broken Links** (low priority):
- [[Incident Response Playbook]] (1 reference) - Journal entry
- [[Old Framework]] (1 reference) - Archived content
**Recommendation**:
Focus on completing [[Database Sharding]] content first (multiple references indicate importance).
Address remaining links as needed or run `/knowledge/validate-links all true` to create all stubs.
Command: /knowledge/validate-links stats
Execution:
logseq-validate-links stats
Output:
๐ Wiki Statistics
Overall Health:
- Total pages: 156
- Total journals: 245
- Unique links: 423
- Unique tags: 78
- Broken links: 0 (0%)
Most Connected Pages (outbound links):
1. [[Platform Engineering]] - 45 links
2. [[Database Design]] - 32 links
3. [[Incident Management]] - 28 links
4. [[System Architecture]] - 24 links
5. [[Performance Optimization]] - 21 links
Link Health Status: โ Excellent (100% valid)
Connectivity: โ Good (avg 2.7 links/page)
Claude Response:
## Wiki Health Report
Your personal wiki is in excellent health!
**Metrics**:
- 156 pages, 245 journal entries
- 423 unique links, 78 tags
- 0 broken links (100% valid) โ
**Most Connected Topics**:
Your knowledge graph has strong clusters around:
1. Platform Engineering (45 connections)
2. Database Design (32 connections)
3. Incident Management (28 connections)
**Analysis**:
- High connectivity (2.7 links/page average)
- No broken references
- Well-structured knowledge graph
No action needed. Continue building your knowledge base!
Scenario: After renaming several pages or restructuring wiki
Command: /knowledge/validate-links
Execution:
logseq-validate-links validate
Output:
Scanning 245 files...
๐ Broken Links Found (8):
Likely due to recent page renames:
- [[Old Page Name]] โ Not found (referenced in 5 files)
- [[Another Old Name]] โ Not found (referenced in 3 files)
Potential fixes:
- [[Old Page Name]] โ [[New Page Name]]? (New Page Name.md exists)
- [[Another Old Name]] โ [[Renamed Page]]? (Renamed Page.md exists)
๐ Summary:
- Broken: 8
- Potential renames detected: 2
Claude Response:
## Validation After Restructuring
Detected broken links likely caused by recent page renames:
**Action Needed**:
1. Update links in 5 files: [[Old Page Name]] โ [[New Page Name]]
2. Update links in 3 files: [[Another Old Name]] โ [[Renamed Page]]
**Options**:
A) Fix manually using search/replace
B) Create redirect stubs (Old Page Name.md with link to new name)
C) Use /knowledge/validate-links to create stubs, then merge content
**Recommendation**: Update links to reflect new page names for clean references.
Would you like me to help update these links across your wiki?
Add to .git/hooks/pre-commit in wiki repository:
#!/bin/bash
cd ~/Documents/personal-wiki
logseq-validate-links validate --exit-code
if [ $? -eq 1 ]; then
echo "โ Commit blocked: Broken links found"
echo "Fix links or run 'logseq-validate-links validate --create-missing'"
exit 1
fi
Add to cron for weekly validation:
# Every Sunday at 9 AM
0 9 * * 0 cd ~/Documents/personal-wiki && logseq-validate-links stats > /tmp/wiki_health.txt
name: Validate Wiki Links
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: uv install -e .
- name: Validate links
run: logseq-validate-links validate
All validation must satisfy:
Completeness:
Accuracy:
Actionability:
Safety:
Reporting:
Format: /knowledge/validate-links [mode] [auto_fix]
Arguments:
mode (optional): Validation mode
validate (default): Full validation with reportingstats: High-level statistics onlymissing: Quick list of broken linksselective: Process high-priority links onlyauto_fix (optional): Automatic stub creation
true or all: Create stubs for all broken linksfalse (default): Report only, no stub creationselective: Create stubs only for multi-referenced pagesExecution Mode: Direct execution using logseq-validate-links CLI tool
Expected Duration: 5-30 seconds depending on wiki size
Prerequisites:
stapler_logseq_tools package installed (uv install -e .)Apply idiomatic, well-structured Python development practices. Use when writing, reviewing, or refactoring Python code. Covers type annotations, package management with uv, Pydantic DTOs, Typer CLIs, pytest patterns, PEP 8 style, architecture, and type-driven design.
How to manage Python dependencies with UV โ inline script metadata (PEP 723), project mode, tool running, and when to use each approach. Always use UV; never pip directly.
Use when receiving code review feedback (especially if unclear or technically questionable), when completing tasks or major features requiring review before proceeding, or before making any completion/success claims. Covers four practices โ receiving feedback with technical rigor, requesting reviews via code-reviewer subagent, verification gates requiring evidence before claims, and security/API-compat awareness. Essential for subagent-driven development, pull requests, and preventing false completion claims.
Synthesize knowledge from multiple sources into Zettelkasten notes for Logseq. Use when creating wiki pages, integrating academic research, or building interconnected knowledge with [[links]] and
Survey a Google Drive's actual folder structure, apply a PARA-lite organization framework, and produce (then safely execute) a concrete reorganization plan โ deduping, sweeping root-level clutter, and fixing misnested folders.
Idiomatic review for Rust โ async/Tokio daemon design, ports-and-adapters trait boundaries, and thiserror/anyhow error handling. Use when reviewing or writing Rust code that defines async trait "ports" (dependency-inversion boundaries), runs a single-threaded Tokio daemon (current_thread runtime + LocalSet/spawn_local), or crosses a wire/domain type boundary. Covers async fn in traits vs async-trait, Rc/RefCell vs Arc/Mutex, tokio::select! cancel-safety, blocking calls in async context, thiserror-vs-anyhow error typing, wire/domain type separation, and common anti-patterns (clone in hot loops, overly generic port bounds). NOT for pure performance/profiling work (see rust-profiling, rust-perf-tuning, rust-memory-optimization, rust-parallel-processing) or unsafe/CLI/wasm-bindgen review (no dedicated skill yet โ use the sdd:6-verify research-agent fallback for those).