Analyze Codebase
About
This skill analyzes a codebase to automatically generate a developer-focused `codebase_analysis.md` file. It detects project types (like MCP servers or Next.js apps) and merges technology-specific templates with a base template. Use it when you need a comprehensive technical overview of a codebase's structure and technologies.
Documentation
Analyze Codebase (Modular Templates)
Follow the Workflow for the FOLDER_PATH then Report the completed work.
Variables
FOLDER_PATH: (to be provided by user)
Workflow
If no FOLDER_PATH is provided, STOP immediately and ask the user to provide it.
Step 1: Project Detection & Template Loading
First, analyze the target directory to detect project type and load appropriate templates:
- Scan for key indicator files in the target directory
- Load base analysis template from
.assets/base.md - Load technology-specific templates based on detection
- Merge templates into comprehensive analysis structure
Step 2: Technology Detection Logic
Detect project types by scanning for these files:
- MCP Server:
package.jsoncontains@modelcontextprotocol/sdk - Next.js:
next.config.jsornext.config.tsexists - Cloudflare Worker:
wrangler.tomlorwrangler.jsoncexists - React App:
package.jsoncontainsreact - TypeScript:
tsconfig.jsonexists - Jest Testing:
jest.config.jsorjest.config.cjsexists - iOS App:
Package.swiftor*.xcodeprojexists - Python:
requirements.txtorpyproject.tomlexists
Step 3: Template Integration
For each detected technology, read the corresponding template file:
Base Template: Always include /assets/base.md
Technology Templates (include if detected):
- MCP Server →
/assets/mcp-server.md - Next.js →
/assets/nextjs.md - Cloudflare Workers →
/assets/cloudflare-worker.md - TypeScript →
/assets/typescript.md - Jest →
/assets/jest-testing.md - iOS →
/assets/ios-swift.md
Step 4: Execute Comprehensive Analysis
Using the merged template structure, analyze the codebase following these sections:
- Project Overview (from base template)
- Technology-Specific Analysis (from detected templates)
- Directory Structure Analysis (enhanced by tech templates)
- File-by-File Breakdown (guided by tech-specific patterns)
- Architecture Deep Dive (incorporating tech-specific patterns)
- Testing Analysis (if testing framework detected)
- Deployment Analysis (if deployment config detected)
- Technology Stack Breakdown (comprehensive based on detections)
- Visual Architecture Diagram (enhanced with tech-specific components)
- Key Insights & Recommendations (tech-specific improvements)
Step 5: Create Analysis Document
Create a comprehensive codebase_analysis.md that includes:
- Detected technologies and their specific analysis sections
- Integration between different technology stacks
- Technology-specific recommendations and best practices
Report
# [Project Name] Modular Codebase Analysis
> Modular Codebase Analysis - Last updated: [timestamp]
> Detected Technologies: [list of detected tech stack]
## Technology Detection Results
- **Project Type**: [Primary type based on detection]
- **Tech Stack**: [All detected technologies]
- **Templates Applied**: [List of templates that were merged]
## Quick Reference
### Primary Entry Points
[Technology-specific entry points based on detected stack]
### Key Integration Files
[Files specific to detected technologies]
### Common Patterns
[Patterns from merged templates]
## Testing Focus
[Testing analysis based on detected framework]
## Environment Setup
[Environment information based on detected deployment type]
## Debug Tips
[Debug information specific to detected technologies]
## Technology-Specific Insights
[Insights from each applied template]
Example Usage
When you run this command on the compass project:
-
Detection Phase:
- Finds
wrangler.jsonc→ Cloudflare Worker detected - Finds
@modelcontextprotocol/sdkin package.json → MCP Server detected - Finds
jest.config.cjs→ Jest testing detected - Finds
tsconfig.json→ TypeScript detected
- Finds
-
Template Loading:
- Read
/assets/base.md - Read
/assets/mcp-server.md - Read
/assets/cloudflare-worker.md - Read
/assets/typescript.md - Read
/assets/jest-testing.md
- Read
-
Merged Analysis: Creates comprehensive analysis combining all templates
This approach ensures you get the right analysis depth for each project's specific technology stack.
Quick Install
/plugin add https://github.com/mpazaryna/claude-toolkit/tree/main/learn-projectCopy and paste this command in Claude Code to install this skill
GitHub 仓库
Related Skills
subagent-driven-development
DevelopmentThis skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
cost-optimization
OtherThis Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
Git Commit Helper
MetaThis Claude Skill generates descriptive commit messages by analyzing git diffs. It automatically follows conventional commit format with proper types like feat, fix, and docs. Use it when you need help writing commit messages or reviewing staged changes in your repository.
algorithmic-art
MetaThis Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
