Claude-skill-registry business-logic-coder
Implement business logic with ActiveInteraction and AASM state machines. Routes to specialized skills for typed operations and state management.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/business-logic-coder" ~/.claude/skills/majiayu000-claude-skill-registry-business-logic-coder && rm -rf "$T"
manifest:
skills/data/business-logic-coder/SKILL.mdsource content
Business Logic Patterns
Orchestrator for structured business logic in Rails.
Skill Routing
| Need | Skill | Use When |
|---|---|---|
| Typed operations | | Creating business operations, refactoring service objects |
| State machines | | Implementing workflows, managing state transitions |
When to Use Each
ActiveInteraction
Use for operations - things that happen once:
- User registration
- Order placement
- Payment processing
- Data imports
- Report generation
# Example: One-time operation with typed inputs outcome = Users::Create.run(email: email, name: name)
AASM
Use for state management - things with lifecycle:
- Order status (pending → paid → shipped)
- Subscription state (trial → active → cancelled)
- Document workflow (draft → review → published)
- Task status (todo → in_progress → done)
# Example: Stateful entity with transitions order.pay! # pending → paid order.ship! # paid → shipped
Combined Pattern
Often used together - interactions trigger state changes:
module Orders class Process < ActiveInteraction::Base object :order, class: Order def execute order.process! # AASM transition fulfill_order(order) order end end end
Setup
# Gemfile gem "active_interaction", "~> 5.3" gem "aasm", "~> 5.5"
Quick Reference
ActiveInteraction:
- Returns outcome (check.run
).valid?
- Raises on failure.run!
- Call nested interactionscompose
AASM:
- Transition or raise.event!
- Transition or return false.event
- Check if transition valid.may_event?
- List available events.aasm.events
Related Skills
- Record domain events from state transitionsevent-sourcing-coder