senior-architect
Architectural support for building scalable, decoupled systems with layer enforcement.
Install
mkdir -p .claude/skills/senior-architect-peadarpol && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9754" && unzip -o skill.zip -d .claude/skills/senior-architect-peadarpol && rm skill.zipInstalls to .claude/skills/senior-architect-peadarpol
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Comprehensive software architecture skill for designing scalable systems using Clean Architecture/DDD. Includes dependency analysis for layer enforcement.Key capabilities
- →Verify architecture layer dependencies
- →Enforce Clean Architecture boundaries
- →Implement Domain-Driven Design patterns
- →Analyze dependency flow between layers
How it works
The skill uses automated scripts to analyze imports and enforce structural rules that ensure business logic remains decoupled from infrastructure.
Inputs & outputs
When to use senior-architect
- →Verifying architecture layers
- →Enforcing dependency flow
- →Implementing domain-driven design
- →Decoupling persistence logic
About this skill
Senior Architect
Overview
Maintain structural integrity using Clean Architecture and Domain-Driven Design (DDD). This skill provides tools to verify that dependencies flow towards the domain and that layers remain isolated.
Main Capabilities
This skill provides automated structural verification for the project:
# Script: Dependency Analyzer
# Checks for layer violations (e.g., domain importing infrastructure)
python .agent/skills/senior-architect/scripts/dependency_analyzer.py src/
Architecture Layers
| Layer | Responsibility | Allowed Dependencies |
|---|---|---|
| Domain | Business logic, Entities, Aggregates | None (External libraries only) |
| Application | Use cases, Services, DTOs, IUnitOfWork | Domain |
| Infrastructure | Database, External APIs, UnitOfWorkImpl | Domain, Application |
| Presentation | UI, API | Application, Domain |
Dependency Rules
- Inner Circle First: Nothing in the
domain/directory should import fromapplication/,infrastructure/, orpresentation/. - Persistence Ignorance: Entities should not know how they are stored (No DB-specific ORM imports in
domain/). - Repository Pattern: Infrastructure implements interfaces defined in the domain/application layers.
Best Practices
- Bounded Contexts: Keep related models within their functional modules.
- DTOs vs Entities: Always use Pydantic DTOs for data transfer across layer boundaries.
- Protocol-Based Type Safety: Use domain protocols to decouple the service layer from concrete model implementations. This ensures type safety and compliance.
- Strict Exception Handling: Refuse any architecture where broad exceptions are suppressed or ignored. Ensure all exception blocks are accompanied by a
raise. - Unit of Work Pattern: Use
IUnitOfWork(in application layer) to group multiple operations into a single transaction. Services should depend onIUnitOfWork, not individual repositories. - Dependency Injection: Use framework-specific dependency injection to inject
IUnitOfWorkinto services. - Event-Driven Decoupling: Services focus on Decision Making and State Changes. Side effects (Notifications, Analytics, Integrations) belong in Event Handlers.
- Layer Rule: Handlers live in the application layer and subscribe in the infrastructure event bus layer.
New Architectural Enforcement (2026)
- Linter: Use
python .agent/skills/senior-architect/scripts/architecture_checks.pyfor automated boundary checks. - DTO Isolation: Strictly enforce that
domain/andapplication/are free ofpresentation/and web framework imports. - Mypy Strictness: Use static checks for the domain and application layers.
- Async Safety: Use proper event loop policy management in test configurations.
Troubleshooting
If the dependency_analyzer.py reports a violation:
- Identify the file and the "forbidden" import.
- If it's a cross-layer dependency, consider introducing an Interface/Protocol in the inner layer and implementing it in the outer layer.
- If it's a circular dependency within a layer, refactor shared logic into a
commonorutilsmodule. - If a Service is importing another Service purely for a side effect, refactor to use a Domain Event instead.
When not to use it
- →When importing infrastructure into the domain layer
- →When suppressing exceptions without handling
Prerequisites
Limitations
- →Requires strict adherence to layer responsibilities
- →Domain layer must remain free of framework imports
How it compares
It provides automated structural enforcement for Clean Architecture rather than manual architectural review.
Compared to similar skills
senior-architect side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| senior-architect (this skill) | 0 | 1mo | Review | Advanced |
| mcp-builder | 136 | 3mo | Review | Advanced |
| architecture-patterns | 55 | 2mo | No flags | Advanced |
| deepwiki-rs | 25 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Peadarpol
View all by Peadarpol →You might also like
mcp-builder
anthropics
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
architecture-patterns
wshobson
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
langchain-architecture
wshobson
Design LLM applications using the LangChain framework with agents, memory, and tool integration patterns. Use when building LangChain applications, implementing AI agents, or creating complex LLM workflows.
python-design-patterns
wshobson
Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use when making architecture decisions, refactoring code structure, or evaluating when abstractions are appropriate.
python-project-structure
wshobson
Python project organization, module architecture, and public API design. Use when setting up new projects, organizing modules, defining public interfaces with __all__, or planning directory layouts.