testing-test-writing
Write strategic, focused tests for critical user flows and core functionality using modern testing frameworks, focusing on behavior over implementation. Use this skill when creating test files, writing unit tests, integration tests, or end-to-end tests in test directories (tests/, __tests__, spec/, *.test.js, *.spec.py). Apply this skill when testing core user workflows and business-critical features, implementing test-driven development (TDD) with red-green-refactor cycles, mocking external dependencies for isolated unit tests, using clear descriptive test names that explain expected behavior, following arrange-act-assert patterns, and ensuring tests run fast and independently. This skill prioritizes testing what matters most (primary user flows) while deferring edge cases and non-critical paths until later, emphasizes behavior testing over implementation details to reduce brittleness, and uses modern frameworks like Jest, Playwright, Cypress, pytest, RSpec, or Testing Library for reliable, maintainable test
When & Why to Use This Skill
This Claude skill automates the creation of strategic, behavior-focused test suites using modern frameworks like Jest, Playwright, and pytest. It helps developers maintain high code quality and reliability by implementing Test-Driven Development (TDD), mocking external dependencies, and prioritizing critical user flows to ensure robust software delivery without increasing technical debt.
Use Cases
- Implementing Test-Driven Development (TDD) cycles to ensure new features meet business requirements from the start.
- Creating end-to-end (E2E) tests for critical user journeys using Playwright or Cypress to prevent regression in production.
- Writing isolated unit tests for complex business logic with mocked APIs and databases for fast, independent execution.
- Developing integration tests for API endpoints and service layers to validate data flow and system interoperability.
- Standardizing test structures using the Arrange-Act-Assert (AAA) pattern to improve code readability and maintainability.
| name | Testing Test Writing |
|---|---|
| description | Write strategic, focused tests for critical user flows and core functionality using modern testing frameworks, focusing on behavior over implementation. Use this skill when creating test files, writing unit tests, integration tests, or end-to-end tests in test directories (tests/, __tests__, spec/, *.test.js, *.spec.py). Apply this skill when testing core user workflows and business-critical features, implementing test-driven development (TDD) with red-green-refactor cycles, mocking external dependencies for isolated unit tests, using clear descriptive test names that explain expected behavior, following arrange-act-assert patterns, and ensuring tests run fast and independently. This skill prioritizes testing what matters most (primary user flows) while deferring edge cases and non-critical paths until later, emphasizes behavior testing over implementation details to reduce brittleness, and uses modern frameworks like Jest, Playwright, Cypress, pytest, RSpec, or Testing Library for reliable, maintainable test suites. |
Testing Test Writing
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle testing test writing.
When to use this skill
- When creating test files in test directories (tests/, tests, spec/, *.test.js, *.spec.py)
- When writing unit tests for core functions, classes, or business logic
- When implementing integration tests for API endpoints, database interactions, or service layers
- When creating end-to-end tests for critical user workflows using Playwright or Cypress
- When practicing test-driven development (TDD) with red-green-refactor cycles
- When testing behavior (what the code does) rather than implementation (how it does it)
- When writing clear, descriptive test names that explain expected outcomes
- When using arrange-act-assert (AAA) pattern to structure tests clearly
- When mocking external dependencies (databases, APIs, file systems) for isolated unit tests
- When ensuring tests are fast (milliseconds for unit tests) and run independently
- When testing core user flows and primary functionality (deferring edge cases until later)
- When working with testing frameworks (Jest, Vitest, pytest, RSpec, JUnit, Testing Library)
- When implementing test fixtures, factories, or test data management
- When ensuring tests provide value without slowing down development velocity
Instructions
For details, refer to the information provided in this file: testing test writing