CtrlK
BlogDocsLog inGet started
Tessl Logo

igmarin/rails-agent-skills

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

1.20x
Quality

98%

Does it follow best practices?

Impact

95%

1.20x

Average score across 35 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-7/

Animal Transfer Service

Problem/Feature Description

A network of animal shelters shares animals between locations. When a transfer is approved, the system must: (1) decrement the animal count at the source shelter, (2) increment the count at the target shelter, and (3) record a transfer log entry — all as a single atomic operation. If any step fails, the others should be rolled back. Additionally, the team needs to look up recent transfers for a given animal by tag number, and that query must be safe against injection since tag numbers are user-supplied strings from an external partner API.

Your task is to write a Ruby service for processing an animal transfer between two shelters. The service should accept source shelter ID, target shelter ID, and the animal's tag number. It should perform the multi-step update atomically, and also expose a method for querying transfer history by tag number using a raw SQL approach for performance reasons.

Output Specification

Produce the following files:

  • app/services/<module>/<service>.rb — the transfer service
  • Any supporting documentation or companion files you consider appropriate for the module
  • spec/services/<mirrored_path>_spec.rb — specs covering: successful transfer, source shelter not found, database failure mid-transfer (transaction rollback scenario)

Use stub comments where real ActiveRecord calls would occur (e.g. # TODO: Shelter.find_by!(id: ...)) so the service structure is clear without a running database.

README.md

tile.json