CtrlK
BlogDocsLog inGet started
Tessl Logo

igmarin/rails-agent-skills

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

Quality

96%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Risky

Do not use without reviewing

Overview
Quality
Evals
Security
Files

Rails Agent Skills

<img width="1408" height="768" alt="rails-agent-skills" src="https://github.com/user-attachments/assets/55e84f62-52ab-44a5-8b0f-9fe1bdb12212" />

Rails Agent Skills turns AI coding assistants into reliable Rails engineers — not just autocomplete tools.

It is a curated library of production-grade agent skills that encode conventions, workflows, and strict quality gates (TDD-first), so assistants generate code that actually holds up in real projects.


Why this exists

Most AI-generated code fails in real Rails apps because it lacks:

  • awareness of project conventions
  • disciplined workflows (especially TDD)
  • structured context across tasks

This library fixes that by giving agents explicit skills and workflows — from PRD → tasks → implementation → review — with tests acting as a hard gate before any code is written.

The goal is simple: make AI outputs predictable, testable, and production-ready.


The Proof: Baseline vs Context

We measure the effectiveness of our skills by comparing a "Baseline" agent (raw LLM) against an agent using our Skill Context. The difference in scores (the Lift) is the mathematical proof of the value this library provides.

SkillBaselineWith ContextLift
plan-tickets30%100%+70
integrate-api-client40%100%+60
generate-tasks (TDD quadruplets)43%100%+57
refactor-code60%100%+40
create-service-object71%100%+29

Scores based on evaluation runs using Claude 3.5 Sonnet. A skill that only beats baseline marginally is considered under-specified; our goal is a significant lift on every non-generic convention.


Ruby License: MIT GitHub tag CodeRabbit Pull Request Reviews


Quick Start — Which Skill to Use?

GoalSkill
Implement feature with TDDworkflows/tdd-workflow
Review PRworkflows/review-workflow
Plan new featureskills/planning/create-prdskills/planning/generate-tasks
Not sure where to startskills/orchestration/skill-router

Methodology

This skill library is built on core principles that shape how every skill operates. For detailed guidance on skill design, read the official Skill Design Principles.

1. Tests Gate Implementation

The core principle of this project. Tests are not a phase that happens "after" development — they are a hard gate that must be passed before any implementation code can be written.

PRD → Tasks → [GATE] → Implementation → YARD → Docs → Code review → PR
                 │
                 ├── 1. Test EXISTS (written and saved)
                 ├── 2. Test has been RUN
                 └── 3. Test FAILS for the correct reason
                        (feature missing, not a typo)

        Only after all 3 conditions are met
        can implementation code be written.

After tests pass: document public Ruby API (YARD), update README/diagrams/
related docs, then self-review (code-review) before opening the PR.
Task lists from generate-tasks include these steps explicitly.

This applies to every skill that produces code: service objects, background jobs, API integrations, engine components, refactoring, and bug fixes. Every implementation skill in this library includes a HARD-GATE: Tests Gate Implementation section enforcing this discipline.

Why this matters:

  • A test that passes immediately proves nothing — you don't know if it tests the right thing
  • A test you never saw fail could be testing existing behavior, not the new feature
  • Implementation code written before the test is biased by what you built, not what's required

Generated output: All generated artifacts (documentation, YARD comments, Postman collections, examples) must be in English unless the user explicitly requests another language. This is reflected in the skill template and in write-yard-docs and generate-api-collection.

2. Workflow Chaining

Skills are designed to be used in sequence, not in isolation. Each skill's Integration table points to the next skill in the chain. The primary daily workflow is:

skills/testing/plan-tests → skills/testing/write-tests (write failing test)
    ↓
[CHECKPOINT: Test Design Review — confirm boundary, behavior, edge cases]
    ↓
[CHECKPOINT: Implementation Proposal — confirm approach before coding]
    ↓
Implement (minimal code to pass test) → Refactor
    ↓
[GATE: Linters + Full Test Suite]
    ↓
skills/patterns/write-yard-docs → Update docs
    ↓
skills/code-quality/code-review (self-review) → skills/code-quality/respond-to-review (on feedback)
    ↓
PR

See docs/workflows/ for the full TDD Feature Loop and all workflow diagrams by lifecycle stage.

Note: plan-tickets is an optional step. The assistant should not push for ticket generation unless the user asks explicitly (e.g. "turn this into tickets") or the context clearly indicates work should be mapped to a board/sprint.

3. Rails-First Pattern Reuse

This library intentionally reuses proven patterns from broader agent-skill libraries, but translates them into a Rails-first workflow instead of copying generic frontend-oriented skills one-to-one.

Reused patternRails-first destination in this repo
PRD interview + scope controlcreate-prd
Planning from requirementsgenerate-tasks
TDD loop and smallest safe slicewrite-tests + plan-tests
Bug investigation to reproducible testtriage-bug
Domain language and context designdefine-domain-language + review-domain-boundaries + model-domain
Skill authoring conventionsdocs/skill-template.md

The rule of thumb is: reuse patterns, not names. If a broader skill maps cleanly to Rails/RSpec/YARD workflows, absorb the pattern into the existing chain. Create a new skill only when there is a real Rails-specific workflow gap.

How to Build a Feature (Your Daily Workflow)

For a practical guide on how to talk to the AI and effectively invoke these workflows, please see our Workflows Index.

Here is the recommended, step-by-step workflow for building a new feature from scratch using this skill library. This ensures every feature is well-planned, test-driven, and meets production-quality standards.

Goal: Build a new feature, e.g., "Feature A"

Step 1: Planning & Task Breakdown

  • Action: Define the feature's requirements.
  • Then: Break the PRD into a detailed, TDD-ready checklist.

Step 2: Start the TDD Cycle

  • Action: Pick the first, highest-value "slice" of behavior from your task list.
  • Action: Get guidance on choosing the right type of test to write first (e.g., a request spec).
  • Action: Write the first failing test. Crucially, run it and watch it fail.

Step 3: Implementation

Step 4: Verification

  • Action: Run the test again and watch it pass.
  • Action: Run linters and the full test suite to ensure no regressions. Refactor your new code if needed.

Step 5: Documentation & Self-Review

  • Action: Add inline documentation to any new public classes or methods.
  • Action: Perform a self-review of your changes.

Step 6: Responding to Peer Review

  • Action: When you receive feedback from teammates, evaluate and implement their suggestions systematically.

For more detailed diagrams of these flows, see the Workflows Index.

MCP Server

The recommended way to use this library is via the embedded Ruby MCP server. The primary setup is local Ruby/Bundler; Docker is supported as a fallback for environments that do not want a local Ruby toolchain.

The use_skill tool loads individual skills on demand, while docs and workflows remain available as MCP resources. That keeps the runtime contract small while still making the full skill library available.

tools/call use_skill { "skill_name": "implement-graphql" }
→ returns full SKILL.md instructions

Published MCP surface:

PrefixSource
doc/<name>All files under docs/
workflow/<name>All workflow definitions
use_skillTool that returns the SKILL.md for a named skill

Adding a new skill directory automatically makes it available through use_skill — no server changes needed.

See mcp_server/README.md for the canonical MCP setup instructions and Docker fallback. Use docs/implementation-guide.md for the broader platform overview and non-MCP alternatives.

Important: When configuring MCP in external tools (like Cursor, Windsurf, OpenCode, etc.), always use absolute paths for cwd and BUNDLE_GEMFILE to avoid environment and timeout errors.

Install via GitHub CLI

Requires GitHub CLI v2.90.0+.

# Install all skills interactively
gh skill install igmarin/rails-agent-skills

# Install a specific skill for the current project
gh skill install igmarin/rails-agent-skills code-review --scope project

# Install a specific skill globally (available everywhere)
gh skill install igmarin/rails-agent-skills code-review --scope user

# Install pinned to a release tag
gh skill install igmarin/rails-agent-skills code-review --pin v3.1.3 --scope user

# Search this repository's skills
gh skill search rails --owner igmarin

The default scope is project; use --scope user for a global install in your home directory. Skills are installed to the correct directory for your selected agent host automatically. To target a specific agent:

gh skill install igmarin/rails-agent-skills plan-tests --agent claude-code --scope user
gh skill install igmarin/rails-agent-skills plan-tests --agent cursor --scope user
gh skill install igmarin/rails-agent-skills plan-tests --agent codex --scope user
gh skill install igmarin/rails-agent-skills plan-tests --agent gemini-cli --scope user
gh skill install igmarin/rails-agent-skills plan-tests --agent windsurf --scope user

Update installed skills:

# Check for updates without changing files
gh skill update --dry-run

# Update all unpinned skills without prompting
gh skill update --all

# Re-download all skills, overwriting local edits
gh skill update --force --all

# Unpin pinned skills and update them to the latest release
gh skill update --unpin

Supply chain note: Every release is tied to a git tag. Pinning to a tag or commit SHA (--pin) gives you reproducible, tamper-evident installs. Provenance metadata is written directly into each installed SKILL.md frontmatter so it travels with the skill.

Platforms & Quick Start

To integrate these skills with your preferred AI development environment, refer to the Implementation Guide.

Platform Integration Overview

PlatformRecommended IntegrationKey Step
Gemini CLIStandard PluginAdd repository path to plugins config
CursorMCP Server / RulesAdd MCP URL or link SKILL.md in .cursorrules
WindsurfMCP ServerRegister the Ruby MCP server in mcp_config.json
Claude CodeMCP ServerOpen the repo with the bundled .mcp.json, or copy the same local Ruby server config globally
Codex / OpenCodeSystem PromptsPoint the agent to the skills/ directory via workspace settings
RubyMineMCP ServerConfigure via the Language Server Protocol settings

The guide covers the MCP server (recommended — on-demand, saves tokens), the Docker fallback, and the symlink approaches for each platform.

Skills Catalog

Planning & Tasks

SkillDescription
create-prdGenerate Product Requirements Documents from feature descriptions
generate-tasksBreak down PRDs into step-by-step implementation task lists
plan-ticketsDraft or create tickets from plans; sprint placement and classification

Rails Code Quality

SkillDescription
code-reviewReview Rails code following The Rails Way conventions — giving a review
respond-to-reviewRespond to review feedback — evaluate, push back, implement safely, trigger re-review
review-architectureReview application structure, boundaries, and responsibilities
security-checkAudit for auth, XSS, CSRF, SQLi, and other vulnerabilities
review-migrationPlan production-safe database migrations
apply-stack-conventionsApply Rails + PostgreSQL + Hotwire + Tailwind conventions
apply-code-conventionsDaily coding checklist: DRY/YAGNI/PORO/CoC/KISS; linter as style SoT; structured logging; per-path rules
implement-background-jobDesign idempotent background jobs with Active Job / Solid Queue
implement-graphqlGraphQL schema design, N+1 prevention, authorization, error handling, and testing with graphql-ruby
implement-authorizationPundit/CanCanCan, roles, permissions, policy objects
optimize-performanceN+1 prevention, profiling, caching, query optimization
version-apiREST API versioning strategies and deprecation policies
seed-databaseFixtures vs Seeds for dev/test data management
implement-hotwireTurbo/Stimulus integration patterns
generate-api-collectionGenerate or update Postman Collection (JSON v2.1) for REST endpoints; use Insomnia for GraphQL

DDD & Domain Modeling

SkillDescription
define-domain-languageBuild a shared domain glossary, resolve synonyms, and clarify business terminology
review-domain-boundariesReview bounded contexts, ownership, and language leakage in Rails codebases
model-domainMap DDD concepts to Rails models, services, value objects, and boundaries without over-engineering

Ruby Patterns

SkillDescription
create-service-objectBuild service objects with .call, standardized responses, transactions
integrate-api-clientIntegrate external APIs with the layered Auth/Client/Fetcher/Builder pattern
implement-calculator-patternImplement variant-based calculators with Strategy + Factory + Null Object
write-yard-docsWrite YARD docs for Ruby classes and public methods (all output in English)

Context & Setup

SkillDescription
load-contextLoad schema, routes, nearest patterns before any code/spec/PRD — surface ambiguity explicitly
setup-environmentComplete dev environment setup (Docker, env vars, database)

Testing

SkillDescription
write-testsWrite maintainable, deterministic RSpec tests with TDD discipline
plan-testsPick the best first failing spec for a Rails change before implementation
triage-bugTurn a Rails bug report into a reproducible failing spec and fix plan
test-serviceTest service objects with instance_double, hash factories, shared_examples

Rails Engines

SkillDescription
create-engineDesign and scaffold Rails engines with proper namespace isolation
test-engineSet up dummy apps and engine-specific specs
review-engineReview engine architecture, coupling, and maintainability
release-enginePrepare versioned releases with changelogs and upgrade notes
document-engineWrite comprehensive engine documentation
create-engine-installerCreate idempotent install generators
extract-engineExtract host app code into engines incrementally
upgrade-engineMaintain cross-version compatibility

Refactoring

SkillDescription
refactor-codeRestructure code with characterization tests and safe extraction

Meta

SkillDescription
skill-routerDiscover and invoke the right skill for the current Rails task
docs/skill-template.mdAuthoring template and checklist for expanding the library

Skill Relationships

graph TB
    subgraph Discovery [🔍 00: Discovery]
        direction TB
        A[load-context] --> B{New project?}
        B -- Yes --> C[setup-environment]
        B -- No --> D[Start]
        C --> D
    end

    subgraph Planning [📝 10: Planning]
        direction TB
        D --> E[create-prd]
        E --> F{PRD approved?}
        F -- No --> E
        F -- Yes --> G[generate-tasks]
        G --> H{Need DDD?}
        H -- Yes --> I[define-domain-language]
        I --> J[review-domain-boundaries]
        J --> K[model-domain]
        K --> G
    end

    subgraph Development [💻 30: Development]
        direction TB
        H -- No --> L[plan-tests]
        G --> L
        L --> M[write-tests]
        M --> N{Test OK?}
        N -- No --> M
        N -- Yes --> O{Proposal OK?}
        O -- No --> O
        O -- Yes --> P[Implement]
        P --> Q{Passes?}
        Q -- No --> P
        Q -- Yes --> R{More?}
        R -- Yes --> M
        R -- No --> S[Linters + Suite]
    end

    subgraph Quality [✅ 40-50: Quality & Review]
        direction TB
        S --> T[write-yard-docs]
        T --> U[code-review]
        U --> V{Findings?}
        V -- Critical --> W[respond-to-review]
        W --> X[Fix]
        X --> U
        V -- None/Minor --> Y((Merge))
    end

    subgraph Engines [🔧 60: Engines]
        direction TB
        Z[create-engine] --> AA{Tests pass?}
        AA -- No --> AB[Fix]
        AB --> Z
        AA -- Yes --> AC[release-engine]
        AC --> AD((Release))
    end

    %% Cross-connections
    U --> V1[security-check]
    U --> V2[review-architecture]
    V2 --> V3[refactor-code]
    V3 --> V4[create-service-object]

    BT[triage-bug] --> L

How Skills Work

Each skill is a SKILL.md file in its own directory. For detailed conventions and structure, refer to the Skill Design Principles.

Skills vs. Workflows

This library differentiates between two types of agent capabilities:

  • Skills (skills/): Atomic, specialized modules (e.g., code-review, write-yard-docs). These are optimized for static analysis and "one-shot" tasks.
  • Workflows (workflows/): Higher-level orchestrators (e.g., tdd-workflow) that chain multiple skills together.
    • Important: Workflows require an agent with ReAct capabilities (like the Gemini CLI, Claude Code, or Cursor with workspace context). They are designed to read multiple files, execute shell commands, and manage state across several turns.
    • Note on Scoring: While platform static analysis might score workflows lower due to their dependency on external files, their actual performance is validated dynamically using our custom ReAct evaluation tool.

Typical Workflows

Tests are a gate between planning and implementation. See docs/workflows/ for full diagrams.

WorkflowSkill Chain
TDD Feature Loop (primary daily workflow)load-context → plan-tests → [Test Feedback checkpoint][Implementation Proposal checkpoint] → implement → [Linters + Suite gate] → write-yard-docs → code-review → respond-to-review (on feedback) → PR
New featureload-context → create-prd → generate-tasks → (optional plan-tickets) → TDD Feature Loop
DDD-first featureload-context → create-prd → define-domain-language → review-domain-boundaries → model-domain → generate-tasks → TDD Feature Loop
Bug fixtriage-bug → plan-tests → [write reproduction spec, verify failure] → fix → verify passes → code-review
Code review + responsecode-review → respond-to-review (on feedback) → re-review if Critical items addressed
Security auditsecurity-check → code-review (verify fixes) → PR
Performance optimizationapply-code-conventions (ActiveRecord rules) → [regression spec] → optimize → code-review
Migrationreview-migration → [test up + down] → implement → code-review
GraphQL featuredefine-domain-language → implement-graphql → TDD Feature Loop → security-check
New enginecreate-engine → [write specs, verify failure] → implement → document-engine
Refactoringrefactor-code → [characterization tests] → refactor → verify tests pass
New serviceplan-tests → [write .call spec, verify failure] → create-service-object → verify passes
API integrationplan-tests → [write layer specs, verify failure] → integrate-api-client → verify passes

Creating New Skills

For guidance on skill authoring, refer to the Skill Design Principles and the Skill Template.

Acknowledgments

Huge thanks to Mumo Carlos (@mumoc). His mentorship has shaped my growth as a developer and influenced many of the habits and practices reflected in this library — not only the plan-tickets workflow he shared, but the broader discipline around quality, clarity, and thoughtful use of tools. This repo and the learning behind it would not be what they are without him.

  • plan-tickets: added assets/ticket-samples and ticket-schema.json to aid robust ticket generation across models
  • apply-stack-conventions: added compact assets/snippets for few-shot examples to improve cross-model robustness
Workspace
igmarin
Visibility
Public
Created
Last updated
Publish Source
CLI
Badge
igmarin/rails-agent-skills badge