From milky-kit
Database operations — create migrations, modify schema, check migration status, and manage PostgreSQL tables (sqlx). Use when adding/changing tables, fields, indexes, constraints, or working with migrations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/milky-kit:database-sqlx <action> (e.g. "add a tasks table", "add field to agent", "create migration for reminders", "status")<action> (e.g. "add a tasks table", "add field to agent", "create migration for reminders", "status")The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Perform database schema and migration operations for **$ARGUMENTS**.
Perform database schema and migration operations for $ARGUMENTS.
DATABASE_URLsqlx::query!() macros.sql files with timestamp-based names.sqlx/ allows building without a databaseCheck the last timestamp and create the next file:
ls packages/infrastructure/pg_migrations/
Create e.g. 20260302000000_add_notifications.sql:
CREATE TABLE IF NOT EXISTS notification (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_notification_user ON notification (user_id);
# Restart app to apply migration, then:
cargo sqlx prepare --workspace
packages/domain/src/models/packages/domain/src/repositories/packages/infrastructure/src/db/pg_repositories/ using sqlx::query!() macroscargo check -p infrastructure
SQLX_OFFLINE=true cargo check --workspace
Never edit an existing migration file. Create a new ALTER TABLE migration.
IF NOT EXISTS (idempotency)created_at and updated_at with DEFAULT now()CHECK constraints for enum-like fieldsTEXT for strings, JSONB for structured data&val for String parameters, .as_deref() for Option<String>.sqlx/ directorycargo sqlx prepare --workspace.sql file created with IF NOT EXISTScargo sqlx prepare --workspacecargo check -p infrastructure passesSQLX_OFFLINE=true cargo check --workspace passesnpx claudepluginhub milkyskies/milky-kit --plugin milky-kitCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.