generate-tests

generate-tests is a command for Claude Code from oxygen-fragment/claude-modular. It costs 0 tokens per session (626 once invoked), scanned A, original, MIT.

A command that generates unit, integration, and end-to-end tests from existing code patterns. Unit tests check small pieces, while end-to-end tests check complete user workflows.

In plain words
What is it for?
Use it to plan testing, create tests for functions and APIs, verify databases and external services, test user journeys, and set up fixtures and test utilities.
Why use it?
It reduces the effort of building a broad test suite and helps cover normal cases, failures, boundaries, and dependencies.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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 commands/oxygen-fragment/claude-modular/generate-tests
Clone the repo
git clone --depth 1 https://github.com/oxygen-fragment/claude-modular

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 generate-tests

README.md
[![agentmods](https://agentmods.dev/badge/commands/oxygen-fragment/claude-modular/generate-tests.svg)](https://agentmods.dev/commands/oxygen-fragment/claude-modular/generate-tests)
Your own site
<a href="https://agentmods.dev/commands/oxygen-fragment/claude-modular/generate-tests"><img src="https://agentmods.dev/badge/commands/oxygen-fragment/claude-modular/generate-tests.svg" alt="Measured on agentmods" height="20"></a>
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 626 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.1 $0.00000 $0.00626
Opus 5 $0.00000 $0.00313
Sonnet 5 $0.00000 $0.00125
Haiku 4.5 $0.00000 $0.00063

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

Security

Grade A, and why

generate-tests 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 7d 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.

.claude/commands/testing/generate-tests.md · 97 lines

What it actually says

Generate Tests Command

2. **Test Strategy Planning**
   - Determine test types needed (unit, integration, e2e)
   - Identify testing boundaries and isolation points
   - Plan mock strategies for dependencies
   - Define test data requirements

3. **Unit Test Generation**
   - Generate tests for individual functions
   - Create positive and negative test cases
   - Add boundary condition testing
   - Include error handling verification

4. **Integration Test Creation**
   - Test component interactions
   - Verify API contract compliance
   - Test database operations
   - Validate external service integration

5. **End-to-End Test Development**
   - Create user journey tests
   - Test complete workflows
   - Validate UI interactions
   - Test cross-browser compatibility

6. **Test Infrastructure**
   - Set up test fixtures and data
   - Configure test environment
   - Create test utilities and helpers
   - Set up continuous testing
# Generated test types:
# - Unit tests for new functions
# - Integration tests for API changes
# - Updated existing test suites
# - Test data and fixtures
```

```bash
# Generate tests for specific module
/test:generate-tests --module=user-service

# Comprehensive module testing:
# - All service methods tested
# - Database interaction tests
# - External API integration tests
# - Error handling scenarios
```

```bash
# Generate specific test types
/test:generate-tests --types=unit,integration

# Focused test generation:
# - Unit tests only
# - Integration tests only
# - Custom test combinations
```
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. 7d ago First seen · 97 lines · 0 tokens per session scan A 6e83e7bbdefe

Subscribe to this mod's changes

generate-tests is a command published in the GitHub repository oxygen-fragment/claude-modular (283 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 626 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.