Customizing Output
You can customize what Sylva extracts and how it formats the AGENTS.md by modifying the prompt signatures in src/prompts.ts.
Modifying Extraction Fields
Each output field in CODEBASE_ANALYSIS_SIGNATURE has a description string that instructs the AI on what to extract. To change the output:
- Open
src/prompts.ts - Find the
.output()call for the field you want to change - Modify the description string
- Rebuild:
npm run build
Example: Adding Framework Version Detection
Change:
.output("techStack", f.string("Tech Stack & Versions: List EVERY distinct language..."))
To:
.output("techStack", f.string(
"Tech Stack & Versions: List EVERY distinct language with EXACT version " +
"numbers from lock files (e.g., 'React 19.0.0' not just 'React'). " +
"Include build tools, linters, and CI runners."
))
Adding New Sections
To add a new section to AGENTS.md:
- Add a new
.output()field toCODEBASE_ANALYSIS_SIGNATUREinsrc/prompts.ts - Add the corresponding field to
EXTRACT_AGENTS_SECTIONS_SIGNATURE - Add the field to the
AgentsMdSectionsinterface insrc/utils.ts - Add the heading mapping to
AGENTS_SECTION_HEADINGSinsrc/utils.ts - Rebuild:
npm run build
Removing Sections
To remove a section you don't need:
- Remove the
.output()call from both signatures insrc/prompts.ts - Remove the field from
AgentsMdSectionsinsrc/utils.ts - Remove the heading mapping from
AGENTS_SECTION_HEADINGS - Rebuild
Changing the Agent Persona
Edit CODEBASE_ANALYZER_IDENTITY in src/prompts.ts:
export const CODEBASE_ANALYZER_IDENTITY = {
name: "CodebaseAnalyzer",
description: "Your custom description here..."
};
Warning: Be careful when modifying the anti-hallucination rules in the identity description. Removing them may cause the AI to guess frameworks incorrectly.