home / skills / ntaksh42 / agents / architecture-reviewer

architecture-reviewer skill

/.claude/skills/architecture-reviewer

This skill evaluates software architecture for SOLID principles, design patterns, and scalability, proposing actionable improvements for maintainability.

npx playbooks add skill ntaksh42/agents --skill architecture-reviewer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.8 KB
---
name: architecture-reviewer
description: Review software architecture for SOLID principles, design patterns, scalability, and maintainability. Use when evaluating system design or planning refactoring.
---

# Architecture Reviewer Skill

システムアーキテクチャを評価し、設計改善を提案するスキルです。

## 概要

SOLID原則、デザインパターン、マイクロサービス設計等の観点からアーキテクチャをレビューします。

## 主な機能

- **SOLID原則評価**: 単一責任、開放閉鎖、リスコフ置換等
- **デザインパターン**: 適切なパターンの適用状況
- **レイヤー分離**: プレゼンテーション、ビジネス、データ層
- **依存性管理**: 依存性注入、循環依存の検出
- **スケーラビリティ**: 水平・垂直スケーリング
- **マイクロサービス**: サービス境界、通信パターン
- **データベース設計**: 正規化、インデックス、パーティショニング

## 使用方法

```
このアーキテクチャをレビュー:
[アーキテクチャ図またはコード]

評価項目:
- SOLID原則
- スケーラビリティ
- 保守性
```

## レビュー観点

### 1. SOLID原則

**単一責任原則(SRP)**:
```typescript
// ❌ 複数の責任
class User {
  saveToDatabase() {}
  sendEmail() {}
  generateReport() {}
}

// ✅ 単一責任
class User {}
class UserRepository {
  save(user: User) {}
}
class EmailService {
  send(to: string) {}
}
class ReportGenerator {
  generate(user: User) {}
}
```

**依存性逆転(DIP)**:
```python
# ❌ 具象に依存
class UserService:
    def __init__(self):
        self.db = MySQLDatabase()  # 具象クラス

# ✅ 抽象に依存
class UserService:
    def __init__(self, database: DatabaseInterface):
        self.db = database  # インターフェース
```

### 2. レイヤー構造

```
┌─────────────────────────────┐
│   Presentation Layer        │  UI, API Endpoints
├─────────────────────────────┤
│   Application Layer         │  Use Cases, Orchestration
├─────────────────────────────┤
│   Domain Layer              │  Business Logic, Entities
├─────────────────────────────┤
│   Infrastructure Layer      │  Database, External APIs
└─────────────────────────────┘
```

### 3. マイクロサービス設計

```
推奨パターン:
- API Gateway: 単一エントリーポイント
- Service Discovery: 動的サービス検出
- Circuit Breaker: 障害の連鎖防止
- Event Sourcing: イベント駆動
- CQRS: コマンドとクエリの分離
```

## 出力例

```markdown
# アーキテクチャレビュー結果

## 総合評価: B+

### 良好な点
✅ クリーンアーキテクチャの採用
✅ 適切な依存性注入
✅ レイヤー分離が明確

### 改善点

#### [HIGH] 循環依存の存在
**場所**: OrderService ↔ PaymentService
**影響**: テスタビリティの低下、デプロイの複雑化
**推奨**: イベント駆動アーキテクチャに変更

#### [MEDIUM] 単一責任原則違反
**場所**: UserController
**問題**: 認証、認可、ビジネスロジックが混在
**推奨**: 責務を分離

### アーキテクチャ提案

1. **イベント駆動への移行**: サービス間の結合度削減
2. **CQRS導入**: 読み書きの分離で性能向上
3. **キャッシュ層追加**: Redis で頻繁な読み取り最適化
```

## バージョン情報

- スキルバージョン: 1.0.0
- 最終更新: 2025-01-22

Overview

This skill reviews software architecture for SOLID principles, design patterns, scalability, and maintainability. It identifies violations, risky dependencies, and opportunities to apply proven patterns. It produces prioritized findings and actionable recommendations for refactoring or redesign. Use it to evaluate existing systems or plan architecture changes.

How this skill works

Provide an architecture diagram, code snippets, or a description of modules, services, and data flows. The skill inspects adherence to SOLID principles, layer separation, dependency management, and pattern usage, and assesses scalability, database design, and microservice boundaries. It flags issues like circular dependencies, SRP violations, and improper abstractions, then suggests concrete fixes and architectural options. Output includes severity-tagged findings, rationale, and recommended next steps.

When to use it

  • Assess an existing system before a major refactor or rewrite
  • Validate a proposed design or architecture diagram before implementation
  • Identify maintainability and testability problems in legacy code
  • Plan microservice boundaries, communication patterns, or scaling strategy
  • Prepare architecture critiques for design reviews or technical leadership

Best practices

  • Include architecture diagrams and representative code snippets for accurate analysis
  • Describe nonfunctional requirements (scalability, latency, consistency) up front
  • Collect dependency graphs and module boundaries to detect cycles
  • Prioritize fixes by impact and effort: high-severity issues first
  • Use suggested patterns (e.g., event-driven, CQRS) only where they address specific constraints

Example use cases

  • Review a monolith to identify candidates for service extraction and responsibilities to split
  • Audit a microservice ecosystem for circular dependencies and communication anti-patterns
  • Evaluate domain model and repository layering for SOLID compliance
  • Recommend database partitioning, indexing, or caching to improve read performance
  • Propose an incremental migration plan to event-driven or CQRS architectures

FAQ

What inputs give the best review?

Provide an architecture diagram, representative code samples, dependency lists, and key nonfunctional requirements like traffic patterns and latency targets.

Will it rewrite my code?

No. The skill analyzes and recommends refactorings, patterns, and design changes. It can supply sample snippets and migration steps but does not modify code directly.