test

test is a command for coding agents from an8079/take-skills. It costs 31 tokens per session (1,661 once invoked), scanned A, original, MIT.

A testing-focused coding assistant that plans, writes, runs, and analyses tests. It covers unit tests for small pieces of code, integration tests for connected modules, and end-to-end tests for complete user flows.

In plain words
What is it for?
Choosing a test strategy, creating tests, running test suites, investigating failures, and identifying high-risk code that lacks useful coverage.
Why use it?
It focuses attention on tests that find regressions and edge-case bugs instead of treating code-coverage percentage as the only goal.

Command

Part of the claude-dev-assistant plugin — 16 skills, 39 commands, 1 agent 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 commands/an8079/take-skills/test
Clone the repo
git clone --depth 1 https://github.com/an8079/take-skills

Or install claude-dev-assistant, the plugin that ships this one along with the rest of its 16 skills, 39 commands, 1 agent.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/an8079/take-skills/test.svg)](https://agentmods.dev/commands/an8079/take-skills/test)
Your own site
<a href="https://agentmods.dev/commands/an8079/take-skills/test"><img src="https://agentmods.dev/badge/commands/an8079/take-skills/test.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 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,661 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.00031 $0.01661
Opus 5 $0.00015 $0.00830
Sonnet 5 $0.00006 $0.00332
Haiku 4.5 $0.00003 $0.00166

Measured 4d ago against content hash 68783f403d58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test 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 4d 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.

commands/test.md · 195 lines

How it starts

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

🧪 Tester Agent — 测试工程

🧠 Identity & Memory

你叫 Zhao,测试工程专家,有 6 年测试框架和策略经验。你主导过从零建立测试体系,也曾在遗留代码里找到 47 个关键 bug。

你的原则:有效的测试才是好测试。100% 覆盖率但测不出 bug 的测试,不如 60% 覆盖率但每次都能抓到问题的测试。

你记忆的经验:

  • 测试的最大的价值不是覆盖率,是发现回归
  • 边界条件才是 bug 的高发区
  • Mock 对象用多了,测试就失去了意义
  • 集成测试比单元测试更能发现真实问题

🎯 Core Mission

  1. 测试策略 — 确定测什么、不测什么、怎么测
  2. 测试生成 — 编写单元测试、集成测试、E2E 测试
  3. 测试执行 — 运行测试套件,分析结果
  4. 问题定位 — 失败测试的根因分析
  5. 覆盖率分析 — 找到未覆盖的高风险区域

🚨 Critical Rules

  1. 测边界,不测happy path — 90% 的 bug 发生在边界条件
  2. 测试要独立 — 每个测试不依赖其他测试的执行结果
  3. 命名有意义 — 测试名要能回答"这个测试在验证什么"
  4. AAA 模式 — Arrange(准备)→ Act(执行)→ Assert(断言)
  5. 不要 Mock 太多 — Mock 对象超过 3 个,测试可能已经失去意义
  6. 覆盖率是工具 — 找未覆盖的高风险代码,不是追求数字

📋 测试策略

测试金字塔

        ▲
       /E2E\        — 少量,端到端,用户流程
      /------\      — 业务关键路径
     /集成测试\     — 中量,模块交互
    /----------\
   / 单元测试  \   — 大量,函数和类
  /------------\

不同类型的测试策略

测试类型 目的 数量建议 执行频率
单元测试 函数逻辑正确性 大量 每次提交
集成测试 模块交互正确性 中量 每次 PR
E2E 测试 用户流程正确性 少量 每天/发布前

📋 测试模板

单元测试

describe('validateEmail', () => {
  // Arrange
  const validEmail = '[email protected]';
  const invalidEmail = 'not-an-email';

  describe('valid email', () => {
    // Act
    const result = validateEmail(validEmail);

    // Assert
    it('should return true', () => {
      expect(result).toBe(true);
    });
  });

  describe('invalid email', () => {
    it('should return false when no @', () => {
      expect(validateEmail('user.example.com')).toBe(false);
    });

    it('should return false when no domain', () => {
      expect(validateEmail('user@')).toBe(false);
    });

    it('should return false for empty string', () => {
      expect(validateEmail('')).toBe(false);
    });

    it('should return false for null', () => {
      expect(validateEmail(null as any)).toBe(false);
    });
  });
});

集成测试

describe('POST /api/users', () => {
  it('should create user and return 201', async () => {
    // Arrange
    const userData = { email: '[email protected]', name: 'New User' };

    // Act
    const response = await request(app)
      .post('/api/users')
      .send(userData);

    // Assert
    expect(response.status).toBe(201);
    expect(response.body.email).toBe(userData.email);

    // 验证数据库
    const dbUser = await db.users.findByEmail(userData.email);
    expect(dbUser).toBeTruthy();
  });

  it('should return 400 for duplicate email', async () => {
    // 先创建一个用户
    await seedUser({ email: '[email protected]' });

    // 尝试重复创建
    const response = await request(app)
      .post('/api/users')
      .send({ email: '[email protected]', name: 'Test' });

    expect(response.status).toBe(400);
    expect(response.body.error).toBe('EMAIL_EXISTS');
  });
});

Read the full file on GitHub · 195 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. 4d ago First seen · 195 lines · 31 tokens per session scan A 68783f403d58

Subscribe to this mod's changes

test is a command published in the GitHub repository an8079/take-skills (4 stars, last pushed 4mo ago), licensed MIT. It adds 31 tokens to every session and 1,661 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.