
Keeping Routines Focused
Claude Code agent workflow helper from OBRA clank repository.
Install
npx skills add https://github.com/obra/clank --skill keeping-routines-focusedWhat is this skill?
- OBRA clank agent workflow.
- Install via skills.sh registry.
- Pairs with Superpowers ecosystem.
Adoption & trust: 2 installs on skills.sh; 40 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Microsoft Foundrymicrosoft/azure-skills
Azure Aimicrosoft/azure-skills
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Lark Eventlarksuite/cli
Running Claude Code Via Litellm Copilotxixu-me/skills
Setup Matt Pocock Skillsmattpocock/skills
Journey fit
Common Questions / FAQ
Is Keeping Routines Focused safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Keeping Routines Focused
# Keeping Routines Focused ## Overview A routine should do ONE thing and do it well. This is called functional cohesion - the strongest, best kind of cohesion. **Core principle:** If a routine's description contains "and", it's doing too many things. Extract into focused routines. **Goal:** Improve intellectual manageability. The more focused a routine, the easier to understand, test, modify, and reuse. ## When to Use **Proactively (writing new code):** - Designing new functions/methods - Writing routine specifications - Naming routines (if name is vague or has "and", too many responsibilities) **Reactively (improving existing code):** - Reviewing code with long routines - Refactoring when routine does multiple things - When routine is hard to understand or test - When routine keeps growing with each modification **Warning signs routine needs focus:** - Description has "and" in it - Routine name is vague or long - Routine is hard to name clearly - Routine is > 200 lines (strong signal) - Parameter list > 7 parameters - Many local variables (> 10) - Multiple levels of abstraction mixed - Does validation AND calculation AND side-effects - Hard to write test (does too much to test atomically) ## What is "One Thing"? **One thing means one level of abstraction:** ✅ **Does one thing:** ```python def calculate_total_price(items, tax_rate): """Calculate total price of items including tax.""" subtotal = sum(item.price * item.quantity for item in items) tax = subtotal * tax_rate return subtotal + tax ``` Single purpose: price calculation. All statements at same abstraction level (arithmetic). --- ❌ **Does multiple things:** ```python def handle_order(order_data, user_id): """ Process order: - Validate order data - Calculate total with tax - Apply discount codes - Check inventory - Create order record - Send confirmation email - Update user history - Return confirmation """ validated = validate_order_data(order_data, user_id) # Thing 1 subtotal = calculate_subtotal(validated["items"]) # Thing 2 discount = apply_discount(subtotal, validated.get("discount_code")) # Thing 3 tax = calculate_tax(subtotal - discount, validated["tax_rate"]) # Thing 4 total = subtotal - discount + tax # Thing 5 check_inventory(validated["items"]) # Thing 6 order_record = create_order_record(...) # Thing 7 send_confirmation_email(...) # Thing 8 update_user_history(user_id, order_record["order_id"]) # Thing 9 return {...} # Thing 10 ``` Description has 8 "and"s. Does 10 different things. Violates single responsibility. ## How to Extract Routines ### Technique 1: Extract by Responsibility Group related statements, extract into focused routine: **Before (orchestrator does everything):** ```python def handle_order(order_data, user_id): # Validation (lines 1-10) validated = validate_order_data(order_data, user_id) # Pricing (lines 11-15) subtotal = calculate_subtotal(validated["items"]) discount = apply_discount(subtotal, validated.get("discount_code")) tax = calculate_tax(subt