code2prompt's templating + source tree is a great base. A natural addition: an entity-level code map (functions, classes, methods per file) as a template variable, so prompts can include structure without dumping every full file, cutting tokens while improving navigation.
Since code2prompt is Rust, this is especially clean: sem is also Rust and exposes a sem-core crate (entity extraction across 26 languages via tree-sitter), so it can integrate as a library rather than a subprocess. There's also a CLI (sem entities <path> --json) if you'd prefer that path.
I maintain sem and would be glad to send a PR adding an optional entity-map variable. Would that fit the project?
code2prompt's templating + source tree is a great base. A natural addition: an entity-level code map (functions, classes, methods per file) as a template variable, so prompts can include structure without dumping every full file, cutting tokens while improving navigation.
Since code2prompt is Rust, this is especially clean: sem is also Rust and exposes a
sem-corecrate (entity extraction across 26 languages via tree-sitter), so it can integrate as a library rather than a subprocess. There's also a CLI (sem entities <path> --json) if you'd prefer that path.I maintain sem and would be glad to send a PR adding an optional entity-map variable. Would that fit the project?