본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.1k · #13531

rails-dev

하는 일

이 스킬은 AI에게 Rails 관례를 제공합니다. 풍부한 모델, 공통 관심사(concern), 픽스처를 쓴 테스트 등이 있으며, 기본적으로 추가 젬은 쓰지 않습니다. Rails 애플리케이션을 만들거나 바꾸는 개발자를 위한 것입니다.

사용하는 경우

  • ✓데이터 모델, 마이그레이션, Rails 기능을 설계할 때.
  • ✓Rails 코드를 바꾸되 프로젝트의 관례에 맞추고 싶을 때.
  • ✓추가 젬을 피하고 앱을 단순하게 유지하고 싶을 때.

스킬 링크

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/rails-dev/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/rails-dev/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 Rails 앱에 사용자가 지원 티켓을 닫을 수 있는 기능을 우리 관례에 맞춰 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 코드를 생각하기 전에 관례 참고 자료를 먼저 불러오고, 레코드와 concern으로 변경을 모델링하며, 가장 적은 수의 의존성을 씁니다.

기술 내용 (원본 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 :closure not post :close)
  • State as records - Closure model instead of closed: 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

repo: tech-leads-club/agent-skills

인기도

GitHub 스타
7.1k
순위
#13531
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬