ruby_llm AGENTS.md

A set of working rules for coding agents contributing to RubyLLM, a Ruby framework for building AI features such as chats, tools, and agents.

In plain words
What is it for?
Use it when setting up the project, changing its code or documentation, checking model names, installing required hooks, or running its documented commands.
Why use it?
It gives contributors clear project rules, including when new features need approval, which generated files to avoid editing, and how to keep changes focused.

Instructions file for CodexOpenCode

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 instructions/crmne/ruby_llm/agents-md
Clone the repo
git clone --depth 1 https://github.com/crmne/ruby_llm

Made for: Codex, OpenCode.

Per session 1,410 This file is loaded in full into every session.
When invoked 1,410 The same file — it is already loaded in full.
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.01410 $0.01410
Opus 5 $0.00705 $0.00705
Sonnet 5 $0.00282 $0.00282
Haiku 4.5 $0.00141 $0.00141

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

Security

Grade A, and why

ruby_llm AGENTS.md 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.

AGENTS.md · 72 lines

How it starts

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

AGENTS.md

Guidance for coding agents working on RubyLLM. Humans welcome too; start with CONTRIBUTING.md for the contribution policy, then come back here for the mechanics.

What this is

RubyLLM is a Ruby AI framework: chat, tools, agents, structured output, embeddings, images, video, audio, and Rails integration behind one API, with seventeen providers in the box. Plain Ruby (>= 3.1.3), a handful of small dependencies, no heavyweight abstractions.

Ground rules

  • New features need an approved GitHub issue before any code. PRs without one get closed without review.
  • Never edit generated files: lib/ruby_llm/models.json, lib/ruby_llm/aliases.json, docs/_reference/available-models.md. rake models regenerates them.
  • Never invent model ids. Every model name in code, specs, and docs must be a real, callable model.
  • Keep diffs small and focused. No drive-by refactors, no style sweeps outside the lines you touch.
  • Plain commit messages that describe the change. No "Generated with" footers, no Co-Authored-By tags.

Setup

bundle install
overcommit --install   # required: installs the git hooks that gate every commit

Commands

Command What it does
bundle exec rspec --tag ~live Fast unit run. No API keys, no cassettes needed.
bundle exec rspec spec/ruby_llm/chat_spec.rb:42 One example.
bundle exec rake test Full suite through rspec-queue, like CI.
overcommit --run Everything the pre-commit hook runs: RuboCop, Flay, archspec, RSpec.
bundle exec rubocop Lint (auto-corrects on commit).
bundle exec archspec check Architecture rules from Archspec.rb.
bundle exec appraisal rails-8.0 rspec Rails version matrix (7.1 through 8.1, see Appraisals).
docs/bin/serve.sh Docs preview at localhost:4002.

Testing

  • Specs tagged :live talk to provider APIs through VCR cassettes in spec/fixtures/vcr_cassettes. Everything else is a plain unit test.
  • Cassette names derive from the example's full description. A failing :live example deletes its cassette on purpose, so the next run hits the real API instead of replaying a recording that may be hiding the bug.
  • Re-record cassettes with rake vcr:record[openai,anthropic] or rake vcr:record[all] (needs real API keys in .env).
  • Check cassettes for leaked keys before committing. bin/gitleaks-staged runs in the pre-commit hook and CI runs gitleaks again.
  • Rails specs run against the dummy app in spec/dummy. Generator specs are tagged :generator and excluded from the pre-commit run because they are slow.
  • spec/support/models_to_test.rb defines the provider and model matrix the live specs iterate over.

Read the full file on GitHub · 72 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 · 72 lines · 1,410 tokens per session scan A 811868a9f286

Subscribe to this mod's changes

ruby_llm AGENTS.md is an instructions file published in the GitHub repository crmne/ruby_llm (4,327 stars, last pushed 4d ago), licensed MIT. It adds 1,410 tokens to every session, about $0.0070 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.