generate-tests_skill

This skill generates high-quality unit tests from given test cases, following Given-When-Then, test-data best practices, and language-specific rules for Java.

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill clear-solutions/unit-tests-skills --skill generate-tests

  • SKILL.md3.3 KB

Overview

This skill generates high-quality unit tests from a verified list of test cases. It enforces proven testing principles like Given-When-Then, focused single-scenario tests, clean test data, and behavior-driven assertions. The skill supports multiple languages and applies Java-specific rules when Java is detected.

How this skill works

Before generating any code, the skill requires a prior run of the test-case generator to produce the canonical list of test cases. It reads the target source, detects the component type (controller, service, repository, etc.) and technology stack, applies relevant rules from the tests ruleset, and emits complete test files. For Java targets it follows the Java unit test conventions (templates, JSON handling, argument capture, logging rules) and performs a compilation verification pass.

When to use it

  • You have a target method/class and a validated set of test cases from /generate-test-cases.
  • You need tests that follow Given-When-Then and behavior-focused testing principles.
  • You want consistent naming, coverage hygiene (include/exclude rules), and avoidance of logic inside tests.
  • You prefer tests that use clean test data builders and verify relevant interactions only.
  • You are preparing code for CI and want tests that compile before submission.

Best practices

  • Always run /generate-test-cases first and confirm the test case list before generating tests.
  • Keep one assertion scenario per test and name tests using the project naming conventions.
  • Use helpers/builders for complex test data to keep tests readable and resilient.
  • Avoid logic in tests: prefer explicit expected values and ArgumentCaptor over broad matchers.
  • For Java, follow the provided templates, use explicit JSON literals, and verify compilation after generation.

Example use cases

  • Generate unit tests for a service method with multiple edge cases derived from the test-case list.
  • Create controller tests that verify behavior, HTTP status mapping, and error handling based on test cases.
  • Produce repository/unit tests that validate query behavior and boundary conditions.
  • Regenerate tests after refactoring a public API to ensure tests follow updated behavior and naming conventions.

FAQ

Stop and run /generate-test-cases for the target. The test-case step is mandatory; the generator will not proceed without it.

Does the skill auto-detect language and framework?

Yes. It detects the technology stack and applies language-specific rules, with special handling for Java unit tests.

Will generated tests be compiled?

Yes. The skill runs a compilation verification and iterates until tests compile successfully.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational