write-tests

write-tests is a skill for Claude Code, Codex from kavo-labs/kavo. It costs 59 tokens per session (1,283 once invoked), scanned A, original, Apache-2.0.

A guide for writing tests in the Kavo monorepo, a repository containing several related packages. It covers where tests belong, how the test tools are configured, and which shared fixtures to reuse.

In plain words
What is it for?
Use it when adding or changing tests in Kavo's core, TypeORM, or Nest packages, including running the full suite, one file, or one test by name.
Why use it?
It prevents tests from being placed in shipped code and helps them run against the real package setup, including framework metadata.

Skill for Claude CodeCodex

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/kavo-labs/kavo/write-tests
Any agent
npx skills add kavo-labs/kavo --skill write-tests
Clone the repo
git clone --depth 1 https://github.com/kavo-labs/kavo

Made for: Claude Code, Codex.

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 write-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/kavo-labs/kavo/write-tests.svg)](https://agentmods.dev/skills/kavo-labs/kavo/write-tests)
Your own site
<a href="https://agentmods.dev/skills/kavo-labs/kavo/write-tests"><img src="https://agentmods.dev/badge/skills/kavo-labs/kavo/write-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,283 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.00059 $0.01283
Opus 5 $0.00030 $0.00642
Sonnet 5 $0.00012 $0.00257
Haiku 4.5 $0.00006 $0.00128

Measured 3d ago against content hash 8cbad024ef6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

write-tests 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/skills/write-tests/SKILL.md · 110 lines

How it starts

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

Writing tests for Kavo

Placement and setup

  • Tests go in each package's tests/ directory — never in src/, so they are not shipped in dist/. The layout is flat: packages/core/tests/*.spec.ts, with shared fixtures in packages/core/tests/support/.
  • Vitest aliases @kavo/* to package src/ (see vitest.config.ts), so tests import the package by name and exercise sources directly. Never import from dist/.
  • The SWC vitest plugin is mandatory: TypeORM entities and Nest DI need decorator metadata that esbuild cannot emit. If a test loses metadata unexpectedly, suspect the transform before the logic.
pnpm test                                                    # whole monorepo
pnpm vitest run packages/core/tests/filter-parser.spec.ts    # one file
pnpm vitest run -t "coerces JavaScript number syntax"        # one test by name

Reuse the fixtures

Check packages/core/tests/support/ before building anything: there are existing entity fixtures (user-fixture.ts, blog-fixture.ts, account-fixture.ts) and shared query cases. A new ad-hoc entity in a spec file is usually a fixture that already exists.

Test through the real seams

Kavo is built from injected seams — handlers, serializer/deserializer, query normalizer, pagination strategies, error handler. Prefer driving the real engine with a test adapter over mocking the pipeline. A test that mocks the thing it is testing passes when the implementation is wrong.

Assert observable behavior, not internals. Call counts, private fields and the order of injected seams break on every refactor and catch no bugs.

The cases a change must pin down

For each behavior you add or change, write the test that would fail if it silently regressed:

  • Happy path — the intended result, with the full shape asserted, not toBeDefined().
  • Validation — rejected input produces the right rejection, not a crash.
  • Error path — assert the thrown *Exception type and its KAVO_SNAKE_CASE code. The code is a public contract; asserting only the message lets the code drift silently.
  • Edge cases — empty results, null vs. absent, boundary pagination values, the field-path recursion cap (ADR-0008), unknown include paths, non-allowlisted filter fields, disabled operations.
  • Regression — a bugfix without a test that fails against the old code is unfinished. Write that test first and watch it fail.

Read the full file on GitHub · 110 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 · 110 lines · 59 tokens per session scan A 8cbad024ef6c

Subscribe to this mod's changes

write-tests is a skill published in the GitHub repository kavo-labs/kavo (12 stars, last pushed today), licensed Apache-2.0. It adds 59 tokens to every session and 1,283 once invoked, about $0.0003 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-09-02.

Related

Other skills, from other repositories

pest-testing

Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to…

coollabsio/coolify · 171 tokens

test-writer

Generate comprehensive Vitest tests for code examples in JavaScript concept documentation pages, following project conventions and referencing source lines.

leonardomso/33-js-concepts · 26 tokens

completion-rule

大模型代码生成任务的自动自检与纠错规则。 在代码输出后强制执行功能自测、单元测试设计和 Linter 检查。 未通过则自动修正并循环,直到全部通过或达到最大迭代次数。 适用于大模型生成或修改代码且要求正确、可测试、规范的场景。 支持 Python、TypeScript、Go、Java,语言规则通过 references 加载。.

Rain120/qq-music-api · 98 tokens

noodle-use

Teach agents to create, organize, maintain, evaluate, import, convert, and automate noodle terminal REST client collections using supported CLI commands plus YAML and dotenv files.

wilfredinni/noodle · 36 tokens

refactor

Refactor Java code in this repo without changing behavior. Not for bug fixes or new features.

membrane/api-gateway · 22 tokens

ocli-api

Turn any OpenAPI/Swagger API into CLI commands and call them. Search endpoints with BM25, check parameters, execute — no MCP server needed.

EvilFreelancer/openapi-to-cli · 34 tokens