spec-gen-write-tests

Generate and run framework-specific tests from implementations and spec contracts.

270|34|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/clay-good/spec-gen --skill spec-gen-write-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-gen-write-tests
Source: https://github.com/clay-good/spec-gen/tree/main/examples/mistral-vibe/skills/spec-gen-write-tests
Command: npx skills add https://github.com/clay-good/spec-gen --skill spec-gen-write-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many projects lack reliable, spec-aligned tests and engineers spend time writing fragile placeholders or guessing intended behavior. This Skill ensures tests are derived from the actual implementation and spec contract so tests verify real behavior rather than stubbing or masking bugs.

Core Features & Use Cases

  • Spec-aligned test generation: Reads the implementation and associated spec scenarios before writing assertions to ensure tests reflect GIVEN/WHEN/THEN semantics.
  • Framework detection and integration: Detects common test frameworks (Vitest, Jest, pytest, Go test, CTest/GTest) and generates framework-specific test files and annotations.
  • Safe, iterative validation: Runs tests, diagnoses failures, and enforces rules such as no placeholder assertions and mocking only system boundaries.

Quick Start

Run the spec-gen write-tests skill to create and run real tests for a specified function or spec scenario in your project root.

Frequently Asked Questions about spec-gen-write-tests

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

FAQPage Schema
How do I generate runnable tests from spec contracts automatically?

Spec-aligned test generation works by reading implementation code and spec contracts together to produce framework-specific test files. This ensures assertions verify real behavior using GIVEN/WHEN/THEN semantics instead of placeholder stubs.

Does this test generation approach work with both Vitest and pytest?

Yes, this test generation approach works with Vitest, Jest, pytest, Go test, and CTest/GTest. It detects the local test framework and generates matching test files with appropriate annotations and conventions.

Can I use spec-gen write-tests for TypeScript and Python codebases?

Yes, you can use it for TypeScript, JavaScript, Python, Go, and C++ codebases. It detects the language test framework, reads implementations and spec contracts, and generates framework-specific test files accordingly.

How to write tests that follow local project conventions without placeholder assertions?

To write tests that follow local project conventions without placeholder assertions, the skill reads existing test patterns and enforces rules such as mocking only system boundaries. It iteratively runs tests to diagnose failures and reports coverage changes.

Do I need an existing spec-gen analysis cache to generate tests?

Yes, you need an existing spec-gen analysis cache for orientation. The skill requires this cache to read spec contracts and implementation details before generating framework-specific test files.

What are the limitations of automated spec-aligned test generation?

Limitations of automated spec-aligned test generation include the requirement for an existing spec-gen analysis cache and the restriction to mock only system boundaries. It cannot generate tests for code lacking spec contracts or implementation files.