Back to Skills

Analyze Codebase

mpazaryna
Updated Today
51 views
2
2
View on GitHub
Metageneral

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.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/mpazaryna/claude-toolkit
Git CloneAlternative
git clone https://github.com/mpazaryna/claude-toolkit.git ~/.claude/skills/Analyze Codebase

Copy and paste this command in Claude Code to install this skill

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:

  1. Scan for key indicator files in the target directory
  2. Load base analysis template from .assets/base.md
  3. Load technology-specific templates based on detection
  4. Merge templates into comprehensive analysis structure

Step 2: Technology Detection Logic

Detect project types by scanning for these files:

  • MCP Server: package.json contains @modelcontextprotocol/sdk
  • Next.js: next.config.js or next.config.ts exists
  • Cloudflare Worker: wrangler.toml or wrangler.jsonc exists
  • React App: package.json contains react
  • TypeScript: tsconfig.json exists
  • Jest Testing: jest.config.js or jest.config.cjs exists
  • iOS App: Package.swift or *.xcodeproj exists
  • Python: requirements.txt or pyproject.toml exists

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:

  1. Project Overview (from base template)
  2. Technology-Specific Analysis (from detected templates)
  3. Directory Structure Analysis (enhanced by tech templates)
  4. File-by-File Breakdown (guided by tech-specific patterns)
  5. Architecture Deep Dive (incorporating tech-specific patterns)
  6. Testing Analysis (if testing framework detected)
  7. Deployment Analysis (if deployment config detected)
  8. Technology Stack Breakdown (comprehensive based on detections)
  9. Visual Architecture Diagram (enhanced with tech-specific components)
  10. 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:

  1. Detection Phase:

    • Finds wrangler.jsonc → Cloudflare Worker detected
    • Finds @modelcontextprotocol/sdk in package.json → MCP Server detected
    • Finds jest.config.cjs → Jest testing detected
    • Finds tsconfig.json → TypeScript detected
  2. 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
  3. Merged Analysis: Creates comprehensive analysis combining all templates

This approach ensures you get the right analysis depth for each project's specific technology stack.

GitHub Repository

mpazaryna/claude-toolkit
Path: generated-skills/learn-project
agentic-frameworkagentic-workflowclaude-code

Related Skills

subagent-driven-development

Development

This 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.

View skill

algorithmic-art

Meta

This 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.

View skill

executing-plans

Design

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

View skill

cost-optimization

Other

This 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.

View skill