testing

A guide for planning and writing automated tests, which are checks that verify code behaves as expected.

In plain words
What is it for?
Use it to add tests, improve coverage, fix flaky tests, set up a test suite, or decide what behavior and edge cases to test.
Why use it?
It helps avoid unreliable tests, tests tied to implementation details, and wasted effort testing low-risk code.

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

Made for: Claude Code, Codex.

Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 741 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.00085 $0.00741
Opus 5 $0.00043 $0.00370
Sonnet 5 $0.00017 $0.00148
Haiku 4.5 $0.00009 $0.00074

Measured 3d ago against content hash b71ae5e9bcf6, 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 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.

src/integrations/common/skills/testing/SKILL.md · 53 lines

How it starts

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

Testing

Write tests that fail for exactly one reason, pass deterministically, and survive refactoring.

Scope

Use for deciding what to test and writing it: new tests, coverage gaps, flaky tests, test structure, setting up a suite.

Do not use for:

  • Diagnosing why production code misbehaves when the cause is unknown — use debugging. Once the cause is identified, bug-fix returns here for the regression test.
  • Judging non-test production code — use code-quality-review.

What to test

  • Test observable behavior and contracts, not implementation details. A refactor that preserves behavior should not break tests.
  • Prioritize by risk: core business logic and boundary conditions first, then error paths, then integration seams. Do not chase coverage numbers for trivial code (getters, framework glue).
  • Every bug fix gets a regression test (see the bug-fix skill).
  • Follow the project's existing test framework, directory layout, naming, and assertion style — do not introduce a new test framework into a project that has one.

Determinism

  • No hidden dependencies on wall-clock time, timezones, locale, random seeds, network, or test execution order. Inject clocks, seed randomness, and fake external services at the boundary.
  • Each test owns its setup and teardown; tests must pass in isolation and in any order.
  • Treat flaky tests as defects in the test suite: find the nondeterminism instead of masking it with retries or sleeps. If the nondeterminism turns out to be in the production code rather than the test, hand off to debugging.

Databases and external state

  • Never test against a development, staging, or production database. Use the project's test database, or add a disposable one (container or in-process instance) if none exists.
  • Assert in global setup that the target is the test database; never let a missing test configuration fall back to the default database.
  • Reset between tests — transaction rollback, truncation, or a fresh schema. Never rely on data left by another test or manual seeding.
  • Never share a test database between parallel test runs unless the project explicitly supports it.
  • Apply the same isolation rules to caches, queues, object storage, and search indexes — use isolated instances or per-test namespaces.

Read the full file on GitHub · 53 lines

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 · 53 lines · 85 tokens per session scan A b71ae5e9bcf6

Subscribe to this mod's changes

testing is a skill published in the GitHub repository thixpin/pitway (19 stars, last pushed 4d ago), licensed MIT. It adds 85 tokens to every session and 741 once invoked, about $0.0004 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

concord-relay

Keep this Grok session reachable by other Concord agents while idle.

Get-Concord-AI/concord-mcp · 18 tokens

pace-workflow

Use for PACEflow-managed coding work: create, approve, resume, verify, close, or archive CHG/HOTFIX before project file edits.

paceaitian/paceflow · 35 tokens

work-loop

Use when implementing or resuming a non-trivial repository change: a feature, behavior-changing fix, refactor, migration, framework or dependency upgrade, schema or API change, performance work, infrastructure or build-system change, reversion, or an existing build spec under docs/specs/. Also use for bare…

eugenelim/agent-ready-repo · 161 tokens

artifact-management

Use for PACEflow artifact fields and formats: task indexes, CHG/HOTFIX lifecycle operations, artifact-writer prompts, approvals, verification, and archive.

paceaitian/paceflow · 36 tokens

new-spec

Use this skill when the user wants to start a new feature with a spec, or wants to write a spec for something they're about to build. Triggers on "new spec", "write a spec for X", "let's spec this out", "start a feature for...". Spec-driven development; the spec drives implementation. Do NOT use for cross-cutting…

eugenelim/agent-ready-repo · 94 tokens

workspace-status

Use this skill to orient at session start, check initiative queue state, or see what's ready to work on next. Reads workspace.toml and surfaces ready-to-start items, blocked items with reason, parallel candidates, and active signals. Triggers on "workspace status", "where am I", "orient me", "session start", "what's…

eugenelim/agent-ready-repo · 170 tokens