rails-dev
БесплатноБез исполняемых скриптовНе проверенRuby on Rails performance and maintainability optimization guidelines for building backend APIs and frontend web applications. This skill should be used when…
от pproenca★ 231 звезда на GitHubОб этом скилле
Community Ruby on Rails Development Best Practices
Comprehensive 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.
When to Apply
Reference these guidelines when:
- Writing new Rails controllers, models, or views
- Optimizing ActiveRecord queries and database access patterns
- Implementing caching strategies (fragment, Russian doll, low-level)
- Building or refactoring API endpoints
- Adding Turbo Frames and Streams for interactive UIs
- Reviewing code for N+1 queries and security vulnerabilities
- Designing background jobs with Sidekiq or Active Job
- Writing or reviewing database migrations
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Database & ActiveRecord | CRITICAL | db- |
| 2 | Controllers & Routing | CRITICAL | ctrl- |
| 3 | Security | HIGH | sec- |
| 4 | Models & Business Logic | HIGH | model- |
| 5 | Caching & Performance | HIGH | cache- |
| 6 | Views & Frontend | MEDIUM-HIGH | view- |
| 7 | API Design | MEDIUM | api- |
| 8 | Background Jobs & Async | LOW-MEDIUM | job- |
Quick Reference
1. Database & ActiveRecord (CRITICAL)
db-eager-load-associations- Eager load associations to eliminate N+1 queriesdb-add-database-indexes- Add database indexes on queried columnsdb-select-specific-columns- Select only needed columnsdb-batch-processing- Use find_each for large dataset iterationdb-avoid-queries-in-loops- Avoid database queries inside loopsdb-use-scopes- Define reusable query scopes on modelsdb-safe-migrations- Write reversible zero-downtime migrationsdb-exists-over-count- Use exists? instead of count for existence checks
2. Controllers & Routing (CRITICAL)
ctrl-thin-controllers- Keep controllers thin by delegating to models and servicesctrl-strong-params- Always use strong parameters for mass assignmentctrl-restful-routes- Follow RESTful routing conventionsctrl-before-action-scoping- Scope before_action callbacks with only/exceptctrl-respond-to-format- Use respond_to for multi-format responsesctrl-rescue-from- Handle errors with rescue_from in controllers
3. Security (HIGH)
sec-parameterized-queries- Never interpolate user input in SQLsec-strong-params-whitelist- Whitelist permitted params, never blacklistsec-authenticate-before-authorize- Authenticate before authorize on every requestsec-csrf-protection- Enable CSRF protection for all form submissionssec-scope-queries-to-user- Scope queries to current user for authorization
4. Models & Business Logic (HIGH)
model-validate-at-model-level- Validate data at the model levelmodel-avoid-callback-side-effects- Avoid side effects in model callbacksmodel-use-service-objects- Extract complex logic into service objectsmodel-scope-over-class-methods- Use scopes instead of class methods for query compositionmodel-use-enums- Use enums for finite state fieldsmodel-concerns-for-shared-behavior- Use concerns for shared model behaviormodel-query-objects- Extract complex queries into query objects
5. Caching & Performance (HIGH)
cache-fragment-caching- Use fragment caching for expensive view partialscache-russian-doll- Use Russian doll caching for nested collectionscache-low-level- Use Rails.cache.fetch for computed datacache-counter-cache- Use counter caches for association countscache-conditional-get- Use conditional GET with stale? for HTTP caching
Установить rails-dev в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rails-dev?
Ruby on Rails performance and maintainability optimization guidelines for building backend APIs and frontend web applications. This skill should be used when writing, reviewing, or refactoring Ruby on Rails code to ensure optimal patterns for controllers, models, ActiveRecord queries, caching, views, API design, security, and background jobs. Triggers on tasks involving Rails controllers, ActiveRecord queries, migrations, Turbo/Hotwire, API endpoints, background jobs, or Rails performance improvements.
Как установить скилл rails-dev?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rails-dev запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic