Repo Review Skill
A systematic approach to fully understand, review, and document any software project or repository.
Phase 0 — Orient & Plan
Before touching any file, run the orientation script:
python3 <SKILL_DIR>/scripts/orient.py <PROJECT_ROOT>
This produces a Project Snapshot JSON with:
- Directory tree (depth 3)
- File count by extension
- Total lines of code estimate
- Top-level README presence
- Git metadata (last commit, branch, contributors)
- Package manifest files detected
Use the snapshot to choose a review depth (see references/depth-guide.md):
| Depth |
Use When |
Output |
| Quick |
< 500 files, simple script/tool |
1-page summary |
| Standard |
500–5000 files, typical app/lib |
Full review report |
| Deep |
5000+ files, monorepo, complex arch |
Deep-dive with sub-reports |
Phase 1 — Structure Analysis
Run the structure analyzer:
python3 <SKILL_DIR>/scripts/structure_analyzer.py <PROJECT_ROOT>
Outputs:
- Annotated directory tree with purpose labels
- Entry points detected (main files, index files, CLI entrypoints)
- Configuration files catalogued
- Test coverage location
- Build artifacts vs source separation
Read references/structure-patterns.md for how to interpret common patterns (monorepo, MVC, layered arch, microservices, etc.).
Phase 2 — Dependency & Tech Stack Analysis
Run the dependency scanner:
python3 <SKILL_DIR>/scripts/dep_scanner.py <PROJECT_ROOT>
This scans:
package.json, pyproject.toml, requirements.txt, Cargo.toml, go.mod, pom.xml, build.gradle, Gemfile, composer.json, .csproj
- Lock files for actual resolved versions
- Dev vs prod dependency split
- Identifies the primary language(s), frameworks, and runtime
Also run:
python3 <SKILL_DIR>/scripts/env_scanner.py <PROJECT_ROOT>
To detect .env files, secrets patterns, and required environment variables.
Phase 3 — Architecture Review
Read references/architecture-patterns.md to match the project to known patterns.
Manual steps Claude must perform:
- Identify the core data model — find schema files, ORM models, or database migrations.
- Trace the main request/data flow from entry point → processing → output.
- Map module boundaries — which directories own which responsibilities.
- Identify cross-cutting concerns — logging, auth, error handling, config management.
- Note external integrations — APIs called, services used, webhooks, queues.
For large projects, run the call-graph helper:
python3 <SKILL_DIR>/scripts/call_graph.py <PROJECT_ROOT> --entry <ENTRY_FILE>
Phase 4 — Code Quality Scan
python3 <SKILL_DIR>/scripts/quality_scan.py <PROJECT_ROOT>
Reports on:
- Code duplication hotspots
- Function/file length outliers (complexity signals)
- TODO/FIXME/HACK comment count and locations
- Test file presence and rough coverage ratio
- Linter config presence
- CI/CD pipeline files
- Documentation coverage (JSDoc, docstrings, type hints)
Read references/quality-rubric.md for scoring interpretation.
Phase 5 — Security & Secrets Audit
python3 <SKILL_DIR>/scripts/security_scan.py <PROJECT_ROOT>
Scans for:
- Hardcoded secrets / API keys (regex patterns)
- Dangerous function calls (
eval, exec, system, shell=True, SQL string concat)
- Insecure defaults (debug=True, CORS wildcard, no auth middleware)
- Sensitive files accidentally committed (
.pem, .key, *.sqlite)
⚠️ Security findings are advisory. Always recommend a dedicated tool (Semgrep, Trivy, Snyk) for production audits.
Phase 6 — Report Generation
Run the report builder:
python3 <SKILL_DIR>/scripts/report_builder.py \
--project-root <PROJECT_ROOT> \
--depth <quick|standard|deep> \
--output /mnt/user-data/outputs/repo-review-report.md
The report follows the template in assets/report-template.md.
Report sections (standard depth):
- Executive Summary — What is this project? Who is it for? What problem does it solve?
- Tech Stack — Languages, frameworks, databases, infra
- Architecture Overview — Diagram (ASCII or Mermaid) + narrative
- Directory Guide — What each major folder does, annotated
- Key Files Reference — The 10–20 most important files and their roles
- Data Flow — How data moves through the system
- External Dependencies — Third-party services and libraries, with risk notes
- Code Quality Assessment — Strengths and improvement areas
- Security Notes — Flags from Phase 5
- Onboarding Checklist — Steps for a new developer to get up and running
- Open Questions — Things that are unclear and worth investigating
For deep depth, also generate sub-reports per major module using report_builder.py --module <MODULE_DIR>.
Phase 7 — Interactive Q&A (optional)
After delivering the report, offer to answer follow-up questions:
"I've completed the review. You can now ask me things like:
- 'How does authentication work in this project?'
- 'Where would I add a new API endpoint?'
- 'What's the test strategy?'
- 'What are the biggest risks in this codebase?'"
Quick Reference
| Task |
Script |
| First look |
orient.py |
| Directory map |
structure_analyzer.py |
| Dependencies |
dep_scanner.py |
| Env/secrets needed |
env_scanner.py |
| Code quality |
quality_scan.py |
| Security flags |
security_scan.py |
| Call graph |
call_graph.py |
| Final report |
report_builder.py |
| Extract archive |
extract_archive.py |
Reference Files
references/depth-guide.md — How to choose review depth and what to include
references/structure-patterns.md — Common project structures and how to interpret them
references/architecture-patterns.md — Architecture patterns (MVC, hexagonal, event-driven, etc.)
references/quality-rubric.md — How to score and describe code quality
references/language-hints.md — Per-language conventions, entry points, and idioms
references/checklist.md — Master checklist for thorough reviews
Important Notes
- If the project root is a
.zip, .tar.gz, or similar archive, extract it first with extract_archive.py
- If only a GitHub URL is given, clone with
git clone --depth=1 <URL> /tmp/project/
- For very large repos (>50k files), limit the scan to key subdirectories
- Always infer intent: "understand this" or "help me learn this codebase" = deep review request
<SKILL_DIR> refers to the directory where this SKILL.md is located
1---2name: repo-review3description: Comprehensive repository and project analysis skill. Use this whenever a user wants to understand, review, audit, or get a deep-dive into any codebase, repo, or software project. Triggers include: "review this repo", "understand this project", "analyze this codebase", "what does this code do", "explain this project", "audit this repo", "walk me through this code", "document this project", "what's the architecture of", "give me an overview of this project", or when a user uploads or points to any project folder / Git repo. Always use this skill for any non-trivial code comprehension task — even if the user doesn't say "review", if they want to understand a project holistically, this skill applies.4---56# Repo Review Skill78A systematic approach to fully understand, review, and document any software project or repository.910---1112## Phase 0 — Orient & Plan1314Before touching any file, run the orientation script:1516```bash17python3 <SKILL_DIR>/scripts/orient.py <PROJECT_ROOT>18```1920This produces a **Project Snapshot** JSON with:21- Directory tree (depth 3)22- File count by extension23- Total lines of code estimate24- Top-level README presence25- Git metadata (last commit, branch, contributors)26- Package manifest files detected2728Use the snapshot to **choose a review depth** (see `references/depth-guide.md`):2930| Depth | Use When | Output |31|-------|----------|--------|32| **Quick** | < 500 files, simple script/tool | 1-page summary |33| **Standard** | 500–5000 files, typical app/lib | Full review report |34| **Deep** | 5000+ files, monorepo, complex arch | Deep-dive with sub-reports |3536---3738## Phase 1 — Structure Analysis3940Run the structure analyzer:4142```bash43python3 <SKILL_DIR>/scripts/structure_analyzer.py <PROJECT_ROOT>44```4546Outputs:47- Annotated directory tree with purpose labels48- Entry points detected (main files, index files, CLI entrypoints)49- Configuration files catalogued50- Test coverage location51- Build artifacts vs source separation5253Read `references/structure-patterns.md` for how to interpret common patterns (monorepo, MVC, layered arch, microservices, etc.).5455---5657## Phase 2 — Dependency & Tech Stack Analysis5859Run the dependency scanner:6061```bash62python3 <SKILL_DIR>/scripts/dep_scanner.py <PROJECT_ROOT>63```6465This scans:66- `package.json`, `pyproject.toml`, `requirements.txt`, `Cargo.toml`, `go.mod`, `pom.xml`, `build.gradle`, `Gemfile`, `composer.json`, `.csproj`67- Lock files for actual resolved versions68- Dev vs prod dependency split69- Identifies the primary language(s), frameworks, and runtime7071Also run:72```bash73python3 <SKILL_DIR>/scripts/env_scanner.py <PROJECT_ROOT>74```75To detect `.env` files, secrets patterns, and required environment variables.7677---7879## Phase 3 — Architecture Review8081Read `references/architecture-patterns.md` to match the project to known patterns.8283Manual steps Claude must perform:841. Identify the **core data model** — find schema files, ORM models, or database migrations.852. Trace the **main request/data flow** from entry point → processing → output.863. Map **module boundaries** — which directories own which responsibilities.874. Identify **cross-cutting concerns** — logging, auth, error handling, config management.885. Note **external integrations** — APIs called, services used, webhooks, queues.8990For large projects, run the call-graph helper:91```bash92python3 <SKILL_DIR>/scripts/call_graph.py <PROJECT_ROOT> --entry <ENTRY_FILE>93```9495---9697## Phase 4 — Code Quality Scan9899```bash100python3 <SKILL_DIR>/scripts/quality_scan.py <PROJECT_ROOT>101```102103Reports on:104- Code duplication hotspots105- Function/file length outliers (complexity signals)106- TODO/FIXME/HACK comment count and locations107- Test file presence and rough coverage ratio108- Linter config presence109- CI/CD pipeline files110- Documentation coverage (JSDoc, docstrings, type hints)111112Read `references/quality-rubric.md` for scoring interpretation.113114---115116## Phase 5 — Security & Secrets Audit117118```bash119python3 <SKILL_DIR>/scripts/security_scan.py <PROJECT_ROOT>120```121122Scans for:123- Hardcoded secrets / API keys (regex patterns)124- Dangerous function calls (`eval`, `exec`, `system`, `shell=True`, SQL string concat)125- Insecure defaults (debug=True, CORS wildcard, no auth middleware)126- Sensitive files accidentally committed (`.pem`, `.key`, `*.sqlite`)127128> ⚠️ Security findings are advisory. Always recommend a dedicated tool (Semgrep, Trivy, Snyk) for production audits.129130---131132## Phase 6 — Report Generation133134Run the report builder:135136```bash137python3 <SKILL_DIR>/scripts/report_builder.py \138 --project-root <PROJECT_ROOT> \139 --depth <quick|standard|deep> \140 --output /mnt/user-data/outputs/repo-review-report.md141```142143The report follows the template in `assets/report-template.md`.144145**Report sections (standard depth):**1461471. **Executive Summary** — What is this project? Who is it for? What problem does it solve?1482. **Tech Stack** — Languages, frameworks, databases, infra1493. **Architecture Overview** — Diagram (ASCII or Mermaid) + narrative1504. **Directory Guide** — What each major folder does, annotated1515. **Key Files Reference** — The 10–20 most important files and their roles1526. **Data Flow** — How data moves through the system1537. **External Dependencies** — Third-party services and libraries, with risk notes1548. **Code Quality Assessment** — Strengths and improvement areas1559. **Security Notes** — Flags from Phase 515610. **Onboarding Checklist** — Steps for a new developer to get up and running15711. **Open Questions** — Things that are unclear and worth investigating158159For **deep** depth, also generate sub-reports per major module using `report_builder.py --module <MODULE_DIR>`.160161---162163## Phase 7 — Interactive Q&A (optional)164165After delivering the report, offer to answer follow-up questions:166167> "I've completed the review. You can now ask me things like:168> - 'How does authentication work in this project?'169> - 'Where would I add a new API endpoint?'170> - 'What's the test strategy?'171> - 'What are the biggest risks in this codebase?'"172173---174175## Quick Reference176177| Task | Script |178|------|--------|179| First look | `orient.py` |180| Directory map | `structure_analyzer.py` |181| Dependencies | `dep_scanner.py` |182| Env/secrets needed | `env_scanner.py` |183| Code quality | `quality_scan.py` |184| Security flags | `security_scan.py` |185| Call graph | `call_graph.py` |186| Final report | `report_builder.py` |187| Extract archive | `extract_archive.py` |188189---190191## Reference Files192193- `references/depth-guide.md` — How to choose review depth and what to include194- `references/structure-patterns.md` — Common project structures and how to interpret them195- `references/architecture-patterns.md` — Architecture patterns (MVC, hexagonal, event-driven, etc.)196- `references/quality-rubric.md` — How to score and describe code quality197- `references/language-hints.md` — Per-language conventions, entry points, and idioms198- `references/checklist.md` — Master checklist for thorough reviews199200---201202## Important Notes203204- If the project root is a `.zip`, `.tar.gz`, or similar archive, extract it first with `extract_archive.py`205- If only a GitHub URL is given, clone with `git clone --depth=1 <URL> /tmp/project/`206- For very large repos (>50k files), limit the scan to key subdirectories207- Always infer intent: "understand this" or "help me learn this codebase" = deep review request208- `<SKILL_DIR>` refers to the directory where this SKILL.md is located