test-generator

test-generator is a skill for Claude Code from asgarovf/locusai. It costs 33 tokens per session (1,186 once invoked), scanned A, original, MIT.

A guide for generating unit tests, integration tests, and end-to-end tests. These test different parts of a program, its connected parts, and complete user flows.

In plain words
What is it for?
Use it for new features, missing test coverage, edge-case checks, improving existing tests, or setting up a test suite from scratch.
Why use it?
It helps add meaningful coverage by first checking the project's test setup, reading the code, and considering errors and edge cases.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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 skills/asgarovf/locusai/test-generator
Any agent
npx skills add asgarovf/locusai --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/asgarovf/locusai

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/asgarovf/locusai/test-generator.svg)](https://agentmods.dev/skills/asgarovf/locusai/test-generator)
Your own site
<a href="https://agentmods.dev/skills/asgarovf/locusai/test-generator"><img src="https://agentmods.dev/badge/skills/asgarovf/locusai/test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,186 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.00033 $0.01186
Opus 5 $0.00016 $0.00593
Sonnet 5 $0.00007 $0.00237
Haiku 4.5 $0.00003 $0.00119

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

Security

Grade A, and why

test-generator 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 6d 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-generator/SKILL.md · 168 lines

How it starts

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

Test Generator

When to use this skill

  • Adding test coverage to existing code
  • Writing tests for a new feature
  • Generating edge case tests
  • Setting up a test suite from scratch
  • Improving test quality or coverage

Step 1: Understand the testing environment

Before writing tests, identify the project's test setup:

# Check for test config files
ls jest.config* vitest.config* pytest.ini setup.cfg pyproject.toml .mocharc* 2>/dev/null

# Check package.json test scripts
grep -A 5 '"test"' package.json

# Find existing test files for patterns
find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" | head -20

Step 2: Read the source code

Read the code you're testing thoroughly:

  • Inputs: What parameters does the function accept?
  • Outputs: What does it return or produce?
  • Side effects: Does it write to DB, call APIs, modify state?
  • Error paths: When does it throw or return errors?
  • Edge cases: Empty inputs, null, boundaries, concurrency

Step 3: Write tests following existing patterns

Test structure (Arrange-Act-Assert)

// TypeScript/Jest/Vitest
describe('calculateDiscount', () => {
  it('should apply percentage discount to total', () => {
    // Arrange
    const items = [{ price: 100 }, { price: 50 }];
    const discountPercent = 10;

    // Act
    const result = calculateDiscount(items, discountPercent);

    // Assert
    expect(result).toBe(135);
  });

  it('should return original total when discount is 0', () => {
    const items = [{ price: 100 }];
    expect(calculateDiscount(items, 0)).toBe(100);
  });

  it('should throw when discount exceeds 100%', () => {
    expect(() => calculateDiscount([{ price: 100 }], 150))
      .toThrow('Discount cannot exceed 100%');
  });
});
# Python/pytest
class TestCalculateDiscount:
    def test_applies_percentage_discount(self):
        items = [{"price": 100}, {"price": 50}]
        assert calculate_discount(items, 10) == 135

    def test_zero_discount_returns_original(self):
        items = [{"price": 100}]
        assert calculate_discount(items, 0) == 100

    def test_raises_on_excessive_discount(self):
        with pytest.raises(ValueError, match="cannot exceed 100%"):
            calculate_discount([{"price": 100}], 150)

Read the full file on GitHub · 168 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. 6d ago First seen · 168 lines · 33 tokens per session scan A 006e7509c702

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository asgarovf/locusai (23 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 1,186 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.