db-seed

Apply idempotent SQL seed data to databases with pre-flight checks and snapshots.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/GDSDN/kord-aios --skill db-seed
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-seed
Source: https://github.com/GDSDN/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-seed
Command: npx skills add https://github.com/GDSDN/kord-aios --skill db-seed

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of applying seed data to a database, ensuring data integrity and consistency across environments through idempotent operations.

Core Features & Use Cases

  • Idempotent Seeding: Safely applies seed data, preventing duplicate entries or errors on re-runs using patterns like INSERT ... ON CONFLICT.
  • Environment Consistency: Ensures development, staging, and production databases can be seeded reliably.
  • Pre-flight Checks & Validation: Validates seed files for dangerous patterns (like TRUNCATE) and confirms idempotency.
  • Snapshotting: Creates database snapshots before seeding for easy rollback.
  • Logging: Documents all seeding operations for auditability.
  • Use Case: Apply a standard set of initial product categories and user roles to a new development database without fear of breaking existing data.

Quick Start

Use the db-seed skill to apply the seed data from the file '/path/to/seed.sql' in interactive mode.

Frequently Asked Questions about db-seed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make database seeding idempotent to prevent duplicate entries on re-runs?

Database seeding becomes idempotent by using SQL operations like INSERT ... ON CONFLICT to prevent duplicates on re-runs. This Skill validates seed files for such patterns during pre-flight checks before safely applying the data.

What is the best way to safely apply SQL seed data to a staging database?

Applying SQL seed data safely requires pre-flight checks, idempotency validation, and pre-seed database snapshots. This Skill uses psql with error handling to apply data and creates snapshots for easy rollback if needed.

Does this database seeding process support rollback if the data migration fails?

Yes, this database seeding process supports rollback by creating pre-seed database snapshots before applying SQL scripts. If data migration fails, you can restore the database to its previous state using that snapshot.

How do I validate SQL seed files for dangerous patterns before applying them?

You validate SQL seed files by running pre-flight checks that scan for dangerous patterns like TRUNCATE and confirm idempotent operations. This Skill performs these validations automatically before executing any seed data application.

Can I automate database initialization in development environments without breaking existing data?

Yes, you can automate database initialization without breaking existing data by applying idempotent SQL seed scripts. This Skill ensures environment consistency by using safe insertion patterns and verifying data after the operation.