Agent skill
migrations
Run migrations, generate schemas, and manage code generation for Momentum CMS. Use when working with database migrations, Drizzle schema generation, type generation, or Angular schematics.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/migrations
SKILL.md
Migrations & Code Generation
Reference for database migrations and type/config generation in the Momentum CMS monorepo.
Arguments
$ARGUMENTS- Operation:generate,run,status,rollback, orcodegen
Momentum Migration CLI (@momentumcms/migrations)
# In the monorepo (via Nx targets on example apps):
nx run example-angular:migrate:generate # Diff schema, create migration file
nx run example-angular:migrate:run # Apply pending migrations
nx run example-angular:migrate:status # Show applied vs pending
nx run example-angular:migrate:rollback # Rollback latest batch
Drizzle Kit
nx run db-drizzle:generate-schema # Generate schema from collections
npx drizzle-kit generate # Create SQL migrations
npx drizzle-kit migrate # Apply migrations
npx drizzle-kit push # Direct push (dev only)
Code Generation (Unified Generator)
The generator reads momentum.config.ts (server-side, Node) and outputs:
- TypeScript types — interfaces for all collections, blocks, where clauses
- Browser-safe admin config — inlined collections with server-only props stripped
nx run example-angular:generate # One-shot generation
nx run example-angular:generate:watch # Watch mode
Angular Schematics
Both @momentumcms/core and @momentumcms/migrations ship Angular schematics:
# Type/config generation (in scaffolded Angular projects)
ng generate @momentumcms/core:types
# Migrations (in scaffolded Angular projects)
ng generate @momentumcms/migrations:generate
ng generate @momentumcms/migrations:run
ng generate @momentumcms/migrations:status
ng generate @momentumcms/migrations:rollback
Workflow
- Make collection changes in
libs/example-config/src/collections/ - Run
nx run example-angular:generateto regenerate types + admin config - Run
nx run example-angular:migrate:generateto create a migration file - Review the generated migration SQL
- Run
nx run example-angular:migrate:runto apply
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?