Tooluck logoTooluck
SKILL.md

test-patterns

Agent skill fromrohitg00/skillkit

Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable, reliable, and readable test suites. Use when the user asks about writing unit tests, integration tests, or end-to-end tests; structuring test cases or test suites; applying TDD or BDD practices; working with mocks, stubs, spies, or fakes; improving test coverage or reducing flakiness; or needs guidance on test organization, naming conventions, or assertions in frameworks like Jest, Vitest, pytest, or similar.

How to install test-patterns

install test-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/test-patterns/

# into

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

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

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

Apache-2.0Full file
1# Test Patterns
2
3You are applying proven testing patterns to write maintainable, reliable tests. These patterns help ensure tests are readable, focused, and trustworthy.
4
5## Pattern Selection Guide
6
7Use this to choose the right pattern for your situation:
8
9- **Structuring a single test?** → Arrange-Act-Assert (AAA) or Given-When-Then
10- **Writing behavior/feature specs?** → Given-When-Then (BDD style)
11- **Repeating test setup data?** → Test Data Builders
12- **Many variations of complex objects?** → Object Mother
13- **Testing same logic with many inputs?** → Parameterized Tests
14- **Shared setup/teardown across tests?** → Test Fixtures
15- **Verifying a dependency was called?** → Spy
16- **Replacing an external dependency?** → Test Doubles (Stub / Mock / Fake)
17
18---
19
20## Pattern Combination Workflows
21
22Patterns rarely stand alone — here's how to combine them for common scenarios:
23
24**Unit tests (isolated logic):**
25Fixtures for setup → AAA structure → Stubs/Mocks for dependencies → Parameterized Tests for multiple input cases
26
27**Integration tests (service + external dependencies):**
28Fixtures for setup → AAA structure → Fakes for external services (e.g. in-memory DB) → Spies to verify interaction points
29
30**BDD / feature specs:**
31Given-When-Then → Object Mother or Test Data Builders for scenario data → Fakes for infrastructure
32
33**High-variation logic (validators, calculators, formatters):**
34Parameterized Tests → Test Data Builders to construct each case → AAA structure within each case
35
36---
37…

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