Test Gen for Openclaw

An advanced testing agent that analyzes existing projects to generate black-box unit tests, E2E scenarios, and comprehensive coverage reports.

fdingiit
v1.0.0
May 11, 2026
0
550
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gen-test

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gen-test using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Test Gen?

Test Gen is a specialized utility within the Openclaw Skills ecosystem designed for legacy or existing codebases that require improved test coverage. Unlike standard TDD tools, it focuses on projects where the code is already written, utilizing a black-box approach to analyze function signatures and interface contracts without being biased by the underlying implementation. It systematically moves through project understanding, testability auditing, and code generation to ensure high-quality, stable results.

The skill is built on the philosophy of honest evaluation. It doesn't just generate tests blindly; it reviews the code for testability defects and proactively suggests refactoring if the design is too coupled or complex to test effectively. This ensures that the generated test suite is robust, maintainable, and provides real value rather than just inflating coverage numbers.

Test Gen Use Cases

  • Increasing test coverage for existing legacy codebases.
  • Generating E2E integration tests based on core user journeys and data flows.
  • Identifying design flaws and code smells through automated testability audits.
  • Establishing quality baselines in CI/CD pipelines using delta coverage reporting.
  • Automating the setup of coverage tools across various languages like Python, JS/TS, Go, and Rust.

How Test Gen Works

  1. Project Detection: Scans the environment to identify languages, existing test frameworks, and coverage tools.
  2. Design Analysis: Parses documentation (README, ARCHITECTURE.md) and directory structures to understand module responsibilities and data flows.
  3. Black-box Analysis: Extracts public API signatures and doc comments to determine testing dimensions without inspecting function bodies.
  4. Testability Audit: Evaluates functions for purity, dependency injection, and granularity, classifying them as testable, needing refactor, or skippable.
  5. Test Generation & Execution: Writes unit and E2E tests following project naming conventions and executes them to verify success.
  6. Coverage Reporting: Generates detailed reports comparing actual metrics against defined thresholds for both the full project and changed lines.

Test Gen Setup

Test Gen can be installed at the project or user level using Openclaw Skills commands. For project-level installation (recommended for teams):

mkdir -p .cursor/skills && cp -r /path/to/test-gen .cursor/skills/test-gen
mkdir -p .cursor/commands && cp /path/to/test-gen.md .cursor/commands/test-gen.md

For global user-level installation:

mkdir -p ~/.cursor/skills && cp -r /path/to/test-gen ~/.cursor/skills/test-gen

Test Gen Data Schema & Taxonomy

The skill manages configuration and output via a structured schema, primarily utilizing .test-gen.yaml for threshold definitions:

Feature Configuration Key Default Value
Overall Coverage coverage_thresholds.overall Line: 80%, Branch: 70%, Function: 80%
Per-file Threshold coverage_thresholds.per_file Line: 60%, Branch: 50%
Delta Coverage coverage_thresholds.delta Line: 90%

It also supports metadata injection via package.json or pyproject.toml and generates summary reports in Markdown format.

Test Gen Advanced Features

  • Delta Coverage (Change Tracking): Specifically tracks coverage for lines changed in the current git diff to ensure new code is tested.
  • Automated Refactoring Suggestions: Provides detailed architectural feedback for code that is too coupled to be tested.
  • Makefile Integration: Automatically detects and adds test-related targets (e.g., test-cov-delta) to existing Makefiles.
  • Environment Recipes: Built-in logic for auto-installing missing coverage dependencies like pytest-cov, istanbul, or cargo-llvm-cov.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*