moai-domain-db-docs

Parse DB migrations and update schema.md, erd.mmd, and migrations.md.

4|4|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/modu-ai/moai-studio --skill moai-domain-db-docs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-domain-db-docs
Source: https://github.com/modu-ai/moai-studio/tree/main/.claude/skills/moai-domain-db-docs
Command: npx skills add https://github.com/modu-ai/moai-studio --skill moai-domain-db-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps DB documentation in sync with migrations across Prisma, Alembic, Rails, and raw SQL by updating schema.md, erd.mmd, and migrations.md to reflect current database state.

Core Features & Use Cases

  • Parses migration files and builds a normalized representation.
  • Updates .moai/project/db/schema.md with table registry, counts, and last_migration_file.
  • Regenerates erd.mmd to reflect current tables and relationships.
  • Appends applied migrations to .moai/project/db/migrations.md with metadata.
  • Works with /moai db refresh and /moai db verify workflows and post-tool use upgrades.

Quick Start

Run /moai db refresh to rebuild schema.md, erd.mmd, and migrations.md from the latest migration files.

Frequently Asked Questions about moai-domain-db-docs

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

FAQPage Schema
How do I sync database documentation with schema migrations?

To sync database documentation with schema migrations, run the /moai db refresh workflow to parse migration files and automatically update schema.md, erd.mmd, and migrations.md to reflect the current database state.

Does this DB documentation sync tool work with Prisma, Alembic, and Rails migrations?

Yes, this DB documentation sync tool works with Prisma, Alembic, Rails, and raw SQL migrations by parsing migration files into a normalized representation to update your project's schema and ERD documentation.

How do I automatically generate an ERD from database migrations?

You can automatically generate an ERD from database migrations by running the /moai db refresh command, which regenerates the erd.mmd file to reflect current tables and relationships based on parsed migration diffs.

What is the best way to prevent schema drift in database documentation?

The best way to prevent schema drift in database documentation is to invoke the /moai db verify workflow after applying migrations, ensuring schema.md and migrations.md maintain versioned history with guardrails and fault-tolerant logging.

Can I append migration history to a markdown file automatically?

Yes, you can append migration history to a markdown file automatically by running the /moai db refresh workflow, which appends applied migrations with metadata to the .moai/project/db/migrations.md file.

What files are updated when syncing DB docs with migration changes?

When syncing DB docs with migration changes, the tool updates .moai/project/db/schema.md with table registry and counts, regenerates erd.mmd for relationships, and appends metadata to migrations.md.