Tooluck logoTooluck
SKILL.md

testing-anti-patterns

Agent skill fromrohitg00/skillkit

Reviews test code to identify and fix common testing anti-patterns including flaky tests, over-mocking, brittle assertions, test interdependency, and hidden test logic. Flags bad patterns, explains the specific defect, and provides corrected implementations. Use when reviewing test code, debugging intermittent or unreliable test failures, or when the user mentions flaky tests, test smells, brittle tests, test isolation issues, mock overuse, slow tests, or test maintenance problems.

How to install testing-anti-patterns

install testing-anti-patterns
# install the skillkit pack with the skills CLI
npx skills add rohitg00/skillkit

# or add only this skill to Claude Code: copy the folder

packages/core/src/methodology/packs/testing/anti-patterns/

# into

~/.claude/skills/anti-patterns/ (all projects)

.claude/skills/anti-patterns/ (one project)

packages/core/src/methodology/packs/testing/anti-patterns/SKILL.md

Apache-2.0Full file
1# Testing Anti-Patterns
2
3You are identifying and avoiding common testing anti-patterns.
4
5## Review Workflow
6
7Follow these steps when reviewing test code:
8
91. **Run tests in isolation** — Verify each test passes independently (no shared state, no ordering dependency).
102. **Check for patterns below** — Scan for each anti-pattern in the checklist; flag every match with the specific defect.
113. **Apply refactoring strategy** — Use the refactoring strategies section to select and apply the appropriate fix.
124. **Verify the test still fails when code breaks** — After fixing, confirm the corrected test catches real regressions (remove or stub the implementation to confirm a failure occurs).
13
14## Critical Anti-Patterns
15
16### 1. The Liar - Tests That Always Pass
17
18**Problem:** Test passes even when the code is broken.
19
20```typescript
21// BAD - Always passes because it tests nothing meaningful
22it('should process data', () => {
23 const result = processData(input);
24 expect(result).toBeDefined(); // Too weak
25});
26
27// GOOD - Actually verifies behavior
28it('should transform input to uppercase', () => {
29 const result = processData({ text: 'hello' });
30 expect(result.text).toBe('HELLO');
31});
32```
33
34**Detection:** Remove or break the implementation - test should fail.
35
36### 2. The Giant - Tests Too Large
37
38**Problem:** Single test covers too many behaviors.
39
40```typescript
41// BAD - Tests multiple things
42it('should handle user registration', async () => {
43 const user = await register(userData);
44…

Excerpt shown under the repository's Apache-2.0 license.

More skills in skillkit

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates