[Feature] Codebase Intelligence & Repo Map (`/repomap`)
Description
Introduce a local tree-sitter or @swc/core based symbol index and directed edge graph (file -> referenced file) to generate a Repo Map. This map can be injected into the system prompt to give the agent codebase-wide context.
Use Case
Currently, every "find X" requires either a grep or a full LLM tool round-trip. A lightweight symbol index would allow the agent to understand codebase structure without LLM invocations, saving time and tokens.
Proposed Solution
Create a new source/repo-map/ module with parsers, graph generation, and in-house PageRank. Add a /repomap slash command. Auto-inject a 1024-token preview into the system prompt.
Alternatives Considered
Relying entirely on LSP (Nanocoder has an LSP client but doesn't proactively use it for background context-gathering).
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] This feature aligns with the project's goals (local-first AI assistance)
Hey @akramcodez!
Happy to take this on. A few implementation notes:
1. Skip tree-sitter for v1.
2. No import resolution.
3. Injection can't happen inside buildSystemPrompt.
4. Startup latency is the real risk,
Suggest splitting into 3 PRs:
(1) source/repo-map/ + /repomap command, no injection;
(2) prompt injection + repo_map tool;
(3) optional tree-sitter extractor.
sure @addyCooks go for it :)