home / skills / hoangnguyen0403 / agent-skills-standard / system-design
This skill helps you apply foundational architectural principles and patterns to design robust, scalable, and maintainable systems.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill system-designReview the files below or copy the command above to add this skill to your agents.
---
name: System Design & Architecture Standards
description: Universal architectural standards for building robust, scalable, and maintainable systems.
metadata:
labels: [system-design, architecture, scalability, reliability]
triggers:
keywords: [architecture, design, system, scalability]
---
# System Design & Architecture Standards
## **Priority: P0 (FOUNDATIONAL)**
## Architectural Principles
- **SoC**: Divide into distinct sections per concern.
- **SSOT**: One source, reference elsewhere.
- **Fail Fast**: Fail visibly when errors occur.
- **Graceful Degradation**: Core functional even if secondary fails.
## Modularity & Coupling
- **High Cohesion**: Related functionality in one module.
- **Loose Coupling**: Use interfaces for communication.
- **DI**: Inject dependencies, don't hardcode.
## Common Patterns
- **Layered**: Presentation → Logic → Data.
- **Event-Driven**: Async communication between decoupled components.
- **Clean/Hexagonal**: Core logic independent of frameworks.
- **Statelessness**: Favor stateless for scaling/testing.
## Distributed Systems
- **CAP**: Trade-off Consistency/Availability/Partition tolerance.
- **Idempotency**: Operations repeatable without side effects.
- **Circuit Breaker**: Fail fast on failing services.
- **Eventual Consistency**: Design for async data sync.
## Documentation & Evolution
- **Design Docs**: Write specs before major implementations.
- **Versioning**: Version APIs/schemas for backward compatibility.
- **Extensibility**: Use Strategy/Factory for future changes.
This skill provides universal architectural standards for building robust, scalable, and maintainable systems. It captures foundational principles, common design patterns, and operational guidance to shape architecture decisions across languages and frameworks. The guidance is framework-agnostic and intended to be applied to projects from mobile apps to distributed backends.
The skill inspects architecture decisions and recommends patterns that improve cohesion, reduce coupling, and increase resilience. It highlights principles such as separation of concerns, single source of truth, dependency injection, and stateless design and maps them to practical patterns like layered, event-driven, and hexagonal architectures. It also flags distributed-system concerns such as idempotency, circuit breakers, and trade-offs in CAP.
How do I choose between layered and hexagonal architectures?
Use layered architecture for straightforward separation of concerns; choose hexagonal when you need a framework-independent core and easier testability of business rules.
When should I favor stateless services?
Favor stateless services when you need horizontal scalability and simple failure recovery; keep state in external stores or dedicated stateful services when necessary.