rails-dev
Что он делает
Этот скилл даёт ИИ набор соглашений Rails: богатые модели, концерны и тесты с фикстурами. По умолчанию он не добавляет лишние гемы. Он нужен разработчикам, которые создают или меняют приложения на Rails.
Когда использовать
- ✓Когда вы проектируете модель данных, миграцию или функцию в Rails.
- ✓Когда вы меняете код Rails и хотите, чтобы он соответствовал соглашениям проекта.
- ✓Когда вы хотите избегать лишних гемов и держать приложение простым.
Ссылка на скилл
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/rails-dev/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Добавь в наше приложение Rails способ для пользователей закрывать тикет поддержки, следуя нашим соглашениям.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ загружает справочные материалы по соглашениям до того, как думает о коде, затем моделирует изменение с помощью записей и концернов, используя минимум зависимостей.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Rails Conventions
Core Philosophy
- Rich models - Business logic lives in models, not service objects
- Everything is CRUD - New resource over new action (
resource :closurenotpost :close) - State as records -
Closuremodel instead ofclosed: boolean - Concerns for composition -
Closeable,Watchable,Commentable - Explicit over clever - Inline until repetition is real; an abstraction earns its place, it isn't built on speculation
- Small interfaces - No public method without a caller
- Let it crash - Bang methods (
create!), handle failures at the boundary, not by pre-guarding (references/error-handling.md) - Invariants in the schema - Hard rules (presence, uniqueness, ranges) are NOT NULL / unique / check constraints; validations are for user-facing messages, not the source of truth. References stay soft: no foreign keys, integrity at the model layer
- Minimal dependencies - Build it yourself before reaching for gems. No Devise, Pundit, RSpec, FactoryBot, ViewComponent, service/form objects, or decorators
- Database-backed - Solid Queue/Cache/Cable, no Redis
- Test coverage - Maintain roughly 1:1 test ratio (1 line test per line of code)
Reference Selection
This table is an index, not the content. The conventions live in the reference files, not in this table, the codebase, or general Rails knowledge. Match the task to the rows below and read those files end to end before you design, write, review, or analyze the code. Reading the row is not reading the reference; guessing from the codebase is how the wrong convention gets shipped.
| Task | Reference |
|---|---|
| Models, validations, associations, business logic | references/model.md |
| Custom validators, validation rules reused across models | references/validator.md |
| Error handling, rescue boundaries, reporting, retries | references/error-handling.md |
| Controllers, CRUD actions | references/crud.md |
Routes, config/routes.rb, resource mapping |
references/routes.md |
| Concerns, shared behavior | references/concerns.md |
| State tracking (not booleans) | references/state-records.md |
| Authentication, authorization, sessions, IDOR scoping | references/auth.md |
| Database migrations | references/migration.md |
| Minitest, fixtures, testing | references/test.md |
| Views, ERB, partials, helpers, presentation logic | references/view.md |
| Turbo Frames, Turbo Streams, real-time | references/turbo.md |
| Stimulus controllers, JS sprinkles | references/stimulus.md |
| Background jobs, Solid Queue | references/jobs.md |
| Concurrency, fibers, Async, external I/O | references/async.md |
| Mailers, email notifications | references/mailer.md |
| Fragment caching, HTTP caching | references/caching.md |
| REST API, JSON responses | references/api.md |
| Multi-tenancy, account scoping | references/multi-tenant.md |
| Event tracking, activity logs | references/events.md |
| Webhooks (inbound/outbound), inbox, idempotency | references/webhooks.md |
| Code review, consistency check | references/review.md |
| HTTP clients, external APIs, Faraday | references/http-client.md |
| Logging, log messages, Rails.logger | references/logging.md |
Coding style
These are cross-cutting rules: they apply to every file, regardless of area. They do not replace the references. For anything area-specific (models, controllers, jobs, views, tests, …) you MUST ALWAYS load the matching reference from the table above before writing or reviewing the code.
Conditionals
Use an expanded if/else over a value-returning guard clause. A guard clause at the top of a method is fine when the body is non-trivial.
# Don't: value-returning guard clause for a simple branch
def status_label
return "closed" if closed?
"open"
end
# Do: expanded if/else
def status_label
if closed?
"closed"
else
"open"
end
end
Method order
Class methods, then public (with initialize first), then private. Order methods vertically by invocation: a caller sits above its callees.
# Don't: callee above its caller, public after private
class Signup
def create_member = Member.create!(email:)
def call = create_member
end
# Do: class method, then the caller, then its callees
class Signup
def self.call(...) = new(...).call
def call = create_member
private
def create_member = Member.create!(email:)
end
Visibili
Частые вопросы
Добавляет ли он Devise или RSpec?
Нет. Соглашения избегают этих гемов и поощряют создание более простых частей самостоятельно.
Помогает ли он с проектированием базы данных?
Да. Он охватывает правила схемы, например ограничения и миграции.
Подходит ли он для проектов не на Rails?
Нет. Он предназначен только для работы с Ruby on Rails.
Подробности
Оригинальное описание автора
Opinionated Rails conventions: rich models, concerns, CRUD-everything, state-as-records, minimal dependencies, Minitest with fixtures. Load this skill BEFORE any code-level thinking, not only before editing a file. It is required the moment a task touches Rails code in ANY way: designing or even just discussing a data model, schema, migration, entity, association, field, validation, class, or method name; writing, planning, reviewing, analyzing, testing, debugging, or refactoring; or proposing any model, table, column, route, or code snippet inline in chat. If you are about to name a model or
Популярность
- Звёзды на GitHub
- 7.1k
- Место в рейтинге
- #13531
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
component-common-domain-detection
7.1kПомогает агенту найти бизнес-логику, которая повторяется в нескольких частях кодовой базы, и предлагает, как её объединить.
component-flattening-analysis
7.1kПомогает агенту найти код, стоящий не на своём месте, и выровнять запутанную структуру папок компонентов, чтобы каждая часть находилась на месте.
component-identification-sizing
7.1kПомогает агенту описать части кодовой базы и измерить их размер, чтобы найти, какой модуль стоит разделить первым.
coupling-analysis
7.1kПомогает агенту проверить, насколько тесно части кодовой базы зависят друг от друга, и какие связи стоит ослабить в первую очередь.
Похожие скиллы
api-connector-builder
280kАгент создаёт новые подключения к API по существующему шаблону. Используйте, когда нужна ещё одна интеграция без нового способа делать то же самое.
api-design
280kПомогает агенту проектировать REST API по лучшим практикам: как API общаются, как показываются ошибки и как организовать данные.
backend-patterns
280kПомогает агенту с архитектурными паттернами серверной части и оптимизацией баз данных. Полезен при создании и проверке серверного кода.