Fix broken links

From mderk/memento · View interactive version

Fix broken links is an AI agent skill from the GitHub repository mderk/memento. Validate Memory Bank links and fix broken references

How to use this skill

Skill file

Fix Broken Links in Memory Bank

This skill helps validate and fix broken links in .memory_bank/ files.

When to Use

Use this skill when:

Invocation

From target project, run:

# Validate entire Memory Bank
python ${CLAUDE_PLUGIN_ROOT}/skills/fix-broken-links/scripts/validate-memory-bank-links.py

# Validate specific files only (e.g. after regeneration)
python ${CLAUDE_PLUGIN_ROOT}/skills/fix-broken-links/scripts/validate-memory-bank-links.py \
  --files .memory_bank/guides/testing.md .memory_bank/guides/testing-frontend.md

Process

Step 1: Run Validation Script

Execute the validation script to scan Memory Bank in the current project:

python ${CLAUDE_PLUGIN_ROOT}/skills/fix-broken-links/scripts/validate-memory-bank-links.py

Run this from the project root (where .memory_bank/ exists).

The script will:

Exit Codes:

Step 2: Parse Results

If validation fails (exit code 1), the output contains:

Example:

.memory_bank/guides/index.md: [Testing](./testing.md) → .memory_bank/guides/testing.md

Step 3: Fix Each Broken Link

For each broken link, analyze and fix:

A. Check if similar file exists:

B. If no similar file exists:

1. Remove link entirely (keep text as plain text)

2. Remove entire section if obsolete

3. Keep as placeholder with note

C. Apply fix:

Step 4: Re-validate

After fixing all links, run validation script again:

python ${CLAUDE_PLUGIN_ROOT}/skills/fix-broken-links/scripts/validate-memory-bank-links.py

If still has errors, repeat Step 3 for remaining issues.

Step 5: Summary

Provide summary:

Examples

Example 1: Update to similar file

Broken: .memory_bank/guides/index.md: [Testing](./testing.md)
Found: .memory_bank/guides/testing-guide.md

Action: Edit .memory_bank/guides/index.md
Change: [Testing](./testing.md) → [Testing](./testing-guide.md)

Example 2: Remove broken link

Broken: .memory_bank/README.md: [Old Guide](./guides/deprecated.md)
No similar files found.

Action: Edit .memory_bank/README.md
Change: [Old Guide](./guides/deprecated.md) → Old Guide (deprecated)

Example 3: Remove obsolete section

Broken: Multiple links in "## Legacy Workflows" section
All files missing, section is obsolete.

Action: Edit .memory_bank/workflows/index.md
Remove entire "## Legacy Workflows" section

Important Notes

Script Location

${CLAUDE_PLUGIN_ROOT}/skills/fix-broken-links/scripts/validate-memory-bank-links.py

It's a standalone Python script that:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.