Design, evaluate, and document software architecture patterns
Recommends, evaluates, or documents software architecture patterns based on system requirements and constraints. Triggered when designing new systems, assessing existing architectures, or creating ADRs for technical decisions.
/plugin marketplace add pluginagentmarketplace/custom-plugin-software-design/plugin install custom-plugin-software-design@pluginagentmarketplace-software-designThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyAtomic skill for architecture design and evaluation
skill_id: architecture-patterns
responsibility: Single - Architecture pattern recommendation and documentation
atomic: true
idempotent: true
interface SkillParams {
// Required
action: 'recommend' | 'evaluate' | 'document' | 'migrate';
// Conditional
requirements?: SystemRequirements; // For recommend
current_architecture?: string; // For evaluate, migrate
target_architecture?: string; // For migrate
// Optional
constraints?: ArchitectureConstraints;
team_size?: number;
output_format?: 'text' | 'diagram' | 'adr';
}
interface SystemRequirements {
functional: string[];
non_functional: {
scalability: 'low' | 'medium' | 'high';
maintainability: 'low' | 'medium' | 'high';
testability: 'low' | 'medium' | 'high';
performance: 'low' | 'medium' | 'high';
};
domain_complexity: 'simple' | 'moderate' | 'complex';
}
interface SkillResult {
recommendation?: ArchitectureRecommendation;
evaluation?: ArchitectureEvaluation;
documentation?: ArchitectureDocumentation;
migration_plan?: MigrationPlan;
}
input_validation:
action:
required: true
enum: [recommend, evaluate, document, migrate]
requirements:
required_when: action == 'recommend'
current_architecture:
required_when: action in ['evaluate', 'migrate']
retry_config:
max_attempts: 3
backoff:
type: exponential
initial_delay_ms: 2000
max_delay_ms: 20000
multiplier: 2
retryable_errors:
- TIMEOUT
- RATE_LIMIT
non_retryable_errors:
- INVALID_REQUIREMENTS
- UNKNOWN_PATTERN
layered:
complexity: low
scalability: limited
testability: medium
best_for:
- Simple CRUD applications
- Small teams (1-5)
hexagonal:
complexity: medium
scalability: high
testability: high
best_for:
- Complex business logic
- High testability requirements
clean:
complexity: high
scalability: high
testability: high
best_for:
- Enterprise applications
- Long-lived systems
cqrs:
complexity: high
scalability: very_high
best_for:
- Read-heavy systems
- Different scaling requirements
event_sourcing:
complexity: very_high
scalability: very_high
best_for:
- Audit requirements
- Temporal queries
decision_matrix:
simple_crud:
recommended: layered
avoid: [event_sourcing, cqrs]
complex_domain:
recommended: hexagonal
avoid: [layered]
high_scalability:
recommended: cqrs
avoid: [layered]
audit_requirements:
recommended: event_sourcing
// Input
{
action: "recommend",
requirements: {
functional: ["User management", "Order processing"],
non_functional: {
scalability: "high",
maintainability: "high",
testability: "high"
},
domain_complexity: "complex"
},
team_size: 8
}
// Output
{
recommendation: {
primary_pattern: "Hexagonal Architecture",
alternatives: [
{ pattern: "Clean Architecture", fit_score: 0.85 }
],
rationale: "Complex domain with high testability needs",
tradeoffs: [
{ benefit: "High testability", cost: "Initial learning curve" }
]
}
}
// Input
{
action: "document",
system_description: "E-commerce platform with complex pricing",
output_format: "adr"
}
// Output
{
documentation: {
adr: `
# ADR-001: Adopt Hexagonal Architecture
## Status
Accepted
## Context
Building e-commerce platform with complex pricing rules.
## Decision
Adopt Hexagonal Architecture with domain-centric design.
## Consequences
### Positive
- Domain logic isolated and highly testable
- Easy to swap external providers
### Negative
- More initial setup required
`
}
}
describe('ArchitecturePatternsSkill', () => {
describe('recommend', () => {
it('should recommend Layered for simple CRUD', async () => {
const result = await skill.execute({
action: 'recommend',
requirements: {
non_functional: { scalability: 'low' },
domain_complexity: 'simple'
},
team_size: 3
});
expect(result.recommendation.primary_pattern).toBe('Layered Architecture');
});
it('should recommend Hexagonal for complex domain', async () => {
const result = await skill.execute({
action: 'recommend',
requirements: {
non_functional: { testability: 'high' },
domain_complexity: 'complex'
},
team_size: 8
});
expect(result.recommendation.primary_pattern).toBe('Hexagonal Architecture');
});
});
});
errors:
INVALID_REQUIREMENTS:
code: 400
message: "Requirements incomplete or invalid"
recovery: "Provide at least functional or non-functional requirements"
UNKNOWN_PATTERN:
code: 400
message: "Architecture pattern not recognized"
recovery: "Use supported pattern name"
requires:
- pattern_matcher
- adr_generator
emits:
- architecture_recommended
- architecture_evaluated
- adr_generated
consumed_by:
- 07-architecture-patterns (bonded agent)
- 05-domain-driven (for DDD architecture mapping)
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.