Skip to main content
skill CX Codex

db-generate — Claude Code skill: Medusa migrations

Generates database migrations for a Medusa module and tells you what to run next.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add medusajs/medusa-agent-skills --skill db-generate -a claude-code
Open on GitHub

What db-generate does

The skill takes a module name and runs npx medusa db:generate <module-name>. That is the whole job — one Bash call with your argument dropped in.

When it finishes, you get the module name, the migration file name or location, and any errors or warnings. It also points at the follow-up: apply the migrations with npx medusa db:migrate.

The module name is required, so a bare invocation goes nowhere. Tool access is scoped to Bash(npx medusa db:generate:*), which keeps the skill inside generation and out of your other commands.

What it helps with

  • generate a migration file for a new Medusa module
  • skip typing the module name into the command by hand
  • find where the migration file landed
  • catch errors and warnings during generation
  • get reminded to apply the migrations

Example prompts for the agent

  • /medusa-dev:db-generate brand
  • /medusa-dev:db-generate custom-module
  • Generate migrations for the product module

How to install db-generate

1Skills CLI (Vercel)

npx skills add medusajs/medusa-agent-skills --skill db-generate -a claude-code

2Manually: put the files in place

~/.claude/skills/db-generate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/db-generate/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about db-generate

How do I install db-generate in Claude?

Run npx skills add medusajs/medusa-agent-skills --skill db-generate -a claude-code. The skill lands at ~/.claude/skills/db-generate/SKILL.md.

What does db-generate do?

It generates database migrations for a named Medusa module and reports the file, any errors, and the next step.

What argument does the skill need?

A module name such as brand or custom-module, substituted into npx medusa db:generate <module-name>.

Similar skills

All skills for Data and databases →

From the same set12

building-with-medusa Defines architecture standards and guardrails for Medusa backend development. Useful when designing custom modules, API routes, or multi-step workflows. CX Codex +1 4,600installs storefront-best-practices This skill guides storefront work, from product pages and carts to checkout flows. Use it when building or changing an online store interface. CX Codex +1 4,600installs building-admin-dashboard-customizations Guides AI agents in building Medusa Admin dashboard extensions, widgets, and custom UI routes. Essential when customizing store management panels. CX Codex +1 4,400installs building-storefronts A skill for building Medusa storefronts: it tells the agent how to call APIs through the SDK and React Query without breaking requests. CX Codex +1 4,200installs learning-medusa An interactive tutoring skill that guides you through Medusa architecture step by step with hands-on checkpoints. CX Codex +1 3,400installs using-medusa-cloud A skill that teaches an agent to run Medusa Cloud through the mcloud CLI: deploys, failed builds, environments, variables. Useful for CI/CD work. CX Codex +1 1,400installs mcloud-organizations This skill lets your agent run mcloud organizations commands: list Cloud organizations, resolve an ID by name, pull subscription and member details. CX Codex +1 1,300installs mcloud-logs A skill that teaches your agent to read backend and storefront logs with mcloud logs, filter them by time or deployment, and pipe them to JSON. CX Codex +1 1,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor