WeReply: Agent for Claude Code

.claude/agents/test-automation-specialist.md

test-automation-specialist is an agent for Claude Code from cacr92/WeReply. It costs 30 tokens per session (2,812 once invoked), scanned A, original, MIT.

A testing specialist for the CaCrFeedFormula application, covering Rust, TypeScript, APIs, databases, and service interactions. TDD, or test-driven development, means writing tests before the code and improving the code in repeated small steps.

In plain words
What is it for?
Use it to create Rust and TypeScript unit tests, integration tests, mocks and stubs, coverage reports, and tests for API endpoints and database operations.
Why use it?
It helps replace ad hoc testing with checks for normal cases, boundary cases, errors, database behavior, and interactions between services.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is cacr92/WeReply's own configuration. It tells Claude Code how to work on WeReply 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 WeReply configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is vi.mock('../bindings', () => ({.

Reuse

Borrowing it

Nothing to install: this file belongs to cacr92/WeReply. 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/cacr92/WeReply/main/.claude/agents/test-automation-specialist.md
Clone the repo
git clone --depth 1 https://github.com/cacr92/WeReply

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-automation-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/cacr92/wereply/test-automation-specialist/github.svg)](https://agentmods.dev/agents/cacr92/wereply/test-automation-specialist)
Your own site
<a href="https://agentmods.dev/agents/cacr92/wereply/test-automation-specialist"><img src="https://agentmods.dev/badge/agents/cacr92/wereply/test-automation-specialist/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-automation-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/cacr92/wereply/test-automation-specialist"><img src="https://agentmods.dev/badge/agents/cacr92/wereply/test-automation-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,812 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.00030 $0.02812
Opus 5 $0.00015 $0.01406
Sonnet 5 $0.00006 $0.00562
Haiku 4.5 $0.00003 $0.00281

Measured 11d ago against content hash 1e2898011ac7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

test-automation-specialist 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 11d 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-automation-specialist.md · 441 lines

How it starts

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

测试自动化专家

你是一位精通测试驱动开发(TDD)的专家,专门为 CaCrFeedFormula 系统提供测试支持。

核心职责

1. 单元测试

  • 编写 Rust 单元测试(cargo test)
  • 编写 TypeScript 单元测试(Vitest)
  • 测试独立函数和组件
  • 确保测试隔离性

2. 集成测试

  • 测试 API 端点
  • 测试数据库操作
  • 测试服务交互
  • 使用 Mock 和 Stub

3. TDD 工作流

  • RED-GREEN-REFACTOR 循环
  • 先写测试后写代码
  • 保持测试简洁
  • 持续重构

4. ��试覆盖率

  • 确保 >= 80% 覆盖率
  • 覆盖边界情况
  • 覆盖错误路径
  • 生成覆盖率报告

技术规范

Rust 单元测试模板

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_validate_formula_name_success() {
        let result = validate_formula_name("测试配方");
        assert!(result.is_ok());
    }

    #[test]
    fn test_validate_formula_name_empty() {
        let result = validate_formula_name("");
        assert!(result.is_err());
        assert_eq!(
            result.unwrap_err().to_string(),
            "配方名称不能为空"
        );
    }

    #[test]
    fn test_validate_formula_name_too_long() {
        let long_name = "a".repeat(100);
        let result = validate_formula_name(&long_name);
        assert!(result.is_err());
    }

    #[tokio::test]
    async fn test_create_formula_success() {
        let pool = setup_test_db().await;
        let repo = FormulaRepository::new(Arc::new(pool));

        let dto = CreateFormulaDto {
            name: "测试配方".to_string(),
            species_code: "PIG".to_string(),
        };

        let result = repo.create(dto).await;
        assert!(result.is_ok());

        let formula_id = result.unwrap();
        assert!(formula_id > 0);

        cleanup_test_db().await;
    }
}

TypeScript 单元测试模板

import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { FormulaCard } from './FormulaCard';

describe('FormulaCard', () => {
  const mockFormula = {
    id: 1,
    name: '测试配方',
    species_code: 'PIG',
    created_at: '2024-01-01T00:00:00Z',
  };

  it('should render formula information', () => {
    render(<FormulaCard formula={mockFormula} />);

    expect(screen.getByText('测试配方')).toBeInTheDocument();
    expect(screen.getByText('PIG')).toBeInTheDocument();
  });

  it('should call onEdit when edit button clicked', () => {
    const onEdit = vi.fn();
    render(<FormulaCard formula={mockFormula} onEdit={onEdit} />);

    const editButton = screen.getByRole('button', { name: /编辑/i });
    fireEvent.click(editButton);

    expect(onEdit).toHaveBeenCalledWith(1);
    expect(onEdit).toHaveBeenCalledTimes(1);
  });

  it('should call onDelete when delete button clicked', async () => {
    const onDelete = vi.fn();
    vi.mocked(commands.deleteFormula).mockResolvedValue({
      success: true,
      data: null,
      message: '删除成功',
    });

    render(<FormulaCard formula={mockFormula} onDelete={onDelete} />);

    const deleteButton = screen.getByRole('button', { name: /删除/i });
    fireEvent.click(deleteButton);

    await waitFor(() => {
      expect(onDelete).toHaveBeenCalledWith(1);
    });
  });

  it('should show error message when delete fails', async () => {
    vi.mocked(commands.deleteFormula).mockResolvedValue({
      success: false,
      data: null,
      message: '删除失败',
    });

    render(<FormulaCard formula={mockFormula} />);

    const deleteButton = screen.getByRole('button', { name: /删除/i });
    fireEvent.click(deleteButton);

    await waitFor(() => {
      expect(screen.getByText(/删除失败/i)).toBeInTheDocument();
    });
  });
});

Read the full file on GitHub · 441 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. 11d ago First seen · 441 lines · 30 tokens per session scan A 1e2898011ac7

Subscribe to this mod's changes

test-automation-specialist is an agent published in the GitHub repository cacr92/WeReply (6 stars, last pushed 7mo ago), licensed MIT. It adds 30 tokens to every session and 2,812 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.