mufeedvh / mufeedvh/code2prompt

Entity-level code map via sem (Rust-native, for templates + token savings)

Open
#315 1 comment 4 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #321 by @rs545837 — merged
Dominant language
Rust
Stars
7.7k
Forks
447
Avg merge
2h 35m
Merged PRs (30d)
2

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading code2prompt's templating and source-tree implementation, then review sem-core's entity extraction interface or the sem entities --json CLI. Determine how an optional entity-map template variable should represent functions, classes, and methods per file. Done means templates can request that structure without including every full source file.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.