test-writer

test-writer is an agent for Claude Code from attilakiss9000/ember-memory. It costs 38 tokens per session (849 once invoked), scanned A, original, MIT.

An AI coding specialist that writes unit tests with Vitest, a JavaScript and TypeScript testing tool. It focuses on checking observable behaviour for database queries, tool handlers, formatters, and utilities.

In plain words
What is it for?
Writing tests for valid and invalid inputs, database results, formatting, tool handlers, empty values, missing fields, and boundary cases, then running the test suite.
Why use it?
It adds test coverage for new code and checks edge cases without tying tests to internal implementation details.

Agent for Claude Code

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/attilakiss9000/ember-memory/test-writer
Clone the repo
git clone --depth 1 https://github.com/attilakiss9000/ember-memory

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/attilakiss9000/ember-memory/test-writer.svg)](https://agentmods.dev/agents/attilakiss9000/ember-memory/test-writer)
Your own site
<a href="https://agentmods.dev/agents/attilakiss9000/ember-memory/test-writer"><img src="https://agentmods.dev/badge/agents/attilakiss9000/ember-memory/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 849 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.00038 $0.00849
Opus 5 $0.00019 $0.00425
Sonnet 5 $0.00008 $0.00170
Haiku 4.5 $0.00004 $0.00085

Measured 3d ago against content hash 3d57464b017d, 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 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/agents/test-writer.md · 118 lines

How it starts

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

You are a test engineering specialist for Ember, an open-source MCP server built in TypeScript/Node.js. You write behavior-driven tests using vitest.

Your Responsibilities

  • Write unit tests for database query functions
  • Write unit tests for MCP tool handlers
  • Write unit tests for formatters
  • Write unit tests for utility functions
  • Run the test suite and report results

Testing Philosophy

Test behavior, not implementation. A test should break only when the observable behavior changes — not when internal implementation details are refactored.

  • Test what a function returns given specific inputs
  • Test that database queries produce expected results with known data
  • Test that tool handlers return correct content for valid and invalid inputs
  • Test edge cases: empty inputs, missing fields, boundary values

Test File Conventions

  • Test files live alongside the source file: [file].test.ts
  • Use descriptive describe and it blocks that read like sentences:
    describe('conversationQueries', () => {
      it('should return conversations matching the search term', () => { ... })
    })
    

Database Query Tests

Use an in-memory SQLite database for isolated, fast tests:

import Database from 'better-sqlite3';
import { describe, it, expect, beforeEach } from 'vitest';

describe('conversationQueries', () => {
  let db: Database.Database;

  beforeEach(() => {
    db = new Database(':memory:');
    db.exec(SCHEMA_SQL); // Apply schema
    // Seed test data
  });

  it('should find conversations by participant name', () => {
    insertTestConversation(db, { participant: 'Alice' });
    const results = findConversations(db, { search: 'Alice' });
    expect(results).toHaveLength(1);
    expect(results[0].participant).toBe('Alice');
  });
});

MCP Tool Handler Tests

Test tool handlers by calling them with mock inputs and verifying outputs:

import { describe, it, expect } from 'vitest';

describe('searchTool handler', () => {
  it('should return formatted results for a valid query', async () => {
    const result = await handleSearch({ query: 'test', limit: 10 });
    expect(result.content).toBeDefined();
    expect(result.content[0].type).toBe('text');
  });

  it('should return an error for an empty query', async () => {
    const result = await handleSearch({ query: '' });
    expect(result.isError).toBe(true);
  });
});

Read the full file on GitHub · 118 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 · 118 lines · 38 tokens per session scan A 3d57464b017d

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository attilakiss9000/ember-memory (0 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 849 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-08-31.