From basic-memory-toolkit
Find and fix broken, self-referential, or cross-project WikiLinks across all notes in a Basic Memory project. Use when the optimize-graph skill or /validate-project command identifies WikiLink issues at scale.
How this skill is triggered — by the user, by Claude, or both
Slash command
/basic-memory-toolkit:batch-fix-wikilinksThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<purpose>
<rules_reference> memory-rules <self_ref>anti-patterns/Self-Referential Relations Anti-Pattern</self_ref> <cross_project>anti-patterns/Cross-Project WikiLinks Anti-Pattern</cross_project> <relation_rules>creating-notes/Relation Creation Rules</relation_rules> <core_skill>verify-memory-relations (for detection)</core_skill> <core_skill>update-memory-note (for individual fixes)</core_skill> </rules_reference>
Identify the project to fix: confirm with user Determine fix categories: - broken: WikiLinks to non-existent notes - cross-project: WikiLinks that should be text format - self-ref: WikiLinks pointing to the note itself - informal: Sections like "## See Also" that should be ## Relations Ask user which categories to fix (default: all) Search all notes in the project: search_notes(query="*", project=target) For each note, read content and extract: - All WikiLinks from ## Relations section - All WikiLinks from body text - Informal relation sections Build issue inventory: {note_title, issue_type, target, suggested_fix} For broken WikiLinks: - Search for similar titles (typo correction) - Search other projects (might be cross-project) - If no match found, mark for removal or forward-ref decision For cross-project WikiLinks: - Identify which project the target lives in - Prepare text-format replacement: "Title" (project-name) For self-references: - Prepare removal of the self-referential relation - If the content is useful, convert to an observation For informal sections: - Extract references from informal sections - Prepare WikiLink relations to add to ## Relations - Plan section removal Present full plan to user for confirmation before executing Process fixes in batches of 5 notes For each note, use edit_note() with appropriate operation: - find_replace for WikiLink text changes - replace_section for ## Relations rewrites After each batch, report progress: "Fixed X/Y notes" Re-scan fixed notes to confirm issues resolved Report: X issues fixed, Y remaining, Z new issues (if any)<fix_patterns> <broken_wikilink>
search_notes(query="similar title", project=current) <if_found>edit_note: find_replace [[Wrong Title]] with [[Correct Title]]</if_found> <if_not_found>Ask user: remove relation, keep as forward-ref, or create target note?</if_not_found> </broken_wikilink><cross_project> WikiLink target found only in different project edit_note: find_replace [[Target]] with "Target" (other-project) </cross_project>
<self_referential> WikiLink target matches current note title edit_note: remove the self-referential relation line </self_referential>
<informal_section> Sections named "See Also", "Related Components", "References", etc. Extract references, add as WikiLinks to ## Relations, remove informal section </informal_section> </fix_patterns>
Always present plan before executing fixes Process in small batches to allow user to stop if needed Verify fixes after each batch Never delete relations without user confirmationnpx claudepluginhub zivba/basic-memory-toolkit --plugin basic-memory-toolkitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.