rails-ai:debugging-rails

Debug Rails applications using logs, console, byebug, and SQL tracing.

41|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/zerobearing2/rails-ai --skill rails-ai-debugging-rails
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-ai:debugging-rails
Source: https://github.com/zerobearing2/rails-ai/tree/main/skills/debugging
Command: npx skills add https://github.com/zerobearing2/rails-ai --skill rails-ai-debugging-rails

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides Rails-specific debugging tooling to streamline investigation when Rails apps misbehave, reducing time to identify root causes.

Core Features & Use Cases

  • Rails logs progression: tail, filter, and trace errors across development and production.
  • Interactive debugging: rails console, byebug breakpoints, and model/query inspection.
  • SQL visibility: enable verbose SQL logging and analyze query patterns to detect N+1 issues.
  • Structured debugging workflow: aligns with the 4-phase framework (Root Cause → Pattern → Hypothesis → Implementation) for repeatable investigations.

Quick Start

Start a debugging session by opening the Rails project, tailing logs, and enabling interactive debugging. For example:

  • Tail development logs: tail -f log/development.log
  • Open the Rails console: bin/rails console
  • Enable SQL logging: ActiveRecord::Base.logger = Logger.new(STDOUT)
  • Reproduce the issue and use byebug breakpoints to inspect state.

Frequently Asked Questions about rails-ai:debugging-rails

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

FAQPage Schema
How do I debug a Rails application with unexpected behavior or failing tests?

To debug a Rails application, you can use a structured workflow integrating log inspection, interactive console testing, byebug breakpoints, and SQL query tracing to systematically identify root causes. This approach guides you through Root Cause, Pattern, Hypothesis, and Implementation phases to resolve unexpected behavior and failing tests.

What is the best way to trace N+1 SQL query issues in Rails?

The best way to trace N+1 SQL query issues in Rails is by enabling verbose SQL logging. You can activate ActiveRecord::Base.logger = Logger.new(STDOUT) in the console to analyze query patterns and detect inefficient database calls during execution.

How do I use byebug breakpoints to inspect state in a Rails console?

You use byebug breakpoints in a Rails console by reproducing the issue and inserting breakpoints into the code execution path. This allows you to pause execution and interactively inspect application state, variables, and model queries during debugging.

Can I use this structured Rails debugging workflow for production incidents?

Yes, this structured Rails debugging workflow applies to production incidents alongside development issues. It supports tailing and filtering logs across environments to trace errors and investigate performance issues systematically.

Why does my Rails debugging process lack consistency when tracking down root causes?

Rails debugging lacks consistency when tracking root causes because it often skips a systematic framework. Applying a structured 4-phase approach—Root Cause, Pattern, Hypothesis, and Implementation—ensures repeatable investigations by standardizing log inspection, console testing, and breakpoint debugging.