write-tests

write-tests is a skill for Claude Code from lukedj78/dev-flow. It costs 176 tokens per session (3,076 once invoked), scanned A, original, MIT.

A tool that writes a test file for one existing source file at a time, using the project’s configured Vitest, Playwright or related test setup. Vitest is for unit and integration tests, while Playwright is for testing a web application in a browser.

In plain words
What is it for?
Use it to add unit or integration tests for server actions, pages, components and data queries, or end-to-end browser tests for a specific page or feature.
Why use it?
It follows the project’s existing testing and mocking patterns instead of generating a large unrelated test suite. Keeping the task to one source file makes each result easier to review.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the dev-flow plugin — 55 skills shipped together

Good fit Use it to add unit or integration tests for server actions, pages, components and data queries, or end-to-end browser tests for a specific page or feature.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lukedj78/dev-flow/write-tests
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 lukedj78/dev-flow --skill write-tests
Clone the repo
git clone --depth 1 https://github.com/lukedj78/dev-flow

Made for: Claude Code.

Or install dev-flow, the plugin that ships this one along with the rest of its 55 skills.

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/lukedj78/dev-flow/write-tests/github.svg)](https://agentmods.dev/skills/lukedj78/dev-flow/write-tests)
Your own site
<a href="https://agentmods.dev/skills/lukedj78/dev-flow/write-tests"><img src="https://agentmods.dev/badge/skills/lukedj78/dev-flow/write-tests/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 write-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/lukedj78/dev-flow/write-tests"><img src="https://agentmods.dev/badge/skills/lukedj78/dev-flow/write-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,076 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00176 $0.03076
Opus 5.5 $0.00070 $0.01230
Sonnet 5.5 $0.00035 $0.00615
Haiku 4.5 $0.00018 $0.00308

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

write-tests/SKILL.md · 174 lines

How it starts

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

write-tests — generate tests for one file at a time

This skill writes the test file that should sit next to a piece of source code. One invocation = one source file → one test file. It does not install test infrastructure (that's module-add test), does not debug failing tests (that's superpowers:systematic-debugging), and does not run an HTTP-based QA pass (that's qa).

The unit of work is deliberately small because tests rot when they're auto-generated in bulk. A single file at a time forces the user to read what was written and accept it before moving to the next.

When this skill applies

  • The user names a source file: "scrivi i test per lib/server/clienti.ts", "test per app/checkout/page.tsx", "e2e per /scadenze".
  • The orchestrator routes here from module_added (test infrastructure exists) when the user wants per-feature coverage.
  • The project has a wired test stack — meta.json#stack.test is set, OR vitest.config.ts + playwright.config.ts exist at the root.

Contract

This skill follows the dev-flow contract — see references/contracts.md. Key facts:

  • Reads <root>/.workflow/meta.json#stack.test to confirm the test framework is wired.
  • Reads the project's existing vitest.setup.ts, vitest.config.ts, playwright.config.ts, and any sibling test files to learn the mocking style — does not re-prescribe patterns from scratch.
  • Writes a single test file alongside the source (__tests__/<name>.test.ts for unit, e2e/<name>.spec.ts for e2e).
  • Does NOT bump phase — tests are continuous work, not a phase transition.
  • Appends to meta.json#history with the source file path, the test path, and the test type.
  • Idempotent: if the test file already exists, ask the user — either regenerate, append missing cases, or abort. Never silently overwrite.

Workflow

Step 1 — Verify prerequisites

Read <project-root>/.workflow/meta.json:

  • stack.framework must be next, or monorepo with the test aimed at apps/web/. On expo-rn (or a file under apps/mobile/), stop and hand off to rn-write-tests: stack.test alone does not tell the two apart — jest-expo+rntl is a valid value too — and this skill's Vitest/Playwright patterns are wrong for React Native.
  • stack.test must be set (e.g., "vitest+playwright"). If null, stop and tell the user: "Test infrastructure not wired. Run module-add test first, then come back."
  • phase should be module_added or later. If earlier, the project might not have anything testable yet — warn and ask whether to proceed.

Read the full file on GitHub · 174 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · +1 lines db02c7b6bb7f
  2. 4d ago Changed · +1 lines · +11 tokens per session a0704dd4e7f3
  3. 11d ago Changed · +3 lines 35b8d5cf5499
  4. 16d ago Changed · +8 lines 8f0aa79c0724
  5. 1mo ago First seen · 161 lines · 165 tokens per session scan A 8d297b5afcc4

Subscribe to this mod's changes

write-tests is a skill published in the GitHub repository lukedj78/dev-flow (6 stars, last pushed yesterday), licensed MIT. It adds 176 tokens to every session and 3,076 once invoked, about $0.0007 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-31.

Related

Other skills, from other repositories