write-tests

Generates or completes project-standard tests for source files with 95% coverage validation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/hemant0510/rwa --skill write-tests-hemant0510
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/hemant0510/rwa/tree/main/.claude/Skills/write-tests
Command: npx skills add https://github.com/hemant0510/rwa --skill write-tests-hemant0510

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the process of writing or completing tests for source files by applying standard project patterns and ensuring consistent coverage thresholds.

Core Features & Use Cases

  • Template-based test generation: Applies per-file patterns for API routes, services, components, pages, and hooks.
  • Coverage enforcement: Validates that each staged file meets the 95% coverage requirement before commit.
  • Use Case: A developer stages a new TS file; the skill generates or completes tests and validates coverage automatically.

Quick Start

Provide tests for the specified source file using the matching templates and ensure the file meets 95% coverage.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I generate Vitest tests for TypeScript files automatically?

Vitest test generation for TypeScript files applies project-standard templates to API routes, services, components, pages, and hooks. It reads the target source file, selects the matching template, and outputs formatted tests while validating required fields.

How do I enforce a 95% code coverage threshold before commit?

Code coverage enforcement validates that each staged TypeScript file meets a 95% per-file coverage requirement. It checks the generated tests against the threshold, ensuring API routes, services, and components are fully covered before allowing a commit.

Does this test generation apply specific patterns for React hooks and components?

Test generation applies specific template-based patterns for React hooks and components. It reads the source file, identifies the hook or component structure, and generates tests using the correct project-standard pattern to ensure 95% coverage.

What is the best way to automate test creation for API routes in TypeScript?

Automating test creation for TypeScript API routes uses template-based generation to apply standard testing patterns. It reads the route file, selects the API template, validates required fields and formatting, and outputs tests enforcing 95% coverage.

Can I complete existing tests for a service file instead of writing them from scratch?

Completing existing tests for service files applies project-standard patterns to fill coverage gaps. It reads the target file, matches the service template, and validates that the final output meets the 95% per-file coverage threshold.

Why does test generation fail if required fields are missing in the source file?

Test generation fails when required fields are missing because it validates formatting and structure before output. The process reads the source file, applies the matching template, and enforces strict validation to ensure the generated tests meet the 95% coverage threshold.