मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)7.1k · #13531

rails-dev

यह क्या करती है

यह स्किल AI को Rails के नियमों का एक सेट देती है, जैसे समृद्ध मॉडल, concerns और fixtures वाले टेस्ट, और डिफ़ॉल्ट रूप से अतिरिक्त gems जोड़ने से बचती है। यह Rails ऐप्स बनाने या बदलने वाले डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब आप डेटा मॉडल, migration या Rails फ़ीचर डिज़ाइन कर रहे हैं।
  • ✓जब आप Rails कोड बदलना चाहते हैं और उसे प्रोजेक्ट के नियमों से मेल में रखना है।
  • ✓जब आप अतिरिक्त gems से बचकर ऐप को सरल रखना चाहते हैं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/rails-dev/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“हमारे Rails ऐप में उपयोगकर्ताओं को सपोर्ट टिकट बंद करने का तरीका जोड़िए, हमारे नियमों का पालन करते हुए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI कोड के बारे में सोचने से पहले नियम संदर्भ लोड करता है, फिर records और concerns से बदलाव का मॉडल बनाता है, और सबसे कम निर्भरताएँ इस्तेमाल करता है।

तकनीकी सामग्री (मूल 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 जोड़ती है?

नहीं। ये नियम उन gems से बचते हैं और सरल हिस्से खुद बनाने को प्राथमिकता देते हैं।

क्या यह डेटाबेस डिज़ाइन में मदद करती है?

हाँ। यह constraints और migrations जैसे स्कीमा नियम कवर करती है।

क्या यह गैर-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
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

component-common-domain-detection

7.1k

यह आपके एजेंट को कोडबेस के कई हिस्सों में दोहराए गए बिज़नेस लॉजिक को ढूँढने और उन्हें मिलाने का तरीका सुझाने में मदद करती है।

कोडिंगसामान्य कोडिंग

component-flattening-analysis

7.1k

यह आपके एजेंट को गलत जगह रखा गया कोड ढूँढने और उलझे हुए कंपोनेंट फ़ोल्डर ढाँचे को सीधा करने में मदद करती है, ताकि हर चीज़ अपनी सही जगह रहे।

कोडिंगसामान्य कोडिंग

component-identification-sizing

7.1k

यह आपके एजेंट को कोडबेस के हिस्सों का नक्शा बनाने और उनका आकार मापने में मदद करती है, ताकि पता चले कि पहले किस मॉड्यूल को तोड़ना है।

कोडिंगसामान्य कोडिंग

coupling-analysis

7.1k

यह आपके एजेंट को जाँचने में मदद करती है कि कोडबेस के हिस्से एक-दूसरे पर कितनी कसकर निर्भर हैं, और पहले कौन से जोड़ ढीले करने चाहिए।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills