testing

A repository-aware guide for testing code, including test-driven development (TDD), where a failing test is written before the implementation. It explains how to choose test boundaries and produce observable proof that behavior works.

In plain words
What is it for?
Use it when writing, reviewing, or fixing tests, especially to select a focused test, verify a behavior change, and run the required wider checks.
Why use it?
It prevents tests from being treated as an afterthought and helps match testing to the repository’s existing commands, fixtures, thresholds, and conventions.

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

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 683 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.00028 $0.00683
Opus 5 $0.00014 $0.00342
Sonnet 5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00068

Measured 2d ago against content hash 89d20e24e1dd, 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 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.

.agents/skills/testing/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.

Testing

Reference

Read references/typescript.md only for TypeScript tests in web frontend work, including React, RTL, MSW, and Playwright tests. It does not apply to backend or non-web TypeScript tests.

Governing Sources

Use test commands, thresholds, boundaries, fixtures, and conventions from the repository, task, Work Plan, Design Doc, or test skeleton. When these sources are silent, select the smallest repository-supported proof without introducing a new project-wide default.

TDD Gate

For behavior-changing implementation:

  1. RED: Add or select a test that observes the required behavior. Run it and confirm it fails for the targeted missing behavior or regression.
  2. GREEN: Make the smallest implementation change that satisfies the behavior. Run the focused test.
  3. REFACTOR: Improve the changed code without changing the contract. Re-run the focused test.
  4. VERIFY: Run the repository's required quality command and every wider check required by the task boundary.

Documentation, pure configuration, and disposable exploration do not require a RED phase. A productionized spike must gain tests before completion.

Proof Selection

  • Test through the public or externally observable boundary named by the acceptance criterion or proof obligation.
  • Keep a dependency real when that dependency is the boundary under proof; isolate external I/O only when the selected test level permits it.
  • Use integration or E2E tests for persistence, process, browser, service, or cross-component claims that unit tests cannot observe.
  • A broader test does not replace a required focused check, and a focused test does not prove a wider boundary.

Capability Probe Postconditions

Evidence is substantive only when an executed assertion observes the exact consumer-visible postcondition.

  • A helper result, mock call, source match, build success, or zero-test run does not prove behavior unless that is the named claim.
  • Intentional absence is substantive when absence is the expected postcondition.
  • State-changing behavior must assert relevant before → action → after state, including persistence or rollback semantics when applicable.
  • For a changed route or alternate input path, exercise that path explicitly; evidence from another route is not interchangeable.

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. 2d ago First seen · 59 lines · 28 tokens per session scan A 89d20e24e1dd

Subscribe to this mod's changes

testing is a skill published in the GitHub repository shinpr/codex-workflows (38 stars, last pushed 5d ago), licensed MIT. It adds 28 tokens to every session and 683 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

chrome-cdp

Drive a headless Chrome over the Chrome DevTools Protocol (CDP) for browser QA — navigate, click, fill forms, read the DOM/accessibility tree, screenshot, and assert. Use whenever a task requires loading a web page and interacting with it like a user. Chrome is launched by a bash step (recipe below); this skill…

mattzcarey/shippie · 91 tokens

skill-creator

Create, install, or update skills in the workspace. Use when (1) installing a skill from a URL or remote source, (2) creating a new skill from scratch, (3) updating or restructuring existing skills. Always use this skill for any skill installation or creation task.

zhayujie/CowAgent · 61 tokens

metrics-instrumentation

Specification for instrumenting an opik-backend workflow with operational OpenTelemetry metrics — per-stage throughput/latency/error counters and native histograms, dimensioned per-customer (workspace). Use when a pipeline (scoring, ingestion, experiments, jobs) needs per-stage visibility. Covers metric emission only…

comet-ml/opik · 93 tokens

peekaboo

Capture and automate macOS UI with the Peekaboo CLI.

the-open-agent/openagent · 17 tokens

powerpoint

Create designed, editable PowerPoint .pptx presentations with PptxGenJS. Use when the user asks to create, generate, update, or inspect a deck, slide deck, presentation, or .pptx file.

the-open-agent/openagent · 48 tokens

new-app

Scaffold a new Atomic Agents project from scratch — create the directory, pyproject.toml, env file, first agent, and a runnable entry point. Use when the user asks to start a new atomic-agents project from scratch, says "scaffold" / "new project" / "start from zero", or runs /atomic-agents:new-app.

Eigenwise/atomic-agents · 76 tokens