testing-strategy

A set of project guidelines for writing and running software tests. It distinguishes unit tests, which check small pieces in isolation, from integration tests, which check parts working together with realistic data or services.

In plain words
What is it for?
Use it when adding unit or integration tests, organizing test folders and fixtures, choosing test commands, or checking coverage and critical paths.
Why use it?
It gives tests a consistent structure and helps avoid slow, dependent, unclear, or poorly isolated tests.

Skill for Claude CodeCodex

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 skills/block/agent-skills/testing-strategy
Any agent
npx skills add block/agent-skills --skill testing-strategy
Clone the repo
git clone --depth 1 https://github.com/block/agent-skills

Made for: Claude Code, Codex.

Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 338 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.00013 $0.00338
Opus 5 $0.00006 $0.00169
Sonnet 5 $0.00003 $0.00068
Haiku 4.5 $0.00001 $0.00034

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

Security

Grade A, and why

testing-strategy 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 2d 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.

testing-strategy/SKILL.md · 67 lines

What it actually says

Testing Guidelines

Unit Tests

  • Test one thing per test
  • Use descriptive test names: test_user_creation_fails_with_invalid_email
  • Mock external dependencies
  • Keep tests fast and isolated

Integration Tests

  • Test API endpoints with realistic data
  • Verify database state changes
  • Clean up test data after each test
  • Use test fixtures for common scenarios

Running Tests

# Run all tests
npm test

# Run unit tests only
npm test:unit

# Run integration tests (requires database)
npm test:integration

# Run tests with coverage
npm test:coverage

Test Structure

tests/
├── unit/           # Fast, isolated unit tests
├── integration/    # Tests requiring external services
├── fixtures/       # Shared test data
└── helpers/        # Test utilities

Best Practices

  1. Arrange-Act-Assert: Structure tests clearly
  2. One assertion per test: When possible, test one behavior
  3. Descriptive names: Test names should describe the scenario
  4. No test interdependence: Tests should run in any order
  5. Clean state: Each test starts with a known state

Coverage Goals

  • Aim for 80%+ line coverage
  • Focus on critical paths first
  • Don't sacrifice test quality for coverage numbers
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. 2d ago First seen · 67 lines · 13 tokens per session scan A a97f1f473fd1

Subscribe to this mod's changes

testing-strategy is a skill published in the GitHub repository block/agent-skills (23 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 338 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

test-driven-development

TDD: enforce RED-GREEN-REFACTOR, tests before code.

mateaix/mateclaw · 20 tokens

plugin-quality

审查和改进 Zhin.js 插件质量(Plugin Runtime)。Use when asked to review plugin code, audit structure, or improve before publishing. 检查 definePlugin、约定目录、发送链与安全。.

zhinjs/zhin · 49 tokens

plugin-test

为 Zhin.js 插件编写和运行测试(Plugin Runtime)。Use when asked to write tests, add test coverage, or verify defineCommand / definePlugin behavior. 引导编写符合 Runtime 的 Vitest 测试。.

zhinjs/zhin · 51 tokens

test-patterns

Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable, reliable, and readable test suites. Use when the user asks about writing unit tests, integration tests, or end-to-end…

rohitg00/skillkit · 138 tokens

qa-bug-root-cause-analysis

当某个 Bug 频繁复现、线上有缺陷需要做事后分析、或者发现同一类问题反复出现需要根治时使用此技能。从症状出发用 5Why、因果图和鱼骨图等方法系统化定位缺陷根源,区分直接原因、间接原因和系统原因。不要只修症状——根因分析的价值在于找到让同类 Bug 不再发生的系统性改进措施,同时分析漏测原因来优化测试设计。 ⚠️ 本技能示例可能调用外部日志/监控工具,请在受控环境执行。.

Kokxi/qa-test-skills · 143 tokens

qa-bug-lifecycle

Skill "qa-bug-lifecycle" from Kokxi/qa-test-skills, covering 缺陷生命周期管理, 核心原则, 缺陷生命周期, 状态流转 and 状态定义.

Kokxi/qa-test-skills · 105 tokens