debug:rails

Debug Rails issues across ActiveRecord, routing, and middleware errors.

9|1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill debug-rails
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug:rails
Source: https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin/tree/main/plugins/debug-and-refactor/skills/debug-rails
Command: npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill debug-rails

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured, repeatable approach to diagnosing and fixing Ruby on Rails errors, covering ActiveRecord issues, routing problems, CSRF token errors, asset pipeline failures, and migration conflicts.

Core Features & Use Cases

  • Structured debugging workflow: Reproduce → gather information → test hypotheses → verify fixes to isolate root causes.
  • Rails tooling guidance: Leverages Byebug, Better Errors, Bullet, and Rails console to inspect state and queries.
  • Common failure scenarios: ActiveRecord::RecordNotFound, ActionController::RoutingError, N+1 queries, CSRF token failures, and migration or asset pipeline issues.
  • Phase-aligned tasks: For each scenario, provides concrete steps to reproduce, collect data, form hypotheses, implement fixes, and verify outcomes.

Quick Start

To begin, reproduce the failure in development, run the recommended commands (routes, console, and debug tools), and apply fixes iteratively.

Frequently Asked Questions about debug:rails

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Rails routing errors and ActiveRecord issues systematically?

Debug Rails routing and ActiveRecord errors by following a structured workflow: reproduce the issue, gather information, form hypotheses, and verify fixes using tools like rails routes, rails console, and byebug.

What is the best way to detect and resolve N+1 queries in ActiveRecord?

Detect and resolve N+1 queries in ActiveRecord by using the Bullet gem to identify inefficient data access patterns, then applying eager loading optimizations during your hypothesis testing phase.

How do I troubleshoot ActionController::RoutingError in a Rails application?

Troubleshoot ActionController::RoutingError by running the rails routes command to inspect defined path mappings, verifying controller actions, and isolating mismatches within your Rails application routes.

Why does my Rails application keep failing CSRF token verification?

Rails CSRF token failures occur when session tokens mismatch form submissions; debug by inspecting middleware configurations, verifying token generation, and checking cross-origin request headers.

Can I use Byebug and Better Errors to diagnose migration and asset pipeline failures?

Yes, use Byebug to inspect runtime states during migration conflicts and Better Errors to visualize asset pipeline failures, applying iterative fixes within your Rails environment to resolve root causes.

What should I do when standard Rails debugging tools are not working?

When standard Rails debugging tools fail, isolate the issue by reproducing the error in a clean environment, checking middleware configurations, and verifying that Byebug and Bullet dependencies are loaded correctly.