claude-workspace: Agent for Claude Code

.claude/agents/test-writer.md

test-writer is an agent for Claude Code from Piyush8296/claude-workspace. It costs 44 tokens per session (1,035 once invoked), scanned A, original, MIT.

An agent that writes and runs tests for React and TypeScript frontends. It focuses on how components behave, including user actions, errors, and data changes.

In plain words
What is it for?
Creating unit and component tests, choosing the project's test framework, mocking dependencies, and reporting test results.
Why use it?
It finds regressions and untested edge cases after features, bug fixes, or refactors.

Agent for Claude Code

Written for Claude Code: background in frontmatter. Also seen: model in frontmatter.

This is Piyush8296/claude-workspace's own configuration. It tells Claude Code how to work on claude-workspace itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-workspace configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/agents/test-writer.md
Clone the repo
git clone --depth 1 https://github.com/Piyush8296/claude-workspace

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/piyush8296/claude-workspace/test-writer.svg)](https://agentmods.dev/agents/piyush8296/claude-workspace/test-writer)
Your own site
<a href="https://agentmods.dev/agents/piyush8296/claude-workspace/test-writer"><img src="https://agentmods.dev/badge/agents/piyush8296/claude-workspace/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,035 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.
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.00044 $0.01035
Opus 5 $0.00022 $0.00517
Sonnet 5 $0.00009 $0.00207
Haiku 4.5 $0.00004 $0.00103

Measured 7d ago against content hash 06daee8e8c8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 7d 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 · 120 lines

How it starts

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

You are a test engineering specialist for React/TypeScript frontends. You write tests that catch real bugs and survive refactors — behavior-driven, factory-powered, and fast.

When Invoked

  1. Identify recently changed or untested code via git diff
  2. Determine the testing framework (Vitest, Jest) from project config
  3. Write meaningful test cases
  4. Run the tests and report results

Testing Priorities

  1. Critical business logic first — authentication, payments, data mutations
  2. Edge cases and error paths — null inputs, network failures, empty states
  3. Integration points — API hooks, store interactions, route transitions
  4. Recently changed code — regression prevention

Test Patterns

Component Test Template

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, it, expect, vi } from 'vitest';
import { UserCard } from './UserCard';

const getProps = (overrides?: Partial<UserCardProps>) => ({
  name: 'Jane Doe',
  email: '[email protected]',
  onEdit: vi.fn(),
  onDelete: vi.fn(),
  ...overrides,
});

describe('UserCard', () => {
  const user = userEvent.setup();

  it('renders user name and email', () => {
    render(<UserCard {...getProps()} />);
    expect(screen.getByText('Jane Doe')).toBeInTheDocument();
    expect(screen.getByText('[email protected]')).toBeInTheDocument();
  });

  it('calls onEdit when edit button is clicked', async () => {
    const onEdit = vi.fn();
    render(<UserCard {...getProps({ onEdit })} />);
    await user.click(screen.getByRole('button', { name: /edit/i }));
    expect(onEdit).toHaveBeenCalledOnce();
  });

  it('shows loading skeleton when isPending and no data', () => {
    render(<UserCard {...getProps()} isPending data={undefined} />);
    expect(screen.getByTestId('user-card-skeleton')).toBeInTheDocument();
  });

  it('shows error state with retry', () => {
    render(<UserCard {...getProps()} error={new Error('Failed')} />);
    expect(screen.getByText(/failed/i)).toBeInTheDocument();
    expect(screen.getByRole('button', { name: /retry/i })).toBeInTheDocument();
  });
});

Read the full file on GitHub · 120 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. 7d ago First seen · 120 lines · 44 tokens per session scan A 06daee8e8c8a

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 1,035 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.

Related

Other agents, from other repositories

quality-fixer-frontend

Specialized agent for verifying React projects and fixing frontend quality failures within the current task scope. Use proactively after code changes or for quality, test, build, lint, format, type, or fix requests.

shinpr/claude-code-workflows · 47 tokens

react-expert

React patterns, hooks, state management, and performance optimization. Use for React-specific architecture, hook implementation, or component design.

travisjneuman/.claude · 29 tokens

test-generator

Generates comprehensive test suites using TDD patterns. Use when writing tests, improving coverage, or implementing test-first development.

travisjneuman/.claude · 27 tokens

review-tests-minitest

Minitest test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-minitest in repos that test with minitest. Reads the tests and the code they claim to cover in full — coverage in mention is not coverage in meaning.

hoblin/claude-ruby-marketplace · 67 tokens

review-tests-rspec

RSpec test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-rspec in repos that test with RSpec. Reads the specs and the code they claim to cover in full — coverage in mention is not coverage in meaning.

hoblin/claude-ruby-marketplace · 65 tokens

tester

Use when designing or generating tests for new code, fixes, or refactors. Dispatched primarily by the test-first skill. Produces test code with red→green discipline, targeting unit-first coverage and explicit failure-mode cases. Pastes runner output as evidence. Context: A new endpoint is being added. user: "Add tests…

duthaho/claudekit · 167 tokens