Codebase writeup
Explain a repository as a working system, not a file list. Lead with the most useful or surprising fact, then show the evidence that supports it.
Workflow
- Establish audience, scope, output destination, and deliverable: technical narrative, onboarding guide, handoff, or focused explainer. Confirm whether security or privacy analysis is authorized and relevant.
- Run
bin/codebase-writeup <repo> for a neutral profile of languages, manifests, entry-point candidates, documentation, external domains, and large files. It follows Git ignore rules by default; use --include-ignored only when ignored material is part of the requested analysis.
- Read the README and manifests, then trace at least one complete execution path from entry point through state, external effects, and output.
- Map runtime and build tooling, module ownership, data storage, API boundaries, third-party services, configuration, deployment, and tests.
- Investigate distinctive behavior from code evidence. Search broadly, then read the surrounding implementation before making a claim.
- If risk analysis is in scope, describe observable security and privacy boundaries without exposing credential values or asserting exploitable behavior from static hints alone.
- For contributor-facing documentation, verify discoverable setup, commands, entry points, project structure, and safe-change guidance with
references/onboarding-docs.md. Do not claim a command works unless it was reproduced or clearly label it as documented-only.
- When the request is to audit stale documentation or reconcile stated intent with the implemented system, use
references/intent-reconciliation.md. Do not treat every mismatch as a code defect or silently rewrite historical rationale.
- Draft with
references/writeup-structure.md, omitting sections that genuinely do not apply.
- Fact-check every concrete claim against files, symbols, configuration, tests, or reproduced behavior.
Evidence rules
- Cite relative paths and symbols; add line numbers when they are stable and useful.
- Distinguish documented intent, observed implementation, reproduced behavior, and inference.
- State what was read closely, sampled, or left out in large repositories.
- Do not identify a dependency vulnerability from memory. Verify version-sensitive claims with an appropriate current source when requested.
- Report suspected secrets by location and type, never by printing the value.
- Avoid editorial language that outruns the evidence.
Output
Produce a self-contained writeup for the stated audience. Include a short scope note and confidence limits so a reader knows what the analysis establishes. For onboarding guides, make the first successful verification path and the likely first change discoverable without duplicating reference material already maintained elsewhere. For reconciliation audits, return a claim matrix and an action for each material mismatch.
Use agents/researcher.md for the evidence pass, agents/onboarding-editor.md for contributor documentation, and agents/fact-checker.md for an independent claim audit.
1---2name: codebase-writeup3description: Analyze a codebase and produce an evidence-backed technical narrative or onboarding guide covering purpose, stack, architecture, execution paths, data flow, external integrations, setup, safe-change guidance, operational constraints, and important gaps. Use for engineering handoffs, unfamiliar-project explainers, README or contributor documentation, technical writeups, due-diligence summaries, or requests to explain how a repository works.4---56# Codebase writeup78Explain a repository as a working system, not a file list. Lead with the most useful or surprising fact, then show the evidence that supports it.910## Workflow11121. Establish audience, scope, output destination, and deliverable: technical narrative, onboarding guide, handoff, or focused explainer. Confirm whether security or privacy analysis is authorized and relevant.132. Run `bin/codebase-writeup <repo>` for a neutral profile of languages, manifests, entry-point candidates, documentation, external domains, and large files. It follows Git ignore rules by default; use `--include-ignored` only when ignored material is part of the requested analysis.143. Read the README and manifests, then trace at least one complete execution path from entry point through state, external effects, and output.154. Map runtime and build tooling, module ownership, data storage, API boundaries, third-party services, configuration, deployment, and tests.165. Investigate distinctive behavior from code evidence. Search broadly, then read the surrounding implementation before making a claim.176. If risk analysis is in scope, describe observable security and privacy boundaries without exposing credential values or asserting exploitable behavior from static hints alone.187. For contributor-facing documentation, verify discoverable setup, commands, entry points, project structure, and safe-change guidance with [`references/onboarding-docs.md`](references/onboarding-docs.md). Do not claim a command works unless it was reproduced or clearly label it as documented-only.198. When the request is to audit stale documentation or reconcile stated intent with the implemented system, use [`references/intent-reconciliation.md`](references/intent-reconciliation.md). Do not treat every mismatch as a code defect or silently rewrite historical rationale.209. Draft with [`references/writeup-structure.md`](references/writeup-structure.md), omitting sections that genuinely do not apply.2110. Fact-check every concrete claim against files, symbols, configuration, tests, or reproduced behavior.2223## Evidence rules2425- Cite relative paths and symbols; add line numbers when they are stable and useful.26- Distinguish documented intent, observed implementation, reproduced behavior, and inference.27- State what was read closely, sampled, or left out in large repositories.28- Do not identify a dependency vulnerability from memory. Verify version-sensitive claims with an appropriate current source when requested.29- Report suspected secrets by location and type, never by printing the value.30- Avoid editorial language that outruns the evidence.3132## Output3334Produce a self-contained writeup for the stated audience. Include a short scope note and confidence limits so a reader knows what the analysis establishes. For onboarding guides, make the first successful verification path and the likely first change discoverable without duplicating reference material already maintained elsewhere. For reconciliation audits, return a claim matrix and an action for each material mismatch.3536Use [`agents/researcher.md`](agents/researcher.md) for the evidence pass, [`agents/onboarding-editor.md`](agents/onboarding-editor.md) for contributor documentation, and [`agents/fact-checker.md`](agents/fact-checker.md) for an independent claim audit.