test-generate

test-generate is a skill for Claude Code from hamr0/liteagents. It costs 11 tokens per session (787 once invoked), scanned A, original, Apache-2.0.

A test-generation workflow that studies the project's existing test setup, writes tests for a specified file, runs them, and reports the result. It covers normal cases, edge cases, and failures without adding a new test framework.

In plain words
What is it for?
Use it to add tests for existing code and verify them with the repository's own test command.
Why use it?
It avoids mismatched tests and catches problems that tests for only the expected path would miss.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to add tests for existing code and verify them with the repository's own test command.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamr0/liteagents/test-generate
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 hamr0/liteagents --skill test-generate
Clone the repo
git clone --depth 1 https://github.com/hamr0/liteagents

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamr0/liteagents/test-generate/github.svg)](https://agentmods.dev/skills/hamr0/liteagents/test-generate)
Your own site
<a href="https://agentmods.dev/skills/hamr0/liteagents/test-generate"><img src="https://agentmods.dev/badge/skills/hamr0/liteagents/test-generate/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-generate

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamr0/liteagents/test-generate"><img src="https://agentmods.dev/badge/skills/hamr0/liteagents/test-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 787 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.00011 $0.00787
Opus 5.5 $0.00004 $0.00315
Sonnet 5.5 $0.00002 $0.00157
Haiku 4.5 $0.00001 $0.00079

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

Security

Grade A, and why

test-generate 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

packages/ampcode/skills/test-generate/SKILL.md · 73 lines

How it starts

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

Generate tests for $ARGUMENTS, then run them. This is a generate → run → verify loop, not just file generation.

1. Discover

  • Detect the test framework already in use (look for jest.config*, vitest.config*, pytest.ini / pyproject.toml [tool.pytest], Go's _test.go convention, Cargo.toml [dev-dependencies], etc.). Never add a new framework or runner.
  • Skim 1–2 existing test files near the target to mirror style, fixtures, setup/teardown, assertion style, and naming convention.

2. Generate

Cover:

  • Happy path (expected usage)
  • Edges (empty / null / boundary / malformed)
  • Errors (invalid input, IO / network / DB failures)

Match existing patterns:

  • Same framework, same fixture style, same naming convention.
  • Reuse existing setup/teardown helpers; do not add new mock libraries or new test-runner config.
  • Do not add test-only public methods or exports to production code to make a test possible — if the test wants a hook the prod code doesn't expose, stop and ask.

3. Run

Execute the project's real test command, scoped to just the new tests (-t <name>, --testPathPattern, pytest path/to/test.py, go test ./pkg, etc.). Report:

  • Pass / fail counts.
  • Any failure with the assertion message and file:line.

4. Verify the tests BITE

A test that passes is not the same as a test that exercises the code. For each new test, confirm:

  • It would fail if the function under test returned the wrong value. Actually make the mutation (break the impl, or swap the return value), run the test, and see it go red — then restore the code.
  • It isn't expect(true).toBe(true), expect(fn).toBeDefined(), or a mock asserting itself.
  • It isn't passing only because the setup masked the real call.

Mark each new test biting or superficial (with reason), one line per test, filled from the run:

broken-by: <mutation made> → red: <test name> | NOT RUN: <reason>

Superficial tests count as a failure to ship — either fix or delete.

Read the full file on GitHub · 73 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 Changed · +5 lines cbe5187fa937
  2. 2mo ago First seen · 68 lines · 11 tokens per session scan A 6696cdf94880

Subscribe to this mod's changes

test-generate is a skill published in the GitHub repository hamr0/liteagents (28 stars, last pushed 3d ago), licensed Apache-2.0. It adds 11 tokens to every session and 787 once invoked, about $0.0000 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-09-05.

Related

test-generate compared with skills from other repositories

test-generate next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-generatehamr0/liteagentsSkill283d agoApache-2.0A11Claude Code
seats-aeroborski/travel-hacking-toolkitSkill1.1k7d agoMITA78Claude Code
round-the-worldborski/travel-hacking-toolkitSkill1.1k7d agoMITA51Claude Code
scandinavia-transitborski/travel-hacking-toolkitSkill1.1k7d agoMITA49Claude Code
ticketsatworkborski/travel-hacking-toolkitSkill1.1k7d agoMITA50Claude Code
amex-travelborski/travel-hacking-toolkitSkill1.1k7d agoMITA47Claude Code
biltborski/travel-hacking-toolkitSkill1.1k7d agoMITA44Claude Code