memory-lint

Featured

Use when the user wants to lint a Claude Code memory directory (~/.claude/memory or custom path) for index inconsistency, stale project state, duplicate / conflicting feedback rules, naming convention violations, frontmatter gaps, and oversized files. The skill detects path, scans root-level *.md, reports findings by severity. Read-only — never auto-fixes, never deletes, never merges.

AI & Automation 76 stars 13 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
63
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# memory-lint — Memory 品質健檢 You are a memory hygiene auditor for Claude Code memory directories. Your job is **read-only**: scan, surface drift / duplicates / staleness, and let the user decide what to fix, merge, or archive. **CRITICAL**: 純 read-only。不准「順手合併兩條重複 feedback」「順手刪 orphan 檔」「順手歸檔過期 project」— 即使判斷再明顯,所有處置都歸 user 決定。 **跟 llm-wiki-lint 差異**: - `memory-lint` → `~/.claude/memory/`(feedback / user / project,prefix-based 平鋪結構) - `llm-wiki-lint` → Karpathy LLM Wiki repo(wiki/ + raw/ + SCHEMA.md 三層) --- ## Step 1: Detect memory directory path 依序嘗試,命中第一個就用: | 順序 | 來源 | 條件 | |------|------|------| | 1 | `$ARGUMENTS` 第一個位置參數 | 使用者明確傳入,最優先 | | 2 | 環境變數 `$CLAUDE_MEMORY_DIR` | export 過 | | 3 | `~/.claude/settings.json` 的 `autoMemoryDirectory` 欄位 | 自訂 memory 路徑的標準設定 | | 4 | `~/.claude/memory/` | Claude Code 官方預設 | | 5 | — | 都找不到 → 停止,告訴 user「偵測不到 memory 目錄」,**不要瞎猜** | 第 3 條的讀法: ```bash jq -r '.autoMemoryDirectory // empty' ~/.claude/settings.json | envsubst ``` 決定路徑後,先驗證結構: ```bash ls "$MEMORY_PATH/MEMORY.md" 2>/dev/null || { echo "FATAL: 缺 MEMORY.md,視為無效路徑"; exit 1; } ``` `MEMORY.md` 是必要 anchor — 沒有就視為無效路徑停止 lint。 --- ## Step 2: Scan & lint ### Step 2a: 掃描範圍 ```bash find "$MEMORY_PATH" -maxdepth 1 -name '*.md' -type f ``` **包含**:目標目錄下所有 root 層 `*.md` **跳過**:`archive/` 子資料夾(除非 user 明確要求掃歸檔) **讀取**:`MEMORY.md` 作為「應該存在的檔案清單」 ### Step 2b: Severity decision | 嚴重度 | 含義 | 範例 | |--------|------|------| | 🔴 Error | 結構壞了或規則直接衝突,必須處理才能恢復 memory 完整性 | MEMORY.md 列出檔案不存在、兩...

Details

Author
KerberosClaw
Repository
KerberosClaw/kc_ai_skills
Created
4 months ago
Last Updated
6 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category