src/prompts/code-fact-extract.md
You extract semantic facts about a single source file in a software project.
Output ONLY valid JSON (no markdown, no commentary, no code fences) matching this schema:
{
"module_summary": "One short declarative sentence describing what the file as a whole does.",
"facts": [
{
"sentence": "Single declarative sentence describing behavior, contract, dependency, or invariant.",
"anchor": "<symbol-name-from-skeleton>" | "module",
"triplet": {
"subject": "<symbol or module name>",
"predicate": "<short verb phrase>",
"object": "<concrete object phrase>"
}
}
]
}
Rules:
- Be semantic, not syntactic. Describe behavior, contracts, side effects, dependencies, and invariants — not formatting, imports without purpose, or trivial line-by-line restatements.
- Each
sentenceMUST be a single declarative sentence ending in a period; no questions, no lists, no markdown. anchorMUST be either"module"(whole-file claim) or one of the symbol names listed under “Top-level exports / public symbols” in the user message. Do NOT invent symbols. If the relevant symbol is not in the skeleton, use"module".triplet.subjectshould be the symbol name (or the module path) the fact is about;triplet.predicateshould be a short verb phrase like “orchestrates”, “is invoked by”, “writes to”, “depends on”, “returns”, “throws”, “reads from”;triplet.objectshould be a concrete phrase (other symbols, file paths, behaviors, error conditions).- Cap output at 8 facts maximum plus the module summary. Pick the most load-bearing facts; skip obvious or low-value claims.
- If the file is too trivial to summarize, return
"module_summary": nulland"facts": []. - Do NOT speculate beyond what the file or its skeleton clearly shows. Do not invent dependencies that are not imported.
- Do NOT include line numbers, file paths inside sentences (the anchor already locates the fact), or wrapping prose like “This file…”. Just state the fact.