architecture-design
Design system architecture and make structural decisions
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Architecture Design Skill
Design Principles
1. Separation of Concerns
Each module has a single, well-defined responsibility.
2. Dependency Inversion
Depend on abstractions, not concretions.
3. Interface Segregation
Many specific interfaces over one general-purpose interface.
4. Open/Closed
Open for extension, closed for modification.
5. Single Source of Truth
Each piece of data has exactly one authoritative source.
Architecture Patterns
Layered Architecture
┌─────────────────────────────┐
│ Presentation Layer │
├─────────────────────────────┤
│ Application Layer │
├─────────────────────────────┤
│ Domain Layer │
├─────────────────────────────┤
│ Infrastructure Layer │
└─────────────────────────────┘
Clean Architecture
┌─────────────────────────────────────┐
│ Frameworks │
│ ┌─────────────────────────────┐ │
│ │ Interface Adapters │ │
│ │ ┌─────────────────────┐ │ │
│ │ │ Use Cases │ │ │
│ │ │ ┌─────────────┐ │ │ │
│ │ │ │ Entities │ │ │ │
│ │ │ └─────────────┘ │ │ │
│ │ └─────────────────────┘ │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────┘
Hexagonal (Ports & Adapters)
┌─────────────┐
┌────┤ Adapter ├────┐
│ └─────────────┘ │
│ │
┌───┴───┐ ┌───────┐ ┌───┴───┐
│ Port │───│ Core │───│ Port │
└───┬───┘ └───────┘ └───┬───┘
│ │
│ ┌─────────────┐ │
└────┤ Adapter ├────┘
└─────────────┘
Decision Framework
When Making Architecture Decisions
- Identify the problem - What specific issue needs solving?
- List constraints - Budget, time, team skills, scale requirements
- Consider options - At least 3 viable approaches
- Evaluate tradeoffs - Pros/cons of each option
- Document decision - Record in ADL with rationale
Technology Evaluation Framework
Use this when comparing frameworks, platforms, or core stack choices.
Rubric (Score 1-5)
| Criterion | What to Evaluate |
|---|---|
| Fit | Requirement alignment, domain constraints, team familiarity |
| Complexity | Build/run/debug complexity and operational overhead |
| Scalability | Headroom for traffic, data growth, and team scaling |
| Risk | Security, delivery, lock-in, and migration exposure |
| Maintainability | Testability, readability, upgrade cadence, hiring impact |
Recommendation Output Pattern
- Present 2-4 realistic alternatives.
- Show rubric scores and one-line rationale per criterion.
- Recommend one option with explicit context-based reasoning.
- State when that option is not appropriate.
- Name a fallback option if core assumptions change.
Neutrality Guardrails
- Start from constraints, not preferred tools.
- Avoid single-framework bias; include a credible alternative.
- Make assumptions explicit when context is incomplete.
- Tie final choice to measurable outcomes (delivery speed, reliability, cost, risk).
Decision Template
### AD-XXX: {Decision Title}
**Context:** {What situation prompted this decision?}
**Options Considered:**
1. {Option A} - {Brief description}
2. {Option B} - {Brief description}
3. {Option C} - {Brief description}
**Decision:** {Which option was chosen}
**Rationale:** {Why this option?}
**Consequences:**
- {Positive consequence}
- {Negative consequence/tradeoff}
**Related:** {Links to related decisions}
Common Patterns
Repository Pattern
Abstracts data access behind a collection-like interface.
Service Layer
Coordinates application operations and transactions.
Factory Pattern
Encapsulates object creation logic.
Observer Pattern
Defines one-to-many dependency for state changes.
Strategy Pattern
Defines family of interchangeable algorithms.
Project Structure
Feature-Based (Recommended)
src/
├── features/
│ ├── auth/
│ │ ├── login.ts
│ │ ├── logout.ts
│ │ └── auth.test.ts
│ └── users/
│ ├── create-user.ts
│ └── users.test.ts
├── shared/
│ ├── database/
│ └── utils/
└── index.ts
Layer-Based
src/
├── controllers/
├── services/
├── repositories/
├── models/
└── utils/
Best Practices
- Document decisions - Every architectural choice in ADL
- Start simple - Add complexity only when needed
- Defer decisions - Make reversible choices when uncertain
- Vertical slices - Complete features over horizontal layers
- Test boundaries - Focus tests on public interfaces
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!