write-unit-test

Generate behavioral unit tests from functional specifications using PreDB/PostDB patterns.

Updated Nov 3, 2025
One-click install
npx skills add https://github.com/edmar/dap-client --skill write-unit-test-edmar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-test
Source: https://github.com/edmar/dap-client/tree/main/.claude/skills/write-unit-test
Command: npx skills add https://github.com/edmar/dap-client --skill write-unit-test-edmar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of unit tests directly from functional specifications, enabling a Test-Driven Development (TDD) workflow and ensuring code adheres to defined behavioral contracts.

Core Features & Use Cases

  • Specification Parsing: Understands Preconditions/Workflow/Postconditions format.
  • Test File Generation: Creates structured test files (e.g., Vitest) with PreDB/PostDB setup.
  • Use Case: When given a specification for a new UserService.createUser method, this Skill generates a user.test.ts file with failing tests, ready for implementation.

Quick Start

Use the write-unit-test skill to generate tests for the provided user creation specification.

Frequently Asked Questions about write-unit-test

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

FAQPage Schema
How do I generate unit tests from functional specifications automatically?

To generate unit tests from functional specifications, provide the spec details including Preconditions, Workflow, and Postconditions to produce structured behavioral test files ready for implementation.

Can I use Vitest for TDD by creating tests before writing the implementation?

Yes, you can use Vitest for TDD by translating specification details into executable test code with PreDB and PostDB setup, creating failing tests that define behavioral contracts before implementation.

What format should specifications follow to generate behavioral unit tests?

Specifications should follow a Preconditions, Workflow, and Postconditions format to generate behavioral unit tests, ensuring the test code accurately validates modules, classes, and database interactions.

Does the generated test code support database interaction testing?

Yes, generated test code supports database interaction testing by applying the PreDB and PostDB pattern, setting up database states before execution and validating postconditions after the workflow completes.

What is the best way to translate spec details into executable Vitest test files?

The best way to translate spec details into executable Vitest test files is by parsing functional specifications and structuring the output with behavioral assertions that validate the defined workflow.