form-objects-query-objects-presenters
CommunityRails form, query, presenter patterns to cut bloat.
System Documentation
What problem does it solve?
This Skill eliminates the frequent issue of bloated Rails models, misplaced multi-model form logic, unreadable complex queries, and view files cluttered with procedural formatting code that AI coding agents often misplace or over-extract.
Core Features & Use Cases
- Form Objects: Handle multi-model form submissions (e.g., signup flows that create User, Account, and Subscription records) and non-ActiveRecord validations without polluting model classes.
- Query Objects: Encapsulate complex, reusable ActiveRecord queries with 10+ lines of chained scopes, filters, and sorting logic for consistent reuse across controllers.
- Presenters / Decorators: Move view-specific formatting and display logic out of models and views to keep both clean, testable, and focused on their core responsibilities.
- Use Case: If your Rails app has a signup flow spanning 3 models, a user search with 6 filter options, and user profile views with 80 lines of conditional formatting, this Skill guides you to apply the right pattern for each scenario without over-engineering.
Quick Start
Ask your AI coding agent to refactor your multi-model signup form into a form object using ActiveModel::Model with transaction wrapping and custom validations, extract your complex filtered user search into a reusable query object, and move all user view formatting logic into a dedicated presenter class to eliminate bloat across your Rails codebase.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: form-objects-query-objects-presenters Download link: https://github.com/sandeepmvl/rails-skills/archive/main.zip#form-objects-query-objects-presenters Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.