Marketplace codebase-analysis
Patterns and techniques for analyzing brownfield codebases. Use when onboarding to unfamiliar code, preparing for refactoring, conducting architecture reviews, or identifying technical debt.
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/consiliency/codebase-analysis" ~/.claude/skills/aiskillstore-marketplace-codebase-analysis-c0dce8 && rm -rf "$T"
manifest:
skills/consiliency/codebase-analysis/SKILL.mdsource content
Codebase Analysis Skill
Systematically explore and understand existing codebases, including entry point discovery, dependency tracing, pattern detection, and technical debt identification.
Variables
| Variable | Default | Description |
|---|---|---|
| ANALYSIS_DEPTH | standard | (5min), (30min), (1hr+) |
| OUTPUT_FORMAT | markdown | , , |
| INCLUDE_DEBT | true | Include technical debt assessment |
| INCLUDE_DIAGRAMS | true | Generate C4 diagrams |
Instructions
MANDATORY - Follow the Workflow steps below in order. Do not skip steps.
- Start with entry points, not random files
- Trace dependencies before analyzing patterns
- Document findings as you go
Red Flags - STOP and Reconsider
If you're about to:
- Analyze random files without finding entry points first
- Make architectural claims without tracing dependencies
- Skip pattern detection before identifying anti-patterns
- Report technical debt without severity classification
STOP -> Read the appropriate cookbook file -> Follow the workflow -> Then proceed
Workflow
- Quick Assessment: Project size, structure, config files
- CHECKPOINT: Identify entry points (read
)cookbook/entry-point-discovery.md - Trace dependencies from entry points
- Detect architectural patterns
- CHECKPOINT: Verify pattern detection before anti-pattern search
- Identify anti-patterns and technical debt
- Document findings with C4 diagrams (if INCLUDE_DIAGRAMS)
Cookbook
Entry Point Discovery
- IF: Starting analysis of unfamiliar codebase
- THEN: Read
cookbook/entry-point-discovery.md - RESULT: List of main entry points by framework
Dependency Tracing
- IF: Need to understand how modules connect
- THEN: Read
cookbook/dependency-tracing.md - RESULT: Import chains, dependency graph
Pattern Detection
- IF: Need to identify architectural style
- THEN: Read
cookbook/pattern-detection.md - RESULT: Identified patterns (MVC, Layered, etc.)
Technical Debt Identification
- IF: Assessing code quality and debt
- THEN: Read
cookbook/debt-identification.md - RESULT: Prioritized debt inventory
Quick Reference
Entry Points by Stack
| Stack | Look For |
|---|---|
| Node.js | main/bin, , |
| TypeScript | , |
| Python | , , |
| Go | , |
| React | , |
See
reference/framework-patterns.md for complete list.
Common Patterns
| Pattern | Directory Signs |
|---|---|
| MVC | , , |
| Layered | , , |
| Hexagonal | , , |
| Microservices | , |
Output
Standard Report Format
# Codebase Analysis: [Project Name] ## Overview - **Size**: X files, Y lines - **Primary Language**: TypeScript - **Framework**: Next.js - **Architecture**: [Pattern] ## Entry Points 1. `src/pages/_app.tsx` - Application root 2. `src/api/` - API routes ## Key Dependencies - [External deps list] ## Architecture Diagram [C4 diagram if INCLUDE_DIAGRAMS] ## Technical Debt (if INCLUDE_DEBT) | Issue | Severity | Location | |-------|----------|----------| | ... | High | ... |