← Back to list

business-logic-coder
by majesticlabs-dev
⭐ 18🍴 1📅 Jan 24, 2026
SKILL.md
name: business-logic-coder description: Implement business logic with ActiveInteraction and AASM state machines. Routes to specialized skills for typed operations and state management.
Business Logic Patterns
Orchestrator for structured business logic in Rails.
Skill Routing
| Need | Skill | Use When |
|---|---|---|
| Typed operations | active-interaction-coder | Creating business operations, refactoring service objects |
| State machines | aasm-coder | 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:
.run- Returns outcome (check.valid?).run!- Raises on failurecompose- Call nested interactions
AASM:
.event!- Transition or raise.event- Transition or return false.may_event?- Check if transition valid.aasm.events- List available events
Related Skills
event-sourcing-coder- Record domain events from state transitions
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon