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

39 lines
2.7 KiB
Markdown
Raw Normal View History

## Why
The current memory-query skill has a god-node dependency — it assumes a hub note is surfaced in the session's `additionalContext` as an entry point. That injection relies on heavy session context output (vault graph report, convention query, journal pointer) that pays a cost every session regardless of whether vault knowledge is needed. There is also no routing rule: nothing tells Claude when to reach for the vault versus when to reach for a project graph.
On the project side, the `memory-project-graph` skill was never implemented. Per-project code graphs exist (any repo can be onboarded to Graphify), but Claude has no protocol for creating, updating, or querying them.
## What Changes
1. **Rename `memory-query` → `memory-vault`** with two changes to the SKILL.md: drop the god-node section (graphify's internal traversal handles this; no injected entry point needed), and add an explicit scope statement — this skill is for cross-project evergreen knowledge, not codebase structure.
2. **Create `memory-project`** — a new skill covering the full lifecycle of per-project Graphify graphs: onboard (extract + cluster + gitignore), incremental update, structural update (--force), remove, and project-scoped query routing. Query mechanics delegate to `memory-vault` rather than being duplicated.
3. **Add a routing rule block to `~/.claude/CLAUDE.md`** — vault for anything that generalizes beyond one repo; project graph for codebase structure and module relationships. Decision heuristic: "Would this be useful outside this repo, next year?"
4. **Trim `session-context.sh`** to emit only the project graph path pointer when `graphify-out/graph.json` exists. Drop: vault graph report, live convention query, journal pointer.
5. **Mirror** both skill renames and additions to `.codex/skills/` and `.pi/skills/` — the three AI assistant directories stay identical.
## Capabilities
### New Capabilities
- `memory-vault`: Cross-project vault querying without god-node injection dependency.
- `memory-project`: Per-project graph lifecycle (onboard, update, remove) and project-scoped queries.
- `memory-routing`: Routing rule in `~/.claude/CLAUDE.md` — globally visible, single place to maintain.
### Modified Capabilities
- `session-context.sh`: Narrowed to project graph pointer only — less injection noise, faster hook execution.
## Impact
- Rename: `~/.claude/plugins/memory/skills/memory-query/``memory-vault/`
- New file: `~/.claude/plugins/memory/skills/memory-project/SKILL.md`
- Edit: `session-context.sh` (trim to graph pointer)
- Edit: `~/.claude/CLAUDE.md` (add routing rule block)
- Mirror all the above to `.codex/skills/` and `.pi/skills/`
- No new runtime dependencies — same `graphify` CLI and `qwen2.5-coder:7b` Ollama model.