Agent skill

Testing Patterns

by softspark in softspark/ai-toolkit

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

Apache-2.0Auto-check passedTesting & QA

Install Testing Patterns

skills CLI
$ npx skills add softspark/ai-toolkit --skill testing-patterns -a claude-code

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

GitHub CLI
$ gh skill install softspark/ai-toolkit testing-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/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/testing-patterns .claude/skills/testing-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-patterns
GitHub stars
179
Token cost
~1.6k tokens
SKILL.md length
656 words
Files
6
Skills in repo
112
Repo updated
First seen
Licence
Apache-2.0

At a glance

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

  • Tasks that involve Test strategy
  • SKILL.md covers Test Structure (AAA Pattern), Test Organization, Quality Targets and Validation contract regressions, plus 5 more sections
  • Calls pytest and jest
  • Tasks that involve End-to-end testing

What it does

Testing Patterns is an agent skill from softspark/ai-toolkit. Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `reference/flutter-testing.md`, `reference/go-testing.md` and `reference/php-phpunit.md`).

It sits in Testing & QA, covering Test strategy, End-to-end testing and Unit testing. It works with Cypress, Playwright, Python and pytest. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Test strategy
  • Tasks that involve End-to-end testing
  • Tasks that involve Unit testing

Example prompts

  • “/testing-patterns”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • jest

    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 Patterns loads about 1.6k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 656 words of instructions outside code blocks.

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

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 softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 656 words, ~1,636 tokens.

Download SKILL.mdSave it as .claude/skills/testing-patterns/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
testing-patterns
description
Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.
allowed-tools
Read
effort
medium
user-invocable
false

Testing Patterns Skill

Test Structure (AAA Pattern)

python
def test_function_does_expected_thing():
    """Test description explaining what and why."""
    # Arrange - Set up test data and preconditions
    input_data = {"key": "value"}
    expected = "result"

    # Act - Execute the code under test
    result = function_under_test(input_data)

    # Assert - Verify the outcome
    assert result == expected

Test Organization

tests/
├── conftest.py           # Shared fixtures
├── unit/                 # Unit tests (isolated)
│   ├── test_search_core.py
│   └── test_utils.py
├── integration/          # Integration tests
│   └── test_api.py
└── e2e/                  # End-to-end tests
    └── test_workflow.py

Quality Targets

MetricTarget
Coverage>70% overall
New code100%
Core modules>80%
No flaky tests0

Validation contract regressions

Mirrored validators can agree on a generated snapshot while disagreeing on real inputs. Execute the same accepted/rejected fixtures against the real backend validator and the client evaluator. Include N/N+1 boundaries, collection/item limits, omitted/null/empty/default values, nested paths, conditional branches, hydrated updates versus fresh DTOs, Unicode units and previously valid inputs.

Test the actual HTTP path for malformed input and unchanged persisted state after a pre-write refusal. Test zero transport calls for a local refusal, normal transport for a valid payload, and field correction/resubmission. Run deterministic-generation and reviewed-exclusion checks separately from behavioral parity. A schema/rule count is inventory, not assertion coverage.

For operation semantics and runtime mismatches, read reference/input-validation.md from the installed security-patterns skill. Resolve the skill through the current client's catalog; directory names may carry an adapter-specific prefix.

Language-Specific References

LanguageReferenceKey Topics
Pythonreference/python-pytest.mdFixtures, mocking, parametrize, markers, conftest, running tests
TypeScriptreference/typescript-vitest.mdVitest/Jest, React Testing Library, mocking, running tests
PHPreference/php-phpunit.mdPHPUnit test cases, mocking, running tests
Goreference/go-testing.mdTable-driven tests, testify mocking, running tests
Flutter/Dartreference/flutter-testing.mdWidget tests, unit tests, running tests

For Python pytest patterns, see reference/python-pytest.md.

For TypeScript Vitest/Jest patterns, see reference/typescript-vitest.md.

For PHP PHPUnit patterns, see reference/php-phpunit.md.

For Go testing patterns, see reference/go-testing.md.

For Flutter/Dart testing patterns, see reference/flutter-testing.md.

Common Rationalizations

ExcuseWhy It's Wrong
"It's too simple to test"Simple code breaks in integration — test the contract, not the complexity
"Tests slow down development"Tests slow down bugs reaching production — that's the point
"We'll add tests later"Untested code accumulates — later means never, and coverage gaps compound
"Mocking everything is fine"Over-mocking tests the mocks, not the code — mock at boundaries only
"100% coverage means no bugs"Coverage measures execution, not correctness — focus on behavior assertions

Rules

  • MUST follow Arrange-Act-Assert (AAA) structure in every test — unstructured tests degrade into procedural smoke tests
  • MUST test behavior through the public interface, not internal implementation — tests coupled to internals break on every refactor
  • NEVER test implementation details (private method return values, internal state flags) — they are not the contract
  • NEVER hit real external services in unit tests — use fakes/stubs for boundaries; save real integration for integration tests
  • CRITICAL: integration tests must hit real dependencies (database, message queue, external API) when mock-vs-prod divergence is a real risk. Mocked integration tests create false confidence.
  • MANDATORY: flaky tests are bugs, not noise. Quarantine or delete them — a tolerated flaky test erodes the suite's credibility.
Show full SKILL.md (232 more words)Show less

Gotchas

  • Coverage numbers are easy to game: include generated code, test files that import but do not assert, or wide # pragma: no cover usage. A 95% reported coverage with 60% real behavior assertion is common.
  • Snapshot tests (Jest .toMatchSnapshot(), pytest-regressions) accept any output as "correct" on first run. An incorrect initial snapshot becomes the accepted baseline — review snapshots as carefully as code.
  • Mocks configured with any matchers (e.g., .mock.calls[0][0] without a schema) pass even when the production call shape changes. Assert on specific arguments, not just "was called".
  • Test isolation fails when globals leak (module-level mutable state, module-scoped fixtures, env vars set in one test). Flakiness that appears only under pytest -n auto or jest --parallel is usually shared state.
  • Property-based tests (Hypothesis, fast-check) shrink failing examples to minimal reproducers, but shrinking time can dominate the run. For complex generators, cap shrink deadlines or seed the failing example for next-run reproducibility.
  • Test pyramid vs trophy: the "right" ratio depends on stack. Frontend apps with rendering concerns benefit from more integration tests (trophy); pure backend services align better with pyramid. Don't cargo-cult one model.

When NOT to Load

  • For running the test suite — use /test
  • For test-first development workflow — use /tdd
  • For debugging a specific test failure — use /debug on the failure output
  • For test framework choice in a new project — use /app-builder
  • For performance/load testing — this skill covers correctness tests, not load

© softspark, 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

SKILL.md and 5 other files in app/skills/testing-patterns of softspark/ai-toolkit.

  • SKILL.md
  • reference/flutter-testing.md
  • reference/go-testing.md
  • reference/php-phpunit.md
  • reference/python-pytest.md
  • reference/typescript-vitest.md

Open the folder on GitHubat commit d64db2b

Compare with similar skills

Testing 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 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Patterns this skillsoftspark/ai-toolkit179—~1.6kAutomated safety check: PassApache-2.0
Angular TestingKilo-Org/kilo-marketplace189—~2.9kAutomated safety check: PassMIT
Designing TestsCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Playwright Testingchongdashu/vibejam-starter-pack149—~2.1kAutomated safety check: PassNone
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Claude Code QAPramodDutta/qaskills232—~2.3kAutomated safety check: PassMIT

Similar skills

  • Angular Testing

    Kilo-Org/kilo-marketplace

    Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns.

    189 GitHub stars~2.9k tokensUpdated 9 days ago
    Testing & QAAuto-check passed
  • Designing Tests

    CloudAI-X/claude-workflow-v2

    Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.1k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Claude Code QA

    PramodDutta/qaskills

    The complete QA skill for Claude Code — turn Claude into an expert QA engineer that picks the right test type, writes reliable Playwright, Cypress, and pytest tests, eliminates flaky tests, enforces…

    232 GitHub stars~2.3k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Test Migration

    petrkindlmann/qa-skills

    Migrate a test suite from one framework to another, incrementally and without losing coverage.

    163 GitHub stars~5.3k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed

More from softspark/ai-toolkit

All 112 skills in this repo
  • Prepare Test Env

    softspark/ai-toolkit

    Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.

    179 GitHub stars~1.8k tokensUpdated today
    Auto-check: notes
  • A11y Validate

    softspark/ai-toolkit

    Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.8k tokensUpdated today
    Auto-check: notes
  • Analyze

    softspark/ai-toolkit

    Analyzes code quality, complexity, patterns across codebase.

    179 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Autonomous Dev

    softspark/ai-toolkit

    Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.

    179 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Brand Voice

    softspark/ai-toolkit

    Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • CI

    softspark/ai-toolkit

    Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).

    179 GitHub stars~1.1k tokensUpdated today
    Auto-check: notes

Categories

Questions about Testing Patterns

What does Testing Patterns do?

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Testing Patterns is an agent skill from softspark/ai-toolkit. Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

When should I use Testing Patterns?

Testing Patterns fits situations like: tasks that involve Test strategy; tasks that involve End-to-end testing; tasks that involve Unit testing.

How do I install Testing Patterns in Claude Code?

Run `npx skills add softspark/ai-toolkit --skill testing-patterns -a claude-code`. Or copy the skill folder (app/skills/testing-patterns in softspark/ai-toolkit) into .claude/skills/testing-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Testing Patterns in Codex?

Run `npx skills add softspark/ai-toolkit --skill testing-patterns -a codex`. Or copy the skill folder (app/skills/testing-patterns in softspark/ai-toolkit) into .agents/skills/testing-patterns in your project. Codex loads it when a task matches its description.

Can I use Testing 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 softspark/ai-toolkit --skill testing-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-patterns, .gemini/skills/testing-patterns, .github/skills/testing-patterns and .opencode/skills/testing-patterns in your project.

What does Testing Patterns need to run?

Going by SKILL.md and its folder, Testing Patterns needs the command-line tools its instructions call (pytest and jest). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read.

Does Testing 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 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 Patterns use?

Testing 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 Patterns use?

About 1.6k tokens (SKILL.md is roughly 6.5k 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 Patterns?

Skills that share tags, products or a category with Testing Patterns: Angular Testing (Kilo-Org/kilo-marketplace, 189 stars), Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars), Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars) and Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Patterns?

softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.

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