explain-architecture-pattern — команда для Claude Code
Команда explain-architecture-pattern для Claude Code разбирает архитектуру проекта, паттерны и связи модулей, объясняя причины структуры кодовой базы.
MIT ★ 2 744 обновлён 2026-10-08
.claude/commands/explain-architecture-pattern.mdЧто делает explain-architecture-pattern
Команда анализирует структуру каталогов, имена файлов и связи между модулями. Она ищет архитектурные и проектные паттерны, объясняет возможные причины таких решений и показывает, где они применяются в коде.
В ответе Claude Code может разобрать поток данных, границы модулей, зависимости, интеграции и организацию файлов. Для пояснения используются Markdown, ASCII-диаграммы и примеры кода. Команда также описывает сильные стороны, компромиссы и варианты улучшений.
Объяснение зависит от структуры проекта и видимых связей между файлами: если нужная часть кодовой базы недоступна анализу, вывод будет неполным.
Какие задачи решает
- определить архитектурный паттерн проекта
- разобрать структуру каталогов и границы модулей
- объяснить реализацию паттерна Repository или CQRS
- показать поток запросов, событий и данных
- сопоставить преимущества архитектуры с её компромиссами
Примеры запросов агенту
- Разбери архитектурный паттерн, использованный в этом проекте.
- Определи, применяется ли здесь MVC, MVP или MVVM, и покажи связи между компонентами.
- Проанализируй модуль авторизации и объясни реализованные в нём паттерны проектирования.
Как установить explain-architecture-pattern
Вручную: положить файлы
.claude/commands/explain-architecture-pattern.mdВызов — /explain-architecture-pattern. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/explain-architecture-pattern.mdВызов — /prompts:explain-architecture-pattern. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/explain-architecture-pattern.prompt.mdВручную: положить файлы
.gemini/commands/explain-architecture-pattern.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы об explain-architecture-pattern
Как установить explain-architecture-pattern в Claude Code?
Сохраните файл команды по пути .claude/commands/explain-architecture-pattern.md.
Что делает explain-architecture-pattern?
Команда находит архитектурные и проектные паттерны в кодовой базе, объясняет их назначение и показывает связи между компонентами с помощью текста, диаграмм и примеров кода.
Что нужно команде для анализа архитектуры?
Ей нужна доступная кодовая база, по которой можно изучить структуру каталогов, файлы и связи между модулями.
Исходный текст
explain-architecture-pattern.md · MIT
# Explain Architecture Pattern Identify and explain architectural patterns, design patterns, and structural decisions found in the codebase. This helps understand the "why" behind code organization and design choices. ## Usage Examples ### Basic Usage "Explain the architecture pattern used in this project" "What design patterns are implemented in the auth module?" "Analyze the folder structure and explain the architecture" ### Specific Pattern Analysis "Is this using MVC, MVP, or MVVM?" "Explain the microservices architecture here" "What's the event-driven pattern in this code?" "How is the repository pattern implemented?" ## Instructions for Claude When explaining architecture patterns: 1. **Analyze Project Structure**: Examine folder organization, file naming, and module relationships 2. **Identify Patterns**: Recognize common architectural and design patterns 3. **Explain Rationale**: Describe why these patterns might have been chosen 4. **Visual Representation**: Use ASCII diagrams or markdown to illustrate relationships 5. **Practical Examples**: Show how the pattern is implemented with code examples ### Common Architecture Patterns #### Application Architecture - **MVC (Model-View-Controller)** - **MVP (Model-View-Presenter)** - **MVVM (Model-View-ViewModel)** - **Clean Architecture** - **Hexagonal Architecture** - **Microservices** - **Monolithic** - **Serverless** - **Event-Driven** - **Domain-Driven Design (DDD)** #### Design Patterns - **Creational**: Factory, Singleton, Builder, Prototype - **Structural**: Adapter, Decorator, Facade, Proxy - **Behavioral**: Observer, Strategy, Command, Iterator - **Concurrency**: Producer-Consumer, Thread Pool - **Architectural**: Repository, Unit of Work, CQRS #### Frontend Patterns - **Component-Based Architecture** - **Flux/Redux Pattern** - **Module Federation** - **Micro-Frontends** - **State Management Patterns** #### Backend Patterns - **RESTful Architecture** - **GraphQL Schema Design** - **Service Layer Pattern** - **Repository Pattern** - **Dependency Injection** ### Analysis Areas #### Code Organization - Project structure rationale - Module boundaries and responsibilities - Separation of concerns - Dependency management - Configuration patterns #### Data Flow - Request/response cycle - State management - Event propagation - Data transformation layers - Caching strategies #### Integration Points - API design patterns - Database access patterns - Third-party integrations - Message queue usage - Service communication ### Output Format Structure the explanation as: ```markdown ## Architecture Pattern Analysis ### Overview Brief description of the overall architecture identified ### Primary Patterns Identified #### 1. [Pattern Name] **What it is**: Brief explanation **Where it's used**: Specific locations in codebase **Why it's used**: Benefits in this context **Example**: ```language // Code example showing the pattern ``` **Diagram**: ``` ┌─────────────┐ ┌─────────────┐ │ Component │────▶│ Service │ └─────────────┘ └─────────────┘ ``` ### Architecture Characteristics #### Strengths - [Strength 1]: How it benefits the project - [Strength 2]: Specific advantages #### Trade-offs - [Trade-off 1]: What was sacrificed - [Trade-off 2]: Complexity added ### Implementation Details #### File Structure ``` src/ ├── controllers/ # MVC Controllers ├── models/ # Data models ├── views/ # View templates └── services/ # Business logic ``` #### Key Relationships - How components interact - Dependency flow - Communication patterns ### Recommendations - Patterns that could enhance current architecture - Potential improvements - Consistency suggestions ``` Remember to: - Use clear, accessible language - Provide context for technical decisions - Show concrete examples from the actual code - Explain benefits and trade-offs objectively
© centminmod · MIT · centminmod/my-claude-code-setup