refactoring-patterns
Installation
SKILL.md
Extract Method
When: A code block does one logical thing within a function that does more.
BEFORE:
function processOrder(order: Order) {
// Validate order
if (!order.items || order.items.length === 0) {
throw new Error('Order must have items');
}
if (order.total <= 0) {
throw new Error('Order total must be positive');
}