home / skills / tlabs-xyz / tbtc-v2-performance / testing--test-writing

testing--test-writing skill

/.codex/skills/testing--test-writing

This skill helps you write tests by applying the Agent OS standard for test-writing across unit and integration tests.

npx playbooks add skill tlabs-xyz/tbtc-v2-performance --skill testing--test-writing

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
382 B
---
name: testing--test-writing
description: Apply the Agent OS standard for testing test writing.
tags: [agent-os, standard, testing]
---

# Testing Test Writing

Use this skill when working on testing test writing in this repo.

## Instructions

- Follow the standard in `agent-os/standards/testing/test-writing.md`.

## References

- `agent-os/standards/testing/test-writing.md`

Overview

This skill applies the Agent OS standard for writing tests and test content. It ensures tests are consistent, maintainable, and aligned with the repository's expectations for test structure and quality. Use it to enforce the project's conventions for test naming, organization, and assertions.

How this skill works

The skill inspects test files and test-writing patterns to verify they conform to the Agent OS test-writing standard. It checks naming conventions, arrangement of arrange/act/assert steps, clarity of test descriptions, and use of fixtures or mocks. It reports issues and suggests concrete fixes that bring tests into compliance.

When to use it

  • When adding new unit or integration tests to the codebase.
  • When reviewing pull requests that include test changes.
  • When refactoring tests to improve clarity or reduce flakiness.
  • When onboarding contributors to ensure their tests match project conventions.
  • When auditing test suites for consistency and maintainability.

Best practices

  • Write descriptive test names that state expected behavior, not implementation details.
  • Structure each test with clear arrange, act, assert sections and keep each test focused on one behavior.
  • Prefer deterministic assertions and avoid brittle timing-based checks; use mocks/stubs where appropriate.
  • Reuse setup code via fixtures or helper functions to minimize duplication while keeping tests independent.
  • Keep test files small and organized by feature or module to simplify navigation and review.

Example use cases

  • Validate that new Jest or Vitest tests follow the project's naming and structure rules before merging.
  • Suggest changes to a flaky integration test, replacing sleeps with explicit event waits or mocks.
  • Refactor a suite of end-to-end tests to use shared fixtures and clearer assertions.
  • Check a contributor's test PR and auto-generate actionable feedback on missing asserts or unclear descriptions.
  • Audit tests to flag anti-patterns like excessive external I/O or hidden dependencies between tests.

FAQ

Does this skill rewrite tests automatically?

It suggests concrete fixes and can generate example replacements, but you should review and approve any changes before applying them.

Which testing frameworks are supported?

The skill focuses on common JS/TS frameworks used in the project (unit and integration patterns); adaptions are possible for Jest, Vitest, and similar tools.