From rails-specialist
Use when creating new Rails files, naming models/controllers/views, organizing directories, or when unsure about Rails naming conventions. Also applies when reviewing code for convention violations like incorrect pluralization, wrong file locations, or non-standard naming. Covers file structure, naming patterns for models, controllers, views, routes, jobs, mailers, and migrations.
npx claudepluginhub chaserx/cpc --plugin rails-specialistThis skill uses the workspace's default tool permissions.
Guidance for following Rails conventions, file organization, naming patterns, and "The Rails Way" for Rails 7+ applications.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Guidance for following Rails conventions, file organization, naming patterns, and "The Rails Way" for Rails 7+ applications.
Rails provides sensible defaults. Follow conventions to benefit from:
app/
├── assets/ # CSS, images, fonts (managed by asset pipeline)
├── channels/ # Action Cable channels
├── components/ # ViewComponents (if used)
├── controllers/ # Request handlers
│ ├── concerns/ # Shared controller logic
│ └── api/ # API controllers (namespaced)
├── helpers/ # View helpers
├── javascript/ # JavaScript/Stimulus controllers
├── jobs/ # Background jobs
├── mailers/ # Email senders
├── models/ # ActiveRecord models
│ └── concerns/ # Shared model logic
├── services/ # Service objects (optional)
├── views/ # Templates and partials
│ ├── layouts/ # Application layouts
│ └── shared/ # Shared partials
config/
├── routes.rb # Routing configuration
├── database.yml # Database configuration
├── environments/ # Environment-specific settings
└── initializers/ # Startup configuration
db/
├── migrate/ # Database migrations
├── schema.rb # Current schema (auto-generated)
└── seeds.rb # Seed data
lib/
├── tasks/ # Rake tasks
└── generators/ # Custom generators
spec/ or test/ # Test files (mirrors app/ structure)
User, OrderItem, BlogPost)user.rb, order_item.rb, blog_post.rb)users, order_items, blog_posts)_id (user_id, order_item_id)UsersController, OrderItemsController)users_controller.rb, order_items_controller.rb)index, show, new, create, edit, update, destroy)app/views/users/)index.html.erb, show.json.jbuilder)_form.html.erb, _user.html.erb)resources :users, resources :order_items)resource :profile, resource :dashboard)SendWelcomeEmailJob, ProcessPaymentJob)UserMailer, OrderMailer)welcome_email, order_confirmation)20240101120000_create_users.rb)CreateUsers, AddEmailToUsers)| What | Convention | Example |
|---|---|---|
| Model class | Singular PascalCase | User |
| Model file | Singular snake_case | user.rb |
| Table | Plural snake_case | users |
| Controller | Plural + Controller | UsersController |
| View folder | Plural snake_case | views/users/ |
| Route | Plural resource | resources :users |
| Foreign key | model_id | user_id |
| Join table | Alphabetical | posts_tags |
Follow these conventions consistently to create maintainable Rails applications that are easy to understand and extend.
For detailed code examples and patterns, consult:
references/restful-design.md — Standard REST actions table, custom actions, nested resources, namespace/scope patterns, and controller structurereferences/model-controller-examples.md — Association naming, polymorphic/self-referential associations, validation patterns, scope naming and chaining, callback conventions, and concern patternsservice-patterns — Service objects, form objects, query objects, and interactorsactive-record-patterns — ActiveRecord query and association patterns in depthaction-controller-patterns — Controller design patterns and advanced techniquesrails-antipatterns — Common anti-patterns, code smells, and refactoring guidance