A Claude Code slash command for generating realistic test data from types or schemas.
# 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/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
- Finds types/models in your project
- Analyzes field types and constraints
- Generates realistic, contextual data
- Outputs as JSON, factory, or seed file
- Handles relationships between models
{
"users": [
{ "id": "uuid", "email": "alice@example.com", "name": "Alice" }
]
}export const createMockUser = (overrides = {}) => ({
id: faker.string.uuid(),
email: faker.internet.email(),
...overrides,
});await prisma.user.createMany({ data: users });| Type | Generated Example |
|---|---|
| alice@example.com | |
| name | Alice Smith |
| uuid | 550e8400-e29b... |
| date | 2025-01-15T10:30:00Z |
| phone | +1-555-123-4567 |
| url | https://example.com |
- TypeScript/Prisma/TypeORM project with types
- Claude Code with Opus 4.5 model access
cd <clone-path>/command-mock-data && git pull