code-architecture-analyzer

智能代码架构解读和分析工具。当用户请求分析项目架构、生成架构文档、识别设计模式、分析依赖关系、评估代码质量、或理解复杂项目结构时使用此skill。适用于接手新项目、代码审查、重构规划、技术选型评估等场景。

16 stars

Best use case

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

智能代码架构解读和分析工具。当用户请求分析项目架构、生成架构文档、识别设计模式、分析依赖关系、评估代码质量、或理解复杂项目结构时使用此skill。适用于接手新项目、代码审查、重构规划、技术选型评估等场景。

Teams using code-architecture-analyzer 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/code-architecture-analyzer/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/code-architecture-analyzer/SKILL.md"

Manual Installation

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

How code-architecture-analyzer Compares

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

Frequently Asked Questions

What does this skill do?

智能代码架构解读和分析工具。当用户请求分析项目架构、生成架构文档、识别设计模式、分析依赖关系、评估代码质量、或理解复杂项目结构时使用此skill。适用于接手新项目、代码审查、重构规划、技术选型评估等场景。

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

# 代码架构分析师 v2.0

## 概述
专业的代码架构分析skill,能够深入解读各种编程语言和框架的项目架构,生成详细的架构文档,识别设计模式,分析依赖关系,并提供改进建议。

## 何时调用

### 触发关键词
当用户请求中包含以下内容时,应主动调用此skill:

| 关键词/意图 | 说明 |
|------------|------|
| "分析架构"、"架构分析"、"项目架构" | 需要了解项目的整体结构设计 |
| "生成架构文档"、"架构文档" | 需要输出结构化的架构说明文档 |
| "设计模式"、"使用了什么模式" | 需要识别代码中的设计模式 |
| "依赖关系"、"模块依赖" | 需要梳理模块间的调用关系 |
| "代码质量评估"、"代码质量" | 需要评估代码的可维护性 |
| "技术栈"、"使用了什么技术" | 需要识别项目使用的技术和框架 |
| "项目结构"、"目录结构" | 需要理解项目的组织方式 |
| "这个项目是怎么组织的" | 用户对项目结构不熟悉 |

### 适用场景

**1. 新项目接手**
- 初次接触代码库,需要快速理解项目结构
- 团队新成员入职培训

**2. 代码审查/重构**
- 重构前的架构现状评估
- 代码审查中的架构合理性检查
- 技术债务识别和优先级排序

**3. 文档生成**
- 生成或补充架构设计文档
- 创建技术方案说明文档
- 输出依赖关系图

**4. 技术选型**
- 评估现有架构是否满足新需求
- 对比不同架构方案的优劣

**5. 质量审计**
- 定期代码健康度检查
- 第三方库安全性审查
- 性能瓶颈分析

### 不适用的场景

- **简单的代码问题**:如单一文件的bug修复、小功能修改 → 直接处理即可
- **运行时调试**:如排查具体错误、性能分析 → 使用调试工具
- **代码搜索**:如查找某个函数、类或文件 → 使用 Glob/Grep 工具
- **单元测试**:编写或运行测试 → 直接操作测试文件

### 🏗️ 架构识别
- 自动识别项目类型(Unity/Python/JS/TS/C#/Java/Go)
- 技术栈分析(语言、框架、数据库、中间件)
- 架构模式检测(MVC/MVVM/微服务/分层架构等)
- 设计模式识别(单例/工厂/观察者/策略等23种模式)

### 📊 代码质量
- 代码结构评估(职责分离、复杂度、耦合度)
- 命名规范检查
- 最佳实践建议
- 技术债务识别

### 🔗 依赖分析
- 模块依赖关系图
- 外部依赖版本/兼容性分析
- 循环依赖检测
- 架构层次分析

### 📝 文档生成
- 执行摘要
- 详细架构分析
- 改进建议(P0/P1/P2优先级)
- Markdown格式报告

## 分析流程

```
1️⃣ 项目扫描
   ├─ 识别项目类型
   ├─ 检测技术栈
   └─ 确定架构风格

2️⃣ 深度分析
   ├─ 核心模块分析
   ├─ 设计模式检测
   └─ 代码质量评估

3️⃣ 报告生成
   ├─ 架构概览
   ├─ 模块说明
   ├─ 依赖关系图
   └─ 改进建议
```

## 支持的项目类型

| 类型 | 识别特征 | 专项分析 |
|------|----------|----------|
| **Unity** | Assets/, .unity | 组件架构、性能优化、资源管理 |
| **Python** | requirements.txt, setup.py | AI/ML、Web框架、数据处理流 |
| **JavaScript/TypeScript** | package.json, .ts/.js | 前端框架、状态管理、路由架构 |
| **C#/.NET** | .csproj, .sln | ASP.NET、WPF、架构模式 |
| **Java** | pom.xml, build.gradle | Spring Boot、Android |
| **Go** | go.mod, go.sum | 微服务、并发模式 |

## 使用示例

### 快速分析
```
分析这个项目的架构
```

### 完整分析
```
生成详细的架构分析报告,包括:
1. 技术栈和架构模式
2. 设计模式识别
3. 模块依赖关系
4. 代码质量评估
5. 改进建议
```

### 专项分析
```
分析Unity项目的性能优化机会:
- 内存分配和GC压力
- 渲染优化
- 组件通信效率
```

## 输出格式

生成的报告包含:
- 执行摘要(项目类型、技术栈、关键发现)
- 项目结构分析
- 技术栈详解
- 架构模式识别
- 代码质量评估
- 依赖关系分析
- 改进建议(按优先级)

## 配置文件

技能包含完整的架构模式配置:
- `config/patterns.yaml` - 23种设计模式定义
- 支持SOLID原则检测
- 识别反模式(God Object、Spaghetti Code等)
- 质量指标基准

---

*详见 prompt.md 获取完整使用说明*

Related Skills

clean-architecture

16
from diegosouzapw/awesome-omni-skill

Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to entities. Use when the user mentions "architecture layers", "dependency rule", "ports and adapters", "hexagonal architecture", or "use case boundary". Covers component principles, boundaries, and SOLID. For code quality, see clean-code. For domain modeling, see domain-driven-design.

c4-architecture

16
from diegosouzapw/awesome-omni-skill

Generate architecture documentation using C4 model Mermaid diagrams. Use when asked to create architecture diagrams, document system architecture, visualize software structure, create C4 diagrams, or generate context/container/component/deployment diagrams. Triggers include "architecture diagram", "C4 diagram", "system context", "container diagram", "component diagram", "deployment diagram", "document architecture", "visualize architecture".

c4-architecture-c4-architecture

16
from diegosouzapw/awesome-omni-skill

Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.

backend-architecture

16
from diegosouzapw/awesome-omni-skill

Design and implement scalable backend infrastructure, microservices, and system architecture patterns.

awareness-analyzer

16
from diegosouzapw/awesome-omni-skill

Diagnose audience awareness level and market sophistication using Eugene Schwartz's Breakthrough Advertising framework

astro-architecture

16
from diegosouzapw/awesome-omni-skill

Technical architecture for Astro lead generation websites. Use when setting up new projects, configuring build tools, or establishing project foundations. For images use astro-images skill. For SEO use astro-seo skill.

ast-analyzer

16
from diegosouzapw/awesome-omni-skill

Deep Abstract Syntax Tree analysis for understanding code structure, dependencies, impact analysis, and pattern detection at the structural level across multiple programming languages

assessing-architecture-quality

16
from diegosouzapw/awesome-omni-skill

Use when assessing codebase architecture and you feel pressure to soften critique, lead with strengths, or frame problems diplomatically - provides evidence-based critical assessment resisting relationship and economic pressures

architecture

16
from diegosouzapw/awesome-omni-skill

Comprehensive system architecture design and implementation workflow that orchestrates expert analysis, technical decision-making, and architectural pattern selection using the integrated toolset. Handles everything from initial system analysis to implementation-ready technical specifications.

architecture-workshop

16
from diegosouzapw/awesome-omni-skill

Framework for designing new architectural mechanisms when existing patterns don't fit

architecture-validator

16
from diegosouzapw/awesome-omni-skill

Validate hexagonal architecture (Domain, Application, Infrastructure, Presentation). Use when creating new files in src/, reorganizing code, or when the user requests architecture validation.

architecture-validation

16
from diegosouzapw/awesome-omni-skill

Dynamically validate codebase compliance with architectural decisions and constraints