agentleFS
pankaj-mahaurpankaj-mahaur/Agent-Daemon/skills/engineering/seed-data/SKILL.md

seed-data

Skill0 starsChanged 6 days agoMITView on GitHub

Use only when user explicitly requests seed/test data generation for specified schema/models. Generates idempotent seed scripts with realistic test data.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only invoke this skill when ALL of these are true:

    line 19
  2. Distinctive:

    NOT for simple CRUD code or component generation

    line 26
  3. Distinctive:

    Use varied, production-like data

    line 74
  4. Distinctive:

    Use concise but realistic content

    line 99
  5. Distinctive:

    Ask clarifying questions FIRST if unclear:

    line 101
  6. Distinctive:

    Create seed data without schema context

    line 122

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Seed Data Generator

Purpose

Generate idempotent database seed scripts with realistic test data.

When to Use (STRICT CRITERIA)

Only invoke this skill when ALL of these are true:

  1. User explicitly requests seed/test data generation with phrases like:
    • "generate seed data"
    • "create test data script"
    • "populate database with mock data"
    • "need sample data for testing"
  2. User specifies schema/models that need data
  3. NOT for simple CRUD code or component generation

When NOT to Use

  • Regular feature development
  • Component/API code generation
  • Bug fixes or refactoring
  • User asks general "how to" questions
  • Unclear requirements

Usage Pattern

User triggers with explicit command: "Generate a seed script for [Product, User, Order] models with 50 realistic entries each"

Output Format

1. Idempotent Script Template (TypeScript)

// scripts/seed-[entity].ts
import { PrismaClient } from '@prisma/client'
// or: import payload from 'payload'
// or: WordPress REST API client

const prisma = new PrismaClient()

async function seed[Entity]() {
  console.log('Seeding [entity] data...')

  const data = [
    // Realistic data array (50-100 items)
  ]

  for (const item of data) {
    await prisma.[entity].upsert({
      where: { id: item.id }, // or slug/email
      create: item,
      update: item,
    })
  }

  console.log(`Seeded ${data.length} [entity] records`)
}

seed[Entity]()
  .catch(console.error)
  .finally(() => prisma.$disconnect())

2. Realistic Data Generation

  • Use varied, production-like data
  • Include edge cases (long strings, special chars, nulls)
  • Realistic dates (past year range)
  • Proper relationships (foreign keys)

3. Make it Idempotent

Always use:

  • upsert (Prisma)
  • findOneAndUpdate with upsert: true (Mongoose)
  • INSERT ... ON CONFLICT DO UPDATE (raw SQL)
  • wp.posts().id(123).update() with existence check (WordPress)

4. Include Run Instructions

// package.json
{
  "scripts": {
    "seed": "tsx scripts/seed-all.ts",
    "seed:products": "tsx scripts/seed-products.ts"
  }
}

Token Efficiency Rules

  1. Generate data inline (no external files)
  2. Use concise but realistic content
  3. Batch related entities in one script
  4. Ask clarifying questions FIRST if unclear:
    • "How many records per entity?"
    • "Which entities need seeding?"
    • "What ORM/database?"

Example Invocation

User says: "I need test data for my e-commerce app - products, categories, and users"

Claude asks: "I can generate seed scripts for those. Quick questions:

  1. How many of each? (default: 50 products, 10 categories, 20 users)
  2. Are you using Prisma, Payload, or WordPress?
  3. Any specific requirements (price ranges, user roles, etc.)?"

Then generates: Complete seed scripts after confirmation.

Anti-Patterns (DO NOT DO)

  • Generate seed data when user just asks for a component
  • Auto-suggest seeding for every database model
  • Create seed data without schema context
  • Generate when user says "create a Product model" (wait for explicit seed request)

Success Criteria

  • User runs script multiple times safely
  • Data looks production-ready
  • Script handles existing data gracefully

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.