snakeo/claude-debug-and-refactor-skills-plugin
Overview
This skill systematically diagnoses and resolves Ruby on Rails application errors. It focuses on common failure patterns—ActiveRecord issues, routing, view and asset problems, N+1 queries, migrations, CSRF and gem conflicts—while recommending modern debugging tools and workflows. Use it to find root causes quickly and verify robust fixes.
How this skill works
The skill guides you through four phases: reproduce and isolate the problem, gather relevant data (logs, stack traces, DB state), form and test hypotheses with breakpoints and console checks, then implement and verify fixes with tests and environment checks. It includes targeted diagnostics and concrete remedies for each common Rails error class, plus commands and gem recommendations for interactive debugging and performance detection.
When to use it
- When ActiveRecord::RecordNotFound occurs or records are unexpectedly absent
- When routes return 404 or route helpers seem broken
- When you see NoMethodError for nil or view template errors during rendering
- When Bullet or logs show N+1 queries and slow pages
- When migrations fail or schema/version mismatches appear
- When assets are missing in production or CSRF token errors surface
Best practices
- Reproduce the bug consistently and capture exact steps before changing code
- Collect full stack trace, request params, session and DB state before guessing
- Use modern debuggers (debug, pry) and Bullet in development to detect issues early
- Write a failing test that reproduces the bug, then implement the fix and run it across environments
- Prefer safe lookup patterns (find_by, safe navigation) and eager loading (includes/preload) where appropriate
- Lock gem versions, check bundle dependency trees, and run migrations in CI-like environments
Example use cases
- Handle a missing User record by switching find to find_by and rendering a 404 page
- Resolve N+1 queries on an index view by adding includes(:association) and verifying with Bullet
- Fix a routing error by running rails routes, adding a missing resource or correcting namespace scope
- Diagnose Asset Pipeline failures by running rails assets:precompile and checking public/assets manifest
- Recover a stuck migration by removing the problematic schema_migration row and re-running migrations after fixes
FAQ
Use the built-in debug gem (Ruby 3.1+/Rails 7+). It supports breakpoints (binding.break/debugger) and familiar walk/inspect commands; byebug is fine for legacy projects.
How do I detect N+1 queries quickly?
Enable the Bullet gem in development to get alerts and log entries; also scan development logs for repeated SELECT statements and add includes/preload accordingly.
27 skills
This skill helps diagnose Rails issues systematically, guiding you through common errors, debugging tools, and proven strategies for fast resolution.
This skill refactors ASP.NET Core code into clean, maintainable .NET patterns, applying SRP, DI, and modern C# to reduce fat controllers and duplication.
This skill helps diagnose and resolve Svelte-specific issues across reactivity, runes, stores, and SSR with actionable debugging guidance.
This skill helps you diagnose and fix ASP.NET Core issues with structured debugging workflows and recommended tooling.
This skill refactors Flutter/Dart code to improve maintainability, readability, and performance using Dart 3 features, modern state management, and clean
This skill guides you through four-phase Docker debugging to diagnose container exits, OOMs, builds, networking, and permissions with practical commands.
This skill refactors NestJS/TypeScript code to improve maintainability and SOLID adherence, addressing circulars, god objects, and SRP violations across
This skill refactors Django/Python code to improve maintainability and readability, adopting modern Django patterns and Python 3.12+ features for robust
This skill refactors React Native and TypeScript code to improve maintainability and performance using modern architecture patterns and Expo tooling.
This skill helps you debug Flutter apps systematically using DevTools, widget inspector, and phased methodologies to locate and fix issues efficiently.
This skill refactors messy Rails code into maintainable, idiomatic solutions by applying SRP, DRY, and modern Ruby/Rails practices.
This skill helps you diagnose and resolve Vue 3 issues across reactivity, components, Pinia, SSR, and tooling with practical debugging workflows.
This skill helps debug React issues systematically by guiding you through common errors, patterns, and modern React 18/19 practices.
This skill helps you diagnose and fix PyTorch errors efficiently by guiding memory, shape, device, and grad issues across models.
This skill helps diagnose and resolve Spring Boot bean, startup, JPA, security, and property issues using actuator insights and JVM debugging.
This skill refactors Laravel PHP code to improve maintainability and aligns with modern PHP 8.3+/8.4+ and Laravel 11+ patterns.
This skill helps diagnose and resolve TensorFlow and Keras issues systematically, improving model reliability, performance, and debugging efficiency.
This skill refactors Next.js apps to App Router best practices, improving maintainability, performance, and server/client boundaries.
This skill refactors FastAPI/Python code to cleaner, maintainable patterns using Pydantic v2, SOLID principles, and modular service design.
This skill helps you diagnose Kubernetes issues with a structured four-phase approach, kubectl commands, and ephemeral debugging to resolve pods and services.
This skill helps you debug Express.js and Node.js apps with a structured four-phase approach and practical diagnostic techniques.
This skill refactors docker configurations to produce secure, lean, production-ready containers following 2025 best practices.
This skill refactors Pandas code to leverage vectorization, method chaining, and memory-efficient dtypes for faster, cleaner data pipelines.
This skill helps you debug scikit-learn issues systematically, diagnosing common errors like shape mismatches, not fitted, NaNs, leakage, and convergence
This skill helps you systematically debug Flask apps with phase-driven approach, tooling guidance, and actionable steps for routing, templates, and DB issues.
This skill helps you systematically diagnose and resolve React Native issues across iOS and Android by following a four-phase approach.
This skill helps you systematically diagnose and fix NestJS issues such as DI errors, circular dependencies, guards, pipes, and microservice problems.