test

test is a command for Claude Code from TheDecipherist/claude-code-mastery. It costs 14 tokens per session (654 once invoked), scanned A, original, MIT.

A command that creates tests for specified code, including unit tests, integration tests, and edge-case tests. It detects common test tools such as Vitest, Jest, Pytest, and Go testing.

In plain words
What is it for?
Use it with a file, function, or recently changed code to generate tests, optionally focused on unit tests, integration tests, edge cases, or coverage.
Why use it?
It saves time identifying what should be tested and which test style the project already uses. It covers normal inputs, boundaries, errors, side effects, and dependencies.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it with a file, function, or recently changed code to generate tests, optionally focused on unit tests, integration tests, edge cases, or coverage.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thedecipherist/claude-code-mastery/test
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.

Clone the repo
git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery

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 test

README.md
[![agentmods](https://agentmods.dev/badge/commands/thedecipherist/claude-code-mastery/test/github.svg)](https://agentmods.dev/commands/thedecipherist/claude-code-mastery/test)
Your own site
<a href="https://agentmods.dev/commands/thedecipherist/claude-code-mastery/test"><img src="https://agentmods.dev/badge/commands/thedecipherist/claude-code-mastery/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 test

Your own site · 80×15
<a href="https://agentmods.dev/commands/thedecipherist/claude-code-mastery/test"><img src="https://agentmods.dev/badge/commands/thedecipherist/claude-code-mastery/test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 654 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.00014 $0.00654
Opus 5.5 $0.00006 $0.00262
Sonnet 5.5 $0.00003 $0.00131
Haiku 4.5 $0.00001 $0.00065

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

Security

Grade A, and why

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 3mo 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.

commands/test.md · 119 lines

How it starts

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

Generate Tests

Generate comprehensive tests for the specified code.

Input

The user will provide one of:

  • A file path: /test src/utils/validators.ts
  • A function name: /test validateEmail
  • Just /test — generate tests for recently changed files

Optional flags via $ARGUMENTS:

  • --unit — unit tests only (default)
  • --integration — integration tests
  • --edge — focus on edge cases
  • --coverage — aim for high coverage

Process

1. Detect Test Framework

Check the project for:

  • vitest.config.* → Vitest
  • jest.config.* → Jest
  • *.test.ts patterns → Match existing style
  • pytest.ini or conftest.py → Pytest
  • go.mod → Go testing

If unclear, ask the user.

2. Analyze the Code

Identify:

  • Public functions/methods to test
  • Input types and valid ranges
  • Expected outputs
  • Error conditions
  • Side effects (mocking needed?)
  • Dependencies (what to mock?)

3. Generate Test Cases

For each function, create tests for:

Happy Path

  • Normal input → expected output
  • Common use cases

Edge Cases

  • Empty input ([], "", null, undefined)
  • Boundary values (0, -1, MAX_INT)
  • Single element collections
  • Very large inputs

Error Cases

  • Invalid input types
  • Out of range values
  • Missing required fields
  • Network/IO failures (if applicable)

4. Test Structure

Follow AAA pattern:

describe('functionName', () => {
  it('should return X when given Y', () => {
    // Arrange
    const input = { ... };

    // Act
    const result = functionName(input);

    // Assert
    expect(result).toEqual(expected);
  });
});

5. Naming Convention

Test names should be readable as sentences:

  • should return empty array when input is empty
  • should throw ValidationError when email is invalid
  • should call API once per unique user

NOT:

  • test1
  • works
  • validateEmail test

Output

  1. Create test file at conventional location:
    • src/foo.ts → src/foo.test.ts or __tests__/foo.test.ts
    • foo.py → test_foo.py or tests/test_foo.py

Read the full file on GitHub · 119 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. 3mo ago First seen · 119 lines · 14 tokens per session scan A 98d947e5c479

Subscribe to this mod's changes

test is a command published in the GitHub repository TheDecipherist/claude-code-mastery (560 stars, last pushed 6mo ago), licensed MIT. It adds 14 tokens to every session and 654 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-30.

Related

test compared with commands from other repositories

test next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testTheDecipherist/claude-code-masteryCommand5606mo agoMITA14Claude Code
test-coverageaffaan-m/ECCCommand313k7d agoMITA5Claude Code, OpenCode
test-suitetravisjneuman/.claudeCommand115yesterdayMITA7Claude Code
refactor-sprintsifxprime/kodelyth-eccCommand12todayMITA32Claude Code
test-coveragesangrokjung/claude-forgeCommand8862mo agoMITA14Claude Code
test-genhalflength-ampleness75/claude-code-recipesCommand31mo agoMITA13Claude Code
dare-laravel-apidewtech-technologies/dare-methodCommand54mo agoMITA0Claude Code