cc-os/openspec/changes/archive/2026-06-08-memory-project-g.../tasks.md

3.8 KiB

1. Write routing rule to ~/.claude/CLAUDE.md

  • 1.1 Add a "Memory routing" section to ~/.claude/CLAUDE.md with:
    • 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

2. Rename memory-query → memory-vault and update SKILL.md

  • 2.1 Rename ~/.claude/plugins/memory/skills/memory-query/ to memory-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-write for knowledge that generalizes; decision heuristic points to ~/.claude/CLAUDE.md routing rule

3. Create memory-project skill

  • 3.1 Create directory ~/.claude/plugins/memory/skills/memory-project/
  • 3.2 Write SKILL.md with sections:
    • Scope — project graph at ./graphify-out/graph.json; codebase structure only
    • Onboardgraphify extract . --backend ollama --model qwen2.5-coder:7b, then graphify cluster-only ., then add graphify-out/ to .gitignore; note AST-only cost for code repos; confirm graph.json exists before reporting done
    • Incremental updategraphify update . for routine edits; graphify update . --force for structural changes (renames, deletions, moves); suggest update after major refactors
    • Remove — delete graphify-out/; graph is rebuildable; leave gitignore entry
    • Querygraphify query "<question>" --graph ./graphify-out/graph.json; delegate traversal mechanics to memory-vault (no duplication)
    • Graph path discoverysession-context.sh injects path if graph exists; if no path injected in project context, suggest onboard
    • Constraints — never commit graphify-out/; model is qwen2.5-coder:7b; gitignore entry survives deletion

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.md with 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.md with the content from step 3

6. Verify against spec

  • 6.1 Check Requirement 1: routing rule exists in ~/.claude/CLAUDE.md with vault/project distinction and decision heuristic
  • 6.2 Check Requirement 2: memory-vault SKILL.md has no god-node section; has scope statement; query patterns present; tag-caution retained
  • 6.3 Check Requirement 3: memory-project SKILL.md covers all lifecycle operations; query delegates to memory-vault; constraints stated; gitignore contract explicit
  • 6.4 Check Requirement 4: session-context.sh emits only the graph path pointer; vault report, convention query, journal pointer are gone
  • 6.5 Check Requirement 5: content of memory-vault/SKILL.md and memory-project/SKILL.md is identical across ~/.claude/plugins/memory/skills/, .codex/skills/, .pi/skills/