testing-patterns

testing-patterns is a skill for Claude Code, Codex from ThibautBaissac/rails_ai_agents. It costs 77 tokens per session (1,375 once invoked), scanned A, original, MIT.

A set of Rails testing instructions using Minitest, a Ruby testing library, and fixtures, which are predefined test records.

In plain words
What is it for?
It helps write model, controller, integration, system, and fixture-based tests for Rails applications.
Why use it?
It prevents tests from drifting into the wrong style by specifying which test tools, data setup, and test layers to use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps write model, controller, integration, system, and fixture-based tests for Rails applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thibautbaissac/rails_ai_agents/testing-patterns
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.

Any agent
npx skills add ThibautBaissac/rails_ai_agents --skill testing-patterns
Clone the repo
git clone --depth 1 https://github.com/ThibautBaissac/rails_ai_agents

Made for: Claude Code, Codex.

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 testing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/thibautbaissac/rails_ai_agents/testing-patterns/github.svg)](https://agentmods.dev/skills/thibautbaissac/rails_ai_agents/testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/thibautbaissac/rails_ai_agents/testing-patterns"><img src="https://agentmods.dev/badge/skills/thibautbaissac/rails_ai_agents/testing-patterns/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 testing-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/thibautbaissac/rails_ai_agents/testing-patterns"><img src="https://agentmods.dev/badge/skills/thibautbaissac/rails_ai_agents/testing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,375 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00077 $0.01375
Opus 5 $0.00039 $0.00687
Sonnet 5 $0.00015 $0.00275
Haiku 4.5 $0.00008 $0.00137

Measured 8d ago against content hash b46bcdfc137a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

testing-patterns 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 8d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude_37signals/skills/testing-patterns/SKILL.md · 211 lines

How it starts

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

You are an expert Rails testing architect specializing in Minitest with fixtures.

Your role

  • Write tests using Minitest, never RSpec
  • Use fixtures for test data, never factories (FactoryBot)
  • Write integration tests over unit tests when possible
  • Output: Fast, readable tests that verify behavior, not implementation

Core philosophy

Minitest is plenty. Fixtures are faster.

Why Minitest: Plain Ruby (no DSL), faster suite, simpler setup, part of Rails, easier to debug.

Why fixtures: 10-100x faster (loaded once), shared consistency, force realistic data, no factory DSL.

Test pyramid:

  • Few system tests (Capybara, full browser)
  • Many integration tests (controller + model)
  • Some unit tests (complex model logic only)

Project knowledge

Tech Stack: Minitest 5.20+, Rails 8.2, YAML fixtures Location: test/models/, test/controllers/, test/system/, test/integration/

Commands

  • bin/rails test -- Full suite
  • bin/rails test test/models/card_test.rb -- Specific file
  • bin/rails test test/models/card_test.rb:14 -- Specific line
  • bin/rails test:system -- System tests
  • bin/rails test:parallel -- Parallel execution

Model test structure

require "test_helper"

class CardTest < ActiveSupport::TestCase
  setup do
    @card = cards(:logo)
    @user = users(:david)
    Current.user = @user
    Current.account = @card.account
  end

  teardown do
    Current.reset
  end

  test "fixtures are valid" do
    assert @card.valid?
  end

  test "closing card creates closure record" do
    assert_difference -> { Closure.count }, 1 do
      @card.close(user: @user)
    end
    assert @card.closed?
    assert_equal @user, @card.closed_by
  end

  test "open scope excludes closed cards" do
    @card.close
    assert_not_includes Card.open, @card
    assert_includes Card.closed, @card
  end
end

Integration test structure

require "test_helper"

class CardsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @card = cards(:logo)
    sign_in_as users(:david)
  end

  test "should create card" do
    assert_difference -> { Card.count }, 1 do
      post board_cards_path(@card.board), params: {
        card: { title: "New card", column_id: @card.column_id }
      }
    end
    assert_redirected_to card_path(Card.last)
  end

  test "requires authentication" do
    sign_out
    get card_path(@card)
    assert_redirected_to new_session_path
  end
end

Read the full file on GitHub · 211 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 211 lines · 77 tokens per session scan A b46bcdfc137a

Subscribe to this mod's changes

testing-patterns is a skill published in the GitHub repository ThibautBaissac/rails_ai_agents (661 stars, last pushed 3mo ago), licensed MIT. It adds 77 tokens to every session and 1,375 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

server-side-calls

Call tRPC procedures directly from server code using t.createCallerFactory() and router.createCaller(context) for integration testing, internal server logic, and custom API endpoints. Catch TRPCError and extract HTTP status with getHTTPStatusCodeFromError(). Error handling via onError option.

trpc/trpc · 61 tokens

mem0-test-integration

Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate…

mem0ai/mem0 · 207 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

python-sdk

Implement or modify Python SDK behavior under python/composio, including tools, toolkits, sessions, auth configs, connected accounts, client integration, and shared Python models. Use for Python core runtime/API work; pair with python-testing and cross-sdk-parity when TypeScript must match.

ComposioHQ/composio · 60 tokens

convex-test

Generate convex-test tests for the app's Convex functions.

openclaw/clawhub · 16 tokens

voiden

Create and edit Voiden .void files for API testing. Covers the .void file format and all enabled extension block types.

VoidenHQ/voiden · 28 tokens