Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:17:56 +08:00
commit 1dc5843958
8 changed files with 196 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
{
"name": "data-seeder-generator",
"description": "Generate realistic test data and database seed scripts for development and testing environments",
"version": "1.0.0",
"author": {
"name": "Claude Code Plugins",
"email": "[email protected]"
},
"skills": [
"./skills"
],
"commands": [
"./commands"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# data-seeder-generator
Generate realistic test data and database seed scripts for development and testing environments

40
commands/seed-data.md Normal file
View File

@@ -0,0 +1,40 @@
---
description: Generate realistic test data and seed scripts
---
# Data Seeder Generator
Generate realistic, consistent test data for database seeding.
## Seeding Strategies
1. **Faker Libraries**: Use Faker.js, Faker (Python) for realistic data
2. **Relational Integrity**: Maintain foreign key relationships
3. **Realistic Distributions**: Natural data patterns
4. **Configurable Volume**: Control record counts
5. **Idempotent Seeds**: Safe to run multiple times
## Example Seeder (Node.js/TypeORM)
```typescript
import { faker } from '@faker-js/faker';
export class UserSeeder {
async run() {
const users = [];
for (let i = 0; i < 100; i++) {
users.push({
email: faker.internet.email(),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
createdAt: faker.date.past()
});
}
await User.save(users);
}
}
```
## When Invoked
Generate seed scripts with realistic data for testing and development.

61
plugin.lock.json Normal file
View File

@@ -0,0 +1,61 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/database/data-seeder-generator",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "a75c5214e70b0ae8e76ae511360668e1dab589ab",
"treeHash": "b894d607b23c1fee46a8ec0809c5d754c5f64b9485317cf65870551f3a6c41b9",
"generatedAt": "2025-11-28T10:18:17.622021Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "data-seeder-generator",
"description": "Generate realistic test data and database seed scripts for development and testing environments",
"version": "1.0.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "6825f8187635efa6ccadf73103ff4b91e748b3239a01c082766157e3c4aefea1"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "11d1a13996b3163d1d86931bc46272f799670ff5622d91ed9acd236cc4ff8f6b"
},
{
"path": "commands/seed-data.md",
"sha256": "c80aa1378969f3cd3d1e5b6639b7d507e9a304980fed2bed7512ac493bc9a1f5"
},
{
"path": "skills/data-seeder-generator/SKILL.md",
"sha256": "a60895bbda16c99c2f00e5460969c2aef2fd2a5a6a9c6e894ab22a837f280bdb"
},
{
"path": "skills/data-seeder-generator/references/README.md",
"sha256": "fa999248b1bf7073fe4f6ad03dc35d696a1095fbbbddc95ee2a70c8b97e7d44e"
},
{
"path": "skills/data-seeder-generator/scripts/README.md",
"sha256": "5825ea3fbbc8222425305ad7fe8a2eecce40a4c794fc7a9f9f75d30f5ba31c25"
},
{
"path": "skills/data-seeder-generator/assets/README.md",
"sha256": "c4d9d0a39293a8ee2c1e6495a48f5a5f4df2fbff307eb8a537d67f8b1b91b55b"
}
],
"dirSha256": "b894d607b23c1fee46a8ec0809c5d754c5f64b9485317cf65870551f3a6c41b9"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}

View File

@@ -0,0 +1,56 @@
---
name: generating-database-seed-data
description: |
This skill enables Claude to generate realistic test data and database seed scripts for development and testing environments. It uses Faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. Use this skill when you need to quickly populate a database with sample data for development, testing, or demonstration purposes. The skill is triggered by phrases like "seed database", "generate test data", "create seed script", or "populate database with realistic data".
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
version: 1.0.0
---
## Overview
This skill automates the creation of database seed scripts, populating your database with realistic and consistent test data. It leverages Faker libraries to generate diverse and believable data, ensuring relational integrity and configurable data volumes.
## How It Works
1. **Analyze Schema**: Claude analyzes the database schema to understand table structures and relationships.
2. **Generate Data**: Using Faker libraries, Claude generates realistic data for each table, respecting data types and constraints.
3. **Maintain Relationships**: Claude ensures foreign key relationships are maintained, creating consistent and valid data across tables.
4. **Create Seed Script**: Claude generates a database seed script (e.g., SQL, JavaScript) containing the generated data.
## When to Use This Skill
This skill activates when you need to:
- Populate a development database with realistic data.
- Create a seed script for automated database setup.
- Generate test data for application testing.
- Demonstrate an application with pre-populated data.
## Examples
### Example 1: Populating a User Database
User request: "Create a seed script to populate my users table with 50 realistic users."
The skill will:
1. Analyze the 'users' table schema (name, email, password, etc.).
2. Generate 50 sets of realistic user data using Faker libraries.
3. Create a SQL seed script to insert the generated user data into the 'users' table.
### Example 2: Seeding a Blog Database
User request: "Generate test data for my blog database, including posts, comments, and users."
The skill will:
1. Analyze the 'posts', 'comments', and 'users' table schemas and their relationships.
2. Generate realistic data for each table, ensuring foreign key relationships are maintained (e.g., comments linked to posts, posts linked to users).
3. Create a seed script (e.g., JavaScript with TypeORM) to insert the generated data into the database.
## Best Practices
- **Data Volume**: Start with a small data volume and gradually increase it to avoid performance issues.
- **Data Consistency**: Ensure the Faker libraries used are appropriate for the data types and formats required by your database.
- **Idempotency**: Design your seed scripts to be idempotent, so they can be run multiple times without causing errors or duplicate data.
## Integration
This skill integrates well with database migration tools and frameworks, allowing you to automate the entire database setup process, including schema creation and data seeding. It can also be used in conjunction with testing frameworks to generate realistic test data for automated testing.

View File

@@ -0,0 +1,7 @@
# Assets
Bundled resources for data-seeder-generator skill
- [ ] example_seed_script.sql: Example SQL script generated by the skill for seeding a database.
- [ ] configuration_template.yaml: Template for configuring the data seeding process, including table names, data volumes, and Faker providers.
- [ ] data_dictionary.json: Example data dictionary defining the structure and data types for each table to be seeded.

View File

@@ -0,0 +1,7 @@
# References
Bundled resources for data-seeder-generator skill
- [ ] faker_providers.md: Documentation on available Faker providers and how to create custom providers for specific data requirements.
- [ ] database_schema.md: Example database schema definitions to guide the data generation process.
- [ ] seeding_best_practices.md: Best practices for database seeding, including data integrity, performance considerations, and security aspects.

View File

@@ -0,0 +1,7 @@
# Scripts
Bundled resources for data-seeder-generator skill
- [ ] seed_database.py: Script to execute the database seeding process, allowing users to specify the number of records and tables to seed.
- [ ] reset_database.py: Script to reset the database to a clean state before seeding, useful for testing and development.
- [ ] validate_seed_data.py: Script to validate the integrity and consistency of the generated seed data.