knofler/myai/seed-data

Claude Code and agent skill by knofler/myai

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Create seed data for development and testing — realistic fixtures, idempotent runs, npm scripts. Triggers: 'seed', 'test data', 'sample data', 'mock data', 'fixtures'.

Install

npx vskill@latest install knofler/myai/seed-data

SKILL.md

The same SKILL.md was published earlier as knofler/myai/seed-data.

Seed Data

Create seed data scripts that populate MongoDB with realistic development and testing data.

Tech Stack

  • MongoDB (Docker locally, Atlas in production)
  • Mongoose ODM
  • Node.js

Playbook

Step 1 — Identify Required Collections
  • List every collection that needs seed data.
  • Note dependencies between collections (e.g., orders reference users).
  • Determine the insertion order to satisfy foreign key references.
  • Decide on record counts: enough to be useful, small enough to run fast (10-50 per collection is typical).
Step 2 — Create Seed Script with Realistic Data
  • Place the script in src/seeds/seed.js (or per-collection files in src/seeds/).
  • Use realistic but obviously fake data (e.g., jane.doe@example.com, not production emails).
  • Generate ObjectIds deterministically so references are stable across runs.
  • Include edge cases: empty arrays, null optional fields, maximum-length strings.
js
// Template
const mongoose = require('mongoose');
const User = require('../models/User');
const users = [
{ _id: new mongoose.Types.ObjectId('aaaaaaaaaaaaaaaaaaaaaaaa'), name: 'Jane Doe', email: 'jane@example.com' },
{ _id: new mongoose.Types.ObjectId('bbbbbbbbbbbbbbbbbbbbbbbb'), name: 'John Smith', email: 'john@example.com' },
];
module.exports = { users };
Step 3 — Support Idempotent Runs
  • Before inserting, drop or clear the target collections: await User.deleteMany({});.
  • Use insertMany with { ordered: true } so failures stop early.
  • Guard the script so it refuses to run against a production URI (check MONGODB_URI for localhost or mongo hostname).
  • Print a summary after completion: number of documents inserted per collection.
Step 4 — Add NPM Script Command
  • Add to package.json:

``json "scripts": { "seed": "node src/seeds/seed.js", "seed:fresh": "node src/seeds/seed.js --fresh" } ``

  • If the project uses Python, add an equivalent entry in Makefile or a CLI command.
  • Ensure the script connects to MongoDB, runs seeds in dependency order, then disconnects.
Step 5 — Document Seed Data Structure
  • Add a comment block or a src/seeds/README.md listing collections, record counts, and notable test scenarios.
  • Note any deterministic ObjectIds so other developers can use them in tests.
  • Update state/STATE.md to reflect available seed data.

Checklist

  • [ ] All referenced collections seeded in correct dependency order.
  • [ ] Data is realistic but obviously non-production.
  • [ ] Script is idempotent (safe to run repeatedly).
  • [ ] Production-safety guard in place.
  • [ ] NPM script or Makefile command added.
  • [ ] state/STATE.md updated.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/knofler/myai/seed-data/badge)](https://verified-skill.com/skills/knofler/myai/seed-data)

Something wrong with this skill or its page? Tell us.