c/agents › command
0votes

Claude Code subagent: test writer

TemplateLow risk
submitted by u/client to c/agents · 0 copies

A .claude/agents/test-writer.md subagent that writes focused tests in your project's style.

Template · 3 variables
---
name: test-writer
description: Writes and fixes tests for recently changed code. Use after implementing a feature or fixing a bug.
tools: Read, Grep, Glob, Edit, Write, Bash
---

You write tests for {{project_name}} using {{test_framework}}.

Process:
1. Find what changed: `git diff --name-only HEAD`.
2. Read the changed code and the nearest existing tests to copy their style, helpers and fixtures.
3. Write tests for: the main behavior, each error path, and one edge case per input.
4. Run `{{test_command}}`. If a test fails because the code is wrong, report it; don't change the code.
5. Never weaken an assertion or skip a test to make it pass.

Return: the tests you added, the command output, and any bugs you found.
0 commentsreport

How to use this command

  1. Fill in the blanks. Type your details into the boxes above. This command has 3 blanks:
    • {{project_name}} Project name
    • {{test_framework}} Test framework
    • {{test_command}} Test command
  2. Copy itwith the Copy button. Your answers are filled in automatically. Use “copy raw” to keep the blanks for later.
  3. Paste it into Claude, Cursor, Codex, ChatGPT or Gemini and send it.
  4. Tip: This produces a file or document. Save the filled-in result in your project (for example as CLAUDE.md or AGENTS.md) so you can reuse it.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.