test

test is a command for Claude Code from dachivadachkoria/claude-code-starter-kit. It costs 20 tokens per session (741 once invoked), scanned A, original, MIT.

A command that generates unit tests—small tests for individual functions or classes—from source files.

In plain words
What is it for?
Use it for a specific file, recently changed files, or staged files, while following the project’s existing testing conventions.
Why use it?
It helps cover normal inputs, edge cases, errors, and asynchronous behavior without writing every test by hand.

Command for Claude Code

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/dachivadachkoria/claude-code-starter-kit/test
Clone the repo
git clone --depth 1 https://github.com/dachivadachkoria/claude-code-starter-kit

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/dachivadachkoria/claude-code-starter-kit/test.svg)](https://agentmods.dev/commands/dachivadachkoria/claude-code-starter-kit/test)
Your own site
<a href="https://agentmods.dev/commands/dachivadachkoria/claude-code-starter-kit/test"><img src="https://agentmods.dev/badge/commands/dachivadachkoria/claude-code-starter-kit/test.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 741 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.00020 $0.00741
Opus 5 $0.00010 $0.00370
Sonnet 5 $0.00004 $0.00148
Haiku 4.5 $0.00002 $0.00074

Measured 3d ago against content hash d35588925eec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

.claude/commands/test.md · 134 lines

How it starts

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

Unit Test Generation

Generate comprehensive unit tests for: $ARGUMENTS

Execution Flow

Step 1: Determine Target Files

If $ARGUMENTS contains a file path:

  • Test that specific file

If $ARGUMENTS is --changed or empty:

  • Run: git diff --name-only HEAD~1 | grep -E '\.(py|js|ts|go)$'
  • Test all changed source files

If $ARGUMENTS is --staged:

  • Run: git diff --cached --name-only | grep -E '\.(py|js|ts|go)$'
  • Test all staged files

Step 2: Analyze Source Code

For each target file:

  1. Read the entire file
  2. Identify all public functions/methods/classes
  3. Note dependencies and imports
  4. Check for existing tests

Step 3: Generate Tests

For each function/method, create tests for:

Happy Path

  • Normal inputs → expected outputs
  • Multiple valid input variations

Edge Cases

  • Empty inputs (null, empty string, empty array)
  • Boundary values (0, -1, MAX_INT)
  • Single element collections

Error Handling

  • Invalid inputs
  • Exception scenarios
  • Network/IO failures (mocked)

Async Behavior (if applicable)

  • Successful async operations
  • Timeout handling
  • Concurrent execution

Step 4: Apply Project Conventions

Read CLAUDE.md and existing tests to match:

  • Naming conventions
  • File structure
  • Assertion style
  • Mocking patterns
  • Fixture usage

Step 5: Write and Verify

  1. Create test file in appropriate location
  2. Run the new tests
  3. Fix any failures
  4. Report coverage delta

Output Format

📁 Generated: tests/test_<module>.py
✅ Tests: 12 passed
📊 Coverage: 87% (+15%)

Language-Specific Patterns

Python (pytest)

import pytest
from unittest.mock import Mock, patch

class TestClassName:
    def test_method_success_returns_expected(self):
        # Arrange
        ...
        # Act
        result = function_under_test(input)
        # Assert
        assert result == expected

JavaScript/TypeScript (jest)

describe('ClassName', () => {
  describe('methodName', () => {
    it('should return expected when given valid input', () => {
      // Arrange
      ...
      // Act
      const result = functionUnderTest(input);
      // Assert
      expect(result).toEqual(expected);
    });
  });
});

Read the full file on GitHub · 134 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. 3d ago First seen · 134 lines · 20 tokens per session scan A d35588925eec

Subscribe to this mod's changes

test is a command published in the GitHub repository dachivadachkoria/claude-code-starter-kit (4 stars, last pushed 5mo ago), licensed MIT. It adds 20 tokens to every session and 741 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.