Back to Skills

mem-fix

verified

Fix issues detected by mem-audit. Supports dry-run mode to preview changes before applying them.

View on GitHub

Marketplace

cc-obsidian-mem

Z-M-Huang/cc-obsidian-mem

Plugin

cc-obsidian-mem

Repository

Z-M-Huang/cc-obsidian-mem
8stars

plugin/skills/mem-fix/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/Z-M-Huang/cc-obsidian-mem/blob/main/plugin/skills/mem-fix/SKILL.md -a claude-code --skill mem-fix

Installation paths:

Claude
.claude/skills/mem-fix/
Powered by add-skill CLI

Instructions

# Memory Fix Skill

Apply fixes for issues detected in your Claude Code knowledge base.

## When to Use

- After running `/mem-audit` and finding issues
- To clean up broken links
- To add missing parent links to orphan notes
- To create missing category indexes
- To rebuild stale indexes

## Usage

```
/mem-fix project:my-project
/mem-fix project:my-project dryRun:true
/mem-fix project:my-project fixCategories:broken_link,orphan_note
```

## Workflow

1. **Run Audit First**
   - Call `mem_audit` to get current issues
   - Present summary: X errors, Y warnings, Z info

2. **Collect Confirmation**
   - Group issues by category
   - For each category with issues, ask: "Fix all N [category] issues?"
   - Show examples (first 3-5) before asking for confirmation

3. **Apply Fixes**
   - Use `dryRun: true` first to preview changes
   - Then apply confirmed fixes with `dryRun: false`

4. **Report Results**
   - Show what was fixed successfully
   - Show what failed and why
   - Suggest re-running audit to verify

## Fix Types

| Category | Fix Type | Auto-Fixable |
|----------|----------|--------------|
| `broken_link` | Remove the broken wikilink | Yes |
| `orphan_note` | Add parent link to frontmatter | Yes |
| `missing_index` | Create category index file | Yes |
| `supersession_inconsistent` | Update frontmatter (may need manual input) | Partial |
| `index_stale` | Rebuild project index | Yes |
| `invalid_frontmatter` | Add missing fields (except title) | Partial |

## Output Format

### Dry Run

```markdown
# Dry Run Results

**Would fix**: 8/10

## Successful

- `broken_link-abc123`: Would remove link [[old-note]]
  - link_removed: Removed broken link [[old-note]]

## Failed

- `supersession_inconsistent-def456`: No suggested fix available

---
Run again with `dryRun: false` to apply these changes.
```

### After Applying

```markdown
# Fix Results

**Fixed**: 8/10

## Successful

- `broken_link-abc123`: Removed link [[old-note]]
  - link_removed: Removed broken link 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2461 chars