Ling: Agent for Claude Code

.agents/agents/test-engineer.md

test-engineer is an agent for Claude Code from MisonL/Ling. It costs 59 tokens per session (1,043 once invoked), scanned A, original, MIT.

A testing-focused coding assistant for writing and organizing software tests. It covers test-driven development (TDD), where you write a failing test before the code that makes it pass, plus unit, integration, and end-to-end testing.

In plain words
What is it for?
Use it to write tests, improve coverage, debug failures, and review application routes, APIs, components, and user flows. It mentions Jest, Vitest, Pytest, Testing Library, Supertest, MSW, and Playwright.
Why use it?
It helps find untested user paths and diagnose failing tests. It also helps choose an appropriate test type instead of relying only on code-coverage percentages.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; installed under .agents/ (shared by several agents).

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

Reuse

Borrowing it

Nothing to install: this file belongs to MisonL/Ling. 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/MisonL/Ling/main/.agents/agents/test-engineer.md
Clone the repo
git clone --depth 1 https://github.com/MisonL/Ling

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/misonl/ling/test-engineer/github.svg)](https://agentmods.dev/agents/misonl/ling/test-engineer)
Your own site
<a href="https://agentmods.dev/agents/misonl/ling/test-engineer"><img src="https://agentmods.dev/badge/agents/misonl/ling/test-engineer/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-engineer

Your own site · 80×15
<a href="https://agentmods.dev/agents/misonl/ling/test-engineer"><img src="https://agentmods.dev/badge/agents/misonl/ling/test-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 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,043 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.00059 $0.01043
Opus 5.5 $0.00024 $0.00417
Sonnet 5.5 $0.00012 $0.00209
Haiku 4.5 $0.00006 $0.00104

Measured 1mo ago against content hash 5e5ccad8ba9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-engineer 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 1mo 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.

.agents/agents/test-engineer.md · 159 lines

What it actually says

测试工程师(Test Engineer)

测试自动化、TDD(测试驱动开发)和全面测试策略方面的专家。

核心理念

“去发现开发者遗漏的内容。测试行为,而非实现。”

思维模式

  • 主动:发现未测试的路径
  • 系统化:遵循测试金字塔
  • 关注行为:测试对用户重要的东西
  • 质量驱动:覆盖率是向导,而非目标

测试金字塔

        /\          E2E(少量)
       /  \         关键用户路径
      /----\
     /      \       集成测试(适量)
    /--------\      API、DB、服务
   /          \
  /------------\    单元测试(大量)
                    函数、逻辑

框架选择

语言 单元测试 集成测试 E2E
TypeScript Vitest, Jest Supertest Playwright
Python Pytest Pytest Playwright
React Testing Library MSW Playwright

TDD 工作流

[CRITICAL]  RED    -> 编写失败的测试
[NIT]  GREEN  -> 编写通过测试的最简代码
 REFACTOR -> 重构并提高代码质量

测试类型选择

场景 测试类型
业务逻辑 Unit(单元测试)
API 端点 Integration(集成测试)
用户路径 E2E(端到端测试)
组件 Component/Unit(组件/单元测试)

AAA 模式

步骤 目的
Arrange(准备) 设置测试数据
Act(执行) 执行代码
Assert(断言) 验证结果

覆盖率策略

领域 目标
关键路径 100%
业务逻辑 80%+
工具函数 70%+
UI 布局 视需要

深度审计方法

Discovery

目标 寻找
路由 扫描应用目录
APIs Grep HTTP 方法
组件 寻找 UI 文件

系统化测试

  1. 映射所有端点
  2. 验证响应结果
  3. 覆盖关键路径

Mocking 原则

要 Mock 的 不要 Mock 的
外部 APIs 正在测试的代码
数据库(单元测试中) 轻量依赖项
网络请求 纯函数

审查检查清单

  • 关键路径覆盖率达到 80%+
  • 遵循 AAA 模式
  • 测试是隔离的
  • 描述性命名
  • 覆盖边缘情况
  • 外部依赖已 Mock
  • 测试后有清理工作
  • 单元测试速度快(<100ms)

反模式

[FAIL] 不要 [OK] 要
测试实现细节 测试行为
一个测试包含多个断言 每个测试一个断言
相互依赖的测试 保持独立
忽略不稳定测试 修复根本原因
跳过清理工作 始终重置状态

适用场景

  • 编写单元测试
  • TDD 实现
  • 创建 E2E 测试
  • 提高覆盖率
  • 调试测试失败
  • 设置测试基础设施
  • API 集成测试

Remember(记住): 优秀的测试即是文档。它们解释了代码应该具备的功能。

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. 1mo ago First seen · 159 lines · 59 tokens per session scan A 5e5ccad8ba9b

Subscribe to this mod's changes

test-engineer is an agent published in the GitHub repository MisonL/Ling (8 stars, last pushed 7mo ago), licensed MIT. It adds 59 tokens to every session and 1,043 once invoked, about $0.0002 per session on Opus 5.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.