
Add Language Support
Adds tree-sitter language support to codegraph, with tests and extraction benchmarks.
Install
npx skills add colbymchenry/codegraph --skill add-lang -g -a claude-code -y- Repository
- colbymchenry/codegraph76.2k
- Category
- Engineering
- Updated
- 2d ago
- License
- MIT
- Context cost
- Mediumabout 2,657 tokens
- Runs scripts
- No, instructions only
What it does
Add tree-sitter language support to codegraph end-to-end, wire the grammar + extractor, write tests, then benchmark extraction quality and retrieval value on 3 popular real-world repos. Use when the user runs /add-lang <language> or asks to add/support a new language (e.g. Lua, Elixir, Zig, OCaml) in codegraph.
Add a language to CodeGraph
Wire a new tree-sitter language into codegraph's extraction pipeline, prove it extracts real symbols on popular repos, and prove it beats no-codegraph for an agent. Runs fully autonomously, pick repos, benchmark, update docs, then report. Never commit, push, publish, or tag (house rule); leave all changes for the user to review.
The argument is the language token used throughout the Language union, e.g.
lua, elixir, zig. If none was given, ask which language. Use the lowercase
single-token form everywhere (csharp, not c#).
Prerequisites
- Run from the codegraph repo root.
node,git,gh, and a logged-inclaudeCLI (the benchmark spawns realclaude -pruns). - The benchmark uses the local dev build, Step 8 builds + links it on PATH.
Workflow
Copy this checklist and work through it in order:
- [ ] 1. Resolve language; bail early if already supported (just benchmark)
- [ ] 2. Find a grammar + health-check it (ABI / heap corruption)
- [ ] 3. Discover the grammar's AST node types (dump-ast.mjs)
- [ ] 4. Wire the language (4 files; sometimes a 5th core touch)
- [ ] 5. Build + verify-extraction loop until PASS
- [ ] 6. Add extraction tests; make them green
- [ ] 7. Auto-pick 3 popular repos by size tier; add to corpus.json
- [ ] 8. Benchmark all 3: extraction + with/without A/B
- [ ] 9. Update README + CHANGELOG
- [ ] 10. Report; do NOT commit
Step 1, Resolve + short-circuit
Check whether the language is already wired: look for the token in the
LANGUAGES const (src/types.ts) and the EXTRACTORS map
(src/extraction/languages/index.ts). If it is already supported (e.g.
typescript, rust), skip Steps 2, 6 and go straight to benchmarking
(Steps 7, 8) to validate/measure it, note in the report that no code changed.
