write-tests

Guide unit, integration, and E2E test authoring with TDD workflows.

4|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/lushly-dev/afd --skill write-tests-lushly-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/lushly-dev/afd/tree/main/.claude/skills/write-tests
Command: npx skills add https://github.com/lushly-dev/afd --skill write-tests-lushly-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing robust tests for your software, ensuring quality through Test-Driven Development (TDD) and comprehensive code coverage.

Core Features & Use Cases

  • TDD Workflow Guidance: Guides you through writing failing tests first, then implementing code, and finally refactoring.
  • Vitest & Playwright Integration: Provides patterns for unit testing with Vitest and E2E testing with Playwright.
  • Mocking Strategies: Covers various techniques for mocking dependencies to ensure isolated and deterministic tests.
  • Use Case: When developing a new feature, use this Skill to write unit tests for its core logic using Vitest and then set up E2E tests with Playwright to verify the user flow.

Quick Start

Use the write-tests skill to create a new Vitest unit test for the calculateTotal function.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I write tests using TDD workflows?

TDD workflows involve writing failing tests first, implementing code to pass them, and then refactoring. This Skill guides you through the full Test-Driven Development cycle to ensure robust code quality and comprehensive coverage.

How do I set up Vitest unit testing for a new function?

Vitest unit testing is set up by writing tests following the AAA pattern and coverage-driven targets. This Skill provides specific patterns to create isolated, deterministic tests for your core logic.

Can I use Playwright for E2E testing alongside unit tests?

Playwright E2E testing can be used alongside Vitest unit tests. This Skill provides integration patterns to verify user flows end-to-end while keeping unit tests isolated for logic validation.

What's the best way to mock dependencies for isolated tests?

Mocking dependencies for isolated tests is best handled through targeted mocking strategies. This Skill covers techniques to replace dependencies, ensuring your tests remain deterministic and independent.

How do I add regression tests for bugs?

Regression tests for bugs are added by following strict regression test discipline. This Skill guides you in writing tests that reproduce the bug, ensuring the fix prevents future regressions effectively.

Does TDD coverage-driven development require specific coverage targets?

Coverage-driven development requires setting specific coverage targets to guide test creation. This Skill helps you establish and meet these targets, ensuring your test infrastructure maintains high quality.