testing-principles

testing-principles is a skill for Claude Code from shinpr/claude-code-workflows. It costs 50 tokens per session (937 once invoked), scanned A, original, MIT.

A set of general testing guidelines covering test-driven development, test quality, coverage, and test design. Test-driven development means writing a failing test, making it pass with the smallest change, then improving the code.

In plain words
What is it for?
Use it when writing tests, planning test coverage, reviewing test quality, or fixing reproducible bugs.
Why use it?
It keeps tests focused on meaningful behaviour instead of chasing coverage numbers or creating fragile, low-value tests.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dev-skills plugin — 11 skills shipped together

Good fit Use it when writing tests, planning test coverage, reviewing test quality, or fixing reproducible bugs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shinpr/claude-code-workflows/testing-principles
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 shinpr/claude-code-workflows --skill testing-principles
Clone the repo
git clone --depth 1 https://github.com/shinpr/claude-code-workflows

Made for: Claude Code.

Or install dev-skills, the plugin that ships this one along with the rest of its 11 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/shinpr/claude-code-workflows/testing-principles/github.svg)](https://agentmods.dev/skills/shinpr/claude-code-workflows/testing-principles)
Your own site
<a href="https://agentmods.dev/skills/shinpr/claude-code-workflows/testing-principles"><img src="https://agentmods.dev/badge/skills/shinpr/claude-code-workflows/testing-principles/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 testing-principles

Your own site · 80×15
<a href="https://agentmods.dev/skills/shinpr/claude-code-workflows/testing-principles"><img src="https://agentmods.dev/badge/skills/shinpr/claude-code-workflows/testing-principles.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 937 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00050 $0.00937
Opus 5.5 $0.00020 $0.00375
Sonnet 5.5 $0.00010 $0.00187
Haiku 4.5 $0.00005 $0.00094

Measured 3d ago against content hash 591da4ef5b88, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-principles 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.

dev-skills/skills/testing-principles/SKILL.md · 59 lines

How it starts

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

Language-Agnostic Testing Principles

Tests here guarantee accepted behavior, and the next agent reads every existing test as a requirement to preserve. A brittle, duplicated, or implementation-shaped test therefore becomes a false requirement: it gets worked around, and the workaround leaves debt in the implementation. Keep the set of tests whose proof is worth its maintenance.

Test Selection

  • Prove accepted behavior by default through integration and E2E tests at the boundary users and callers observe. Add a unit test for logic whose cases one representative boundary test cannot prove, such as calculations, parsing, or branching rules.
  • Each behavioral claim is owned by one test: such logic by its unit test, other behavior by the test at the narrowest integration or E2E boundary where it is observable. A test at a wider boundary or in a variant (viewport, device, role) proves what that boundary or variant adds, such as wiring, mapping, persistence, rendering, or navigation, and keeps at most one representative case of a rule owned elsewhere.
  • Treat coverage as a diagnostic signal for finding untested areas, not a target; any CI threshold is the project's config, not a quality goal in itself.
  • Use project-configured speed budgets when present. Otherwise investigate test speed only when observed feedback or CI cost is material to the current outcome; retain slower tests when their proof boundary requires it.

Test Design Rules

  • Structure each test as Arrange, one Act, and Assert; multiple assertions may prove one behavior.
  • Follow the repository's test naming convention and name the condition and observable outcome.
  • Exercise behavior through a public or integration boundary. Assertions verify return values, outputs, errors, or state changes rather than private implementation.
  • Use independently derived literal, property, approved snapshot, or fixture expectations. An implementation-derived oracle cannot detect the same implementation defect.
  • Keep each test's expected outcome unconditional. Table-driven or property-based cases are acceptable when each case is reported distinctly and uses an independent oracle.
  • Cover accepted boundary and error behavior; derive cases from the contract instead of adding generic edge-case permutations.
  • Each test creates and cleans up its own state, passes in isolation and any order, and controls time or randomness that affects its result.
  • Keep tests executable. Fix or remove tests that no longer describe accepted behavior; restore tests disabled only to bypass a failure.

Read the full file on GitHub · 59 lines

Files

What ships with it

2 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 Changed · +1 lines · +10 tokens per session 591da4ef5b88
  2. 1mo ago First seen · 58 lines · 40 tokens per session scan A 3da24a71e449

Subscribe to this mod's changes

testing-principles is a skill published in the GitHub repository shinpr/claude-code-workflows (698 stars, last pushed 4d ago), licensed MIT. It adds 50 tokens to every session and 937 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-30.

Related

Other skills, from other repositories

plan

Analyzes architecture, selects patterns, assesses testability, then decomposes work into ordered TDD tasks with exact verification commands and explicit acceptance mapping. Works from an approved spec (zuvo:brainstorm output) or directly from a user-provided description.

greglas75/zuvo · 53 tokens

tdd

This skill should be used when the user asks to "add a feature using TDD", "fix a bug with TDD", "do TDD", "red-green-refactor", "write a failing test first", "use test-driven development", "start TDD", "test first approach", "TDD loop", "TDD cycle", or mentions TDD workflow, baby steps, guessing game, or…

t1/tdder · 102 tokens

engineering-craft

Use when writing or changing any production code or tests — new features, bug fixes, refactors, or test authoring, in any language, by any model on any CLI.

mickeyyaya/evolve-loop · 40 tokens

unbiased-review

Use when reviewing a spec, plan, or implementation produced by another session - verifies its claims against the actual repo, grades TDD and hexagonal discipline, and reports severity-ranked findings without writing the fix. Triggers on "review this spec/plan/implementation", "second opinion on", "check this design"…

karsten-s-nielsen/mad-scientist-skills · 84 tokens

tdd

Use when the plan-review verdict is PROCEED (or plan-review is disabled) and code has not yet been written. Writes RED tests first, defining the contract Builder must satisfy. The mandatory hop before any implementation.

mickeyyaya/evolve-loop · 47 tokens

ci-cd

A collection of practices for automating software checks and delivery. CI/CD means continuous integration and continuous delivery: changes are automatically checked, built, and potentially deployed.

int2t05/engineering-skills · 28 tokens