From ai-dev
Knowledge and patterns for designing software architectures and system design.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-dev:designing-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides patterns and techniques for designing robust software architectures.
This skill provides patterns and techniques for designing robust software architectures.
┌─────────────────────────────────┐
│ Presentation Layer │
├─────────────────────────────────┤
│ Application Layer │
├─────────────────────────────────┤
│ Domain Layer │
├─────────────────────────────────┤
│ Infrastructure Layer │
└─────────────────────────────────┘
┌─────────────────┐
│ REST API │
└────────┬────────┘
│
┌──────────┐ ┌──────▼──────┐ ┌──────────┐
│ Database │◀──│ Domain │──▶│ External │
│ Adapter │ │ Core │ │ API │
└──────────┘ └─────────────┘ └──────────┘
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Service │ │ Service │ │ Service │
│ A │ │ B │ │ C │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└────────────┼────────────┘
│
┌──────▼──────┐
│ Message Bus │
└─────────────┘
┌─────────┐ ┌───────────┐ ┌─────────┐
│ Producer│────▶│Event Store│────▶│Consumer │
└─────────┘ └───────────┘ └─────────┘
class UserRepository:
def get_by_id(self, user_id: str) -> User: ...
def save(self, user: User) -> None: ...
def delete(self, user_id: str) -> None: ...
def find_by_email(self, email: str) -> Optional[User]: ...
class OrderService:
def __init__(self, order_repo, payment_service, notification_service):
self.order_repo = order_repo
self.payment = payment_service
self.notifications = notification_service
def place_order(self, order: Order) -> OrderResult:
self.order_repo.save(order)
self.payment.charge(order.total)
self.notifications.send_confirmation(order)
class NotificationFactory:
@staticmethod
def create(type: str) -> Notification:
if type == "email":
return EmailNotification()
elif type == "sms":
return SMSNotification()
elif type == "push":
return PushNotification()
raise ValueError(f"Unknown type: {type}")
class PaymentStrategy(Protocol):
def process(self, amount: Decimal) -> PaymentResult: ...
class StripePayment:
def process(self, amount: Decimal) -> PaymentResult: ...
class PayPalPayment:
def process(self, amount: Decimal) -> PaymentResult: ...
class PaymentProcessor:
def __init__(self, strategy: PaymentStrategy):
self.strategy = strategy
def pay(self, amount: Decimal) -> PaymentResult:
return self.strategy.process(amount)
ADRs should be stored in /strategy/adrs/ using the naming convention ###-kebab-case-title.md.
Before making architectural decisions, check existing ADRs to avoid revisiting settled questions.
Template:
# ADR-001: [Decision Title]
**Status:** Proposed | Accepted | Deprecated | Superseded
**Date:** YYYY-MM-DD
## Context
[Why is this decision needed?]
## Decision
[What was decided?]
## Consequences
### Positive
- [Benefit 1]
- [Benefit 2]
### Negative
- [Trade-off 1]
- [Trade-off 2]
### Risks
- [Risk 1]
ADRs are part of the broader strategy workflow:
/strategy/VISION.md — Strategic context/strategy/OKRs.md — Current priorities/strategy/epics/ — Feature initiatives/strategy/tasks/ — Specific work items/strategy/adrs/ — Architectural decisions (you are here)┌─────────────────────────────────────────┐
│ Application │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ API │ │ Service │ │ DB │ │
│ │ Gateway │─▶│ Layer │─▶│ Access │ │
│ └─────────┘ └─────────┘ └────┬────┘ │
└──────────────────────────────────┼──────┘
│
┌──────▼──────┐
│ Database │
└─────────────┘
Client API Service Database
│ │ │ │
│──request────▶│ │ │
│ │──validate────▶│ │
│ │ ││──query───────▶│
│ │ ││◀──result──────│
│ │◀──response───│ │
│◀──response───│ │ │
npx claudepluginhub drewdresser/ai-dev-settings --plugin ai-devGuides system design, architecture reviews, ADR creation, hexagonal compliance, Mermaid/PlantUML diagram generation, and layer dependency enforcement.
Designs system architecture, creates ADRs, evaluates trade-offs, and plans scalability. Use for architecture review, microservices structuring, and infrastructure pattern selection.
Designs software architectures evaluating monolith/microservices/serverless/event-driven/CQRS/hexagonal patterns; generates C4 diagrams, ADRs, bounded contexts, and quality analysis.