Common system design patterns and architectures
View on GitHubplugins/aai-architecture/skills/system-design-patterns/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-architecture/skills/system-design-patterns/SKILL.md -a claude-code --skill system-design-patternsInstallation paths:
.claude/skills/system-design-patterns/# System Design Patterns Skill
Common patterns for designing scalable systems.
## Architectural Patterns
### Layered Architecture
```
┌─────────────────────────────┐
│ Presentation Layer │ UI, API endpoints
├─────────────────────────────┤
│ Application Layer │ Business logic, use cases
├─────────────────────────────┤
│ Domain Layer │ Entities, business rules
├─────────────────────────────┤
│ Infrastructure Layer │ Database, external services
└─────────────────────────────┘
```
```typescript
// Presentation Layer
@Controller('users')
class UserController {
constructor(private userService: UserService) {}
@Get(':id')
getUser(@Param('id') id: string) {
return this.userService.findById(id)
}
}
// Application Layer
class UserService {
constructor(private userRepository: UserRepository) {}
async findById(id: string): Promise<User> {
return this.userRepository.findById(id)
}
}
// Domain Layer
class User {
constructor(
public id: string,
public email: string,
public name: string
) {}
updateEmail(newEmail: string) {
// Business validation
if (!this.isValidEmail(newEmail)) {
throw new ValidationError('Invalid email')
}
this.email = newEmail
}
}
// Infrastructure Layer
class TypeOrmUserRepository implements UserRepository {
async findById(id: string): Promise<User | null> {
return this.repository.findOne({ where: { id } })
}
}
```
### Microservices
```
┌─────────────┐
│ API Gateway │
└──────┬──────┘
┌───────────────┼───────────────┐
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────┐
│ User │ │ Order │ │ Payment │
│ Service │ │ Service │ │ Service │
└────────────┘ └────────────┘ └────────────┘
│ │ │
▼ ▼ ▼
┌─────────