agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing Ruby or working in Rails codebases. Covers idiomatic object design, service objects, ActiveRecord query performance, RSpec structure, and RuboCop-clean style.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill ruby --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/rubyContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing Ruby or working in Rails codebases. Covers idiomatic object design, service objects, ActiveRecord query performance, RSpec structure, and RuboCop-clean style.
name: ruby description: Use when writing Ruby or working in Rails codebases. Covers idiomatic object design, service objects, ActiveRecord query performance, RSpec structure, and RuboCop-clean style. metadata: category: languages version: 1.0.0 tags: [ruby, rails, activerecord, rspec, rubocop]
Write Ruby that stays readable as it grows: small objects with clear responsibilities, controllers that stay thin, and ActiveRecord queries that do not quietly issue a query per row.
1. **Locate the responsibility** — If a method touches HTTP, business rules, and persistence, split it before changing it. 2. **Extract a service object** — One public `call`, explicit dependencies, no global state. 3. **Fix the queries** — Add `includes`, convert loops into set operations, batch with `find_each`. 4. **Make jobs idempotent** — Retries are guaranteed; double-execution must be harmless. 5. **Gate** — RSpec, RuboCop, and Bullet (or equivalent) to fail the build on N+1.
**Service object with explicit failure:**
# frozen_string_literal: true
class RefundOrder
Result = Struct.new(:success?, :refund, :error, keyword_init: true)
def initialize(gateway: PaymentGateway.new)
@gateway = gateway
end
def call(order:, amount_cents:)
return failure("order not refundable") unless order.refundable?
return failure("amount exceeds order total") if amount_cents > order.total_cents
refund = @gateway.refund(order.charge_id, amount_cents)
order.update!(refunded_cents: order.refunded_cents + amount_cents)
Result.new(success?: true, refund: refund)
rescue PaymentGateway::Error => e
failure(e.message)
end
private
def failure(message) = Result.new(success?: false, error: message)
endA curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…