name: codebase-explainer
description: Explain the structure, responsibilities, entry points, and dependencies of a directory, module, or feature. Use it to understand an unfamiliar codebase or gather context before making changes.
Codebase Explainer
Purpose
Explain part or all of a codebase so someone can understand its structure quickly.
Core Principles
- Explain structure and roles before listing files.
- Separate confirmed facts from inferences.
- Prioritize entry points, core modules, data flow, and dependencies.
- Surface change-sensitive boundaries before diving into implementation details.
- Tell the reader what to inspect next.
- Target path or module
- Perspective to focus on
- overall structure
- feature flow
- data flow
- dependencies
- modification points
- Related issue or change context, if available
Workflow
- Define the analysis scope.
- Identify entry points and the main responsibility units.
- Summarize the primary flow at a high level.
- Explain module relationships and boundary points.
- Document coupling points and validation points that matter for changes.
- Suggest the next files or functions to read.
One-Line Summary
Structural Overview
- Key directories or modules
- Responsibility of each
Main Flow
- Where requests or input begin
- Key processing stages
- How it reaches storage, response, or rendering
Key Boundaries
- External integration points
- State transition points
- Shared contracts or interfaces
Change Points
- Files to inspect first when changing this area
- Related areas that must be checked together
- High-regression-risk spots
Recommended Next Steps
- Files or symbols to inspect more deeply
- Questions that still need answers
- Explain only what can be verified from the current context.
- Do not fill gaps with guesses; label them as "needs confirmation."
- If the scope is large, summarize the top-level structure first and suggest deeper follow-up targets.