name: codebase-analysis
Analyze an existing codebase to determine what the software does, how it is structured, how its main components interact, and how it behaves at runtime.
The primary goal is to produce a technical report that allows a developer unfamiliar with the repository to understand the system without requiring an exhaustive manual review of every file.
This skill is for analysis and architecture discovery only.
Do not:
Do those only when explicitly requested by the user.
The analysis must distinguish between:
Never present an inference as a verified fact.
At the end of the analysis, answer this question:
If this codebase were handed to a developer who had never seen it before, would the report allow them to understand what the software does and how it works?
Do not read every file indiscriminately.
Use a progressive discovery process:
For large repositories, analyze by subsystem or directory and progressively merge findings.
Avoid repeatedly reading files that do not add meaningful information.
Inspect the repository structure and identify:
Identify files that provide high information value, such as:
README*package.jsoncomposer.jsonpyproject.tomlrequirements.txtCargo.tomlgo.mod.csproj.slnpom.xmlbuild.gradleMakefileDockerfileDo not assume the README accurately represents the implementation. Verify important claims against the code.
Determine the technologies used by the project.
Include where applicable:
Separate direct evidence from inferred technologies.
Determine what the software actually does.
Use evidence from:
Describe:
Do not derive the purpose from filenames alone when implementation evidence is available.
Locate the principal execution entry points.
Examples include:
For each important entry point, explain:
Describe the logical repository structure rather than merely listing directories.
For each important area, explain its responsibility.
Example:
src/
controllers/ HTTP request handling
services/ Application logic
repositories/ Persistence abstraction
models/ Domain/data models
Ignore directories that are purely generated, vendored, cached, or otherwise irrelevant unless they affect runtime behavior.
Reconstruct the architecture from the implementation.
Identify where applicable:
Do not force the repository into a known architectural pattern.
If no clear formal architecture exists, describe the actual observed structure.
Document:
Identify the major components or modules.
For each important component, document:
Focus on components that materially affect system behavior.
Analyze both external and internal dependencies.
Identify important libraries and services that materially influence the application.
Do not enumerate every dependency unless useful.
Explain what the significant dependencies are used for.
Describe relationships between:
Highlight central components that many other areas depend on.
Trace the most important execution flows through the application.
Examples:
For each flow, show the sequence of important components.
Example:
HTTP Request
-> Router
-> Controller
-> Service
-> Repository
-> Database
-> Response
Only include flows supported by the implementation.
Identify how data is stored and accessed.
Document where applicable:
Describe how data flows between the application and persistence layer.
Do not perform a database quality assessment unless explicitly requested.
Identify external systems used by the codebase.
Examples:
For each meaningful integration, document:
Never include actual secret values in the report.
If present, identify:
Describe how the mechanism works based on implementation evidence.
This is architectural documentation, not a security assessment.
Identify important configuration sources:
Explain how configuration reaches the application.
Do not expose secret values.
Determine how the project is built and run.
Identify where applicable:
Describe only what can be established from the repository.
Identify asynchronous or non-request-driven execution such as:
Explain how they are triggered and what they do.
Identify:
Describe how these fit into the repository.
Do not evaluate test quality unless explicitly requested.
Produce a concise list of the files that are most useful for understanding the application.
For each file, explain why it matters.
Prioritize files such as:
Avoid producing a large unfiltered file list.
For large repositories:
Prefer targeted exploration over exhaustive file reading.
When token or context limits matter, prioritize:
Every important conclusion must be supported by repository evidence.
Classify conclusions as follows.
Directly established from code, configuration, dependency manifests, or other repository artifacts.
Strongly suggested by the implementation but not conclusively established.
State why the inference was made.
Information that cannot be determined from the available repository.
Do not invent missing behavior.
When evidence conflicts, explicitly describe the conflict.
The final report must:
Use diagrams in text form when they improve understanding.
Example:
Browser
|
v
Frontend SPA
|
v
HTTP API
|
v
Application Services
|
+----> External API
|
v
Database
Use the following structure when applicable.
Summarize the system, its purpose, and its high-level architecture.
Explain the observable functional purpose of the application.
List the significant technologies and their roles.
Explain the important directories and logical organization.
Document how the major execution paths begin.
Describe the observed architecture, layers, boundaries, and communication paths.
Explain the responsibilities and relationships of major components.
Describe important external and internal dependencies.
Trace the most important application flows.
Explain storage, models, repositories, databases, caches, and data flow.
Document meaningful external systems and integration boundaries.
Describe authentication and authorization architecture when present.
Explain the important configuration mechanisms.
Describe how the software is built, started, and deployed.
Describe workers, queues, cron jobs, listeners, and scheduled processes.
Describe testing infrastructure and developer tooling.
List the most informative files and why they matter.
Identify architectural patterns only when supported by clear evidence.
Summarize the most important conclusions directly established from the repository.
List conclusions that are likely but not fully verified, including the evidence behind them.
List important aspects that could not be determined from the repository.
The analysis is complete when the report makes it possible to understand:
Do not continue exploring low-value files once these questions are sufficiently answered.