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.
npx agentmods add skills/softspark/ai-toolkit/ruby-patternsnpx skills add softspark/ai-toolkit --skill ruby-patternsgit clone --depth 1 https://github.com/softspark/ai-toolkitWrote 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/softspark/ai-toolkit/ruby-patterns)<a href="https://agentmods.dev/skills/softspark/ai-toolkit/ruby-patterns"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/ruby-patterns.svg" alt="Measured on agentmods" 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 | $0.00060 | $0.02704 |
| Opus 5 | $0.00030 | $0.01352 |
| Sonnet 5 | $0.00012 | $0.00541 |
| Haiku 4.5 | $0.00006 | $0.00270 |
Grade A, and why
ruby-patterns 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.
How it starts
The opening of the file, as written. The whole thing — 456 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ruby Patterns
Project Structure
Gem Layout
my_gem/
├── lib/
│ ├── my_gem.rb # Entry point, require sub-files
│ └── my_gem/
│ ├── version.rb
│ ├── configuration.rb
│ ├── client.rb
│ └── errors.rb
├── spec/
│ ├── spec_helper.rb
│ ├── my_gem/
│ │ └── client_spec.rb
│ └── fixtures/
├── bin/
│ └── console # IRB with gem loaded
├── sig/ # RBS type signatures
├── Gemfile
├── Rakefile
├── my_gem.gemspec
├── .rubocop.yml
└── .ruby-version
Rails Standard Structure
app/
├── controllers/
│ ├── application_controller.rb
│ └── api/v1/
│ └── users_controller.rb
├── models/
│ ├── application_record.rb
│ ├── user.rb
│ └── concerns/
│ └── searchable.rb
├── services/
│ └── users/
│ ├── create_service.rb
│ └── import_service.rb
├── jobs/
│ └── user_sync_job.rb
├── mailers/
├── serializers/
│ └── user_serializer.rb
└── views/
config/
├── routes.rb
├── database.yml
├── initializers/
│ ├── sidekiq.rb
│ └── cors.rb
└── environments/
db/
├── migrate/
├── schema.rb
└── seeds.rb
spec/
├── rails_helper.rb
├── spec_helper.rb
├── models/
├── requests/
├── services/
├── factories/
│ └── users.rb
└── support/
└── shared_examples/
Gemfile Best Practices
source "https://rubygems.org"
ruby "~> 3.3"
gem "rails", "~> 7.2"
gem "pg"
gem "puma", ">= 6.0"
gem "sidekiq", "~> 7.0"
gem "redis", ">= 5.0"
group :development, :test do
gem "rspec-rails"
gem "factory_bot_rails"
gem "faker"
gem "debug"
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
end
group :test do
gem "shoulda-matchers"
gem "webmock"
gem "vcr"
gem "simplecov", require: false
end
Idioms / Code Style
Blocks, Procs, and Lambdas
# Block -- yielded to, not stored
def with_retry(attempts: 3)
attempts.times do |i|
return yield
rescue StandardError => e
raise if i == attempts - 1
sleep(2**i)
end
end
with_retry { http_client.get("/data") }
# Proc -- flexible arity, returns from enclosing method
validator = Proc.new { |val| val.to_s.strip.length > 0 }
# Lambda -- strict arity, returns from itself
transform = ->(x) { x.to_s.downcase.strip }
words = ["Hello ", " WORLD"].map(&transform)
# Method reference
names = users.map(&:name)
valid = values.select(&method(:valid?))
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.
- yesterday First seen · 456 lines · 60 tokens per session scan A 32e09bd933ec
ruby-patterns is a skill published in the GitHub repository softspark/ai-toolkit (168 stars, last pushed yesterday), licensed Apache-2.0. It adds 60 tokens to every session and 2,704 once invoked, about $0.0003 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.
Other skills, from other repositories
contributing
Contribute to RubyLLM - set up the repo, run and record specs, add providers or chat options, work on the Rails integration, and edit docs. Use when fixing a bug, building a feature, writing specs, or changing documentation in the RubyLLM codebase.
new
Create a new project to start development quickly.
bevy-ecs
Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the Time resource for frame-rate-independent motion. Use when building or debugging a Bevy game in Rust — when the user mentions…
godot-csharp
Use C#/.NET in Godot 4.7: partial classes extending nodes, the PascalCase lifecycle (Ready/Process/PhysicsProcess), [Export] fields, [Signal] delegates as C# events, type-safe node lookup, and calling between C# and GDScript. Use when writing Godot game code in C# (.cs files, .csproj), needing the Godot .NET build…
codebase-analyzer
Statistical rule discovery from Go codebase patterns.
go-patterns
Go development patterns: testing, concurrency, errors, review, and conventions.