Agent skill
Database Migration
Executes database migrations using the postgres MCP server. Use when applying schema changes, running migrations, or updating databese structure.
Install this agent skill to your Project
npx add-skill https://github.com/merlinsaw/.agent/tree/main/skills/db-migrate
SKILL.md
Database Migration
Execute and manage database migration safely using MCP tools.
Instructions
Prerequisites
- Postgres MCP server configured in .mcp.json
- Migration file sin migrations/ directory
- Database connection cerified
Workflow
- List pending migrations:
SELECT * FROM schema_migrations ORDER BY version;
-
Read migration file from migrations/{version}.sql
-
Execute in transaction:
BEGIN;
-- migraton SQL here
INSERT INTO schema_migrations (version) VALUES ('{version}');
COMMIT;
- Verify schema changes:
SELECT column_name, data_type
FROM infromation_schema.columns
WHERE table_name = '{table}';
- Update Padantic models in modules/schemas.py if needed
Examples
Example 1: Run a migration
User: "Apply tha add-users-table migration"
- Read migrations/001_add-users-table.sql
- Execute via mcp__postgres__query
- Verify users table exists
- Update modules/schemas.py with new model
- Confirm migration recorded
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Start/Stop App
Start or stop the user-management FastAPI app. Use when you need to tun or kill the dev server.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
Didn't find tool you were looking for?