sync-db-schema-from-code

Apply database schema changes from Prisma SSOT to a target database.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/willyu1007/Template-Skill-Basic --skill sync-db-schema-from-code
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: sync-db-schema-from-code
Source: https://github.com/willyu1007/Template-Skill-Basic/tree/main/.claude/skills/workflows/database/sync-db-schema-from-code
Command: npx skills add https://github.com/willyu1007/Template-Skill-Basic --skill sync-db-schema-from-code

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill automates the process of applying database schema changes defined in the codebase to a target database, ensuring consistency and reducing manual errors.

Core Features & Use Cases

  • Schema Synchronization: Applies schema changes from prisma/schema.prisma to a target database.
  • Migration Management: Utilizes Prisma migrations for controlled database updates.
  • Diff Preview: Provides a preview of schema differences before applying changes.
  • Approval Gate: Includes a step for manual approval before execution.
  • Context Refresh: Updates LLM context with the latest database schema information.
  • Use Case: Developers can ensure their local development database schema accurately reflects the production schema by running this skill after code changes that affect the database.

Quick Start

Apply the latest database schema changes from the code to the development database.

Frequently Asked Questions about sync-db-schema-from-code

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

FAQPage Schema
How do I sync database schema changes from code to my target database?โ–ผ

You can sync database schema changes by applying Prisma migrations directly from your codebase's Single Source of Truth to the target database. This Skill automates the synchronization process to ensure consistency and reduce manual errors.

What is the best way to preview Prisma schema differences before applying migrations?โ–ผ

The best way to preview Prisma schema differences is using the built-in diff preview step. This Skill provides a preview of schema differences and includes an approval gate to manually review changes before executing the migration on your target database.

Do I need a prisma schema file to apply database migrations?โ–ผ

Yes, you need a defined `prisma/schema.prisma` file and a configured database connection to apply database migrations. This Skill requires both elements to execute schema synchronization and apply changes from your codebase to the target database.

Can I automate Prisma database schema synchronization for local development?โ–ผ

Yes, you can automate Prisma database schema synchronization for local development. Developers can run this Skill after code changes to ensure their local development database schema accurately reflects the production schema defined in the codebase.

Why does my database schema not match my codebase after pulling recent changes?โ–ผ

Your database schema may not match your codebase because recent schema changes have not been applied. This Skill resolves the mismatch by executing Prisma migrations and updating the LLM context with the latest database schema information.