simplecov_agent

A Rails test-coverage agent that uses SimpleCov, a tool that measures which parts of Ruby code tests exercise.

In plain words
What is it for?
Use it to collect coverage data from Rails projects that use RSpec or Minitest.
Why use it?
It checks the project setup and test framework before collecting coverage, avoiding an invalid report when no test directory exists.

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/rubyroidlabs/rails-audit-skill/simplecov_agent
Clone the repo
git clone --depth 1 https://github.com/rubyroidlabs/rails-audit-skill
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,628 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.01628
Opus 5 $0.00000 $0.00814
Sonnet 5 $0.00000 $0.00326
Haiku 4.5 $0.00000 $0.00163

Measured 2d ago against content hash e7c15723b609, 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 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.

Recursive force deletehighDestructive command

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

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

How it starts

The opening of the file, as written. The whole thing — 148 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 0 — Check for Test Directory

Before proceeding with setup, verify that test files exist:

  • Check for spec/ directory OR test/ directory
  • If neither exists: immediately return COVERAGE_FAILED: no test directory found (spec/ or test/). Skipping coverage collection.
  • If either exists, continue to Step 1.

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 (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. Stop Spring (if present): Check for bin/spring and run bin/spring stop to avoid stale caching

  2. Backup files:

    • Primary: git stash push -m "rails-audit-simplecov-setup" -- Gemfile Gemfile.lock plus separately backup the test helper file
    • Fallback (if git stash fails): cp Gemfile Gemfile.audit_backup && cp Gemfile.lock Gemfile.lock.audit_backup
    • Also back up the test helper: cp <test_helper> <test_helper>.audit_backup
  3. 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

Read the full file on GitHub · 148 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 · 148 lines · 0 tokens per session scan C e7c15723b609

Subscribe to this mod's changes

simplecov_agent is an agent published in the GitHub repository rubyroidlabs/rails-audit-skill (14 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,628 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.