본문으로 건너뛰기
cccskills
무료GitHub에 공개

rails-dev

Apply a specific set of Rails conventions to design, implementation, and code review. It keeps business logic in models, represents state changes as records, limits dependencies, and uses Minitest with fixtures, or predefined test data.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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 sketch a column you are already in scope, even in an exploratory back-and-forth where no file is written yet. Do not let a "we're just discussing" framing defer it. Do NOT use for non-Rails backends, NestJS, or general architecture (use nestjs-modular-monolith or coding-guidelines).

설치 방법 보기

이럴 때 유용합니다

  • Designing Rails models and database changes
  • Representing state changes with separate records
  • Reviewing code for consistent Rails conventions
  • Planning tests with Minitest and fixtures

포함된 파일(25)

  • SKILL.md8.5 KB
  • references/api.md8.0 KB
  • references/async.md1.7 KB
  • references/auth.md9.8 KB
  • references/caching.md4.8 KB
  • references/concerns.md5.9 KB
  • references/crud.md5.3 KB
  • references/error-handling.md8.4 KB
  • references/events.md4.1 KB
  • references/http-client.md3.4 KB
  • references/jobs.md8.9 KB
  • references/logging.md8.5 KB
  • references/mailer.md3.7 KB
  • references/migration.md6.6 KB
  • references/model.md16.4 KB
  • references/multi-tenant.md3.6 KB
  • references/review.md6.2 KB
  • references/routes.md5.3 KB
  • references/state-records.md7.1 KB
  • references/stimulus.md4.6 KB
  • references/test.md8.8 KB
  • references/turbo.md4.8 KB
  • references/validator.md3.0 KB
  • references/view.md5.2 KB
  • references/webhooks.md9.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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.

TaskReference
Models, validations, associations, business logicreferences/model.md
Custom validators, validation rules reused across modelsreferences/validator.md
Error handling, rescue boundaries, reporting, retriesreferences/error-handling.md
Controllers, CRUD actionsreferences/crud.md
Routes, config/routes.rb, resource mappingreferences/routes.md
Concerns, shared behaviorreferences/concerns.md
State tracking (not booleans)references/state-records.md
Authentication, authorization, sessions, IDOR scopingreferences/auth.md
Database migrationsreferences/migration.md
Minitest, fixtures, testingreferences/test.md
Views, ERB, partials, helpers, presentation logicreferences/view.md
Turbo Frames, Turbo Streams, real-timereferences/turbo.md
Stimulus controllers, JS sprinklesreferences/stimulus.md
Background jobs, Solid Queuereferences/jobs.md
Concurrency, fibers, Async, external I/Oreferences/async.md
Mailers, email notificationsreferences/mailer.md
Fragment caching, HTTP cachingreferences/caching.md
REST API, JSON responsesreferences/api.md
Multi-tenancy, account scopingreferences/multi-tenant.md
Event tracking, activity logsreferences/events.md
Webhooks (inbound/outbound), inbox, idempotencyreferences/webhooks.md
Code review, consistency checkreferences/review.md
HTTP clients, external APIs, Faradayreferences/http-client.md
Logging, log messages, Rails.loggerreferences/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

Visibility

No blank line after private; indent the methods beneath it. A module of only private methods marks private at the top with a blank line after, not indented.

# Don't: blank line after private, methods not indented
class Card
  private

  def closure_exists? = closure.present?
end

# Do: no blank line, indented under private
class Card
  private
    def closure_exists? = closure.present?
end

Bang methods

Use ! only when a non-bang counterpart exists (like save/save!). Never add ! just to flag a destructive or important action.

# Don't: unpaired bang used to signal "this is destructive"
def revoke! = update!(revoked_at: Time.current)

# Do: plain domain verb; the ! belongs to the paired persistence call
def revoke = update!(revoked_at: Time.current)

Method naming

Public methods are domain verbs. When a verb collides with a scope, predicate, or core method (Kernel#fail), prefix with mark_ (no bang): mark_failed. Class and concept naming live in references/model.md.

# Don't: mark_ prefix when the plain verb is free
def mark_published = update!(published_at: Time.current)

# Do: plain verb; reserve mark_ for a real collision (fail -> Kernel#fail)
def publish = update!(published_at: Time.current)
def mark_failed = update!(failed_at: Time.current)

Comments

Default to none. Most comments are noise: the code and naming should carry the meaning.

Add one only when the code can't carry it:

  • The path or code can't make the problem clear.
  • The model's language is ambiguous and a note clarifies where it sits in the domain.

Don't:

  • Restate what the code already says.
  • Section code (e.g. # ----- some_method ----- banners in tests).

When a comment earns its place:

  • Plain English, always.
  • Concise.
  • No LLM-slop vocabulary.
  • Use a list when it reads clearer than prose.
# Don't: restates what the code already says; section banner
# increment the attempts counter
attempts += 1

# ----- private helpers -----

# Do: explains the non-obvious why
# Circle returns 422 on duplicate emails, so we reconcile instead of recreating.
reconcile_member(email)

Errors

Don't swallow errors. Make the failure accessible to the caller, usually by recording it on a returned object rather than logging and returning false. Full handling conventions (record vs raise, reporting, wrapping, retries) live in references/error-handling.md.

# Don't: swallow the error; the caller can't tell it failed
def provision_circle
  circle_client.create_community_member(...)
rescue Circle::AdminClient::ApiError
  false
end

# Do: record the failure on the returned object
def provision_circle
  circle_client.create_community_member(...)
  circle_access.mark_successful(external_id: response.dig(:community_member, :id))
rescue Circle::AdminClient::ApiError => e
  circle_access.mark_failed(error: e.message)   # caller checks access.failed?
end

Sources

These conventions are adapted from, and may diverge from, these reference apps:

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and improve website accessibility using WCAG 2.1, guidelines for making web content usable by people with disabilities. Check image descriptions, contrast, forms, keyboard controls, and screen reader support with automated and manual testing.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking a site before launch
  • Fixing keyboard navigation and focus
  • Improving form labels and error messages
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

Plan personalized sales emails to prospects you have not contacted before. This skill covers prospect selection, contact research, email drafts, follow-up sequences, inbox delivery, and reply handling, with guidance on tools and campaign improvements.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Drafting personalized sales emails for new prospects
  • Planning a sequence of emails and follow-ups
  • Investigating low reply rates or spam placement
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

Plan pricing for AI products by comparing charges based on usage, tasks, or results. Use customer value and computing costs to shape pricing tiers, usage limits, hybrid plans, and margin improvement strategies.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Choosing how to charge for an AI product
  • Designing pricing tiers and usage limits
  • Reviewing low margins
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

ai-sdr

무료

Plan AI sales development systems that qualify prospects, organize outreach, classify replies, and hand opportunities to people. Use customer criteria, budget, CRM setup, and sales goals to shape platform choices and a four-week rollout plan.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Planning an AI sales development rollout
  • Defining prospect scores and qualification criteria
  • Improving outreach with low reply or meeting conversion rates
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

ai-seo

무료

Plan AI-assisted SEO, from keyword research and competitor comparison pages to content production using data and templates. It also guides content changes for AI search citations, tool selection, quality checks, and ongoing performance tracking.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Planning competitor alternative and comparison pages
  • Designing page production using data and templates
  • Reviewing content for citations in AI Overviews
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

Plan UGC campaigns, ads built around user-style content, from creator recruitment and production briefs to AI video variations. Organize organic testing, paid promotion, and creative refreshes for TikTok, Meta, and YouTube Shorts.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Recruiting creators for product videos
  • Writing a short video production brief
  • Planning AI-generated ad variations
tech-leads-club/agent-skills7.1천2026년 10월 21일 업데이트

tech-leads-club의 스킬 모두 보기

이 스킬의 문제 신고