Strategic architecture, tactical design, and testable code principles (SOLID, Clean Architecture, Design Patterns, Testable Design)
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
{
"instructions": [
{
"instruction": "Before choosing a pattern, state the concrete problem without pattern jargon: what conditional logic or coupling exists, what needs to vary independently, and what external system needs integration.",
"relevant_when": "Evaluating a codebase to decide whether a design pattern applies",
"why_given": "Step 1 of the workflow requires a concrete problem statement before pattern selection"
},
{
"instruction": "When proposing a pattern, explicitly state the win condition: what complexity the pattern removes and what it adds. If the cost outweighs the benefit for simple code, recommend staying with the current approach.",
"relevant_when": "Recommending or applying a design pattern",
"why_given": "Step 2 requires evaluating pattern fit with an explicit win condition and cost/benefit analysis"
},
{
"instruction": "Use the Strategy pattern to eliminate if/else chains or switch statements that select between interchangeable algorithms. Extract each branch into a class implementing a common interface.",
"relevant_when": "Code contains conditional logic that selects between algorithm variants",
"why_given": "Strategy pattern section: 'Use when: Conditional logic selects between algorithms'"
},
{
"instruction": "Use the Adapter pattern when integrating an external or legacy API whose interface does not match your domain interface. Create a thin adapter class that translates between the two interfaces.",
"relevant_when": "Integrating external APIs or legacy systems with incompatible interfaces",
"why_given": "Adapter pattern section: 'Use when: Integrating external APIs or legacy systems with incompatible interfaces'"
},
{
"instruction": "Use the Anti-Corruption Layer pattern to prevent external system design from polluting domain models. The ACL translates external data types to domain types and must live at the infrastructure boundary.",
"relevant_when": "Integrating with external systems that have poor or incompatible domain models",
"why_given": "Anti-Corruption Layer section prescribes this for preventing external pollution of the domain"
},
{
"instruction": "NEVER apply patterns preemptively for imagined future needs. Apply a Factory or Strategy only when a second concrete implementation exists or complexity justifies it.",
"relevant_when": "Evaluating whether to extract a pattern when only one implementation exists",
"why_given": "Anti-pattern: NEVER apply patterns preemptively — wait for concrete need"
}
]
}clean-architecture
evals
references
design-patterns
solid-principles
testable-design