Install
openclaw skills install write-better-testsUse when Codex is adding, editing, selecting, reviewing, or explaining tests in any repository, including mocks, fixtures, snapshots, CI validation, regression coverage, TDD/red-green proof, or readiness claims. Enforces behavior-first test design so tests catch real regressions instead of merely passing the current implementation.
openclaw skills install write-better-testsUse this skill whenever test quality matters. The goal is not "more tests"; the goal is tests a skeptical maintainer would trust.
Before saying coverage is good, prove the test would fail for the old or broken behavior when practical. A passing test without a credible failure mode is weak evidence.
Accept a test only if it satisfies all three:
If a meaningful test is not practical, say that directly and use a different proof path. Do not add decorative coverage.
references/test-smells.md before calling the change ready.Never keep a temporary mutation, broad debug fixture, or local-only proof artifact in the final diff.
Prefer tests that:
Reject or rewrite tests that:
toBeTruthy, not.toThrow, or "renders something" as the main proof for a concrete regression;Read references/test-smells.md when a test feels plausible but maybe too convenient.
For OpenClaw repositories, use this skill alongside openclaw-contributions.
For ClawHub Convex work, respect convex/_generated/ai/guidelines.md; avoid unindexed scans and tests that bless expensive exact-count behavior when the product should use bounded limit + 1 or hasMore contracts.
For openclaw/openclaw CLI, config, session, auth, filesystem, or sandbox work, isolate state with temp directories and test homes. Never run tests against Vyctor's real ~/.openclaw instance unless he explicitly asks for that exact path.
In the final work summary, include:
For public PR bodies, mention only repository-native commands and behavior. Do not mention this skill, Codex-local checks, local paths, or temporary mutation details.