Skill: Review Codebase
Purpose
Run a scope-only atomic review of the current state of a given path (a single file / a directory / a repository). Paired with review-diff (which reviews git changes only), it is one of the two scope-step candidates for orchestrate-code-review — this skill looks at the snapshot, review-diff looks at the change.
Not done here: cognitive dimensions such as security / performance / architecture (the cognitive-step atomic skills review-security / review-performance / review-architecture take those), and language- or framework-specific analysis (the language / framework steps take that).
Core Objective
Primary goal: produce a scope-only findings list that identifies the structural problems in a given path (boundaries, patterns, dependencies, tech debt, interfaces).
Success criteria (all of them must hold):
- ✅ Scope confirmed: confirm the user's path or directory before analysis
- ✅ 5 dimensions covered: findings are emitted for module boundaries, pattern consistency, cross-module dependencies, tech debt and interface stability
- ✅ Precise locations: every finding carries a
file:line reference
- ✅ Format conformant: findings carry location / category=
scope / severity / title / description / suggestion, per specs/findings-list.md
- ✅ Large scopes handled: for a repository-level scope, emit by layer (module / directory), or settle a priority subset with the user
- ✅ No overreach: no security / performance / architecture / language / framework cognitive findings are emitted (they are flagged, pointing at the matching atomic skill)
Scope Boundaries
This skill owns:
- Structural review of the current state of the given path
- Findings across 5 dimensions: module boundaries, pattern consistency, cross-module dependency and coupling, tech debt and maintainability, interface stability
This skill does not own:
- Reviewing git changes alone (use
review-diff)
- The full orchestrated review (use
orchestrate-code-review)
- Language- / framework-specific conventions (use
review-<lang> / review-<framework>)
- The security / performance / architecture cognitive dimensions (use
review-security / review-performance / review-architecture)
Handoff point: once the findings are out, they feed the scope step of orchestrate-code-review for aggregation, or go to the user to decide what follows (refactoring / a deeper review).
Use Cases
- New module review: given
src/auth/, look at the current structure and dependencies
- Legacy path audit: given a path, look at tech debt and boundary problems
- Sampled review: a file or directory a colleague names, with no diff needed
- As the scope step of orchestrate-code-review: this one or
review-diff, never both
Behavior
Scope resolution
- The input defines the scope: a single file / a directory / the repository root / several paths, named by the user
- No dependence on a diff: analyze the current file content; a diff the user supplies is context only, not a requirement
Defaults and pre-run confirmation
| Item |
Default |
How the user departs from it |
| Path |
Repository root |
Choose: [repository root] / [the current file's directory] / [list the top-level directories and pick] |
| Large-scope handling |
Emit by layer (module / directory) |
Choose a priority subset (from the top-level directory list) |
Two things must be confirmed before the run: (1) the review path; (2) for a large scope, by-layer vs priority subset.
The 5 dimensions
For the code in scope (at the layer / subset the user chose), emit findings on these dimensions:
- Module boundaries: whether module / service boundaries are clear, whether responsibilities are single, whether the dependency direction is sound
- Pattern consistency: whether patterns are used aptly and match the repository's existing style
- Cross-module dependency and coupling: dependency relations, cyclic dependencies, degree of coupling
- Tech debt and maintainability: duplication, complexity, testability, the current state of docs and comments
- Interface stability: how clear and how stable a module's outward interface is
Every finding must carry a file:line reference.
Flagging out-of-scope findings
When the analysis turns up a concrete security / performance / architecture / language / framework problem: flag it and point at the matching atomic skill, without opening the analysis. For example:
Potential SQL injection risk detected (user input concatenated without escaping); suggest running review-security
Input and Output
Input
- Path: one or more file / dir paths
- Optional: a focus hint ("concentrate on module boundaries", for example)
Output
- Findings list: the standard format (location / category=scope / severity / title / description / suggestion), grouped by file or by module
- Large-scope summary: when organized by layer, emit the findings count and severity distribution for each layer
Restrictions
Hard boundaries
- Do not assume "the diff only" — by default this skill reviews the complete current state of the given scope
- Emit no cognitive-dimension findings (security / performance / architecture)
- Emit no language- / framework-specific findings
- Emit no finding that lacks a
file:line reference
- Use no vague language ("might be a problem", carrying neither a type nor a direction → delete it)
Skill boundaries
Not done here (other atomic skills own it):
- Reviewing git changes →
review-diff
- Full-dimension orchestration →
orchestrate-code-review
- Language conventions →
review-<lang>
- Framework conventions →
review-<framework>
- Security / performance / architecture →
review-security / review-performance / review-architecture
Self-Check
Examples
Example 1: a single directory
- Input:
src/auth/
- Output: findings across the 5 dimensions, grouped by file, each carrying a reference of the
auth.go:42 kind; a weak crypto algorithm is flagged only, pointing at review-security
Example 2: a single file
- Input:
pkg/validator/validator.go
- Output: findings on module responsibility / interface clarity / test coverage / dependencies on upstream modules, and so on
Example 3: the whole repository (large scope)
- Input: the repository root
- Behavior: first emit a findings summary table by layer (top-level directory), then have the user pick a priority subset to go deeper on
- Output: the layer summary plus detailed findings for the priority subset
1---2name: review-codebase3description: Review given file/dir/repo for current-state code organization: module boundaries, design patterns, cross-module dependencies, tech debt, and interface stability. Scope-only atomic skill; output is a findings list.4license: MIT5---67# Skill: Review Codebase89## Purpose1011Run a scope-only atomic review of the **current state** of a **given path** (a single file / a directory / a repository). Paired with `review-diff` (which reviews git changes only), it is one of the two scope-step candidates for orchestrate-code-review — this skill looks at the snapshot, review-diff looks at the change.1213**Not done here**: cognitive dimensions such as security / performance / architecture (the cognitive-step atomic skills `review-security` / `review-performance` / `review-architecture` take those), and language- or framework-specific analysis (the language / framework steps take that).1415---1617## Core Objective1819**Primary goal**: produce a scope-only findings list that identifies the structural problems in a given path (boundaries, patterns, dependencies, tech debt, interfaces).2021**Success criteria** (all of them must hold):22231. ✅ **Scope confirmed**: confirm the user's path or directory before analysis242. ✅ **5 dimensions covered**: findings are emitted for module boundaries, pattern consistency, cross-module dependencies, tech debt and interface stability253. ✅ **Precise locations**: every finding carries a `file:line` reference264. ✅ **Format conformant**: findings carry location / category=`scope` / severity / title / description / suggestion, per [specs/findings-list.md](../../specs/findings-list.md)275. ✅ **Large scopes handled**: for a repository-level scope, emit by layer (module / directory), or settle a priority subset with the user286. ✅ **No overreach**: no security / performance / architecture / language / framework cognitive findings are emitted (they are flagged, pointing at the matching atomic skill)2930---3132## Scope Boundaries3334**This skill owns**:3536- Structural review of the current state of the given path37- Findings across 5 dimensions: module boundaries, pattern consistency, cross-module dependency and coupling, tech debt and maintainability, interface stability3839**This skill does not own**:4041- Reviewing git changes alone (use `review-diff`)42- The full orchestrated review (use `orchestrate-code-review`)43- Language- / framework-specific conventions (use `review-<lang>` / `review-<framework>`)44- The security / performance / architecture cognitive dimensions (use `review-security` / `review-performance` / `review-architecture`)4546**Handoff point**: once the findings are out, they feed the scope step of orchestrate-code-review for aggregation, or go to the user to decide what follows (refactoring / a deeper review).4748---4950## Use Cases5152- **New module review**: given `src/auth/`, look at the current structure and dependencies53- **Legacy path audit**: given a path, look at tech debt and boundary problems54- **Sampled review**: a file or directory a colleague names, with no diff needed55- **As the scope step of orchestrate-code-review**: this one or `review-diff`, never both5657---5859## Behavior6061### Scope resolution6263- **The input defines the scope**: a single file / a directory / the repository root / several paths, named by the user64- **No dependence on a diff**: analyze the current file content; a diff the user supplies is context only, not a requirement6566### Defaults and pre-run confirmation6768| Item | Default | How the user departs from it |69|---|---|---|70| **Path** | Repository root | Choose: [repository root] / [the current file's directory] / [list the top-level directories and pick] |71| **Large-scope handling** | Emit by layer (module / directory) | Choose a priority subset (from the top-level directory list) |7273Two things must be confirmed before the run: (1) the review path; (2) for a large scope, by-layer vs priority subset.7475### The 5 dimensions7677For the code in scope (at the layer / subset the user chose), emit findings on these dimensions:78791. **Module boundaries**: whether module / service boundaries are clear, whether responsibilities are single, whether the dependency direction is sound802. **Pattern consistency**: whether patterns are used aptly and match the repository's existing style813. **Cross-module dependency and coupling**: dependency relations, cyclic dependencies, degree of coupling824. **Tech debt and maintainability**: duplication, complexity, testability, the current state of docs and comments835. **Interface stability**: how clear and how stable a module's outward interface is8485Every finding must carry a `file:line` reference.8687### Flagging out-of-scope findings8889When the analysis turns up a concrete security / performance / architecture / language / framework problem: **flag it and point at the matching atomic skill**, without opening the analysis. For example:9091> Potential SQL injection risk detected (user input concatenated without escaping); suggest running `review-security`9293---9495## Input and Output9697### Input9899- **Path**: one or more file / dir paths100- **Optional**: a focus hint ("concentrate on module boundaries", for example)101102### Output103104- **Findings list**: the standard format (location / category=scope / severity / title / description / suggestion), grouped by file or by module105- **Large-scope summary**: when organized by layer, emit the findings count and severity distribution for each layer106107---108109## Restrictions110111### Hard boundaries112113- Do not assume "the diff only" — by default this skill reviews the complete current state of the given scope114- Emit no cognitive-dimension findings (security / performance / architecture)115- Emit no language- / framework-specific findings116- Emit no finding that lacks a `file:line` reference117- Use no vague language ("might be a problem", carrying neither a type nor a direction → delete it)118119### Skill boundaries120121**Not done here** (other atomic skills own it):122123- Reviewing git changes → `review-diff`124- Full-dimension orchestration → `orchestrate-code-review`125- Language conventions → `review-<lang>`126- Framework conventions → `review-<framework>`127- Security / performance / architecture → `review-security` / `review-performance` / `review-architecture`128129---130131## Self-Check132133- [ ] The scope was confirmed with the user134- [ ] A large scope was emitted by layer, or a priority subset was settled135- [ ] All 5 dimensions are covered (module boundaries / patterns / dependencies / tech debt / interfaces)136- [ ] Every finding carries a file:line reference137- [ ] No cognitive / language / framework dimension finding was emitted (they are flagged only, pointing at the matching atomic skill)138- [ ] The output format conforms (location / category / severity / title / description / suggestion)139140---141142## Examples143144### Example 1: a single directory145146- Input: `src/auth/`147- Output: findings across the 5 dimensions, grouped by file, each carrying a reference of the `auth.go:42` kind; a weak crypto algorithm is flagged only, pointing at `review-security`148149### Example 2: a single file150151- Input: `pkg/validator/validator.go`152- Output: findings on module responsibility / interface clarity / test coverage / dependencies on upstream modules, and so on153154### Example 3: the whole repository (large scope)155156- Input: the repository root157- Behavior: first emit a findings summary table by layer (top-level directory), then have the user pick a priority subset to go deeper on158- Output: the layer summary plus detailed findings for the priority subset