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 Greenfield Commerce platform recently added a promotions feature through a community contribution. The PR was submitted by a developer who is strong in feature delivery but less experienced with Rails security and performance conventions. Before this can be merged to main, the team needs a thorough review of the code to catch any issues that could cause problems in production.
Your job is to produce a complete code review of the provided diff. The application is a standard Rails 7 API app backed by PostgreSQL. The review should help the developer understand what must be addressed before the PR can be merged, what is strongly recommended, and what is optional. The team's review process requires that any items needing re-review are clearly flagged.
Produce a single file review.md containing your complete review. Structure it by area (e.g. Controllers, Queries, Migrations, Security, etc.) and classify every finding with a severity. For each finding include the affected location, what the problem is, and a concrete fix suggestion. End the review with a clear statement about next steps — specifically whether a follow-up review pass is needed and under what conditions.
The following files are provided as inputs. Extract them before beginning.
=============== FILE: app/controllers/promotions_controller.rb ===============
class PromotionsController < ApplicationController def index @promotions = Promotion.all render json: @promotions.map { |p| { id: p.id, title: p.title, discount_percent: p.discount_percent, used_count: p.orders.count, creator: p.created_by.name } } end
def apply promotion = Promotion.find(params[:id]) order = Order.find(params[:order_id])
# Calculate the discounted total
base_total = order.line_items.sum { |item| item.quantity * item.unit_price }
discount_amount = base_total * (promotion.discount_percent / 100.0)
final_total = base_total - discount_amount
tax = final_total * 0.08
order.update!(total_cents: ((final_total + tax) * 100).round)
order.applied_promotions << promotion
promotion.increment!(:usage_count)
flash_message = "Promotion applied! You saved #{discount_amount.round(2)} on your order."
render json: {
message: flash_message.html_safe,
order_total_cents: order.total_cents
}end
def create @promotion = Promotion.new(params.require(:promotion).permit!)
if @promotion.save
render json: @promotion, status: :created
else
render json: { errors: @promotion.errors }, status: :unprocessable_entity
endend end
=============== FILE: db/migrate/20240315_add_promotions.rb =============== class AddPromotions < ActiveRecord::Migration[7.1] def change create_table :promotions do |t| t.string :title, null: false t.decimal :discount_percent, null: false t.integer :usage_count, default: 0 t.references :created_by, null: false, foreign_key: { to_table: :users } t.timestamps end
create_table :applied_promotions do |t|
t.integer :promotion_id, null: false
t.integer :order_id, null: false
t.timestamps
endend end
=============== FILE: app/models/promotion.rb =============== class Promotion < ApplicationRecord belongs_to :created_by, class_name: 'User' has_many :orders, through: :applied_promotions has_many :applied_promotions end
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