Skip to content

claude-commands/command-mock-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

command-mock-data

A Claude Code slash command for generating realistic test data from types or schemas.

Installation

# Clone to your preferred location
git clone git@github.com:claude-commands/command-mock-data.git <clone-path>/command-mock-data

# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-mock-data/mock-data.md ~/.claude/commands/mock-data.md

Usage

/mock-data User 10           # Generate 10 mock users
/mock-data Order             # Generate mock orders
/mock-data --factory User    # Create factory function
/mock-data --seed            # Generate database seed
/mock-data --all             # Generate for all models

What it does

  1. Finds types/models in your project
  2. Analyzes field types and constraints
  3. Generates realistic, contextual data
  4. Outputs as JSON, factory, or seed file
  5. Handles relationships between models

Output Formats

JSON Fixtures

{
  "users": [
    { "id": "uuid", "email": "alice@example.com", "name": "Alice" }
  ]
}

Factory Function

export const createMockUser = (overrides = {}) => ({
  id: faker.string.uuid(),
  email: faker.internet.email(),
  ...overrides,
});

Database Seed

await prisma.user.createMany({ data: users });

Field Type Mapping

Type Generated Example
email alice@example.com
name Alice Smith
uuid 550e8400-e29b...
date 2025-01-15T10:30:00Z
phone +1-555-123-4567
url https://example.com

Requirements

  • TypeScript/Prisma/TypeORM project with types
  • Claude Code with Opus 4.5 model access

Updates

cd <clone-path>/command-mock-data && git pull

About

Claude Code command: Generate realistic test data from types or schemas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •