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.
npx skills add Lion-1209/coderio --skill testinggit clone --depth 1 https://github.com/Lion-1209/coderioWrote 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.
[](https://agentmods.dev/skills/lion-1209/coderio/testing)<a href="https://agentmods.dev/skills/lion-1209/coderio/testing"><img src="https://agentmods.dev/badge/skills/lion-1209/coderio/testing/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.
<a href="https://agentmods.dev/skills/lion-1209/coderio/testing"><img src="https://agentmods.dev/badge/skills/lion-1209/coderio/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00016 | $0.02699 |
| Opus 5.5 | $0.00006 | $0.01080 |
| Sonnet 5.5 | $0.00003 | $0.00540 |
| Haiku 4.5 | $0.00002 | $0.00270 |
Grade A, and why
testing 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- testing — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing
概述
写能真正抓住 bug、且不脆弱(改实现不会无端崩)的测试。核心:测试是行为的契约,不是"代码的镜像"——测的是"给它这个输入,该有这个结果",不是"它内部该这样工作"。好测试让你敢改实现(因为测试守着行为),坏测试让你不敢改(因为一改测试就崩)。
何时使用
- 写完功能,要补测试
- 写测试时纠结测什么、不测什么、要不要 mock
- 现有测试脆弱(改实现就一片红)或 flaky(时过时不过)
- 测试覆盖率挺高但 bug 还是漏
不该用:纯探索/原型(不要求正确,测试是负担);一次性脚本(跑完即弃)。
与相邻 skill 的衔接:testing 在 task-breakdown 下游、verify-and-fix 上游——task 拆出"做完 X 能验证 Y",testing 负责把 Y 写成可重复运行的测试,verify-and-fix 负责跑它验证。三者接力:task 定验证目标 → testing 把目标落地成测试 → verify-and-fix 用测试验证完成。
核心内容
先识别被测对象的性质
写测试前先看清"被测的是什么",策略大不相同——这决定了要不要 mock、用什么工具、放哪个层次:
- 纯函数(无副作用、输入决定输出,如
calculateDiscount)→ 直接输入输出断言,零 mock,单元层。 - 有外部依赖的逻辑(如调 DB/HTTP 的 service)→ mock 掉外部副作用,验证被测逻辑对依赖返回值的真实处理(详见下文 mock 纪律)。
- UI 组件(渲染 + 交互)→ 用组件测试库测渲染输出和用户交互,不测内部 state 细节。
- 模块协作(多个组件配合)→ 集成层,用真实(或内存版)依赖验证组件间契约。
识别性质能避免最常见的错配:给纯函数上 mock、给 UI 组件测 state、把单元能测的逻辑推到端到端。先问"它是什么",再问"怎么测"。
测行为,不测实现
这是测试设计的第一原则。测"做什么",不测"怎么做":
- 测行为(对):给定输入,断言输出/可观测结果。例:
calculateDiscount(100, 'vip')应返回80。 - 测实现(错):断言内部走了哪个分支、调了哪个方法几次。例:断言"内部调用了
multiply两次"。
为什么测实现糟糕:实现是会变的(重构、换算法、优化),但行为不该变。测实现的测试,每次合理的实现改动都会让它崩——这就是脆弱测试。它逼你改实现时还得改测试,让测试从"保护"变成"负担"。
判别尺子:问自己"如果我把内部实现整个换掉(但行为不变),这个测试还该过吗?" 该过 → 测的是行为(对);崩了 → 测的是实现(错,改)。
例外:有些"交互契约"本身就是行为——比如"调支付时确实发了请求""保存时确实写库了"。这类"验证发生了正确的外部交互"是测行为,不是测实现。区分点:你关心的是结果(钱扣了/数据存了),还是调用细节(调了 3 次不是 2 次)。前者是行为,后者是过度断言。
测什么:聚焦有判断的逻辑,跳过无价值的
不是每行代码都值得测。测试有价值,是因为代码有逻辑、可能错。按代码性质分:
- 有判断的逻辑(分支、计算、状态转换、边界处理)→ 重点测。这是 bug 高发区。
- 纯数据搬运(getter/setter、直接赋值、简单透传)→ 不值得专门测。测它等于测语言本身。
- 框架/库的代码 → 不测。你不需要测 ORM 的 save 有没有存数据库,那是框架的事。
判断尺子:这段代码如果写错了,测试能抓住吗?写对了,测试有信息量吗? 两问都否 → 不值得测(如 getter)。把测试预算投到"写错会出事"的地方。
边界和错误路径是重点:happy path 谁都会测,但 bug 大多藏在边界(空值、零、负数、空集合、最大值)和错误路径(异常、超时、依赖失败)。问自己"这个函数在什么输入下会出错?"——那些输入就是要补的测试。
mock 的纪律:隔离依赖,不隔离被测逻辑
mock 用来隔离外部依赖(数据库、网络、第三方服务、时间),让测试快、稳、可重复。但 mock 容易被滥用:
- 合理 mock:被测代码依赖的外部副作用(真连库太慢、真发邮件会骚扰人)。mock 掉它们,专注测被测逻辑。
- 过度 mock:把被测对象自己的依赖链也 mock 掉,导致测试退化成"测 mock"——你 mock 了 db.save 返回固定 id,又只断言"调了 save",那其实什么都没测。
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago First seen · 135 lines · 16 tokens per session scan A cf1ba0bf5d4a
testing is a skill published in the GitHub repository Lion-1209/coderio (9 stars, last pushed 7d ago), licensed MIT. It adds 16 tokens to every session and 2,699 once invoked, about $0.0001 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.
Other skills, from other repositories
playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser…
e2e-testing
Guide for running end-to-end tests of the Qwen Code CLI, including headless mode, MCP server testing, and API traffic inspection. Use this skill whenever you need to verify CLI behavior with real model calls, reproduce user-reported bugs end-to-end, test MCP tool integrations, or inspect raw API request/response…
terminal-capture
Automates terminal UI screenshot testing for CLI commands. Applies when reviewing PRs that affect CLI output, testing slash commands (/about, /context, /auth, /export), generating visual documentation, or when 'terminal screenshot', 'CLI test', 'visual test', or 'terminal-capture' is mentioned.
tmux-real-user-testing
A real-user test workflow for Qwen Code's terminal interface, using tmux to drive the program and capture readable screen snapshots. tmux is a tool for running and observing terminal sessions.
agent-reproduce-align
Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.
codew-release-qa-sweep
Use before claiming Codewhale release work is done: run the full gate sweep and list the manual QA targets.