db-generate — Claude Code skill: Medusa migrations
Generates database migrations for a Medusa module and tells you what to run next.
npx skills add medusajs/medusa-agent-skills --skill db-generate -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/db-generate/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/db-generate/
1Skills CLI (Vercel)
npx skills add medusajs/medusa-agent-skills --skill db-generate -a codex2Manually: put the files in place
.agents/skills/db-generate/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add medusajs/medusa-agent-skills --skill db-generate -a cursor2Manually: put the files in place
.cursor/skills/db-generate/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install medusajs/medusa-agent-skills db-generate2Manually: put the files in place
.github/skills/db-generate/SKILL.md1Skills CLI (Vercel)
npx skills add medusajs/medusa-agent-skills --skill db-generate -a gemini-cli2Platform CLI
gemini skills install https://github.com/medusajs/medusa-agent-skills --path plugins/medusa-dev/skills/db-generateManually: put the files in place
.devin/skills/db-generate/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add medusajs/medusa-agent-skills --skill db-generate -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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>.