资深架构师

Universal

senior-architect

by alirezarezvani

适合系统设计评审、ADR记录和扩展性规划,分析依赖与耦合,权衡单体或微服务、数据库与技术栈选型,并输出Mermaid、PlantUML、ASCII架构图。

搞系统设计、技术选型和扩展规划时,用它能更快理清架构决策与依赖关系,还能直接产出 Mermaid/PlantUML 图,方案讨论效率很高。

11.5k数据与存储未扫描2026年3月5日

安装

claude skill add --url github.com/alirezarezvani/claude-skills/tree/main/engineering-team/senior-architect

文档

Senior Architect

Architecture design and analysis tools for making informed technical decisions.

Table of Contents


Quick Start

bash
# Generate architecture diagram from project
python scripts/architecture_diagram_generator.py ./my-project --format mermaid

# Analyze dependencies for issues
python scripts/dependency_analyzer.py ./my-project --output json

# Get architecture assessment
python scripts/project_architect.py ./my-project --verbose

Tools Overview

1. Architecture Diagram Generator

Generates architecture diagrams from project structure in multiple formats.

Solves: "I need to visualize my system architecture for documentation or team discussion"

Input: Project directory path Output: Diagram code (Mermaid, PlantUML, or ASCII)

Supported diagram types:

  • component - Shows modules and their relationships
  • layer - Shows architectural layers (presentation, business, data)
  • deployment - Shows deployment topology

Usage:

bash
# Mermaid format (default)
python scripts/architecture_diagram_generator.py ./project --format mermaid --type component

# PlantUML format
python scripts/architecture_diagram_generator.py ./project --format plantuml --type layer

# ASCII format (terminal-friendly)
python scripts/architecture_diagram_generator.py ./project --format ascii

# Save to file
python scripts/architecture_diagram_generator.py ./project -o architecture.md

Example output (Mermaid):

mermaid
graph TD
    A[API Gateway] --> B[Auth Service]
    A --> C[User Service]
    B --> D[(PostgreSQL)]
    C --> D

2. Dependency Analyzer

Analyzes project dependencies for coupling, circular dependencies, and outdated packages.

Solves: "I need to understand my dependency tree and identify potential issues"

Input: Project directory path Output: Analysis report (JSON or human-readable)

Analyzes:

  • Dependency tree (direct and transitive)
  • Circular dependencies between modules
  • Coupling score (0-100)
  • Outdated packages

Supported package managers:

  • npm/yarn (package.json)
  • Python (requirements.txt, pyproject.toml)
  • Go (go.mod)
  • Rust (Cargo.toml)

Usage:

bash
# Human-readable report
python scripts/dependency_analyzer.py ./project

# JSON output for CI/CD integration
python scripts/dependency_analyzer.py ./project --output json

# Check only for circular dependencies
python scripts/dependency_analyzer.py ./project --check circular

# Verbose mode with recommendations
python scripts/dependency_analyzer.py ./project --verbose

Example output:

code
Dependency Analysis Report
==========================
Total dependencies: 47 (32 direct, 15 transitive)
Coupling score: 72/100 (moderate)

Issues found:
- CIRCULAR: auth → user → permissions → auth
- OUTDATED: lodash 4.17.15 → 4.17.21 (security)

Recommendations:
1. Extract shared interface to break circular dependency
2. Update lodash to fix CVE-2020-8203

3. Project Architect

Analyzes project structure and detects architectural patterns, code smells, and improvement opportunities.

Solves: "I want to understand the current architecture and identify areas for improvement"

Input: Project directory path Output: Architecture assessment report

Detects:

  • Architectural patterns (MVC, layered, hexagonal, microservices indicators)
  • Code organization issues (god classes, mixed concerns)
  • Layer violations
  • Missing architectural components

Usage:

bash
# Full assessment
python scripts/project_architect.py ./project

# Verbose with detailed recommendations
python scripts/project_architect.py ./project --verbose

# JSON output
python scripts/project_architect.py ./project --output json

# Check specific aspect
python scripts/project_architect.py ./project --check layers

Example output:

code
Architecture Assessment
=======================
Detected pattern: Layered Architecture (confidence: 85%)

Structure analysis:
  ✓ controllers/  - Presentation layer detected
  ✓ services/     - Business logic layer detected
  ✓ repositories/ - Data access layer detected
  ⚠ models/       - Mixed domain and DTOs

Issues:
- LARGE FILE: UserService.ts (1,847 lines) - consider splitting
- MIXED CONCERNS: PaymentController contains business logic

Recommendations:
1. Split UserService into focused services
2. Move business logic from controllers to services
3. Separate domain models from DTOs

Decision Workflows

Database Selection Workflow

Use when choosing a database for a new project or migrating existing data.

Step 1: Identify data characteristics

CharacteristicPoints to SQLPoints to NoSQL
Structured with relationships
ACID transactions required
Flexible/evolving schema
Document-oriented data
Time-series data✓ (specialized)

Step 2: Evaluate scale requirements

  • <1M records, single region → PostgreSQL or MySQL
  • 1M-100M records, read-heavy → PostgreSQL with read replicas
  • 100M records, global distribution → CockroachDB, Spanner, or DynamoDB

  • High write throughput (>10K/sec) → Cassandra or ScyllaDB

Step 3: Check consistency requirements

  • Strong consistency required → SQL or CockroachDB
  • Eventual consistency acceptable → DynamoDB, Cassandra, MongoDB

Step 4: Document decision Create an ADR (Architecture Decision Record) with:

  • Context and requirements
  • Options considered
  • Decision and rationale
  • Trade-offs accepted

Quick reference:

code
PostgreSQL → Default choice for most applications
MongoDB    → Document store, flexible schema
Redis      → Caching, sessions, real-time features
DynamoDB   → Serverless, auto-scaling, AWS-native
TimescaleDB → Time-series data with SQL interface

Architecture Pattern Selection Workflow

Use when designing a new system or refactoring existing architecture.

Step 1: Assess team and project size

Team SizeRecommended Starting Point
1-3 developersModular monolith
4-10 developersModular monolith or service-oriented
10+ developersConsider microservices

Step 2: Evaluate deployment requirements

  • Single deployment unit acceptable → Monolith
  • Independent scaling needed → Microservices
  • Mixed (some services scale differently) → Hybrid

Step 3: Consider data boundaries

  • Shared database acceptable → Monolith or modular monolith
  • Strict data isolation required → Microservices with separate DBs
  • Event-driven communication fits → Event-sourcing/CQRS

Step 4: Match pattern to requirements

RequirementRecommended Pattern
Rapid MVP developmentModular Monolith
Independent team deploymentMicroservices
Complex domain logicDomain-Driven Design
High read/write ratio differenceCQRS
Audit trail requiredEvent Sourcing
Third-party integrationsHexagonal/Ports & Adapters

See references/architecture_patterns.md for detailed pattern descriptions.


Monolith vs Microservices Decision

Choose Monolith when:

  • Team is small (<10 developers)
  • Domain boundaries are unclear
  • Rapid iteration is priority
  • Operational complexity must be minimized
  • Shared database is acceptable

Choose Microservices when:

  • Teams can own services end-to-end
  • Independent deployment is critical
  • Different scaling requirements per component
  • Technology diversity is needed
  • Domain boundaries are well understood

Hybrid approach: Start with a modular monolith. Extract services only when:

  1. A module has significantly different scaling needs
  2. A team needs independent deployment
  3. Technology constraints require separation

Reference Documentation

Load these files for detailed information:

FileContainsLoad when user asks about
references/architecture_patterns.md9 architecture patterns with trade-offs, code examples, and when to use"which pattern?", "microservices vs monolith", "event-driven", "CQRS"
references/system_design_workflows.md6 step-by-step workflows for system design tasks"how to design?", "capacity planning", "API design", "migration"
references/tech_decision_guide.mdDecision matrices for technology choices"which database?", "which framework?", "which cloud?", "which cache?"

Tech Stack Coverage

Languages: TypeScript, JavaScript, Python, Go, Swift, Kotlin, Rust Frontend: React, Next.js, Vue, Angular, React Native, Flutter Backend: Node.js, Express, FastAPI, Go, GraphQL, REST Databases: PostgreSQL, MySQL, MongoDB, Redis, DynamoDB, Cassandra Infrastructure: Docker, Kubernetes, Terraform, AWS, GCP, Azure CI/CD: GitHub Actions, GitLab CI, CircleCI, Jenkins


Common Commands

bash
# Architecture visualization
python scripts/architecture_diagram_generator.py . --format mermaid
python scripts/architecture_diagram_generator.py . --format plantuml
python scripts/architecture_diagram_generator.py . --format ascii

# Dependency analysis
python scripts/dependency_analyzer.py . --verbose
python scripts/dependency_analyzer.py . --check circular
python scripts/dependency_analyzer.py . --output json

# Architecture assessment
python scripts/project_architect.py . --verbose
python scripts/project_architect.py . --check layers
python scripts/project_architect.py . --output json

Getting Help

  1. Run any script with --help for usage information
  2. Check reference documentation for detailed patterns and workflows
  3. Use --verbose flag for detailed explanations and recommendations

相关 Skills

迁移架构师

by alirezarezvani

Universal
热门

为数据库、API 与基础设施迁移制定分阶段零停机方案,提前校验兼容性与风险,生成回滚策略、验证关卡和时间线,适合复杂系统平滑切换。

做数据库与存储迁移时,用它统一梳理表结构和数据搬迁流程,架构视角更完整,复杂迁移也更稳。

数据与存储
未扫描11.5k

资深数据工程师

by alirezarezvani

Universal
热门

聚焦生产级数据工程,覆盖 ETL/ELT、批处理与流式管道、数据建模、Airflow/dbt/Spark 优化和数据质量治理,适合设计数据架构、搭建现代数据栈与排查性能问题。

复杂数据管道、ETL/ELT 和治理难题交给它,凭 Spark、Airflow、dbt 等现代数据栈经验,能更稳地搭起可扩展的数据基础设施。

数据与存储
未扫描11.5k

数据库设计

by alirezarezvani

Universal
热门

聚焦数据库 Schema 设计与演进,自动检查规范化、数据类型、约束和索引问题,生成 ERD,并为零停机迁移、数据变更和回滚提供可执行方案。

专注数据库设计与数据建模,帮你快速理清表结构和关系,减少后期返工,SQL 落地也更顺手。

数据与存储
未扫描11.5k

相关 MCP 服务

by Anthropic

热门

PostgreSQL 是让 Claude 直接查询和管理你的数据库的 MCP 服务器。

这个服务器解决了开发者需要手动编写 SQL 查询的痛点,特别适合数据分析师或后端开发者快速探索数据库结构。不过,由于是参考实现,生产环境使用前务必评估安全风险,别指望它能处理复杂事务。

数据与存储
83.9k

SQLite 数据库

编辑精选

by Anthropic

热门

SQLite 是让 AI 直接查询本地数据库进行数据分析的 MCP 服务器。

这个服务器解决了 AI 无法直接访问 SQLite 数据库的问题,适合需要快速分析本地数据集的开发者。不过,作为参考实现,它可能缺乏生产级的安全特性,建议在受控环境中使用。

数据与存储
83.9k

by Firecrawl

热门

Firecrawl 是让 AI 直接抓取网页并提取结构化数据的 MCP 服务器。

它解决了手动写爬虫的麻烦,让 Claude 能直接访问动态网页内容。最适合需要实时数据的研究者或开发者,比如监控竞品价格或抓取新闻。但要注意,它依赖第三方 API,可能涉及隐私和成本问题。

数据与存储
6.1k

评论