codebase-architecture-analysis

Analyze a GitHub codebase to create comprehensive architecture documentation including ASCII diagrams, component relationships, data flow, hosting infrastructure, and file structure assessment.

16 stars

Best use case

codebase-architecture-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze a GitHub codebase to create comprehensive architecture documentation including ASCII diagrams, component relationships, data flow, hosting infrastructure, and file structure assessment.

Teams using codebase-architecture-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codebase-architecture-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/codebase-architecture-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codebase-architecture-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codebase-architecture-analysis Compares

Feature / Agentcodebase-architecture-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze a GitHub codebase to create comprehensive architecture documentation including ASCII diagrams, component relationships, data flow, hosting infrastructure, and file structure assessment.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Codebase Architecture Analysis

## When to use this skill

Use this skill when you need to understand the high-level architecture and structure of a codebase. Specifically, use it when you need to:
- Create architecture diagrams for documentation
- Understand component relationships and dependencies
- Assess hosting infrastructure and deployment architecture
- Generate comprehensive architectural overviews
- Document data flow between system components
- Create visual representations of code organization

## Overview

This skill guides a specialized agent through a comprehensive analysis of a GitHub repository to produce detailed architecture documentation. The analysis includes ASCII diagrams, component maps, infrastructure details, and file-level assessments.

## Workflow

### Step 1: Repository Setup

**Input required:**
- GitHub repository URL or `owner/repo` format
- Optional: Specific branch or commit to analyze

**Actions:**
1. Clone the repository using the GitHub PAT from environment variables
2. Verify the repository is cloned successfully
3. Document the repository metadata (language, size, structure)

YOU MUST CLONE THE REPOSITORY AND INSPECT THE FILES USING BASH TOOLS AND GIT CLI RATHER THAN MCP.

### Step 2: Codebase Discovery and Assessment

**Analyze the directory structure:**
1. Map the complete directory tree
2. Identify major components/modules/packages
3. Classify directories by purpose (src, config, tests, build, etc.)
4. Count files by type (TypeScript, Python, JSON, etc.)
5. Identify entry points and main application files

**For each file, assess:**
- File type and purpose
- Size and complexity
- Key imports and dependencies
- What module/component it belongs to
- Role in the overall system

### Step 3: Create Architecture Diagrams

**Create multiple ASCII diagrams:**

1. **System Architecture Diagram**
   - High-level components and their relationships
   - External systems and services
   - Data flow between components

2. **Deployment Architecture**
   - Hosting infrastructure (cloud platform, containers, etc.)
   - Service relationships
   - Network and database layers

3. **File Structure Diagram**
   - Directory hierarchy showing major components
   - Key files and their purposes
   - Organization by feature or layer

4. **Data Flow Diagram**
   - How data moves through the system
   - API endpoints and their interactions
   - Database access patterns

Example ASCII diagram structure:

```
┌─────────────────────────────────────────────────┐
│                  Client (React)                  │
├─────────────────────────────────────────────────┤
│  - Components                                    │
│  - Pages                                         │
│  - State Management                              │
└────────────────┬────────────────────────────────┘
                 │ HTTP/WebSocket
┌────────────────▼────────────────────────────────┐
│            Backend Server (Node.js)              │
├─────────────────────────────────────────────────┤
│  - API Routes                                    │
│  - Authentication                                │
│  - Business Logic                                │
└────────────────┬────────────────────────────────┘
                 │
┌────────────────▼────────────────────────────────┐
│            Database & External APIs              │
├─────────────────────────────────────────────────┤
│  - PostgreSQL / MongoDB                          │
│  - Third-party Services                          │
└─────────────────────────────────────────────────┘
```

### Step 4: Component Analysis

**For each major component, document:**
- Purpose and responsibilities
- Key files and entry points
- External dependencies
- Interactions with other components
- API surface (if applicable)

**Document component categories:**
- **Frontend Components**: UI components, pages, layouts
- **Backend Services**: API endpoints, middleware, handlers
- **Business Logic**: Core algorithms, processing
- **Infrastructure**: Configuration, build, deployment
- **Testing**: Test utilities, test files
- **Documentation**: READMEs, specs, guides

### Step 5: Technology Stack Assessment

**Identify and document:**
- Programming languages used
- Key frameworks and libraries
- Database systems
- External services and APIs
- Development tools and build systems
- Container/deployment technologies
- Version numbers where significant

### Step 6: Hosting and Infrastructure Analysis

**Assess the deployment architecture:**
1. Identify hosting platform (AWS, GCP, Vercel, Cloudflare, etc.)
2. Document service configuration
   - Environment variables
   - Build processes
   - Deployment scripts
3. Identify infrastructure-as-code files (Terraform, Docker, etc.)
4. Document scaling considerations
5. Identify external service dependencies

### Step 7: Generate Final Documentation

**Create a comprehensive architecture document including:**

1. **Executive Summary**
   - Project purpose
   - High-level architecture overview
   - Technology stack
   - Hosting platform and deployment

2. **Architecture Diagrams** (multiple views as described in Step 3)

3. **Component Catalog**
   - List of major components
   - Purpose of each
   - Key files
   - Dependencies

4. **File Structure Overview**
   - Directory layout with purposes
   - Important files highlighted

5. **Data Flow Explanation**
   - How requests are processed
   - Database interactions
   - External API calls

6. **Technology Details**
   - Language versions
   - Framework versions
   - Key library versions
   - Database schema summary (if visible in code)

7. **Deployment and Hosting**
   - Hosting platform details
   - Build and deployment process
   - Environment configuration
   - Scaling considerations

8. **Dependencies and Integrations**
   - List of external services
   - API integrations
   - Authentication/authorization approach

## Common Patterns

### For Monolithic Applications
- Single codebase containing frontend, backend, and shared logic
- Clear separation between presentation, business logic, and data layers
- Review package.json/requirements.txt for all dependencies

### For Microservices
- Multiple services in separate directories or repositories
- Service communication documented in deployment config
- API contracts between services
- Separate databases per service (typically)

### For Full-Stack Web Applications
- Frontend framework (React, Vue, Angular, etc.)
- Backend framework (Node.js/Express, Python/Django, etc.)
- Database (SQL or NoSQL)
- API layer connecting frontend and backend

## Edge Cases

**Large Codebases:**
- Focus on major components first
- Group related files together
- Create summary before diving into details

**Polyglot Repositories:**
- Separate analysis by language when relevant
- Document language integration points
- Highlight cross-language dependencies

**Complex Infrastructure:**
- Document infrastructure-as-code separately
- Identify deployment stages (dev, staging, prod)
- Note auto-scaling or load balancing configurations

## Output Format

The final architecture analysis should be delivered as:
1. A comprehensive Markdown document with embedded ASCII diagrams
2. Clear section headers and navigation
3. Links between related sections
4. Visual hierarchy showing component relationships
5. Concise but complete descriptions

## Tools and Resources

The agent may use:
- Git commands to explore repository structure
- File reading tools to examine source code
- Text parsing to extract key information
- ASCII art libraries for diagram generation

## Example Use Case

**User Request:** "Analyze the architecture of the user-management microservice in our platform"

**Agent Process:**
1. Clones the user-management repository
2. Maps the directory structure (controllers, models, tests, config)
3. Creates ASCII diagrams showing:
   - Service components (auth handler, user DB access, role manager)
   - Data flow (API request → controller → service → database)
   - Deployment (Docker container → Kubernetes → PostgreSQL)
4. Documents all dependencies and integrations
5. Provides complete architecture documentation

## Success Criteria

The analysis is complete when:
- ✅ Repository successfully cloned and analyzed
- ✅ All major components identified
- ✅ Multiple ASCII diagrams created showing different views
- ✅ File structure documented and explained
- ✅ Technology stack clearly identified
- ✅ Hosting/deployment architecture understood
- ✅ Data flow between components visible
- ✅ Comprehensive documentation generated

Related Skills

Cost Analysis

16
from diegosouzapw/awesome-omni-skill

Analyze infrastructure and operational costs with optimization recommendations

azure-ai-vision-imageanalysis-py

16
from diegosouzapw/awesome-omni-skill

Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks.

architecture-specialist

16
from diegosouzapw/awesome-omni-skill

提供系统架构设计、技术选型、架构审查和组件设计能力。当需要设计新系统、重构现有架构或进行架构审查时使用。

architecture-decision-records

16
from diegosouzapw/awesome-omni-skill

Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.

architecture-decision-record

16
from diegosouzapw/awesome-omni-skill

ADR format and methodology for documenting significant technical decisions with context, alternatives considered, and consequences. Use when making or documenting architectural decisions.

alibaba-cloud-architecture

16
from diegosouzapw/awesome-omni-skill

Alibaba Cloud architecture patterns and best practices. Use when designing, deploying, or reviewing infrastructure on Alibaba Cloud including ECS, ACK, Function Compute, and OSS.

abaqus-modal-analysis

16
from diegosouzapw/awesome-omni-skill

Complete workflow for modal/frequency analysis - extract natural frequencies and mode shapes. Use for vibration analysis and resonance avoidance.

abaqus-dynamic-analysis

16
from diegosouzapw/awesome-omni-skill

Complete workflow for dynamic analysis. Use when user mentions impact, crash, drop test, transient, or time-varying response. Handles explicit and implicit dynamics.

Tech Stack & Architecture Decision

16
from diegosouzapw/awesome-omni-skill

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies", "architecture decisions", "what stack should we use", or any request to select and document frontend, backend, database, auth, hosting, and infrastructure choices for a project.

stride-analysis-patterns

16
from diegosouzapw/awesome-omni-skill

Apply STRIDE methodology to systematically identify threats. Use when analyzing system security, conducting threat modeling sessions, or creating security documentation.

statistical-analysis-spa

16
from diegosouzapw/awesome-omni-skill

웹 기반 통계 분석 SPA 개발 스킬. 이상치 탐지(Outlier Detection)와 행별 통계 분석(Row Statistics)을 수행하는 React 애플리케이션 구현. Z-Score, IQR, MAD, Grubbs, Winsorize 이상치 탐지와 T-test, ANOVA 통계 분석 지원. Copy & Paste 또는 CSV/TXT 파일 드래그 앤 드롭으로 데이터 입력, Recharts를 활용한 시각화 기능 포함. 모든 데이터는 로컬에서만 처리되며 네트워크 전송 없음.

springboot-architecture-analyzer

16
from diegosouzapw/awesome-omni-skill

系統化分析 Spring Boot 專案並生成完整的企業級架構文件,涵蓋系統概述、架構視圖、技術細節、部署策略等所有關鍵面向。