[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEFC2PR4D9MSFD987YZ2KC":3,"skill-same:01M6FEFC2PR4D9MSFD987YZ2KC":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6FEFC2PR4D9MSFD987YZ2KC","rails-dev",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frails-dev\u002FSKILL.md",[],[18,19,20],"dev","rails","rails dev","2026-11-10 10:12:30",false,"# Community Ruby on Rails Development Best Practices\n\nComprehensive performance and maintainability optimization guide for Ruby on Rails applications, maintained by Community. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.\n\n## When to Apply\n\nReference these guidelines when:\n- Writing new Rails controllers, models, or views\n- Optimizing ActiveRecord queries and database access patterns\n- Implementing caching strategies (fragment, Russian doll, low-level)\n- Building or refactoring API endpoints\n- Adding Turbo Frames and Streams for interactive UIs\n- Reviewing code for N+1 queries and security vulnerabilities\n- Designing background jobs with Sidekiq or Active Job\n- Writing or reviewing database migrations\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Database & ActiveRecord | CRITICAL | `db-` |\n| 2 | Controllers & Routing | CRITICAL | `ctrl-` |\n| 3 | Security | HIGH | `sec-` |\n| 4 | Models & Business Logic | HIGH | `model-` |\n| 5 | Caching & Performance | HIGH | `cache-` |\n| 6 | Views & Frontend | MEDIUM-HIGH | `view-` |\n| 7 | API Design | MEDIUM | `api-` |\n| 8 | Background Jobs & Async | LOW-MEDIUM | `job-` |\n\n## Quick Reference\n\n### 1. Database & ActiveRecord (CRITICAL)\n\n- [`db-eager-load-associations`](references\u002Fdb-eager-load-associations.md) - Eager load associations to eliminate N+1 queries\n- [`db-add-database-indexes`](references\u002Fdb-add-database-indexes.md) - Add database indexes on queried columns\n- [`db-select-specific-columns`](references\u002Fdb-select-specific-columns.md) - Select only needed columns\n- [`db-batch-processing`](references\u002Fdb-batch-processing.md) - Use find_each for large dataset iteration\n- [`db-avoid-queries-in-loops`](references\u002Fdb-avoid-queries-in-loops.md) - Avoid database queries inside loops\n- [`db-use-scopes`](references\u002Fdb-use-scopes.md) - Define reusable query scopes on models\n- [`db-safe-migrations`](references\u002Fdb-safe-migrations.md) - Write reversible zero-downtime migrations\n- [`db-exists-over-count`](references\u002Fdb-exists-over-count.md) - Use exists? instead of count for existence checks\n\n### 2. Controllers & Routing (CRITICAL)\n\n- [`ctrl-thin-controllers`](references\u002Fctrl-thin-controllers.md) - Keep controllers thin by delegating to models and services\n- [`ctrl-strong-params`](references\u002Fctrl-strong-params.md) - Always use strong parameters for mass assignment\n- [`ctrl-restful-routes`](references\u002Fctrl-restful-routes.md) - Follow RESTful routing conventions\n- [`ctrl-before-action-scoping`](references\u002Fctrl-before-action-scoping.md) - Scope before_action callbacks with only\u002Fexcept\n- [`ctrl-respond-to-format`](references\u002Fctrl-respond-to-format.md) - Use respond_to for multi-format responses\n- [`ctrl-rescue-from`](references\u002Fctrl-rescue-from.md) - Handle errors with rescue_from in controllers\n\n### 3. Security (HIGH)\n\n- [`sec-parameterized-queries`](references\u002Fsec-parameterized-queries.md) - Never interpolate user input in SQL\n- [`sec-strong-params-whitelist`](references\u002Fsec-strong-params-whitelist.md) - Whitelist permitted params, never blacklist\n- [`sec-authenticate-before-authorize`](references\u002Fsec-authenticate-before-authorize.md) - Authenticate before authorize on every request\n- [`sec-csrf-protection`](references\u002Fsec-csrf-protection.md) - Enable CSRF protection for all form submissions\n- [`sec-scope-queries-to-user`](references\u002Fsec-scope-queries-to-user.md) - Scope queries to current user for authorization\n\n### 4. Models & Business Logic (HIGH)\n\n- [`model-validate-at-model-level`](references\u002Fmodel-validate-at-model-level.md) - Validate data at the model level\n- [`model-avoid-callback-side-effects`](references\u002Fmodel-avoid-callback-side-effects.md) - Avoid side effects in model callbacks\n- [`model-use-service-objects`](references\u002Fmodel-use-service-objects.md) - Extract complex logic into service objects\n- [`model-scope-over-class-methods`](references\u002Fmodel-scope-over-class-methods.md) - Use scopes instead of class methods for query composition\n- [`model-use-enums`](references\u002Fmodel-use-enums.md) - Use enums for finite state fields\n- [`model-concerns-for-shared-behavior`](references\u002Fmodel-concerns-for-shared-behavior.md) - Use concerns for shared model behavior\n- [`model-query-objects`](references\u002Fmodel-query-objects.md) - Extract complex queries into query objects\n\n### 5. Caching & Performance (HIGH)\n\n- [`cache-fragment-caching`](references\u002Fcache-fragment-caching.md) - Use fragment caching for expensive view partials\n- [`cache-russian-doll`](references\u002Fcache-russian-doll.md) - Use Russian doll caching for nested collections\n- [`cache-low-level`](references\u002Fcache-low-level.md) - Use Rails.cache.fetch for computed data\n- [`cache-counter-cache`](references\u002Fcache-counter-cache.md) - Use counter caches for association counts\n- [`cache-conditional-get`](references\u002Fcache-conditional-get.md) - Use conditional GET with stale? for HTTP caching\n\n### 6. Views & Frontend (MEDIUM-HIGH)\n\n- [`view-collection-rendering`](references\u002Fview-collection-rendering.md) - Use collection rendering instead of loop partials\n- [`view-turbo-frames`](references\u002Fview-turbo-frames.md) - Use Turbo Frames for partial page updates\n- [`view-turbo-streams`](references\u002Fview-turbo-streams.md) - Use Turbo Streams for real-time page mutations\n- [`view-form-with`](references\u002Fview-form-with.md) - Use form_with instead of form_tag or form_for\n- [`view-avoid-logic-in-views`](references\u002Fview-avoid-logic-in-views.md) - Move display logic to helpers or presenters\n\n### 7. API Design (MEDIUM)\n\n- [`api-serializers`](references\u002Fapi-serializers.md) - Use serializers for consistent JSON responses\n- [`api-pagination`](references\u002Fapi-pagination.md) - Always paginate collection endpoints\n- [`api-versioning`](references\u002Fapi-versioning.md) - Version APIs from day one\n- [`api-error-responses`](references\u002Fapi-error-responses.md) - Return structured error responses\n- [`api-avoid-jbuilder-hot-paths`](references\u002Fapi-avoid-jbuilder-hot-paths.md) - Avoid Jbuilder on high-traffic endpoints\n\n### 8. Background Jobs & Async (LOW-MEDIUM)\n\n- [`job-idempotent-design`](references\u002Fjob-idempotent-design.md) - Design jobs to be idempotent\n- [`job-small-payloads`](references\u002Fjob-small-payloads.md) - Pass IDs to jobs, not serialized objects\n- [`job-error-handling`](references\u002Fjob-error-handling.md) - Configure retry and error handling for jobs\n- [`job-unique-jobs`](references\u002Fjob-unique-jobs.md) - Prevent duplicate job enqueuing\n\n## How to Use\n\nRead individual reference files for detailed explanations and code examples:\n\n- [Section definitions](references\u002F_sections.md) - Category structure and impact levels\n- [Rule template](assets\u002Ftemplates\u002F_template.md) - Template for adding new rules\n\n## Reference Files\n\n| File | Description |\n|------|-------------|\n| [references\u002F_sections.md](references\u002F_sections.md) | Category definitions and ordering |\n| [assets\u002Ftemplates\u002F_template.md](assets\u002Ftemplates\u002F_template.md) | Template for new rules |\n| [metadata.json](metadata.json) | Version and reference information |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Frails-dev",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill rails-dev",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill rails-dev",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill rails-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frails-dev\u002FSKILL.md",true,[],[49,63,73,82,88,95],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":59,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[54],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[60,61,62],"model","model hierarchy","model hierarchy skill",{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":69,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[68],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[93],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[90],{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[97]]