| name | testing |
| description | Write, configure, and run unit + integration tests using project-independent best practices; detect tooling; triage failures/flakes; keep a compact Testing State Capsule. |
| metadata | [object Object] |
Testing
Help the agent add and improve unit/integration tests across languages and frameworks, while staying aligned with repo-specific conventions.
Core rules
- Follow the closest in-scope
AGENTS.mdinstructions first. - If present, follow
docs/testing-policy.md. - Prefer the smallest, fastest test that proves the change; expand only if needed by policy/risk.
- Do not invent test commands: discover how the repo runs tests, then reuse it.
- Keep tests deterministic: no network calls, no real time dependence, no order dependence, no shared global state.
- Ask clarifying questions only when they unblock forward progress; otherwise proceed with explicit assumptions.
- While this skill is active, keep a short Testing State Capsule updated in every reply.
- If the task continues across turns, keep following this skill; if context was reset/compacted, re-invoke
$testingand restate the state capsule.
Clarifying loop (no fixed turn limit)
If test tooling/requirements are unclear:
- Ask the minimum set of questions that unblock an immediate next action.
- If the user cannot answer, propose reasonable assumptions and continue (clearly marked), preserving easy rollback.
- After each user answer, restate the updated state capsule and continue.
Workflow (repeatable)
- Read project context (
AGENTS.md,docs/testing-policy.md, README/CONTRIBUTING/CI config). - Discover test tooling and commands (see
references/tooling-discovery.md). - Choose the right layer:
- Unit: pure logic and edge cases; fast; isolated.
- Integration: cross-module boundaries and real dependency behavior; realistic setup.
- Draft a small test plan (use
assets/test-plan-template.mdand/orassets/test-matrix.csvas needed). - Implement tests with minimal coupling and clear naming (see
references/unit-testing.md,references/integration-testing.md). - Run the narrowest relevant tests, then expand per policy/risk.
- If failures are flaky or environment-related, follow
references/flaky-tests.md.
Output requirements (when this skill is used)
- Always include exact commands you ran (or will run) and the observed output snippets that matter.
- Always update the Testing State Capsule (keep it short).
- When making assumptions, label them and provide the easiest validation step.
Testing State Capsule (template)
Keep this block up to date and near the end of each reply:
[Testing State Capsule]
Goal:
Repo signals (runner/framework):
Unit command(s):
Integration command(s):
Env/deps (DB/containers/fixtures):
Assumptions:
Last result:
Next action:
Open questions:
References
references/principles.mdreferences/tooling-discovery.mdreferences/unit-testing.mdreferences/integration-testing.mdreferences/flaky-tests.md
Assets
assets/test-plan-template.mdassets/test-matrix.csv