|
| 1 | +# DX Improvements — Research |
| 2 | + |
| 3 | +Candidates for improving developer experience, agent ergonomics, and tooling. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 1. `.agents/lessons.md` convention |
| 8 | + |
| 9 | +**Type:** Doc | **Effort:** ~10 min |
| 10 | + |
| 11 | +Add a persistent lessons file that agents update after corrections. Prevents repeating the same mistakes across sessions. Convention: agents check it before starting, append after corrections. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## 2. `--performance` CLI flag |
| 16 | + |
| 17 | +**Type:** Code | **Effort:** ~2-4 hr |
| 18 | + |
| 19 | +Instrument key phases (glob, parse, resolve, insert, index creation) with `perf_hooks` timerify. A `--performance` flag prints a timing breakdown after indexing. Helps users and devs diagnose slow runs without external profiling tools. |
| 20 | + |
| 21 | +Current state: `index-engine.ts` already captures total elapsed ms via `performance.now()`, and `benchmark.ts` measures query speed and reindex speed externally. The gap is per-phase granularity from the CLI itself. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## 3. Adapter scaffolding script |
| 26 | + |
| 27 | +**Type:** Code | **Effort:** ~2-4 hr |
| 28 | + |
| 29 | +`codemap create-adapter --name [name]` generates boilerplate for a community language adapter: adapter file, test file, fixture directory. Lowers the barrier for contributors building adapters for new languages. |
| 30 | + |
| 31 | +Prerequisite: community adapter registration API (on roadmap). Scaffolding could land independently with a manual registration step if the API isn't ready. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## 4. AST-based config resolution |
| 36 | + |
| 37 | +**Type:** Code | **Effort:** ~2-4 hr |
| 38 | + |
| 39 | +For `codemap.config.ts`, consider AST-based extraction (via `oxc-parser`, already a dependency) instead of executing the config with native `import()` (ESM dynamic import). Faster, no side effects, safer in untrusted repos. JSON configs are already safe. |
| 40 | + |
| 41 | +Trade-off: AST-based can't handle dynamic configs (the current loader supports async functions returning config). Could offer both paths — AST-first with `import()` fallback. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 5. Watch mode |
| 46 | + |
| 47 | +**Type:** Code | **Effort:** ~4-8 hr | **Status:** On roadmap backlog |
| 48 | + |
| 49 | +`node:fs.watch` with `{ recursive: true }` + incremental re-index of changed files. The existing incremental/targeted model (`--files`) already supports the core loop — the gap is the file-watching shell and session management. |
| 50 | + |
| 51 | +Platform note: `recursive: true` on Linux requires Node 19.1+ and behaves differently from macOS FSEvents — may need a fallback or documented minimum. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 6. MCP server wrapping `query` |
| 56 | + |
| 57 | +**Type:** Code | **Effort:** ~4-8 hr | **Status:** On roadmap backlog |
| 58 | + |
| 59 | +Expose `query` as an MCP tool so agents in any IDE can run SQL against the index without shell access. Minimal surface: one tool (run SQL, return rows). Could be a separate entry point or package. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## 7. Monorepo / workspace awareness |
| 64 | + |
| 65 | +**Type:** Code | **Effort:** ~8+ hr | **Status:** On roadmap backlog |
| 66 | + |
| 67 | +Discover workspaces from `pnpm-workspace.yaml` / `package.json` workspaces and index per-workspace dependency graphs. Currently Codemap indexes one root — workspace-aware indexing would give more precise `dependencies` edges in monorepos. |
0 commit comments