design-creative
Stop Tautological Tests: The test-hygiene Skill
A skill that ensures agents write meaningful tests that fail without production logic, improving reliability.
Where this fits
You're building an agent that refactors a payment service. It adds a test for the new calculateFee function. The test asserts the function returns amount * 0.02 — exactly what the implementation does. The test passes even if you delete the function body. That's a tautological test: it pins the implementation, not the behavior. This skill steps in when your agent writes, modifies, or touches test code, or when a plan includes a "done when" check. It forces the agent to pin observable behavior with independent expected values, so tests actually catch regressions.
Why agents benefit
- Detects tautological tests before they ship, using a hard gate that fails if the test would still pass after deleting production logic.
- Guides what to pin: return values, thrown errors, rendered UI, or real side effects — never private helpers or internal call order.
- Applies to any test-writing context: new tests, edits to existing suites, or adding done-when criteria to a plan node.
- Prevents snapshot sprawl by rejecting tests that compare against implementation-generated values.
- Works without forcing TDD — it only requires that the test fails when the logic is removed, keeping the agent flexible.
Practical scenarios
Refactoring a legacy module with existing tests
Your agent modifies a function and the surrounding test file. The skill loads, reviews the existing tests, and flags any that are tautological (e.g., a test that hardcodes the same formula as the implementation). It rewrites those tests to use literal fixture values, ensuring they'd fail if the logic breaks.
Adding a done-when check to a plan node
A plan says "implement error handling for the API client." The agent adds a done when test that checks the client throws a specific error on a 500 response. The skill validates the expected error is an independent literal, not a reference to the production constant.
Writing tests for a new feature end-to-end
Your agent builds a small UI component and writes tests. The skill steers it toward asserting rendered text or DOM structure with static strings, not by calling internal state methods. It also warns against snapshot tests that capture the whole component tree, which are brittle and often tautological.
Add it to your agent workflow
Install the skill via:
npx skills add AlemTuzlak/skills --skill test-hygiene
Then load it in your agent's instructions or as a tool. For example, when your agent is about to write a test, it can call the skill with the test file path and the production code it covers. The skill returns guidance and a gate check before the agent finalizes the test.
Compare before adopting
Before you adopt test-hygiene, compare it against alternatives you already use (like a custom lint rule or a prompt template). Look at the quality signals: does the skill actually enforce the hard gate, or is it just advice? Check maintenance freshness — the repo has 39 stars and is actively updated. Also consider workflow fit: does it integrate with your agent framework (Claude, OpenAI, etc.)? For a deeper look, see the skill page on OpenAgentSkill.
Why it is worth tracking
This skill addresses a real failure mode in agent-written tests: the tendency to mirror implementation details. Its hard gate is a concrete, checkable rule that improves test quality without slowing down development. With 39 stars and a single maintainer, it's early but promising. Track it if you care about reliable agent-generated test suites; evaluate it when your agents start writing tests beyond simple smoke checks.
Featured Skill
test-hygiene
Skill by AlemTuzlak