testing

testing is a skill for Claude Code from xiaobei930/cc-best. It costs 34 tokens per session (943 once invoked), scanned A, original, MIT.

A testing guide covering TDD, or test-driven development, where you write a failing test before the code, and E2E testing, which checks a complete user flow from start to finish.

In plain words
What is it for?
Use it to plan unit and E2E tests, follow the RED–GREEN–REFACTOR workflow, set up test frameworks and mocks, and check key user journeys.
Why use it?
It helps catch regressions and choose suitable tests for new features, bug fixes, refactoring, and user-interface interactions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cc-best plugin — 19 skills, 44 commands, 8 agents, 20 hooks shipped together

Good fit Use it to plan unit and E2E tests, follow the RED–GREEN–REFACTOR workflow…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xiaobei930/cc-best/testing
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.

Any agent
npx skills add xiaobei930/cc-best --skill testing
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best

Made for: Claude Code.

Or install cc-best, the plugin that ships this one along with the rest of its 19 skills, 44 commands, 8 agents, 20 hooks.

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 testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaobei930/cc-best/testing.svg)](https://agentmods.dev/skills/xiaobei930/cc-best/testing)
Your own site
<a href="https://agentmods.dev/skills/xiaobei930/cc-best/testing"><img src="https://agentmods.dev/badge/skills/xiaobei930/cc-best/testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 943 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.00034 $0.00943
Opus 5 $0.00017 $0.00472
Sonnet 5 $0.00007 $0.00189
Haiku 4.5 $0.00003 $0.00094

Measured 3d ago against content hash dd80fe6adb34, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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 3d 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.

skills/testing/SKILL.md · 102 lines

What it actually says

测试策略

关联 Agent: tdd-guide(测试驱动开发)、code-reviewer(可测试性评估)、build-error-resolver(修复后测试验证)

本技能提供测试策略选择指南,整合 TDD(测试驱动开发)和 E2E(端到端测试)最佳实践。

子文件

测试金字塔

        ┌─────────┐
        │  E2E   │  少量:验证核心流程
        ├─────────┤
        │集成测试 │  中等:验证组件交互
        ├─────────┤
        │单元测试 │  大量:验证独立单元
        └─────────┘

测试策略选择

场景 推荐策略 参阅文件
新功能开发 TDD(测试先行) tdd.md
Bug 修复 先写失败测试,再修复 tdd.md
核心用户流程验证 E2E 测试 e2e.md
重构现有代码 先补测试,再重构 tdd.md
UI 交互验证 E2E + 视觉回归 e2e.md

覆盖率目标

代码类型 单元测试 E2E 测试
核心业务逻辑 100% 关键流程
普通业务代码 80%+ 可选
工具函数 80%+ 不需要
UI 组件 70%+ 关键交互

最佳实践

  1. 测试先行 - TDD 循环:RED → GREEN → REFACTOR
  2. 独立隔离 - 每个测试独立运行,无共享状态
  3. 快速反馈 - 单元测试 < 50ms,E2E 适度控制
  4. 语义命名 - 测试名称描述行为,不描述实现
  5. 分层覆盖 - 单元测试多,E2E 测试精

TDD 循环速览

RED → GREEN → REFACTOR → REPEAT

RED:      写一个失败的测试
GREEN:    写最少的代码使测试通过
REFACTOR: 改进代码,保持测试绿色
REPEAT:   下一个场景

详细指南参阅 tdd.md

E2E 测试速览

tests/
├── e2e/                       # E2E 测试目录
│   ├── auth/                  # 认证流程
│   └── core/                  # 核心功能
├── pages/                     # Page Object Model
└── playwright.config.ts

详细指南参阅 e2e.md

测试命令

# 单元测试
npm test
npm test -- --coverage

# E2E 测试
npx playwright test
npx playwright test --headed  # 可视化
npx playwright test --debug   # 调试模式

记住:测试不是可选项。它是支持自信重构、快速开发和生产可靠性的安全网。

Files

What ships with it

5 files 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.

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. 3d ago First seen · 102 lines · 34 tokens per session scan A dd80fe6adb34

Subscribe to this mod's changes

testing is a skill published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 943 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-09-03.

Related

Other skills, from other repositories

moai-ref-testing-pyramid

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

modu-ai/moai-adk · 61 tokens

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

plan-pipeline-execute

Execute a validated plan: worktree isolation, TDD scaffolding, level-based parallel agents, quality gate with smoke test, PR creation and merge. Handles everything through to merged PR.

FlorianBruniaux/claude-code-ultimate-guide · 43 tokens

qa

Systematic QA testing of a web application: diff-aware, tiered, with fix-and-verify loop.

FlorianBruniaux/claude-code-ultimate-guide · 23 tokens

plan-pipeline-eng-review

Engineering architecture gate: lock architecture, diagrams, edge cases, and test matrix before writing implementation code.

FlorianBruniaux/claude-code-ultimate-guide · 25 tokens

ci-all

Full CI pipeline: run local tests, type check, push branch, and return the pipeline URL. The only command you need before opening a PR.

FlorianBruniaux/claude-code-ultimate-guide · 33 tokens