test-gen

test-gen is an agent for coding agents from cveralyon/axel-setup. It costs 19 tokens per session (430 once invoked), scanned A, original, MIT.

A test-spec generator that examines a file or feature and proposes tests for normal behavior, edge cases, errors, state changes, permissions, and side effects. It supports Rails RSpec projects and JavaScript or TypeScript projects using Jest or Vitest.

In plain words
What is it for?
Use it to create test specifications for models, API requests, services, components, or bug fixes.
Why use it?
It helps reveal untested behavior and gives you a structured test plan based on the code and the project’s existing testing patterns.

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/cveralyon/axel-setup/test-gen
Clone the repo
git clone --depth 1 https://github.com/cveralyon/axel-setup

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-gen

README.md
[![agentmods](https://agentmods.dev/badge/agents/cveralyon/axel-setup/test-gen.svg)](https://agentmods.dev/agents/cveralyon/axel-setup/test-gen)
Your own site
<a href="https://agentmods.dev/agents/cveralyon/axel-setup/test-gen"><img src="https://agentmods.dev/badge/agents/cveralyon/axel-setup/test-gen.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 430 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.00019 $0.00430
Opus 5 $0.00010 $0.00215
Sonnet 5 $0.00004 $0.00086
Haiku 4.5 $0.00002 $0.00043

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

Security

Grade A, and why

test-gen 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 3d 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.

agents/test-gen.md · 40 lines

What it actually says

Generate thorough test specs for a given file, feature, or bug fix.

Step 1: Analyze the target

  • Read the file(s) to test
  • Identify: public methods, input variations, dependencies, side effects, error paths
  • Check existing specs for patterns: ls spec/ or search for similar test files

Step 2: Plan test cases

For each public method/endpoint/component:

  • Happy path — normal expected usage
  • Edge cases — empty inputs, nil/null, boundary values, large datasets, special characters
  • Error cases — invalid inputs, missing associations, unauthorized access, network failures
  • State transitions — if AASM states involved, test each valid transition and reject invalid ones
  • Authorization — if Pundit policies, test each role (admin, manager, recruiter, freelance)

Step 3: Generate specs

Rails (RSpec):

  • Model specs: validations, associations, scopes, instance methods
  • Request specs: HTTP status, response body, side effects (DB changes, jobs enqueued)
  • Service specs: input/output, error handling, external service mocking
  • Follow describe/context/it nesting. Use let/let! for setup
  • Use FactoryBot if factories exist, otherwise build/create directly

Next.js (when Vitest is set up):

  • Component tests: renders correctly, user interactions, loading/error states
  • Hook tests: query behavior, mutation side effects, cache invalidation
  • Use accessible queries: getByRole, getByText, getByLabelText

Step 4: Run and verify

  • Run the generated specs
  • Fix any failures from incorrect assumptions
  • Report coverage: what's tested, what's intentionally skipped and why
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. 3d ago First seen · 40 lines · 19 tokens per session scan A c07925ecb267

Subscribe to this mod's changes

test-gen is an agent published in the GitHub repository cveralyon/axel-setup (4 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 430 once invoked, about $0.0001 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-31.