ruby

ruby is a skill for Claude Code, Codex from miles990/claude-software-skills. It costs 8 tokens per session (3,083 once invoked), scanned A, original, MIT.

A reference for Ruby programming patterns and idioms, meaning conventions commonly used by Ruby developers.

In plain words
What is it for?
Use it for classes, inheritance, modules, blocks, metaprogramming, validation, and other Ruby programming tasks.
Why use it?
It helps produce Ruby code that follows familiar language conventions instead of applying patterns from other languages.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/miles990/claude-software-skills/ruby
Any agent
npx skills add miles990/claude-software-skills --skill ruby
Clone the repo
git clone --depth 1 https://github.com/miles990/claude-software-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for ruby

README.md
[![agentmods](https://agentmods.dev/badge/skills/miles990/claude-software-skills/ruby.svg)](https://agentmods.dev/skills/miles990/claude-software-skills/ruby)
Your own site
<a href="https://agentmods.dev/skills/miles990/claude-software-skills/ruby"><img src="https://agentmods.dev/badge/skills/miles990/claude-software-skills/ruby.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.03083
Opus 5 $0.00004 $0.01541
Sonnet 5 $0.00002 $0.00617
Haiku 4.5 $0.00001 $0.00308

Measured 3d ago against content hash 5f3189c52c9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ruby 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 3d 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.

programming-languages/ruby/SKILL.md · 612 lines

How it starts

The opening of the file, as written. The whole thing — 612 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ruby

Overview

Ruby programming patterns including blocks, metaprogramming, and idiomatic Ruby code.


Core Ruby Patterns

Classes and Modules

# Class definition
class User
  attr_accessor :name, :email
  attr_reader :id
  attr_writer :password

  # Class variable
  @@count = 0

  # Class method
  def self.count
    @@count
  end

  # Initialize
  def initialize(name, email)
    @id = SecureRandom.uuid
    @name = name
    @email = email
    @@count += 1
  end

  # Instance method
  def display_name
    "#{name} <#{email}>"
  end

  # Private methods
  private

  def validate_email
    email.include?('@')
  end
end

# Inheritance
class Admin < User
  attr_accessor :permissions

  def initialize(name, email, permissions = [])
    super(name, email)
    @permissions = permissions
  end

  def has_permission?(perm)
    permissions.include?(perm)
  end
end

# Modules for mixins
module Timestampable
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def timestamped_attrs
      [:created_at, :updated_at]
    end
  end

  def touch
    @updated_at = Time.now
  end

  def created_at
    @created_at ||= Time.now
  end
end

# Including module
class Document
  include Timestampable
  include Comparable

  attr_accessor :title, :content

  def <=>(other)
    title <=> other.title
  end
end

# Module for namespacing
module MyApp
  module Services
    class UserService
      def create(params)
        # ...
      end
    end
  end
end

Blocks, Procs, and Lambdas

# Block usage
[1, 2, 3].each { |n| puts n }

[1, 2, 3].map do |n|
  n * 2
end

# Yield to block
def with_timing
  start = Time.now
  result = yield
  elapsed = Time.now - start
  puts "Elapsed: #{elapsed}s"
  result
end

with_timing { sleep(0.1) }

# Block with arguments
def transform_items(items)
  items.map { |item| yield(item) }
end

transform_items([1, 2, 3]) { |n| n * 2 }

# Check if block given
def optional_block
  if block_given?
    yield
  else
    "No block provided"
  end
end

# Convert block to proc
def with_block(&block)
  block.call(42)
end

# Proc
my_proc = Proc.new { |x| x * 2 }
my_proc.call(21) # => 42

# Lambda
my_lambda = ->(x) { x * 2 }
my_lambda.call(21) # => 42

# Proc vs Lambda differences
proc_example = Proc.new { |x, y| x }
proc_example.call(1) # Works, y is nil

lambda_example = ->(x, y) { x }
# lambda_example.call(1) # ArgumentError

# Symbol to proc
['a', 'b', 'c'].map(&:upcase)
# Equivalent to: ['a', 'b', 'c'].map { |s| s.upcase }

Read the full file on GitHub · 612 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 3d ago First seen · 612 lines · 8 tokens per session scan A 5f3189c52c9e

Subscribe to this mod's changes

ruby is a skill published in the GitHub repository miles990/claude-software-skills (20 stars, last pushed 7mo ago), licensed MIT. It adds 8 tokens to every session and 3,083 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ruby

Ruby programming language — syntax, core types, OOP, blocks/procs/lambdas, exceptions, I/O, concurrency, metaprogramming, gems, testing, style guide, C extensions, and tooling.

pledgeandgrow/pledge-skills · 45 tokens

ruby-gc

Audit asdf-installed Ruby versions against project pins and remove unreferenced ones. Dry-run by default.

joshukraine/dotfiles · 25 tokens

real-world-rails

Research how production Rails apps solve architectural problems using the Real World Rails repository. Use when the user wants to know how other apps handle something, find patterns, or compare approaches. Triggers on "rails patterns", "how do other apps", "real world rails", "research how apps do".

steveclarke/real-world-rails · 64 tokens

ruby-rails

Use this skill when building Ruby on Rails applications — MVC, ActiveRecord, service objects, API mode, background jobs, and testing. This skill enforces: thin controllers, service objects for business logic, ActiveRecord query best practices, Rails API mode conventions, and RSpec testing patterns. Requires Rails 7+…

j4flmao/agent-skills · 94 tokens

rails-audit-thoughtbot

Perform comprehensive code audits of Ruby on Rails applications based on thoughtbot best practices. Use this skill when the user requests a code audit, code review, quality assessment, or analysis of a Rails application. The skill analyzes the entire codebase focusing on testing practices (RSpec), security…

thoughtbot/rails-audit-thoughtbot · 130 tokens

rails-load-defaults

Incrementally upgrade Rails config.loaddefaults by walking through each newframeworkdefaults config one at a time. Use this skill whenever the user mentions loaddefaults upgrade, newframeworkdefaults, framework defaults, or wants to bring their Rails app's default configuration up to match their Rails version. Also…

ombulabs/claude-code_rails-load-defaults-skill · 120 tokens