home / skills / tlabs-xyz / tbtc-v2-performance / testing-test-writing
/.claude/skills/testing-test-writing
This skill guides you to write focused, fast, behavior-driven tests for core flows using Jest, Vitest, PyTest, or similar.
npx playbooks add skill tlabs-xyz/tbtc-v2-performance --skill testing-test-writingReview the files below or copy the command above to add this skill to your agents.
---
name: Testing Test Writing
description: Write strategic, minimal tests focused on core user flows and critical paths, testing behavior rather than implementation with fast execution and clear test names. Use this skill when writing unit tests, integration tests, or end-to-end tests, creating test files or test suites, testing critical user workflows, implementing test mocking or stubbing, writing test assertions, naming test cases descriptively, testing business-critical features, running tests during development, or working with test files in directories like __tests__, test/, spec/, or similar. Use when completing feature implementation and adding tests at logical completion points, not during intermediate development steps. Use when working with testing frameworks like Jest, Vitest, pytest, RSpec, JUnit, or any testing library.
---
## When to use this skill
- When writing unit tests for core functionality
- When writing integration tests for critical user flows
- When writing end-to-end tests for primary workflows
- When creating test files or test suites
- When testing business-critical features or paths
- When implementing test mocking, stubbing, or test doubles
- When writing test assertions and expectations
- When naming test cases descriptively
- When ensuring tests execute quickly (milliseconds for unit tests)
- When testing behavior rather than implementation details
- When working with test files in __tests__, test/, spec/, or similar directories
- When completing feature implementation at logical completion points
- When working with testing frameworks (Jest, Vitest, pytest, RSpec, JUnit, Mocha, etc.)
- When focusing on what code does, not how it does it
# 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.
## Instructions
For details, refer to the information provided in this file:
[testing test writing](../../../agent-os/standards/testing/test-writing.md)
This skill teaches how to write strategic, minimal tests that focus on core user flows and critical paths. It emphasizes testing observable behavior, fast execution, and clear, descriptive test names to keep suites reliable and maintainable. Use it to guide unit, integration, and end-to-end test design across popular frameworks.
The approach inspects the user-facing or API-facing behavior and identifies the smallest set of tests that exercise business-critical paths. Tests are written to assert outcomes and side effects rather than internal implementation details. It recommends fast, isolated unit tests for logic, focused integration tests for component interactions, and a few targeted end-to-end tests for primary workflows.
How many tests should I write for a feature?
Cover the critical paths and common edge cases: minimal unit tests for logic, one or two integration tests for interactions, and at most a couple of E2E tests for the primary workflow.
Should tests inspect private functions?
No. Focus on public behavior and outcomes. If you need to test internals, it often indicates a refactor to expose behavior through a public API.