Mock Data Generator for Openclaw

A CLI utility that uses AI to generate realistic, context-aware mock data directly from your TypeScript interfaces.

lxgicstudios
v1.0.1
Jan 29, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install ai-mock-data

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 ai-mock-data 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 Mock Data Generator?

Mock Data Generator is a specialized tool within the Openclaw Skills ecosystem designed to accelerate development and testing workflows. By analyzing your existing TypeScript interfaces, it leverages AI to understand the semantic meaning of your fields—distinguishing between an email, a phone number, or a currency value—and generates high-fidelity fake data accordingly. This eliminates the need for manually creating tedious JSON fixtures and ensures your development environment remains populated with data that reflects real-world scenarios.

Mock Data Generator Use Cases

  • Creating realistic JSON fixtures for unit and integration tests.
  • Populating frontend UI components with varied data during the prototyping phase.
  • Generating large-scale datasets for performance and stress testing.
  • Simulating backend API responses before the actual services are fully implemented.

How Mock Data Generator Works

  1. The user points the CLI tool at a specific TypeScript file containing interface or type definitions.
  2. The tool parses the TypeScript source code to identify exported types and their properties.
  3. Using AI-driven analysis, it determines the appropriate data format for each field (e.g., 'price' becomes a numeric value, 'email' becomes a valid email string).
  4. The generator produces the requested number of records and outputs them as a formatted JSON object or file.

Mock Data Generator Setup

To integrate this tool into your Openclaw Skills workflow, ensure you have Node.js 18+ installed and an OpenAI API key available.

# Set your environment variable
export OPENAI_API_KEY='your_api_key_here'

# Generate data from a specific type file
npx ai-mock-data ./src/types/User.ts --count 10 --out ./mocks/users.json

Mock Data Generator Data Schema & Taxonomy

Mock Data Generator adapts to your unique data structures. It maps TypeScript properties to JSON values as follows:

Property Type Mock Data Strategy
string (e.g., email) Generates valid, realistic email addresses
string (e.g., address) Generates full physical addresses
number (e.g., price) Generates currency-appropriate decimal values
Date Generates ISO-compliant date strings
Array Generates lists of data following the same semantic rules

Mock Data Generator Advanced Features

  • Smart semantic field detection that understands property intent beyond simple primitive types.
  • Support for generating specific counts of data via the --count flag for batch processing.
  • Targeted generation from files containing multiple exported interfaces using the --type flag.
  • Automated file output management for direct integration into test fixture directories.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*