Agent skill

Testing Anti Patterns

by rohitg00 in rohitg00/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.

Apache-2.0Auto-check passedTesting & QA

Install Testing Anti Patterns

skills CLI
$ npx skills add rohitg00/skillkit --skill testing-anti-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rohitg00/skillkit testing-anti-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rohitg00/skillkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/core/src/methodology/packs/testing/anti-patterns .claude/skills/testing-anti-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-anti-patterns
GitHub stars
1.5k
Token cost
~2.1k tokens
SKILL.md length
382 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reviews test code to identify and fix common testing anti-patterns including flaky tests, over-mocking, brittle assertions, test interdependency, and hidden test logic.

  • Works in 8 steps: The Liar - Tests That Always Pass → The Giant - Tests Too Large → The Inspector - Testing Implementation… → …
  • Reviewing test code
  • SKILL.md covers Review Workflow, Critical Anti-Patterns, Anti-Pattern Detection Checklist and Refactoring Strategies, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Testing Anti Patterns is an agent skill from rohitg00/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.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Failing and flaky tests. The repository describes itself as: Supercharge AI coding agents with portable skills. Install, translate & share skills across Claude Code, Cursor, Codex, Copilot & 40 more. The licence is Apache-2.0.

When your agent uses it

  • Reviewing test code
  • Debugging intermittent
  • Unreliable test failures
  • The user mentions flaky tests

Example prompts

  • “Use the testing-anti-patterns skill to review test code to identify and fix common testing anti-patterns including flaky tests, over-mocking…”
  • “/testing-anti-patterns”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. The Liar - Tests That Always Pass
  2. The Giant - Tests Too Large
  3. The Inspector - Testing Implementation Details
  4. The Mockery - Over-Mocking
  5. The Flaky Test - Random Failures
  6. The Slow Poke - Unnecessarily Slow Tests
  7. The Chain Gang - Test Dependency
  8. The Secret Catcher - Hidden Test Logic

What it can do on your machine

Read from SKILL.md and the folder at commit d2e5c34. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Anti Patterns loads about 2.1k tokens when it runs. Until then it costs about 127 tokens; SKILL.md has 382 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~127
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rohitg00/skillkit at commit d2e5c34, republished under its Apache-2.0 licence (© rohitg00). 382 words, ~2,052 tokens.

Download SKILL.mdSave it as .claude/skills/testing-anti-patterns/SKILL.md (or your agent's skills folder).
name
testing-anti-patterns
description
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.
version
1.0.0
triggers
test anti-patterns, testing mistakes, bad tests, flaky tests, test smells
tags
testing, anti-patterns, quality, code-smells
difficulty
intermediate
estimatedTime
10
relatedSkills
testing/red-green-refactor, testing/test-patterns

Testing Anti-Patterns

You are identifying and avoiding common testing anti-patterns.

Review Workflow

Follow these steps when reviewing test code:

  1. Run tests in isolation — Verify each test passes independently (no shared state, no ordering dependency).
  2. Check for patterns below — Scan for each anti-pattern in the checklist; flag every match with the specific defect.
  3. Apply refactoring strategy — Use the refactoring strategies section to select and apply the appropriate fix.
  4. 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).

Critical Anti-Patterns

1. The Liar - Tests That Always Pass

Problem: Test passes even when the code is broken.

typescript
// BAD - Always passes because it tests nothing meaningful
it('should process data', () => {
  const result = processData(input);
  expect(result).toBeDefined(); // Too weak
});

// GOOD - Actually verifies behavior
it('should transform input to uppercase', () => {
  const result = processData({ text: 'hello' });
  expect(result.text).toBe('HELLO');
});

Detection: Remove or break the implementation - test should fail.

2. The Giant - Tests Too Large

Problem: Single test covers too many behaviors.

typescript
// BAD - Tests multiple things
it('should handle user registration', async () => {
  const user = await register(userData);
  expect(user.id).toBeDefined();
  expect(user.email).toBe(userData.email);
  expect(user.password).toBeUndefined();
  expect(sendEmail).toHaveBeenCalled();
  expect(createProfile).toHaveBeenCalled();
  // ... 20 more assertions
});

// GOOD - Focused tests
it('should create user with provided email', async () => {
  const user = await register(userData);
  expect(user.email).toBe(userData.email);
});

it('should send welcome email on registration', async () => {
  await register(userData);
  expect(sendEmail).toHaveBeenCalledWith(
    expect.objectContaining({ type: 'welcome' })
  );
});

Fix: One test, one logical assertion concept.

3. The Inspector - Testing Implementation Details

Problem: Test breaks when implementation changes, even if behavior is correct.

typescript
// BAD - Tests internal implementation
it('should use QuickSort for sorting', () => {
  const sorter = new Sorter();
  const spy = jest.spyOn(sorter, '_quickSort');
  sorter.sort([3, 1, 2]);
  expect(spy).toHaveBeenCalled();
});

// GOOD - Tests behavior/output
it('should return sorted array', () => {
  const sorter = new Sorter();
  expect(sorter.sort([3, 1, 2])).toEqual([1, 2, 3]);
});

Fix: Test what the code does, not how it does it.

4. The Mockery - Over-Mocking

Problem: Too many mocks make tests meaningless.

typescript
// BAD - Everything is mocked, test proves nothing
it('should calculate price', () => {
  const mockProduct = { getPrice: jest.fn().mockReturnValue(100) };
  const mockDiscount = { apply: jest.fn().mockReturnValue(80) };
  const mockTax = { calculate: jest.fn().mockReturnValue(8) };

  const total = calculateTotal(mockProduct, mockDiscount, mockTax);
  expect(total).toBe(88); // Just testing mock arithmetic
});

// GOOD - Use real objects where feasible
it('should apply 20% discount to price', () => {
  const product = new Product({ price: 100 });
  const discount = new PercentageDiscount(20);

  const total = calculateTotal(product, discount);
  expect(total).toBe(80);
});

Fix: Only mock external dependencies and side effects.

5. The Flaky Test - Random Failures

Problem: Test sometimes passes, sometimes fails.

Common causes:

  • Time-dependent logic
  • Race conditions in async code
  • Shared mutable state
  • External dependencies
typescript
// BAD - Depends on current time
it('should show recent items', () => {
  const item = { createdAt: new Date() };
  expect(isRecent(item)).toBe(true);
});

// GOOD - Control the time
it('should show items from last 24 hours', () => {
  const now = new Date('2024-01-15T12:00:00Z');
  jest.setSystemTime(now);

  const recent = { createdAt: new Date('2024-01-15T00:00:00Z') };
  const old = { createdAt: new Date('2024-01-13T00:00:00Z') };

  expect(isRecent(recent)).toBe(true);
  expect(isRecent(old)).toBe(false);
});
6. The Slow Poke - Unnecessarily Slow Tests

Problem: Tests take too long to run.

typescript
// BAD - Real network call
it('should fetch user data', async () => {
  const response = await fetch('https://api.example.com/users/1');
  const user = await response.json();
  expect(user.name).toBeDefined();
});

// GOOD - Mocked network
it('should parse user response', async () => {
  mockFetch.mockResolvedValue({
    json: () => Promise.resolve({ id: 1, name: 'Test User' })
  });

  const user = await fetchUser(1);
  expect(user.name).toBe('Test User');
});

Target: Unit tests < 100ms, Integration tests < 1s.

Show full SKILL.md (143 more words)Show less
7. The Chain Gang - Test Dependency

Problem: Tests depend on other tests running first.

typescript
// BAD - Tests must run in order
describe('User operations', () => {
  let userId;

  it('should create user', () => {
    userId = createUser(); // Sets state for next test
    expect(userId).toBeDefined();
  });

  it('should update user', () => {
    updateUser(userId, newData); // Depends on previous test
    expect(getUser(userId).name).toBe(newData.name);
  });
});

// GOOD - Each test is independent
describe('User operations', () => {
  it('should create user', () => {
    const userId = createUser();
    expect(userId).toBeDefined();
  });

  it('should update user', () => {
    const userId = createUser(); // Creates its own user
    updateUser(userId, newData);
    expect(getUser(userId).name).toBe(newData.name);
  });
});
8. The Secret Catcher - Hidden Test Logic

Problem: Test logic is hidden in helpers or setup.

typescript
// BAD - Assertions hidden in helper
function assertValidUser(user) {
  expect(user.id).toBeDefined();
  expect(user.email).toMatch(/@/);
  expect(user.createdAt).toBeInstanceOf(Date);
  // Many more hidden assertions
}

it('should create valid user', () => {
  const user = createUser(data);
  assertValidUser(user); // What is actually being tested?
});

// GOOD - Explicit assertions
it('should create user with email', () => {
  const user = createUser(data);
  expect(user.email).toBe(data.email);
});

Anti-Pattern Detection Checklist

When reviewing tests, watch for:

  • Tests without meaningful assertions
  • Tests with more than 5-7 assertions
  • Tests that mock everything
  • Tests that access private methods/properties
  • Tests with sleep/wait calls
  • Tests that depend on test execution order
  • Tests with complex setup that obscures intent

Refactoring Strategies

  1. Too many assertions → Split into multiple tests
  2. Over-mocking → Use real implementations or fakes
  3. Flaky tests → Control time, mock external calls
  4. Slow tests → Mock I/O, parallelize independent tests
  5. Hidden logic → Inline or clearly name helpers

When to Delete Tests

Tests that:

  • Always pass regardless of implementation
  • Test third-party library behavior
  • Are permanently flaky without fix
  • Duplicate other tests exactly
  • Test deprecated code

© rohitg00, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/core/src/methodology/packs/testing/anti-patterns of rohitg00/skillkit.

Open the folder on GitHubat commit d2e5c34

Compare with similar skills

Testing Anti Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Anti Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Anti Patterns this skillrohitg00/skillkit1.5k—~2.1kAutomated safety check: PassApache-2.0
Swig Testswig/swig6.3k—~2.3kAutomated safety check: PassCustom licence
Triage CI FailureDataDog/datadog-agent3.8k—~2.3kAutomated safety check: PassApache-2.0
Dynamo Jira TicketDynamoDS/Dynamo2k—~1.1kAutomated safety check: PassApache-2.0
Fix Ready PRsfastrepl/anarlog9.5k—~1.4kAutomated safety check: PassMIT
Trx Analysismicrosoft/vstest969—~1.8kAutomated safety check: PassMIT

Similar skills

  • Swig Test

    swig/swig

    Run SWIG test suite for specific languages. An agent skill from swig/swig.

    6.3k GitHub stars~2.3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Triage CI Failure

    DataDog/datadog-agent

    Official

    Classify a failed CI as either caused by an active incident, flakiness, or a true code regression.

    3.8k GitHub stars~2.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Dynamo Jira Ticket

    DynamoDS/Dynamo

    Create structured Jira tickets for Dynamo from bug reports, failing tests, or feature requests.

    2k GitHub stars~1.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Fix Ready PRs

    fastrepl/anarlog

    Inspect every open non-draft PR for CI failures and unresolved Cursor Bugbot findings, then fix them on the existing PR branches.

    9.5k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Trx Analysis

    microsoft/vstest

    Official

    Parse and analyze Visual Studio TRX test result files. An agent skill from microsoft/vstest.

    969 GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Wio

    workersio/skills

    Testing workflow skill for finding high-value test candidates, writing focused tests, generating realistic workloads, reviewing test value, and diagnosing test-suite health.

    190 GitHub stars~5.8k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed

More from rohitg00/skillkit

All 14 skills in this repo
  • Design First

    rohitg00/skillkit

    Guides the creation of technical design documents before writing code, producing architecture diagrams, data models, API interface definitions, implementation plans, and multi-option trade-off…

    1.5k GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Find Skills

    rohitg00/skillkit

    Discovers, searches, and installs skills from multiple AI agent skill marketplaces (400K+ skills) using the SkillKit CLI.

    1.5k GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Handoff Protocols

    rohitg00/skillkit

    Manages work transitions between team members or agents by creating structured handoff documents, summarizing project status, documenting key decisions, blockers, and open questions, and generating…

    1.5k GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Hypothesis Testing

    rohitg00/skillkit

    Applies the scientific method to debugging by helping users form specific, testable hypotheses, design targeted experiments, and systematically confirm or reject theories to find root causes.

    1.5k GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Parallel Investigation

    rohitg00/skillkit

    Coordinates parallel investigation threads to simultaneously explore multiple hypotheses or root causes across different system areas.

    1.5k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Red Green Refactor

    rohitg00/skillkit

    Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green.

    1.5k GitHub stars~1.3k tokensUpdated 4 mo ago
    Auto-check passed

Categories

Questions about Testing Anti Patterns

What does Testing Anti Patterns do?

Reviews test code to identify and fix common testing anti-patterns including flaky tests, over-mocking, brittle assertions, test interdependency, and hidden test logic. Testing Anti Patterns is an agent skill from rohitg00/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.

When should I use Testing Anti Patterns?

Testing Anti Patterns fits situations like: reviewing test code; debugging intermittent; unreliable test failures; the user mentions flaky tests.

How do I install Testing Anti Patterns in Claude Code?

Run `npx skills add rohitg00/skillkit --skill testing-anti-patterns -a claude-code`. Or copy the skill folder (packages/core/src/methodology/packs/testing/anti-patterns in rohitg00/skillkit) into .claude/skills/testing-anti-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Testing Anti Patterns in Codex?

Run `npx skills add rohitg00/skillkit --skill testing-anti-patterns -a codex`. Or copy the skill folder (packages/core/src/methodology/packs/testing/anti-patterns in rohitg00/skillkit) into .agents/skills/testing-anti-patterns in your project. Codex loads it when a task matches its description.

Can I use Testing Anti Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rohitg00/skillkit --skill testing-anti-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-anti-patterns, .gemini/skills/testing-anti-patterns, .github/skills/testing-anti-patterns and .opencode/skills/testing-anti-patterns in your project.

What does Testing Anti Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Testing Anti Patterns is instructions for the agent only.

Does Testing Anti Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Anti Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Anti Patterns use?

Testing Anti Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Anti Patterns use?

About 2.1k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Anti Patterns?

Skills that share tags, products or a category with Testing Anti Patterns: Swig Test (swig/swig, 6.3k stars), Triage CI Failure (DataDog/datadog-agent, 3.8k stars), Dynamo Jira Ticket (DynamoDS/Dynamo, 2k stars) and Fix Ready PRs (fastrepl/anarlog, 9.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Anti Patterns?

rohitg00 (a GitHub user) maintains it in rohitg00/skillkit, which has 1,546 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on June 2, 2026.

Source: rohitg00/skillkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.