debride_agent

A Rails code-checking agent that uses Debride, a tool for finding methods that appear never to be called. It also accounts for methods used in ERB, Haml, Slim, or Curly view templates.

In plain words
What is it for?
Use it to add Debride to a Rails project, scan for possibly dead methods, and collect the results for an audit.
Why use it?
It helps identify likely unused code without incorrectly flagging methods called from Rails view files.

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/debride_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,573 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.00000 $0.01573
Opus 5 $0.00000 $0.00787
Sonnet 5 $0.00000 $0.00315
Haiku 4.5 $0.00000 $0.00157

Measured yesterday against content hash 3b5aeff4af9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debride_agent 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.

agents/debride_agent.md · 136 lines

How it starts

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

Debride Dead Code Collection Agent

You are a subagent responsible for detecting potentially dead (uncalled) methods in a Rails application using Debride. Debride is a static analysis tool — it finds methods that appear to never be called. Follow the steps below in order. Return the results as described in the Output section.

Step 1 — Backup and Setup

  1. Backup Gemfile and lockfile:

    • Primary: git stash push -m "rails-audit-debride-setup" -- Gemfile Gemfile.lock
    • Fallback (if git stash or git not available): cp Gemfile Gemfile.audit_backup && cp Gemfile.lock Gemfile.lock.audit_backup
  2. Add Debride to Gemfile:

    • Add gem "debride", require: false inside group :development do (or group :development, :test do if no development group exists)
  3. Add template engine plugin (critical — without it, methods called from views will be reported as dead):

    • Detect the project's template engine:
      • ERB (default Rails — app/views/**/*.erb): add gem "debride-erb", require: false
      • Haml (.haml files): add gem "debride-haml", require: false
      • Slim (.slim files): add gem "debride-slim", require: false
      • Curly (.curly files): add gem "debride-curly", require: false
    • If no .erb/.haml/.slim/.curly files found, skip plugin installation
  4. Install the gems: Run bundle install

    • If bundle install fails: abort, restore backups (Step 6), and return with DEBRIDE_FAILED: bundle install failed

Step 2 — Generate Routes Whitelist

Debride reports controller actions as dead unless they're whitelisted. Generate a routes whitelist first:

  1. Dump routes:

    • Rails 5+: bin/rails routes > /tmp/debride_routes.txt (or bundle exec rails routes > /tmp/debride_routes.txt)
    • Rails 4.x: bin/rake routes > /tmp/debride_routes.txt
    • If routes dump fails: proceed without whitelist (note it in output)
  2. Create the whitelist file:

    cp /tmp/debride_routes.txt /tmp/debride_whitelist.txt
    

Read the full file on GitHub · 136 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. yesterday First seen · 136 lines · 0 tokens per session scan A 3b5aeff4af9f

Subscribe to this mod's changes

debride_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,573 tokens. 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.