contributing

A contribution guide for working on RubyLLM, including setup, tests, new providers or chat options, Rails integration, and documentation. RubyLLM is a Ruby library for working with language-model services.

In plain words
What is it for?
It is for fixing bugs, adding features or providers, changing documentation, running unit and live-recorded tests, and checking code quality before committing.
Why use it?
It gives contributors the repository’s required development loop and architecture checks, reducing the chance that changes pass local tests but fail project standards.

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/crmne/ruby_llm/contributing
Any agent
npx skills add crmne/ruby_llm --skill contributing
Clone the repo
git clone --depth 1 https://github.com/crmne/ruby_llm

Made for: Claude Code, Codex.

Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,312 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.00060 $0.01312
Opus 5 $0.00030 $0.00656
Sonnet 5 $0.00012 $0.00262
Haiku 4.5 $0.00006 $0.00131

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

Security

Grade A, and why

contributing 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 2d 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.

.claude/skills/contributing/SKILL.md · 92 lines

How it starts

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

Contributing to RubyLLM

Read AGENTS.md at the repo root first: it has the ground rules, the command table, and the architecture constraints that archspec check enforces. This skill adds the step-by-step recipes.

The fast loop

bundle exec rspec --tag ~live          # unit tests only, no keys, seconds not minutes
bundle exec rspec spec/ruby_llm/chat_spec.rb:42   # one example
overcommit --run                       # what the commit hook will run

Run the fast loop while developing. Run overcommit --run before declaring anything done: it runs RuboCop (auto-correct), Flay (duplication), archspec (architecture), and the unit suite, and the commit fails if any of them do.

Working with cassettes

Specs tagged :live replay recorded provider traffic from spec/fixtures/vcr_cassettes. The cassette name derives from the example's full description, so renaming an example orphans its cassette.

To re-record after changing request shapes:

rake vcr:record[openai]            # deletes that provider's cassettes, reruns the suite
rake vcr:record[openai,anthropic]  # several providers
rake vcr:record[all]               # everything (long, needs many keys)

Recording needs real API keys in .env. To re-record a single spec, delete its cassette file and run the spec with the provider's key set.

Rules that bite:

  • A failing :live example deletes its own cassette on purpose. Do not "fix" a red spec by restoring the cassette; fix the code, then re-record.
  • Review every new or changed cassette for leaked keys and personal data before committing. The pre-commit hook runs gitleaks, but eyes first.
  • A spec that can neither replay (no cassette) nor record (no key) skips with a message naming the env var it needs. That is expected on a fork without keys.

Adding or changing a chat option

  1. Add with_x to lib/ruby_llm/chat.rb (chainable, returns self).
  2. Add the matching bare x class macro to lib/ruby_llm/agent.rb. The archspec build fails without it.
  3. Thread the option through the Provider contract, never by referencing a concrete provider or protocol from Chat.
  4. Implement per protocol in lib/ruby_llm/protocols/* (render_* for request payloads, parse_* for responses).
  5. Spec it in spec/ruby_llm/chat_<x>_spec.rb; add live coverage over the matrix in spec/support/models_to_test.rb when providers differ.
  6. Document it on the matching page in docs/_core_features/.

Read the full file on GitHub · 92 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. 2d ago First seen · 92 lines · 60 tokens per session scan A 145fc2bc2fda

Subscribe to this mod's changes

contributing is a skill published in the GitHub repository crmne/ruby_llm (4,334 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 1,312 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-08-30.