ruby-rules

ruby-rules is a skill for Claude Code, Codex from softspark/ai-toolkit. It costs 48 tokens per session (3,216 once invoked), scanned A, original, Apache-2.0.

A set of coding guidance for Ruby, a programming language often used with the Rails web framework. It covers style, patterns, security, and testing.

In plain words
What is it for?
Use it when writing or reviewing Ruby files, Rails applications, gems, background jobs, or tests.
Why use it?
It gives an agent project conventions for Ruby code and helps it avoid common mistakes in Ruby and Rails projects.

Skill for Claude CodeCodex

Part of the ai-toolkit plugin — 114 skills, 44 agents, 14 hooks shipped together

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/softspark/ai-toolkit/ruby-rules
Any agent
npx skills add softspark/ai-toolkit --skill ruby-rules
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code, Codex.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 114 skills, 44 agents, 14 hooks.

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-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/ruby-rules.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/ruby-rules)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/ruby-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/ruby-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,216 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.00048 $0.03216
Opus 5 $0.00024 $0.01608
Sonnet 5 $0.00010 $0.00643
Haiku 4.5 $0.00005 $0.00322

Measured yesterday against content hash 8a6d84fe2105, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ruby-rules 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 yesterday.

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.

app/skills/ruby-rules/SKILL.md · 287 lines

How it starts

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

Ruby Rules

These rules come from app/rules/ruby/ in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in Ruby. Apply them when writing or reviewing Ruby code.

Ruby Coding Style

Naming

  • PascalCase: classes, modules.
  • snake_case: methods, variables, file names, directories.
  • UPPER_SNAKE: constants (MAX_RETRIES = 3).
  • Prefix boolean methods with predicate: empty?, valid?, admin?.
  • Suffix dangerous methods with !: save!, sort!, strip!.
  • Use _ prefix for intentionally unused variables: _unused.

Methods

  • Keep methods short: 5-10 lines ideal. Extract helper methods.
  • Use keyword arguments for methods with >2 parameters.
  • Use default parameter values instead of checking for nil.
  • Use def method_name = expression (Ruby 3.0+) for one-liners.
  • Prefer each over for loops. Use block-style iteration.
  • Return values implicitly (last expression). Use explicit return only for early exit.

Blocks, Procs, Lambdas

  • Use { } for single-line blocks. Use do...end for multi-line blocks.
  • Use &:method shorthand: names.map(&:upcase).
  • Use lambdas for strict argument checking. Use procs for flexible arity.
  • Use yield for single-block methods. Use explicit &block for storing/forwarding.

Classes

  • Use attr_reader, attr_writer, attr_accessor for simple getters/setters.
  • Use Struct for simple data containers. Use Data.define (Ruby 3.2+) for immutable.
  • Use modules for mixins: include for instance methods, extend for class methods.
  • Use frozen_string_literal: true magic comment at the top of every file.
  • Use private / protected keywords to control method visibility.

Collections

  • Use map, select, reject, reduce, flat_map for transformations.
  • Use each_with_object over inject when accumulating into a mutable object.
  • Use dig for safe nested hash/array access: data.dig(:user, :address, :city).
  • Use Hash#fetch with default for explicit missing-key handling.
  • Use Enumerable#lazy for large collection processing.

Read the full file on GitHub · 287 lines

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. yesterday First seen · 287 lines · 48 tokens per session scan A 8a6d84fe2105

Subscribe to this mod's changes

ruby-rules is a skill published in the GitHub repository softspark/ai-toolkit (168 stars, last pushed yesterday), licensed Apache-2.0. It adds 48 tokens to every session and 3,216 once invoked, about $0.0002 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-09-03.