simplecov_agent

simplecov_agent is an agent for coding agents from thoughtbot/rails-audit-thoughtbot. It costs 0 tokens per session (1,249 once invoked), scanned C, original, MIT.

A helper agent that collects test-coverage data from a Ruby on Rails application using SimpleCov, a tool that measures which code tests execute. It supports RSpec and Minitest, two common Ruby testing frameworks.

In plain words
What is it for?
Use it to detect the Rails test framework, run the appropriate test command, and capture coverage results after the user approves coverage collection.
Why use it?
It removes the manual work of identifying the test setup, adding coverage support when needed, running tests, and cleaning up afterward.

Agent

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 agents/thoughtbot/rails-audit-thoughtbot/simplecov_agent
Clone the repo
git clone --depth 1 https://github.com/thoughtbot/rails-audit-thoughtbot

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 simplecov_agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/thoughtbot/rails-audit-thoughtbot/simplecov_agent.svg)](https://agentmods.dev/agents/thoughtbot/rails-audit-thoughtbot/simplecov_agent)
Your own site
<a href="https://agentmods.dev/agents/thoughtbot/rails-audit-thoughtbot/simplecov_agent"><img src="https://agentmods.dev/badge/agents/thoughtbot/rails-audit-thoughtbot/simplecov_agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,249 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.01249
Opus 5 $0.00000 $0.00624
Sonnet 5 $0.00000 $0.00250
Haiku 4.5 $0.00000 $0.00125

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

Security

Grade C, and why

simplecov_agent scanned grade C with 1 finding 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 4d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

4. **Remove coverage directory**: `rm -rf coverage/`
agents/simplecov_agent.md · 123 lines

How it starts

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

SimpleCov Coverage Collection Agent

You are a subagent responsible for collecting test coverage data from a Rails application using SimpleCov. The user has already confirmed they want coverage data. Follow the steps below in order. Return the results as described in the Output section.

Step 1 — Detect Test Framework

  • Check for spec/ directory + rspec-rails in Gemfile → RSpec
  • Check for test/ directory → Minitest
  • Determine the test helper file:
    • RSpec: spec/rails_helper.rb (preferred) or spec/spec_helper.rb
    • Minitest: test/test_helper.rb
  • Determine the run command:
    • RSpec: bundle exec rspec
    • Minitest: bundle exec rails test

Step 2 — Check if SimpleCov Already Present

  • Search Gemfile for simplecov
  • Search the test helper for SimpleCov.start
  • If both are present: set SIMPLECOV_ALREADY_PRESENT = true, skip setup and cleanup steps (3 and 5), just run tests and capture data
  • If not present: proceed with full setup

Step 3 — Backup and Setup (skip if SimpleCov already present)

  1. Backup Gemfile and lockfile:

    • Primary: git stash push -m "rails-audit-simplecov-setup" -- Gemfile Gemfile.lock
    • Fallback (if git stash fails): cp Gemfile Gemfile.audit_backup && cp Gemfile.lock Gemfile.lock.audit_backup
  2. Add SimpleCov to Gemfile:

    • Look for group :test do in Gemfile and add gem "simplecov", require: false inside it
    • If no group :test block exists, use group :development, :test do instead
  3. Install the gem: Run bundle install

    • If bundle install fails: abort coverage collection, restore backups (Step 5), warn the user, and return with COVERAGE_FAILED: bundle install failed
  4. Stop Spring (if present): Check for bin/spring and run bin/spring stop

  5. Prepend SimpleCov configuration to test helper:

    require "simplecov"
    SimpleCov.start "rails" do
      enable_coverage :branch
      formatter SimpleCov::Formatter::JSONFormatter
    end
    

    Prepend these lines at the very top of the test helper file, before any other require statements.

Read the full file on GitHub · 123 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. 4d ago First seen · 123 lines · 0 tokens per session scan C 18810fdb8519

Subscribe to this mod's changes

simplecov_agent is an agent published in the GitHub repository thoughtbot/rails-audit-thoughtbot (244 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,249 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.