dhh-rails-reviewer

Review Ruby on Rails code for convention adherence and unnecessary complexity.

240|75|Updated Jul 13, 2023
One-click install
npx skills add https://github.com/udecode/plate-playground-template --skill dhh-rails-reviewer-udecode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dhh-rails-reviewer
Source: https://github.com/udecode/plate-playground-template/tree/main/.codex/skills/dhh-rails-reviewer
Command: npx skills add https://github.com/udecode/plate-playground-template --skill dhh-rails-reviewer-udecode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides brutally honest code reviews for Rails applications, focusing on adherence to Rails conventions and identifying anti-patterns, particularly those influenced by JavaScript frameworks or unnecessary complexity.

Core Features & Use Cases

  • Convention Enforcement: Ruthlessly checks for deviations from Rails conventions (e.g., fat models, skinny controllers, RESTful routes).
  • Anti-Pattern Detection: Identifies JavaScript-world patterns (e.g., unnecessary API layers, JWT tokens, Redux-style state management) creeping into Rails.
  • Complexity Analysis: Tears apart over-engineered solutions like excessive service objects or dependency injection containers.
  • Use Case: Review a new Rails feature that uses a separate API layer and JWT authentication to ensure it aligns with Rails philosophy and avoids common pitfalls.

Quick Start

Review the provided Rails code for adherence to conventions and potential over-engineering.

Frequently Asked Questions about dhh-rails-reviewer

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

FAQPage Schema
How do I review Ruby on Rails code for convention violations and over-engineering?

Reviewing Rails code for convention violations involves checking for deviations from RESTful routes, fat models, and skinny controllers. This review identifies JavaScript-world patterns like unnecessary API layers and over-engineered service objects that creep into Rails applications.

What are common Rails anti-patterns influenced by JavaScript frameworks?

Common Rails anti-patterns influenced by JavaScript frameworks include building unnecessary API layers, implementing JWT tokens for authentication, and applying Redux-style state management. These patterns violate convention over configuration principles and add unnecessary complexity to the majestic monolith.

When should I avoid using service objects in a Rails application?

You should avoid using service objects in a Rails application when they represent over-engineered solutions that add unnecessary complexity. Excessive service objects and dependency injection containers often deviate from Rails conventions and contradict the majestic monolith philosophy.

How do I check if my Rails feature aligns with DHH's majestic monolith philosophy?

Checking alignment with the majestic monolith philosophy involves critically analyzing your Rails feature for unnecessary complexity, JavaScript framework patterns, and convention violations. The review ensures your code adheres to RESTful routes, skinny controllers, and convention over configuration principles.

Does a separate API layer with JWT authentication belong in a Rails application?

A separate API layer with JWT authentication typically does not belong in a Rails application. This pattern represents a JavaScript-world anti-pattern that adds unnecessary complexity, violating the majestic monolith approach and convention over configuration principles that Rails promotes.

What is the best way to enforce convention over configuration in Ruby on Rails?

The best way to enforce convention over configuration in Ruby on Rails is through critical code review that identifies deviations from standard patterns. This involves checking for fat models, skinny controllers, RESTful routes, and flagging over-engineered solutions like excessive service objects.