Curated library of 42 public AI agent skills for Ruby on Rails development, plus 5 callable workflow skills. Organized by category: planning, testing, code-quality, ddd, engines, infrastructure, api, patterns, context, orchestration, and workflows. Covers code review, architecture, security, testing (RSpec), engines, service objects, DDD patterns, and TDD automation.
96
96%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Risky
Do not use without reviewing
One API for the client: Calculator::Factory.for(entity).calculate. The factory picks the strategy; NullService handles unknown variants safely.
For each component (Factory → BaseService → NullService → Concrete):
| Component | Responsibility |
|---|---|
| Factory | Dispatch to correct service class via SERVICE_MAP; fall back to NullService |
| BaseService | Guard with should_calculate?; delegate to compute_result |
| NullService | Always returns nil safely — never raises |
| Concrete | Override should_calculate? (add variant check on top of super) and compute_result |
app/services/<calculator_name>/
├── factory.rb
├── base_service.rb
├── null_service.rb
├── standard_service.rb
├── premium_service.rb# frozen_string_literal: true
module PricingCalculator
class Factory
SERVICE_MAP = {
'standard' => StandardPricingService,
'premium' => PremiumPricingService
}.freeze
def self.for(order)
plan = order.plan
return NullService.new(order) unless plan&.active?
service_class = SERVICE_MAP[plan.name] || NullService
service_class.new(order)
end
end
endNo qualifying context or unknown variant → NullService.
# frozen_string_literal: true
module PricingCalculator
class BaseService
def initialize(order)
@order = order
end
def calculate
return nil unless should_calculate?
compute_result
end
private
def should_calculate?
@order.present?
end
def compute_result
raise NotImplementedError, "#{self.class}#compute_result must be implemented"
end
end
end# frozen_string_literal: true
module PricingCalculator
class NullService < BaseService
private
def should_calculate?
false
end
def compute_result
nil
end
end
end# frozen_string_literal: true
module PricingCalculator
class StandardPricingService < BaseService
private
def should_calculate?
super && @order.plan.name == 'standard'
end
def compute_result
@order.base_price * 1.0
end
end
endAlways call super in should_calculate? to preserve the base guard.
price = PricingCalculator::Factory.for(order).calculateSingle entry point rule: Factory.for(entity) is the only permitted access path. Clients never instantiate service classes directly. If you see StandardPricingService.new(order) outside of Factory, that is a bug — route through the factory.
See assets/examples.md for complete, copy-paste-ready RSpec examples for the Factory, NullService, and each concrete service.
Each spec suite must cover: inactive plan, nil plan, each named variant, and unknown variant. Mirror the same context structure across all concrete services.
| Pitfall | Fix |
|---|---|
| SERVICE_MAP key mismatch | Verify keys match exactly what is stored in the database — typos cause silent NullService fallbacks |
| Missing NullService spec | Always add a spec context for unknown/nil variants or tests will never catch the fallback regression |
Direct service instantiation (ServiceClass.new(entity)) | Route through Factory.for(entity) — it is the sole public entry point; direct instantiation bypasses the NullService safety net |
Forgetting super in concrete should_calculate? | Always call super — skipping it removes the base nil/presence guard |
| Skill | When to chain |
|---|---|
| test-service | For complete Factory, BaseService, NullService, and concrete strategy specs |
| create-service-object | For naming conventions, YARD docs, and frozen_string_literal baseline |
build
docs
mcp_server
skills
api
generate-api-collection
implement-graphql
code-quality
apply-code-conventions
apply-stack-conventions
assets
snippets
code-review
refactor-code
respond-to-review
review-architecture
security-check
context
load-context
setup-environment
ddd
define-domain-language
model-domain
review-domain-boundaries
engines
create-engine
create-engine-installer
document-engine
extract-engine
release-engine
review-engine
test-engine
upgrade-engine
infrastructure
implement-background-job
implement-hotwire
optimize-performance
review-migration
seed-database
version-api
orchestration
skill-router
patterns
create-service-object
implement-calculator-pattern
write-yard-docs
planning
create-prd
generate-tasks
plan-tickets
testing
plan-tests
test-service
triage-bug
write-tests
workflows