rails-agent-skills/SKILL.md
This skill is the starting point for all Rails tasks. It identifies the correct, more specialized skill to use for a given task, like code reviews, TDD, or documentation, and enforces the 'Tests Gate Implementation' mandate.
npx skillsauth add igmarin/rails-agent-skills rails-agent-skillsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Core principle: This skill serves as the central hub for discovering, understanding, and orchestrating specialized Ruby on Rails development skills. It guides agents to select the most appropriate skill for a given task and ensures adherence to core development mandates.
When a skill might apply to the current task, invoke it before responding. If a task requires coding, always adhere to the Tests Gate Implementation mandate.
THIS IS NON-NEGOTIABLE AND APPLIES TO EVERY SKILL THAT PRODUCES CODE.
THE WORKFLOW IS: PRD → TASKS → TESTS → IMPLEMENTATION → YARD → DOCS → CODE REVIEW → PR
Tests are a GATE. Implementation code CANNOT be written until:
1. The test for that behavior EXISTS
2. The test has been RUN
3. The test FAILS for the right reason (feature missing, not a typo)
ONLY THEN can implementation code be written.
The full cycle for each piece of behavior:
After all targeted tests pass for the feature:
This applies when using: ruby-service-objects, ruby-api-client-integration, strategy-factory-null-calculator, rails-background-jobs, rails-code-conventions, rails-stack-conventions, rails-engine-author, refactor-safely, and any other skill that results in writing Ruby/Rails code.
Wrote implementation code before the test? Delete it. Start over. No exceptions.
Skipped running the test before implementing? You don't know if the test works. Stop. Run it. Confirm the failure. Then implement.
| Skill | Use when... | | ----- | ----------- | | create-prd | Planning a new feature, defining requirements, or creating a Product Requirements Document (PRD). | | generate-tasks | Breaking down a PRD or feature into actionable implementation steps, tasks, or a checklist. | | ticket-planning | Drafting or creating Jira tickets from a plan, including sprint placement and issue classification. |
| Skill | Use when... | | ----- | ----------- | | rails-code-review | Conducting a code review of Rails pull requests, controllers, models, migrations, or queries. | | rails-review-response | Evaluating, responding to, or implementing feedback received from a code review. | | rails-architecture-review | Reviewing the application's structure, domain boundaries, or addressing issues like 'fat models' or 'fat controllers'. | | rails-security-review | Auditing for common Rails vulnerabilities (e.g., authentication flaws, XSS, CSRF, SQL injection). | | rails-migration-safety | Planning or reviewing database migrations to ensure safety in production environments. | | rails-stack-conventions | Writing new Rails code specifically for a PostgreSQL, Hotwire, and Tailwind CSS stack, adhering to established conventions. | | rails-code-conventions | Applying daily coding checklist items such as DRY/YAGNI/PORO/CoC/KISS principles, using linters as style guides, structured logging, and path-specific rules. | | rails-background-jobs | Adding or reviewing background jobs | | rails-graphql-best-practices | Building or reviewing GraphQL APIs with `graphql-ruby`, covering schema design, N+1 prevention, authorization, error handling, and testing. |
| Skill | Use when... | | ----- | ----------- | | ddd-ubiquitous-language | Clarifying domain terms, resolving synonyms, or building a shared business glossary before modeling or refactoring. | | ddd-boundaries-review | Reviewing bounded contexts, ownership, and identifying language leakage within a Rails codebase. | | ddd-rails-modeling | Mapping Domain-Driven Design (DDD) concepts (entities, value objects, services, repositories, events) to Rails without over-engineering. |
| Skill | Use when... | | ----- | ----------- | | ruby-service-objects | Creating service classes following the `.call` pattern, standardized responses, and transaction management. | | ruby-api-client-integration | Integrating external APIs using the layered Auth/Client/Fetcher/Builder pattern. | | strategy-factory-null-calculator | Building variant-based calculators | | yard-documentation | Writing or reviewing YARD documentation for Ruby classes and public methods. |
| Skill | Use when... | | ----- | ----------- | | rspec-best-practices | Writing, reviewing, or cleaning up RSpec tests — AND the TDD discipline that applies to ALL implementation | | rails-tdd-slices | Choosing the best first failing spec or vertical slice for a Rails change | | rails-bug-triage | Turning a Rails bug report into reproduction, failing spec, and fix plan | | rspec-service-testing | Testing service objects (spec/services/) |
| Skill | Use when... | | ----- | ----------- | | rails-engine-author | Creating or scaffolding a Rails engine | | rails-engine-testing | Setting up dummy app and engine specs | | rails-engine-reviewer | Reviewing an existing engine | | rails-engine-release | Preparing an engine release | | rails-engine-docs | Writing engine documentation | | rails-engine-installers | Creating install generators | | rails-engine-extraction | Extracting code from host app to engine | | rails-engine-compatibility | Ensuring cross-version compatibility | | api-rest-collection | Creating or modifying REST API endpoints — generate/update Postman collection (not for GraphQL) |
| Skill | Use when... | | ----- | ----------- | | refactor-safely | Restructuring code while preserving behavior |
When multiple skills could apply:
ddd-ubiquitous-language, ddd-boundaries-review, ddd-rails-modeling) — clarify business language when the domain is the hard partTDD Feature Loop (primary daily workflow): rails-tdd-slices → [Test Feedback checkpoint] → [Implementation Proposal checkpoint] → implement → [Linters + Suite gate] → yard-documentation → rails-code-review → rails-review-response (on feedback) → PR
New feature: create-prd → generate-tasks → (optional ticket-planning) → TDD Feature Loop
DDD-first feature design: create-prd → ddd-ubiquitous-language → ddd-boundaries-review → ddd-rails-modeling → generate-tasks → TDD Feature Loop
Code review + response: rails-code-review → rails-review-response (on feedback) → re-review if Critical items addressed
Bug fix: rails-bug-triage → rails-tdd-slices → [GATE: write reproduction spec, run, verify failure] → fix → verify passes
GraphQL feature: ddd-ubiquitous-language → rails-graphql-best-practices → TDD Feature Loop → rails-security-review
New engine: rails-engine-author → [GATE: write engine specs, run, verify failure] → implement → rails-engine-docs
Refactoring: refactor-safely → [GATE: characterization tests, run, verify they pass on current code] → refactor → verify tests still pass
New service object: rails-tdd-slices → rspec-service-testing → [GATE: write .call spec, run, verify failure] → ruby-service-objects → verify spec passes
External API integration: rails-tdd-slices → [GATE: write layer specs, run, verify failure] → ruby-api-client-integration → verify → yard-documentation → docs
development
Entry point for Rails development workflows covering TDD, RSpec, Service Objects, DDD, GraphQL, Engines, and Code Quality. Use when the user asks about Ruby on Rails development patterns, needs RSpec test suites generated, wants service objects scaffolded, is setting up GraphQL schemas, performing Rails code review, refactoring .rb files, working with domain-driven design, implementing background jobs, conducting Rails security checks, or building Rails engines. Generates RSpec tests, structures service objects, enforces TDD workflows, configures GraphQL schemas, and coordinates domain-driven design patterns. Trigger keywords: Rails, RSpec, TDD, Rails testing, Rails refactor, Rails API, Rails code review, domain driven design, service objects, GraphQL, Rails engine, Ruby, .rb, background jobs, Rails migrations, Rails security check.
development
Use when shipping a Rails engine gem — FIRST run full test suite (`bundle exec rspec`) and fix ALL failures, verify gemspec metadata and dependencies match tested Rails/Ruby versions, dry-run: `gem build *.gemspec && gem push --dry-run *.gem` and verify contents, generate CHANGELOG.md organized by category (added/changed/deprecated/removed/fixed), produce step-by-step upgrade notes with before/after code, set semantic version in `lib/[engine_name]/version.rb`, document deprecations with migration paths, load release assets conditionally and state which one informed the output. Trigger words: version bump, changelog, deprecation, gemspec, upgrade, release, publish gem, ship gem.
development
Orchestrates the full Rails TDD cycle with hard gates: test MUST exist, be run, and FAIL for the correct reason (e.g. undefined method, not syntax error) before any implementation code — propose minimal implementation and wait for user approval → verify test PASSES → run full suite with rubocop, brakeman, rspec all green → produce YARD documentation and self-reviewed PR; phases context/test design→implementation→iterate→finish. Use when practicing test-driven development, red-green-refactor, TDD workflow, writing tests before code, adding tests first, or building a Rails feature where specs must gate implementation.
development
Complete Rails project setup loop with hard gates: verify Ruby version matches .ruby-version, Bundler installed, database connection successful, all env vars loaded, and ALL external CI actions pinned to immutable commit SHAs (never mutable tags like @v4) → configure CI/CD pipeline with linting, testing, and security scanning → validate end-to-end with bundle install, db:create, db:migrate, rspec, and write SETUP_CHECKLIST.md; phases context/onboarding→CI/CD configuration→environment validation. Use when starting a new Rails project, running `rails new`, configuring a Gemfile or .ruby-version, setting up a development environment, or wiring up CI/CD for a Ruby on Rails app. Trigger: setup project, new Rails app, configure CI/CD, dev environment setup, rails new, Gemfile setup, .ruby-version, Ruby on Rails project bootstrap.