sinatra-test

sinatra-test is a command for Claude Code from geoffjay/claude-plugins. It costs 18 tokens per session (5,196 once invoked), scanned A, original, MIT.

A command that creates tests for Sinatra applications. Sinatra is a Ruby web framework; the tests can cover web routes, middleware that processes requests, and helper methods.

In plain words
What is it for?
Use it to generate tests for routes, middleware, helpers, or all three, using the testing framework your project prefers.
Why use it?
It saves time finding the relevant application code and writing the initial test cases for it. You can choose RSpec or Minitest, two common Ruby testing frameworks.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is require_relative '../config/environment'.

Good fit Use it to generate tests for routes, middleware, helpers, or all three, using the testing framework your project prefers.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/geoffjay/claude-plugins
agentmods
npx agentmods add commands/geoffjay/claude-plugins/sinatra-test

Made for: Claude Code.

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 sinatra-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/geoffjay/claude-plugins/sinatra-test/github.svg)](https://agentmods.dev/commands/geoffjay/claude-plugins/sinatra-test)
Your own site
<a href="https://agentmods.dev/commands/geoffjay/claude-plugins/sinatra-test"><img src="https://agentmods.dev/badge/commands/geoffjay/claude-plugins/sinatra-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sinatra-test

Your own site · 80×15
<a href="https://agentmods.dev/commands/geoffjay/claude-plugins/sinatra-test"><img src="https://agentmods.dev/badge/commands/geoffjay/claude-plugins/sinatra-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,196 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00018 $0.05196
Opus 5.5 $0.00007 $0.02078
Sonnet 5.5 $0.00004 $0.01039
Haiku 4.5 $0.00002 $0.00520

Measured 1mo ago against content hash f31035c2637b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sinatra-test 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 1mo 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.

plugins/ruby-sinatra-advanced/commands/sinatra-test.md · 861 lines

How it starts

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

Sinatra Test Command

Generates comprehensive test suites for Sinatra applications including route tests, middleware tests, helper tests, and integration tests using RSpec or Minitest.

Arguments

  • $1: test-type (optional) - Type of tests to generate: routes, middleware, helpers, or all (default: all)
  • $2: framework (optional) - Testing framework: rspec or minitest (default: rspec)

Usage Examples

# Generate all tests using RSpec
/sinatra-test

# Generate only route tests with RSpec
/sinatra-test routes

# Generate all tests using Minitest
/sinatra-test all minitest

# Generate middleware tests with Minitest
/sinatra-test middleware minitest

# Generate helper tests with RSpec
/sinatra-test helpers rspec

Workflow

Step 1: Analyze Application Structure

Discovery Phase:

  1. Identify application type (classic vs modular)
  2. Locate controller files
  3. Extract route definitions
  4. Find middleware stack
  5. Identify helper methods
  6. Check existing test structure
  7. Detect testing framework if already configured

Files to Analyze:

# Controllers
app/controllers/**/*.rb
app.rb (classic style)

# Middleware
config.ru
config/**/*.rb

# Helpers
app/helpers/**/*.rb
helpers/ directory

# Existing tests
spec/**/*_spec.rb
test/**/*_test.rb

Route Extraction:

# Parse routes from controller files
# Identify: HTTP method, path, parameters, conditions

# Example routes to extract:
get '/users' do
  # Handler
end

get '/users/:id', :id => /\d+/ do
  # Handler with constraint
end

post '/users', :provides => [:json] do
  # Handler with content negotiation
end

Step 2: Generate Test Structure (RSpec)

Create spec_helper.rb if missing:

# spec/spec_helper.rb
ENV['RACK_ENV'] = 'test'

require 'simplecov'
SimpleCov.start do
  add_filter '/spec/'
  add_filter '/config/'
end

require_relative '../config/environment'
require 'rack/test'
require 'rspec'
require 'json'

# Database setup (if applicable)
if defined?(Sequel)
  require 'database_cleaner/sequel'

  RSpec.configure do |config|
    config.before(:suite) do
      DatabaseCleaner.strategy = :transaction
      DatabaseCleaner.clean_with(:truncation)
    end

    config.around(:each) do |example|
      DatabaseCleaner.cleaning do
        example.run
      end
    end
  end
end

RSpec.configure do |config|
  config.include Rack::Test::Methods

  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.shared_context_metadata_behavior = :apply_to_host_groups
  config.filter_run_when_matching :focus
  config.example_status_persistence_file_path = 'spec/examples.txt'
  config.disable_monkey_patching!
  config.warnings = true
  config.order = :random
  Kernel.srand config.seed
end

# Helper methods for all specs
module SpecHelpers
  def json_response
    JSON.parse(last_response.body)
  end

  def auth_header(token)
    { 'HTTP_AUTHORIZATION' => "Bearer #{token}" }
  end
end

RSpec.configure do |config|
  config.include SpecHelpers
end

Read the full file on GitHub · 861 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. 1mo ago First seen · 861 lines · 18 tokens per session scan A f31035c2637b

Subscribe to this mod's changes

sinatra-test is a command published in the GitHub repository geoffjay/claude-plugins (8 stars, last pushed 11mo ago), licensed MIT. It adds 18 tokens to every session and 5,196 once invoked, about $0.0001 per session on Opus 5.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-31.