3.8 KiB
3.8 KiB
1. Write routing rule to ~/.claude/CLAUDE.md
- 1.1 Add a "Memory routing" section to
~/.claude/CLAUDE.mdwith:- Vault (
memory-vault) for: conventions, tool behavior, client facts, patterns that generalize beyond one repo - Project graph (
memory-project) for: codebase structure, module relationships, what exists where in the current repo - Decision heuristic: "Would this be useful outside this repo, next year?" — yes → vault; no → project graph
- Vault (
2. Rename memory-query → memory-vault and update SKILL.md
- 2.1 Rename
~/.claude/plugins/memory/skills/memory-query/tomemory-vault/ - 2.2 Rewrite
SKILL.md:- Replace description frontmatter to reflect vault scope
- Add explicit scope statement: "cross-project evergreen knowledge — not codebase structure"
- Remove the god-node section entirely (no injected hub note required)
- Keep: query/path/explain patterns with
--budget 2000, tag-scoped caution note (ADR-014), episodic → memsearch redirect - Add write guidance: use
memory-writefor knowledge that generalizes; decision heuristic points to~/.claude/CLAUDE.mdrouting rule
3. Create memory-project skill
- 3.1 Create directory
~/.claude/plugins/memory/skills/memory-project/ - 3.2 Write
SKILL.mdwith sections:- Scope — project graph at
./graphify-out/graph.json; codebase structure only - Onboard —
graphify extract . --backend ollama --model qwen2.5-coder:7b, thengraphify cluster-only ., then addgraphify-out/to.gitignore; note AST-only cost for code repos; confirm graph.json exists before reporting done - Incremental update —
graphify update .for routine edits;graphify update . --forcefor structural changes (renames, deletions, moves); suggest update after major refactors - Remove — delete
graphify-out/; graph is rebuildable; leave gitignore entry - Query —
graphify query "<question>" --graph ./graphify-out/graph.json; delegate traversal mechanics tomemory-vault(no duplication) - Graph path discovery —
session-context.shinjects path if graph exists; if no path injected in project context, suggest onboard - Constraints — never commit
graphify-out/; model isqwen2.5-coder:7b; gitignore entry survives deletion
- Scope — project graph at
4. Trim session-context.sh
- 4.1 Edit
~/.claude/plugins/memory/hooks/session-context.sh:- Remove: vault graph report output, live convention query, journal pointer
- Keep: conditional check for
<project-root>/graphify-out/graph.json; if exists, emit the absolute path; else emit nothing
5. Mirror to .codex/ and .pi/
- 5.1 Rename
.codex/skills/memory-query/→memory-vault/; replace SKILL.md with the updated content from step 2 - 5.2 Create
.codex/skills/memory-project/SKILL.mdwith the content from step 3 - 5.3 Rename
.pi/skills/memory-query/→memory-vault/; replace SKILL.md with the updated content from step 2 - 5.4 Create
.pi/skills/memory-project/SKILL.mdwith the content from step 3
6. Verify against spec
- 6.1 Check Requirement 1: routing rule exists in
~/.claude/CLAUDE.mdwith vault/project distinction and decision heuristic - 6.2 Check Requirement 2:
memory-vaultSKILL.md has no god-node section; has scope statement; query patterns present; tag-caution retained - 6.3 Check Requirement 3:
memory-projectSKILL.md covers all lifecycle operations; query delegates to memory-vault; constraints stated; gitignore contract explicit - 6.4 Check Requirement 4:
session-context.shemits only the graph path pointer; vault report, convention query, journal pointer are gone - 6.5 Check Requirement 5: content of
memory-vault/SKILL.mdandmemory-project/SKILL.mdis identical across~/.claude/plugins/memory/skills/,.codex/skills/,.pi/skills/