test-writer

test-writer is an agent for coding agents from nirholas/XActions. It costs 32 tokens per session (366 once invoked), scanned A, original, Apache-2.0.

A set of instructions for writing and maintaining automated tests in a TypeScript monorepo, which is a repository containing multiple related packages. It covers unit tests, end-to-end tests, test doubles, and coverage checks using Vitest.

In plain words
What is it for?
Use it to add or fix unit tests, mock providers and browsers, check coverage, and handle end-to-end tests that need external API keys.
Why use it?
It encourages focused tests that run without real external services and keeps test structure and coverage consistent across the repository.

Agent

Part of the xactions plugin — 50 skills, 1 command, 8 agents, 1 MCP server shipped together

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 agents/nirholas/xactions/test-writer
Clone the repo
git clone --depth 1 https://github.com/nirholas/XActions

Or install xactions, the plugin that ships this one along with the rest of its 50 skills, 1 command, 8 agents, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/nirholas/xactions/test-writer.svg)](https://agentmods.dev/agents/nirholas/xactions/test-writer)
Your own site
<a href="https://agentmods.dev/agents/nirholas/xactions/test-writer"><img src="https://agentmods.dev/badge/agents/nirholas/xactions/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 366 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.00032 $0.00366
Opus 5 $0.00016 $0.00183
Sonnet 5 $0.00006 $0.00073
Haiku 4.5 $0.00003 $0.00037

Measured yesterday against content hash 0463393fbcb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-writer 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 yesterday.

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.

xspace-agents/.github/agents/test-writer.agent.md · 35 lines

What it actually says

You are a test engineer for the xspace-agent TypeScript monorepo. Your job is to write, fix, and improve Vitest tests.

Context

  • Framework: Vitest with @vitest/coverage-v8
  • Tests live in packages/core/tests/ and packages/core/src/__tests__/
  • E2E tests in packages/core/src/__tests__/e2e/ (require API keys)
  • Coverage targets: ~80% statements/functions/lines, ~70% branches
  • CI runs on Node 18, 20, 22

Approach

  1. Read the source file being tested to understand its public API and edge cases
  2. Check existing tests for the module to avoid duplication
  3. Write focused unit tests using mock providers — never call real external APIs
  4. Run cd packages/core && npx vitest run <test-file> to verify
  5. Check coverage: cd packages/core && npx vitest run --coverage

Constraints

  • DO NOT call real LLM/STT/TTS APIs in unit tests — always mock
  • DO NOT modify source code unless fixing a testability issue
  • ONLY write tests that can run without environment variables (except E2E)
  • Use describe/it blocks with clear test names describing the behavior
  • Mock Puppeteer browser instances for browser-related tests
  • Test timeout: 10 seconds max per test

Output

Provide the test file with all tests passing. Report any coverage gaps found.

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. yesterday First seen · 35 lines · 32 tokens per session scan A 0463393fbcb0

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository nirholas/XActions (502 stars, last pushed yesterday), licensed Apache-2.0. It adds 32 tokens to every session and 366 once invoked, about $0.0002 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-03.

Related

Other agents, from other repositories

vitest-component-tester

Use this agent when you need to test components and logic using Vitest following the project's testing strategy. Examples: Context: User has just implemented a new React component and wants to ensure it's properly tested. user: 'I just created a UserProfile component that displays user information and handles edit…

ayoubben18/ab-method · 0 tokens

js-unit-test-writer

Jest test writer for the plugin's JavaScript/TypeScript (React components, data-store selectors, handlers, helpers). MUST BE USED whenever JS/TS unit tests need to be written or updated - the colocated .test.js files next to module resources/js sources.

woocommerce/woocommerce-paypal-payments · 65 tokens

typescript-pro

Master TypeScript with advanced types, generics, and strict type safety. Handles complex type systems, decorators, and enterprise-grade patterns. Use PROACTIVELY for TypeScript architecture, type inference optimization, or advanced typing patterns.

NOMARJ/sigil · 49 tokens

test-generator

Use this agent to generate high-quality TypeScript unit tests for a target file or directory. Detects the host project's test runner (Jest, Vitest, node:test) and follows the project's documented testing standards.

trickycdm/tricky-cc-plugins · 46 tokens

typescript-test-fixer

Use this agent when TypeScript tests are failing and need to be fixed, when test suites need cleanup to remove redundant tests, or when new tests need to be added after discovering bugs that weren't caught by existing coverage. Examples: Context: User has failing Playwright tests in their TypeScript project. user: 'My…

rben01/agentic-coder-config · 0 tokens

frontend-dev

Frontend Developer (Aria Chen) - React, Next.js, TypeScript, accessibility, performance.

vibeeval/vibecosystem · 22 tokens