| name | test |
| description | Create, repair, or run tests for changed behavior. |
| argument-hint | file, module, feature, or failing test output |
| license | MIT |
| metadata | {"category":"quality","tags":["tests","qa","coverage"],"effort":"medium","side_effect":"tests-write","explicit_invocation":false} |
Test
Use this skill to add or fix focused tests.
The canonical testing rubric lives in docs/rubrics/testing.md.
Process
- Detect the test framework and naming conventions.
- Identify behavior under test.
- Identify product type and minimum test set from
docs/rubrics/testing.md.
- For changed behavior, write the failing test first and record the red evidence.
- Add unit tests first, integration tests when boundaries are involved, and E2E/smoke tests for deployable user flows.
- Include edge cases, negative cases, permission cases, and regression cases for bugs.
- Add contract tests for API, bot, CLI, webhook, queue, or integration boundaries.
- Run the smallest relevant test command, then broader tests if risk warrants it.
- Update
TEST_PLAN.md and record green/refactor evidence in QUALITY_GATES.md or .codex-memory/STATE.json.
- Run or satisfy
scripts/validate_plan_quality.py <project> before accepting a behavior-change gate.
Self-validation
Before final output, verify:
- Route, side-effect, and confirmation requirements match metadata.
- Required artifacts or read-only result are explicit.
- Verification, blockers, and next route are stated.
Rules
- Do not rewrite the app to make tests easy.
- Prefer stable behavior assertions over snapshots.
- Mock external services at process boundaries.
- Report commands run and failures that remain.
- Do not mark a gate as passing without a command or explicit manual check.
- Do not count a new behavior test as valid unless it was observed failing before implementation, or the exception is explicit.
- Engineering Discipline v2 blocks behavior changes without TDD red and green evidence.
- For production-facing browser products, ensure
/browser-check has Playwright/browser evidence before deploy readiness.