Curated library of 39 AI agent skills for Ruby on Rails development. Organized by category: planning, testing, code-quality, ddd, engines, infrastructure, api, patterns, context, orchestration, and workflows. Includes 5 callable workflow skills (rails-tdd-loop, rails-review-flow, rails-setup-flow, rails-quality-flow, rails-engines-flow) for complete development cycles. Covers code review, architecture, security, testing (RSpec), engines, service objects, DDD patterns, and TDD automation.
95
98%
Does it follow best practices?
Impact
95%
1.20xAverage score across 35 eval scenarios
Passed
No known issues
The platform team at CloudSub has recently shipped a SubscriptionBillingService that handles plan upgrades, downgrades, and cancellations. The service is already implemented and all specs are passing, but the module has no inline documentation. Two junior engineers joining the team next week need to consume these classes from a new payment gateway integration, and the tech lead wants the public API fully documented before the onboarding begins.
The service handles complex input hashes and can raise several exceptions. Without proper docs, consumers will have to read the full implementation to understand what parameters are accepted, what the return shape looks like, and what exceptions they need to rescue.
Your task is to add YARD documentation to the provided Ruby source file. Do not change the logic — only add documentation.
The following file is provided as input. Extract it before beginning.
=============== FILE: app/services/subscription_billing_service.rb ===============
module Billing class SubscriptionBillingService VALID_PLANS = %w[starter growth enterprise].freeze
def self.call(params)
new(params).call
end
def initialize(params)
@params = params
end
def call
validate!
result = process_change
{ success: true, response: result }
rescue InvalidPlanError => e
{ success: false, response: { error: e.message } }
rescue PaymentGatewayError => e
{ success: false, response: { error: e.message, retryable: true } }
end
def self.supported_plans
VALID_PLANS
end
private
def validate!
raise InvalidPlanError, "Unknown plan: #{@params[:plan]}" unless VALID_PLANS.include?(@params[:plan])
raise ArgumentError, "customer_id is required" unless @params[:customer_id]
end
def process_change
case @params[:action]
when "upgrade" then upgrade_plan
when "downgrade" then downgrade_plan
when "cancel" then cancel_subscription
else raise ArgumentError, "Unknown action: #{@params[:action]}"
end
end
def upgrade_plan
{ plan: @params[:plan], effective_date: Time.current, previous_plan: @params[:current_plan] }
end
def downgrade_plan
{ plan: @params[:plan], effective_date: end_of_billing_period, previous_plan: @params[:current_plan] }
end
def cancel_subscription
{ cancelled_at: Time.current, refund_eligible: @params[:plan] != "starter" }
end
def end_of_billing_period
Time.current.end_of_month
endend
class InvalidPlanError < StandardError; end class PaymentGatewayError < StandardError; end end
Produce a single updated file:
app/services/subscription_billing_service.rb — the source file with YARD documentation added to all public surfaces (the class itself, self.call, self.supported_plans, initialize)Do not modify the Ruby logic — only add YARD comments.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
mcp_server
skills
api
api-rest-collection
rails-graphql-best-practices
code-quality
rails-architecture-review
rails-code-conventions
rails-code-review
rails-review-response
rails-security-review
rails-stack-conventions
assets
snippets
refactor-safely
context
rails-context-engineering
rails-project-onboarding
ddd
ddd-boundaries-review
ddd-rails-modeling
ddd-ubiquitous-language
engines
rails-engine-compatibility
rails-engine-docs
rails-engine-extraction
rails-engine-installers
rails-engine-release
rails-engine-reviewer
rails-engine-testing
infrastructure
rails-api-versioning
rails-background-jobs
rails-database-seeding
rails-frontend-hotwire
rails-migration-safety
rails-performance-optimization
orchestration
rails-skills-orchestrator
patterns
ruby-service-objects
strategy-factory-null-calculator
yard-documentation
planning
create-prd
generate-tasks
ticket-planning
testing
rails-bug-triage
rails-tdd-slices
rspec-best-practices
rspec-service-testing