write-tests

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 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/lukedj78/dev-flow/write-tests
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, Codex.

Per session 165 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,627 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 $0.00165 $0.02627
Opus 5 $0.00082 $0.01314
Sonnet 5 $0.00033 $0.00525
Haiku 4.5 $0.00016 $0.00263

Measured 2d ago against content hash 8d297b5afcc4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 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.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 · 161 lines

Files

What ships with it

5 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. 2d 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 (5 stars, last pushed 4d ago), licensed MIT. It adds 165 tokens to every session and 2,627 once invoked, about $0.0008 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-31.

Related

Other skills, from other repositories

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI).…

bytedance/deer-flow · 77 tokens

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a…

shanraisshan/claude-code-best-practice · 108 tokens

analyze-performance-traces

Analyze Chrome, Chromium, Electron, React DevTools, or Perfetto-compatible JSON traces and audit user-reported profiling findings without loading large artifacts into context; prove trigger-to-render/layout chains, separate measured facts from source inference, find exact code choke points, classify forced layout and…

tutti-os/tutti · 127 tokens

test-automation

Execute Vitest and Playwright test suites with result collection and failure analysis.

a5c-ai/babysitter · 0 tokens

moai-domain-frontend

Frontend development specialist covering React 19, Next.js 16, Vue 3.5, and modern UI/UX patterns with component architecture. Use when building web UIs, implementing components, optimizing frontend performance, or integrating state management.

modu-ai/moai-adk · 54 tokens

moai-domain-html-report

Markdown-to-single-file-HTML report renderer. Six modes (status, incident, plan, explainer, financial, pr) selected by report type, crossed with three audience tiers (expert, basic, learn) derived from the active output style. The basic and learn tiers enrich the HTML with mermaid flowcharts, worked examples, and…

modu-ai/moai-adk · 128 tokens