test-service

test-service is a skill for Claude Code, Codex from igmarin/rails-agent-skills. It costs 36 tokens per session (1,416 once invoked), scanned A, original, MIT.

A guide for writing RSpec tests for Ruby service objects, which are classes that perform a focused application task. It defines how to test the public `.call` method, including normal, error, and edge cases.

In plain words
What is it for?
Use it to create service specs, isolate collaborators, test database-backed behavior, check time-dependent code, and run the relevant RSpec suite.
Why use it?
It makes the expected behavior explicit before implementation and helps catch regressions in service code.

Skill for Claude CodeCodex

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

Good fit Use it to create service specs, isolate collaborators, test database-backed behavior, check time-dependent code, and run the relevant RSpec suite.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/igmarin/rails-agent-skills/test-service
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 igmarin/rails-agent-skills --skill test-service
Clone the repo
git clone --depth 1 https://github.com/igmarin/rails-agent-skills

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/igmarin/rails-agent-skills/test-service/github.svg)](https://agentmods.dev/skills/igmarin/rails-agent-skills/test-service)
Your own site
<a href="https://agentmods.dev/skills/igmarin/rails-agent-skills/test-service"><img src="https://agentmods.dev/badge/skills/igmarin/rails-agent-skills/test-service/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 test-service

Your own site · 80×15
<a href="https://agentmods.dev/skills/igmarin/rails-agent-skills/test-service"><img src="https://agentmods.dev/badge/skills/igmarin/rails-agent-skills/test-service.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,416 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.00036 $0.01416
Opus 5 $0.00018 $0.00708
Sonnet 5 $0.00007 $0.00283
Haiku 4.5 $0.00004 $0.00142

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

Security

Grade A, and why

test-service 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 10d 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.

skills/test-service/SKILL.md · 182 lines

How it starts

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

Test Service

Quick Reference

Aspect Rule
File location spec/services/module_name/service_spec.rb
Subject subject(:service_call) { described_class.call(params) }
Unit isolation instance_double for collaborators
Integration create for DB-backed tests
Multi-assertion aggregate_failures
State verification change matchers
Time-dependent travel_to
API responses FactoryBot hash factories (class: Hash)

HARD-GATE

DO NOT implement the service before step 1 is written and failing for the right reason.
1. WRITE:   Write the spec (happy path + error cases + edge cases)
2. RUN:     bundle exec rspec spec/services/your_service_spec.rb
3. VERIFY:  Confirm failures are for the right reason (not a typo or missing factory)
4. FIX:     Implement or fix until the spec passes
5. SUITE:   bundle exec rspec spec/services/ — verify no regressions

Core Process

Spec Template

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ModuleName::MainService do
  describe '.call' do
    subject(:service_call) { described_class.call(params) }

    let(:shelter) { create(:shelter, :with_animals) }
    let(:params) do
      { shelter: { shelter_id: shelter.id }, items: %w[TAG001 TAG002] }
    end

    context 'when input is valid' do
      before { create(:animal, tag_number: 'TAG001', shelter:) }

      it 'returns success' do
        expect(service_call[:success]).to be true
      end
    end

    context 'when shelter is not found' do
      let(:params) { super().merge(shelter: { shelter_id: 999_999 }) }

      it 'returns error response' do
        expect(service_call[:success]).to be false
      end
    end

    context 'when input is blank' do
      let(:params) { { shelter: { shelter_id: nil }, items: [] } }

      it 'returns error response with meaningful message' do
        aggregate_failures do
          expect(service_call[:success]).to be false
          expect(service_call[:errors]).not_to be_empty
        end
      end
    end
  end
end

Read the full file on GitHub · 182 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. 10d ago First seen · 182 lines · 36 tokens per session scan A ceceb8d734a6

Subscribe to this mod's changes

test-service is a skill published in the GitHub repository igmarin/rails-agent-skills (25 stars, last pushed 19d ago), licensed MIT. It adds 36 tokens to every session and 1,416 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

rspec-conventions

Rootstrap RSpec conventions. Use when writing, reviewing, or editing RSpec test files (spec//spec.rb, spec/railshelper.rb, spec/spechelper.rb, spec/support//.rb) or factories. Covers describe/context structure, let/subject, matchers, factories, mocking/stubbing, shared examples, and spec types (model, request…

rootstrap/rails_api_base · 82 tokens

rspec

RSpec testing best practices for Ruby and Rails applications, covering test organization, data management, and isolation patterns.

Mindrally/skills · 24 tokens

ruby

Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.

Mindrally/skills · 32 tokens

testunit-skill

Generates Test::Unit tests in Ruby. Classic xUnit-style testing with assert methods and test case classes. Use when user mentions "Test::Unit", "assertequal Ruby", "Ruby test-unit". Triggers on: "Test::Unit", "Ruby test-unit", "assertequal Ruby" (not RSpec).

LambdaTest/agent-skills · 70 tokens

rspec

This skill should be used when the user asks to "write specs", "create spec", "add RSpec tests", "fix failing spec", or mentions RSpec, describe blocks, it blocks, expect syntax, test doubles, or matchers. Should also be used when editing spec.rb files, working in spec/ directory, planning implementation phases that…

hoblin/claude-ruby-marketplace · 125 tokens

rails-testing

Ruby on Rails testing best practices for writing effective, maintainable test suites with RSpec. This skill should be used when writing, reviewing, or refactoring Rails tests to ensure proper test design, data management, and coverage patterns. Triggers on tasks involving RSpec specs, model tests, request specs…

pproenca/dot-skills · 103 tokens