$ recombobulate _
home / tips / ask-claude-to-generate-realistic-seed-data-and-test-factories-from-your-models
109

Ask Claude to Generate Realistic Seed Data and Test Factories from Your Models

recombobulate @recombobulate · Mar 29, 2026 · Workflows
ask-claude-to-generate-realistic-seed-data-and-test-factories-from-your-models

Random factory data hides bugs. When your test user is named "asdfgh" with email "test@test.com" and an order total of 0, you miss the real-world edge cases. Claude generates data that matches your domain.

"Read my models and create factory definitions with realistic data for all of them"

Claude reads your models, relationships, column types, and validation rules, then generates factories that produce data matching your domain:

// Instead of this:
'name' => fake()->word(),
'email' => fake()->email(),
'price' => fake()->randomFloat(),

// Claude generates this:
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'price' => fake()->randomFloat(2, 9.99, 299.99),
'sku' => 'PRD-' . fake()->unique()->numerify('######'),
'status' => fake()->randomElement(['active', 'draft', 'archived']),

You can be specific about what you need:

# Seed data for demos and screenshots
"Create a database seeder with 50 realistic users, each with 2-5 orders
containing real-looking product names and prices for an e-commerce demo"

# Edge case factories
"Add factory states for edge cases — users with special characters in names,
extremely long emails, orders at price boundaries, and expired subscriptions"

# Relationship-aware data
"Generate seed data where orders reference real products and users,
reviews belong to users who actually purchased the product, and
inventory counts match the order history"

Claude handles the hard parts of test data:

  • Relationships — ensures foreign keys point to existing records
  • Realistic values — prices that look real, dates in sensible ranges, statuses that match your workflow
  • Unique constraints — generates data that won't violate unique indexes
  • Domain logic — a "shipped" order has a shipping date, a "trial" account expires in 14 days
  • Factory states — named states for common scenarios like unverified(), expired(), withSubscription()

Good test data catches bugs that random data hides — Claude writes factories that exercise your code the way real users will.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Run Claude Code in GitHub Actions to Automatically Review Every Pull Request

Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.

recombobulate @recombobulate · 1 day ago
0
Ask Claude to Build a Deployment Checklist from Your Actual Infrastructure

Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.

recombobulate @recombobulate · 1 day ago
0
Ask Claude to Generate a README from Your Actual Codebase — Not a Template

Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.

recombobulate @recombobulate · 1 day ago