write-tests

Guide red-green-refactor cycles for unit and integration tests.

19|3|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/qa-aman/claude-skills --skill write-tests-qa-aman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/qa-aman/claude-skills/tree/main/skills/by-role/engineer/write-tests
Command: npx skills add https://github.com/qa-aman/claude-skills --skill write-tests-qa-aman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams adopt Test-Driven Development by guiding developers to write tests before implementing code, ensuring interfaces are well-thought-out and changes are safer.

Core Features & Use Cases

  • Identify testable behaviors for a given function or module.
  • Write failing tests first (Red), implement minimal code to pass (Green), and refactor with confidence.
  • Provide guidance for unit tests, integration tests, and comprehensive refactoring workflows, including a behavior-first approach and a Python example.

Quick Start

Start by writing a failing test for a simple function, then implement the minimal code to pass.

Frequently Asked Questions about write-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start test-driven development using pytest?

Test-driven development automates software quality by guiding you through red-green-refactor cycles. You write a failing test first to define expected behavior, implement minimal code to pass, then refactor with confidence using the test as a safety net.

How does the red-green-refactor cycle work for unit testing?

The red-green-refactor cycle works by first writing a failing unit test, implementing the minimal code required to make it pass, and then refactoring the code while relying on the test to ensure no behavior breaks. This enforces a behavior-focused testing discipline.

Can I use this test-first approach for integration testing as well as unit testing?

Yes, the test-first approach supports both unit testing and integration testing workflows across Python projects and other languages. It helps identify testable behaviors for modules and guides comprehensive refactoring workflows to ensure changes remain safe across the system.

What is the best way to identify testable behaviors before writing code?

The best way to identify testable behaviors is to define the expected outputs and side effects for a given function or module before implementation. This behavior-first approach ensures interfaces are well-thought-out and changes are safer to execute.

When should I not use a test-first workflow?

You should avoid a test-first workflow when rapidly prototyping exploratory code where interfaces are highly volatile. Defining testable behaviors and maintaining red-green-refactor cycles adds overhead that may not suit highly experimental or throwaway scripts.