API Case Generator (api-case-gen) for Openclaw

A high-performance API test case designer that blends automated script extraction with AI semantic reasoning to achieve 100% constraint coverage.

liujianyeey-oss
v1.2.0
Mar 31, 2026
0
817
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install api-case-gen

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 api-case-gen 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 API Case Generator (api-case-gen)?

The API Case Generator is a sophisticated tool designed for Openclaw Skills that transforms OpenAPI and Swagger specifications into actionable test matrices. By utilizing a hybrid approach—where scripts handle the heavy lifting of structured schema parsing and regular expression extraction, while AI agents interpret complex natural language descriptions—it ensures that no semantic constraint is overlooked. This skill is essential for developers and QA engineers looking to automate the creation of P0 to P2 test cases, including normal flows, boundary conditions, and complex parameter interdependencies.

Built to handle professional-grade API repositories, the tool supports multi-file resolution and deep recursive model expansion. It provides a standardized way to bridge the gap between static documentation and executable test design, making it a cornerstone of the Openclaw Skills ecosystem for quality assurance and API lifecycle management.

API Case Generator (api-case-gen) Use Cases

  • Automatically generating test matrices for new or updated API endpoints within Openclaw Skills.
  • Conducting deep coverage analysis to identify missing validation logic in API documentation.
  • Creating executable YAML test configurations with response assertions for automated CI/CD pipelines.
  • Mapping CRUD lifecycles to ensure end-to-end testing of resource management operations.
  • Supplementing legacy documentation with AI-derived semantic constraints for improved test coverage.

How API Case Generator (api-case-gen) Works

  1. The orchestrator parses the provided OpenAPI or Swagger specification, supporting multi-file $ref resolution across different modules.
  2. It performs deep model expansion, recursively unfolding objects and arrays to identify all leaf-node parameters up to a configurable depth.
  3. Automated scripts extract structured constraints like enums, maximum lengths, and regex patterns directly from the YAML/JSON schema keys.
  4. The generator applies P0/P1/P2 strategies to create a base set of test cases, utilizing slim-mode optimizations to remove low-value redundancy.
  5. An AI agent performs a critical fallback review to interpret natural language descriptions, supplementing cases for complex business logic that scripts cannot parse.
  6. The system renders the final output as Markdown test matrices and optional executable YAML configurations, complete with total coverage statistics.

API Case Generator (api-case-gen) Setup

To get started with this component of Openclaw Skills, ensure you have the necessary environment and dependencies:

# Ensure Python 3 and PyYAML are installed
pip install "pyyaml>=6.0"

# Run the analyzer on a specific service file
python3 api_case_gen.py analyze -s ./path/to/service.yaml -o ./output/cases

# Analyze an entire product directory to generate a full suite
python3 api_case_gen.py analyze-all -d ./v1/api/ -o ./output/cases

# Generate a coverage report to verify test design depth
python3 api_case_gen.py coverage -d ./v1/api/

API Case Generator (api-case-gen) Data Schema & Taxonomy

The skill organizes extracted data and generated cases into a clear taxonomy within the Openclaw Skills framework:

Data Component Format Description
Service Matrix Markdown A table-based view of endpoints, operations, and priority-ranked cases.
Test Config YAML Executable test definitions including request bodies and response assertions.
CRUD Chains Table A sequence mapping the lifecycle from Create to Delete for specific resources.
Fallback Report Text/JSON A list of fields requiring AI semantic review to ensure 100% coverage.
Coverage Stats Summary Quantitative analysis of schema-based vs. AI-supplemented constraints.

API Case Generator (api-case-gen) Advanced Features

  • Intelligent $ref resolution across multiple files and directories with automated context switching for complex repositories.
  • Slim Mode optimization which intelligently reduces redundant cases for non-required path parameters and empty strings.
  • Automated CRUD chain detection based on operationId patterns (create, describe, update, delete) to guide E2E test execution.
  • High-fidelity AI semantic extraction that identifies hidden constraints like character set requirements and mutual exclusivity within Openclaw Skills.
  • Priority-layered generation allowing teams to focus on P0 critical paths before expanding into P2 edge cases.
  • Custom regex pattern registration for extending the script's ability to recognize domain-specific documentation styles.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*