Borrowing it
Nothing to install: this file belongs to irahardianto/rugged-gemini. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/skills/ruby-idioms/SKILL.mdgit clone --depth 1 https://github.com/irahardianto/rugged-geminiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/irahardianto/rugged-gemini/ruby-idioms)<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/ruby-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/ruby-idioms/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/ruby-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/ruby-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00775 |
| Opus 5.5 | $0.00000 | $0.00310 |
| Sonnet 5.5 | $0.00000 | $0.00155 |
| Haiku 4.5 | $0.00000 | $0.00077 |
Grade A, and why
ruby-idioms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
92% identical to ruby-idioms — 14 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ruby Idioms and Patterns
Ruby rewards expressiveness, convention, and developer happiness. Modern Ruby (3.x) favors pattern matching, Ractor for concurrency, and strict typing via Sorbet/RBS. Idiomatic Ruby = readable, tested, convention-following.
Scope: Ruby coding idioms. Test naming: GEMINI.md § Testing Strategy. Logging:
@.gemini/skills/logging-and-observability-principles/SKILL.md.
Modern Ruby Features (3.x)
-
Pattern matching:
case result in { status: :success, data: Task => task } render json: task in { status: :not_found, id: String => id } render json: { error: "Task #{id} not found" }, status: :not_found end -
Endless methods for simple accessors:
def full_name = "#{first_name} #{last_name}" -
Data class (3.2+) for immutable value objects:
TaskResult = Data.define(:task, :status) result = TaskResult.new(task: task, status: :created)
Error Handling
-
Domain exception hierarchies:
class DomainError < StandardError; end class NotFoundError < DomainError attr_reader :resource, :resource_id def initialize(resource, resource_id) @resource = resource @resource_id = resource_id super("#{resource} '#{resource_id}' not found") end end -
rescuespecific exceptions — never barerescue. -
Use
ensurefor cleanup — equivalent tofinally.
Naming
- snake_case for methods, variables, file names.
- PascalCase for classes, modules.
- UPPER_SNAKE_CASE for constants.
?suffix for boolean queries:active?,valid?.!suffix for destructive or dangerous methods:save!,delete!.
Testing
- RSpec (preferred) or Minitest:
RSpec.describe TaskService do describe '#create' do it 'creates a task with valid attributes' do task = service.create(title: 'Test', priority: :high) expect(task.title).to eq('Test') end it 'raises ValidationError for blank title' do expect { service.create(title: '', priority: :high) } .to raise_error(ValidationError) end end end
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 100 lines · 0 tokens per session scan A 3e14dbca59cd
ruby-idioms is a skill published in the GitHub repository irahardianto/rugged-gemini (5 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 775 tokens. A static security scan graded it A with 0 findings. It is 92% identical to ruby-idioms, differing in 14 lines, and is treated as a copy.
Other skills, from other repositories
rubyllm
Build and maintain Ruby or Rails applications with the RubyLLM AI framework. Use for chats, agents, tools, MCP servers, structured output, judgments, evaluations, media generation, transcription, OCR, moderation, embeddings, reranking, tracing, Rails integration, and RubyLLM upgrades; not for contributing to the…
new
Create a new project to start development quickly.
rspec-conventions
Rootstrap RSpec conventions. Use when writing, reviewing, or editing RSpec test files (spec//spec.rb, spec/railshelper.rb, spec/spechelper.rb, spec/support//.rb) or factories. Covers describe/context structure, let/subject, matchers, factories, mocking/stubbing, shared examples, and spec types (model, request…
dhh-rails-style
This skill should be used when writing Ruby and Rails code in DHH's distinctive 37signals style. It applies when writing Ruby code, Rails applications, creating models, controllers, or any Ruby file. Triggers on Ruby/Rails code generation, refactoring requests, code review, or when the user mentions DHH, 37signals…
ruby-patterns
Ruby/Rails: blocks, metaprogramming, ActiveRecord, Sidekiq, RSpec, Sorbet, Hanami. Triggers: Ruby, Rails, ActiveRecord, Sidekiq, RSpec, Gemfile, bundler, Hanami, Sorbet.
ruby-idioms
Modern Ruby (3.x) idioms: pattern matching, keyword arguments, immutable data structures, error hierarchies, and RSpec testing. Use when writing, modifying, or reviewing Ruby scripts, gems, or business logic. Pair with rails-idioms for Rails applications.