Plan a feature through codegraph
When the user describes a new feature, a refactor, or any broad change,
resist the reflex to Read / Grep / ls files. Call codegraph MCP tools
first: they return exact file paths + line numbers, so the Read calls
that follow are surgical.
Required sequence
mcp__codegraph__context_for_task(task, session_id=<id>)
Pass the user's full description. Returns the most-relevant symbols
with their docstrings and relationships (callers, callees, inheritors),
PLUS top Claude Code memory entries and related plan files in one
response. Pass a stable session_id so subsequent calls don't
re-serve already-shown entities.
If it returns empty code results, move on: don't block the plan.
mcp__codegraph__architecture_overview()
Compact map of files grouped by layer + role (router / handler /
manager / service / model / schema / component / store / ...). Use
this to locate where the new feature should live.
mcp__codegraph__domain_map(keyword)
For every noun the user mentions (e.g. "donors", "stats", "receipts"),
call this to get every file touching that domain grouped by role.
Do this in PARALLEL for multiple keywords.
mcp__codegraph__endpoints(path_pattern)
If the feature involves HTTP (API calls, new routes, frontend/backend
coupling), list existing endpoints matching the domain. Reveals the
FastAPI ↔ Nuxt contract.
mcp__codegraph__memory_search(query, kind="feedback"): only when
the user hints at preferences you might already know. Avoids asking
the same question twice across sessions.
mcp__codegraph__plan_search(query): when the user mentions a
past plan ("the refactor we discussed"). Reuse rather than re-derive.
mcp__codegraph__find_callers(fn_name) / find_callees(fn_name)
Only for symbols identified in steps 1-4 that you plan to change.
Never blindly on arbitrary names.
After the map is clear
Summarise the touch points to the user in 3-6 bullet points
before writing any code. Format:
• api/handlers/donation_handler.py:42-58: DonationHandler.list
• api/routers/donations.py:87: GET /donations route
• apps/admin/pages/donations.vue:12-40: frontend consumer
Ask for confirmation on scope before implementing.
Read only the exact line ranges returned by the tools. Never Read
full files during planning: only during implementation for the
specific regions you'll modify.
What NOT to do
- No
ls, find, or tree: architecture_overview already gives you
the structure.
- No
grep/rg for symbol names: search_symbols / symbol_lookup
are 100× more precise (match class/function nodes, not string
occurrences).
- No Read of CLAUDE.md to find where handlers live: the role taxonomy
in
architecture_overview is canonical.
- No parallel speculative Reads. Plan first, then Read only what you'll
edit.
Token savings
A typical feature plan on this repo:
- Without codegraph: ~8-12 tool calls (ls, Grep, Read × 4-6) →
30k+ tokens just to locate files.
- With this skill: 3-5 tool calls, < 5k tokens, more accurate
results.
1---2name: cgh-feature-plan3description: Plan a new feature or architectural change by FIRST mapping the codebase through codegraph MCP tools instead of Read/Grep. Triggers when the user describes what they want to build or changes ("I want X", "can we add Y", "how should we implement Z", "refactor X to do Y").4---56# Plan a feature through codegraph78When the user describes a new feature, a refactor, or any broad change,9resist the reflex to Read / Grep / ls files. Call codegraph MCP tools10first: they return exact file paths + line numbers, so the Read calls11that follow are surgical.1213## Required sequence14151. **`mcp__codegraph__context_for_task(task, session_id=<id>)`**16 Pass the user's full description. Returns the most-relevant symbols17 with their docstrings and relationships (callers, callees, inheritors),18 PLUS top Claude Code memory entries and related plan files in one19 response. Pass a stable `session_id` so subsequent calls don't20 re-serve already-shown entities.21 If it returns empty code results, move on: don't block the plan.22232. **`mcp__codegraph__architecture_overview()`**24 Compact map of files grouped by layer + role (router / handler /25 manager / service / model / schema / component / store / ...). Use26 this to locate where the new feature should live.27283. **`mcp__codegraph__domain_map(keyword)`**29 For every noun the user mentions (e.g. "donors", "stats", "receipts"),30 call this to get every file touching that domain grouped by role.31 Do this in PARALLEL for multiple keywords.32334. **`mcp__codegraph__endpoints(path_pattern)`**34 If the feature involves HTTP (API calls, new routes, frontend/backend35 coupling), list existing endpoints matching the domain. Reveals the36 FastAPI ↔ Nuxt contract.37385. **`mcp__codegraph__memory_search(query, kind="feedback")`**: only when39 the user hints at preferences you might already know. Avoids asking40 the same question twice across sessions.41426. **`mcp__codegraph__plan_search(query)`**: when the user mentions a43 past plan ("the refactor we discussed"). Reuse rather than re-derive.44457. **`mcp__codegraph__find_callers(fn_name)` / `find_callees(fn_name)`**46 Only for symbols identified in steps 1-4 that you plan to change.47 Never blindly on arbitrary names.4849## After the map is clear50516. **Summarise the touch points** to the user in 3-6 bullet points52 before writing any code. Format:53 ```54 • api/handlers/donation_handler.py:42-58: DonationHandler.list55 • api/routers/donations.py:87: GET /donations route56 • apps/admin/pages/donations.vue:12-40: frontend consumer57 ```58 Ask for confirmation on scope before implementing.59607. **Read only the exact line ranges** returned by the tools. Never Read61 full files during planning: only during implementation for the62 specific regions you'll modify.6364## What NOT to do6566- No `ls`, `find`, or `tree`: `architecture_overview` already gives you67 the structure.68- No `grep`/`rg` for symbol names: `search_symbols` / `symbol_lookup`69 are 100× more precise (match class/function nodes, not string70 occurrences).71- No Read of CLAUDE.md to find where handlers live: the role taxonomy72 in `architecture_overview` is canonical.73- No parallel speculative Reads. Plan first, then Read only what you'll74 edit.7576## Token savings7778A typical feature plan on this repo:79- Without codegraph: ~8-12 tool calls (ls, Grep, Read × 4-6) →80 30k+ tokens just to locate files.81- With this skill: 3-5 tool calls, < 5k tokens, more accurate82 results.