testing

testing is a skill for Claude Code, Codex from TheBeardedBearSAS/claude-craft. It costs 30 tokens per session (1,013 once invoked), scanned A, original, MIT.

A general testing guide based on TDD and BDD. TDD means writing a failing test, making it pass, and then improving the code; BDD focuses tests on expected behaviour.

In plain words
What is it for?
Use it when designing a test strategy, writing tests, reviewing coverage, or deciding between unit, integration, and end-to-end tests.
Why use it?
It provides a common way to organise tests across different languages and frameworks, from small units to complete user flows.

Skill for Claude CodeCodex

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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

Made for: Claude Code, Codex.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 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/thebeardedbearsas/claude-craft/testing.svg)](https://agentmods.dev/skills/thebeardedbearsas/claude-craft/testing)
Your own site
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/testing"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,013 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.00030 $0.01013
Opus 5 $0.00015 $0.00507
Sonnet 5 $0.00006 $0.00203
Haiku 4.5 $0.00003 $0.00101

Measured yesterday against content hash b680d21d6c1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

.claude/skills/testing/SKILL.md · 127 lines

How it starts

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

Testing - Principes TDD/BDD (2026)

Principes universels de testing pour toutes les technologies du framework Claude-Craft.

Principes fondamentaux

  • TDD Cycle: RED → GREEN → REFACTOR
  • Couverture cible: >= 80%
  • Pyramide: Unit (70%) > Integration (20%) > E2E (10%)
  • Pattern: Arrange-Act-Assert (AAA)
  • Nommage: Tests descriptifs expliquant le comportement

Outils recommandés 2026

Stack Unit/Composants E2E/Browser Mutation Testing
JS/TS/React Vitest 4.1+ (Browser Mode stable) Playwright Stryker
PHP/Laravel/Symfony Pest 4.5+ (PHPUnit 12, Browser Testing) Playwright via Pest Infection
Python pytest 8.x + Ruff 0.8+ Playwright Mutmut
Flutter flutter_test + bloc_test 10+ Patrol 3.13+ built-in
React Native RNTL + Jest Detox/Maestro Stryker

Sources : Vitest 4, Pest 4, Stryker Mutator

Stratégies 2026

Vitest 4 — Browser Mode stable

Abandonner JSDOM lourd. Chromium/Firefox/WebKit natifs.

// vitest.config.ts
export default defineConfig({
  test: {
    browser: {
      enabled: true,
      name: 'chromium', // ou 'firefox', 'webkit'
      provider: 'playwright',
    },
  },
});

Source : Vitest Browser Mode

Mutation Testing — "Coverage ment, mutation scores disent la vérité"

Tester la qualité des tests. Mutation score >= 80%.

# Stryker (JS/TS/C#)
npx stryker run

# Infection (PHP)
vendor/bin/infection --min-msi=80

# Mutmut (Python)
mutmut run

Source : Stryker Mutator

Property-based Testing

Générer des tests à partir de propriétés invariantes.

// fast-check (JS/TS)
import fc from 'fast-check';

test('sorting preserves all elements', () => {
  fc.assert(
    fc.property(fc.array(fc.integer()), (arr) => {
      const sorted = [...arr].sort();
      return sorted.length === arr.length;
    })
  );
});

Read the full file on GitHub · 127 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. yesterday First seen · 127 lines · 0 tokens per session scan A b680d21d6c1b

Subscribe to this mod's changes

testing is a skill published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 2d ago), licensed MIT. It adds 30 tokens to every session and 1,013 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

agent-integration

Run all three agent integration phases sequentially: research, write-tests, and implement using E2E-first TDD (unit tests written last). For individual phases, use /agent-integration:research, /agent-integration:write-tests, or /agent-integration:implement. Use when the user says "integrate agent", "add agent…

entireio/cli · 89 tokens

outside-in-tdd

Use when writing tests from the outside-in, defining behavior before code, or any feature where tests should start from observable business behavior and let internal design emerge.

SebastienDegodez/copilot-instructions · 35 tokens

implement

Execute approved plans, fix bugs, and make code changes inline with incremental validation. TDD by default, build+test after each logical block, commit at green checkpoints, and divergence detection that routes back to planning instead of pushing through a broken approach. Use when: 'implement this', 'execute the…

melodic-software/claude-code-plugins · 110 tokens

red-synthesize-green

Use when implementing any feature or fix using TDD, before writing any implementation code.

SebastienDegodez/copilot-instructions · 21 tokens

playwright

Live E2E browser automation via Microsoft's @playwright/cli: named sessions, accessibility-ref snapshots, click/fill by ref, screenshots, console and network capture, network mocking, tracing, video, and auth state, with artifacts written to disk so only paths enter context (far fewer tokens than Playwright MCP). Use…

melodic-software/claude-code-plugins · 114 tokens

verify

Re-derive a performance result in a FRESH CONTEXT that does not inherit the implementer's numbers, then report the target as met or not met without rounding a miss into a win. Dispatches a verifier told to distrust the reported figures and reproduce them from the trees, checks that the change did not alter behavior…

melodic-software/claude-code-plugins · 173 tokens