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.

Good fit Use it for new features, missing test coverage, edge-case checks, improving existing tests, or setting up a test suite from scratch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asgarovf/locusai/test-generator
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.

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/github.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/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-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/asgarovf/locusai/test-generator"><img src="https://agentmods.dev/badge/skills/asgarovf/locusai/test-generator.svg" alt="Reviewed on agentmods" width="80" 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. 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.00033 $0.01186
Opus 5.5 $0.00013 $0.00474
Sonnet 5.5 $0.00007 $0.00237
Haiku 4.5 $0.00003 $0.00119

Measured 1mo ago against content hash 006e7509c702, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 7mo ago), licensed MIT. It adds 33 tokens to every session and 1,186 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

Other skills, from other repositories

automacao-de-testes

Automação de testes: unitários (Jest, Pytest), integração (supertest, httpx) e E2E com Playwright. Inclui estratégia de pirâmide de testes, cobertura mínima, CI/CD integration e testes para contexto brasileiro (CPF, CNPJ, CEP, PIX).

ricneves-ai/flowgrammers-skills · 67 tokens

testing-expert

Expert-level software testing with unit tests, integration tests, E2E tests, TDD/BDD, and testing best practices. Use when the user mentions TDD, BDD, unit tests, integration tests, or end-to-end tests, or when the task involves Testing Fundamentals, Unit Testing, Integration Testing, or End-to-End Testing.

personamanagmentlayer/pcl · 73 tokens

test-generator

A skill for creating unit tests, generating mock data or objects, and analysing test coverage. Unit tests check small parts of a program in isolation.

chainlesschain/chainlesschain · 18 tokens

Test Engineer

Creates or completes a medium-coverage test suite: unit, component, and critical e2e flows.

Tariux/AI-Skills-Not-Awesome · 24 tokens

Code Coverage Analysis

Measure and enforce test coverage with Istanbul/nyc, c8, Jest, and Vitest. Covers branch versus line coverage, per-directory thresholds, CI gates, and correctly excluding generated code from reports.

PramodDutta/qaskills · 45 tokens

vue-component-testing

Applies the three-tier test taxonomy for Vue 3 applications: writes unit tests for composables and Pinia stores with Vitest, component tests for behaviour and user interactions with @testing-library/vue, and acceptance tests for full user flows with Playwright. Ensures tests focus on observable behaviour, not…

soulcodex/agentic · 79 tokens