home / skills / xfstudio / skills / architecture-patterns
This skill helps you design and migrate backend systems using Clean, Hexagonal, and Domain-Driven patterns for scalable, testable architectures.
npx playbooks add skill xfstudio/skills --skill architecture-patternsReview the files below or copy the command above to add this skill to your agents.
---
name: architecture-patterns
description: 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.
---
# Architecture Patterns
Master proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design to build maintainable, testable, and scalable systems.
## Use this skill when
- Designing new backend systems from scratch
- Refactoring monolithic applications for better maintainability
- Establishing architecture standards for your team
- Migrating from tightly coupled to loosely coupled architectures
- Implementing domain-driven design principles
- Creating testable and mockable codebases
- Planning microservices decomposition
## Do not use this skill when
- You only need small, localized refactors
- The system is primarily frontend with no backend architecture changes
- You need implementation details without architectural design
## Instructions
1. Clarify domain boundaries, constraints, and scalability targets.
2. Select an architecture pattern that fits the domain complexity.
3. Define module boundaries, interfaces, and dependency rules.
4. Provide migration steps and validation checks.
Refer to `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.
## Resources
- `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.
This skill implements proven backend architecture patterns such as Clean Architecture, Hexagonal Architecture, and Domain-Driven Design to produce maintainable, testable, and scalable systems. It guides pattern selection, module boundaries, and migration plans tailored to your domain constraints and scalability targets. Use it to standardize architecture decisions and reduce long-term technical debt.
I analyze your domain boundaries, constraints, and nonfunctional requirements, then recommend an appropriate pattern and concrete module interfaces. I produce dependency rules, layered or port-adapter layouts, and a step-by-step migration or implementation plan. Deliverables include interface sketches, testing strategies, and validation checks to ensure the design remains decoupled and testable.
Which pattern should I choose for a greenfield project?
Start with Clean Architecture for clear separation of concerns; adopt DDD if the domain is complex and requires rich modeling.
How do I migrate incrementally without breaking production?
Create an adapter layer around legacy code, introduce the domain core behind interfaces, and run validation checks after each small migration step.