Phase 1b: Rename all ~94 commands across 12 plugins to /<noun> <action> sub-command pattern. Git-flow consolidated from 8→5 commands (commit variants absorbed into --push/--merge/--sync flags). Dispatch files, name: frontmatter, and cross-reference updates for all plugins. Phase 2: Design documents for 8 new plugins in docs/designs/. Phase 3: Scaffold 8 new plugins — saas-api-platform, saas-db-migrate, saas-react-platform, saas-test-pilot, data-seed, ops-release-manager, ops-deploy-pipeline, debug-mcp. Each with plugin.json, commands, agents, skills, README, and claude-md-integration. Marketplace grows from 12→20. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
72 lines
2.6 KiB
Markdown
72 lines
2.6 KiB
Markdown
# Design: saas-db-migrate
|
|
|
|
**Domain:** `saas`
|
|
**Target Version:** v9.2.0
|
|
|
|
## Purpose
|
|
|
|
Database migration management for SQL databases. Supports Alembic (Python/SQLAlchemy), Prisma (Node.js), and raw SQL migrations. Provides migration generation, validation, rollback planning, and drift detection.
|
|
|
|
## Target Users
|
|
|
|
- Backend developers managing database schemas
|
|
- Teams using SQLAlchemy/Alembic or Prisma
|
|
- Projects needing migration safety checks before deployment
|
|
|
|
## Commands
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `/db-migrate setup` | Setup wizard — detect ORM/migration tool, configure paths |
|
|
| `/db-migrate generate` | Generate migration from model diff or description |
|
|
| `/db-migrate validate` | Check migration safety (destructive ops, data loss risk, locking) |
|
|
| `/db-migrate plan` | Show migration execution plan with rollback strategy |
|
|
| `/db-migrate history` | Display migration history and current state |
|
|
| `/db-migrate rollback` | Generate rollback migration for a given migration |
|
|
|
|
## Agent Architecture
|
|
|
|
| Agent | Model | Mode | Role |
|
|
|-------|-------|------|------|
|
|
| `migration-planner` | sonnet | default | Migration generation, rollback planning |
|
|
| `migration-auditor` | haiku | plan | Read-only safety validation (destructive op detection) |
|
|
|
|
## Skills
|
|
|
|
| Skill | Purpose |
|
|
|-------|---------|
|
|
| `orm-detection` | Detect Alembic vs Prisma vs raw SQL, identify config |
|
|
| `migration-safety` | Rules for detecting destructive operations (DROP, ALTER, data loss) |
|
|
| `rollback-patterns` | Standard rollback generation patterns per tool |
|
|
| `naming-conventions` | Migration file naming and ordering conventions |
|
|
| `visual-header` | Standard command output headers |
|
|
|
|
## MCP Server
|
|
|
|
**Not required.** Migrations are file-based. Database connectivity is handled by the ORM tool itself, not by Claude.
|
|
|
|
## Integration Points
|
|
|
|
| Plugin | Integration |
|
|
|--------|-------------|
|
|
| projman | Issue labels: `Component/Database`, `Tech/SQLAlchemy`, `Tech/Prisma` |
|
|
| saas-api-platform | Schema models shared between API and migration layers |
|
|
| code-sentinel | Migration validation as part of security scan |
|
|
| data-platform | PostgreSQL tools can inspect live schema for drift detection |
|
|
|
|
## Token Budget
|
|
|
|
| Component | Estimated Tokens |
|
|
|-----------|-----------------|
|
|
| `claude-md-integration.md` | ~600 |
|
|
| Dispatch file (`db-migrate.md`) | ~200 |
|
|
| 6 commands (avg) | ~3,600 |
|
|
| 2 agents | ~1,200 |
|
|
| 5 skills | ~2,000 |
|
|
| **Total** | **~7,600** |
|
|
|
|
## Open Questions
|
|
|
|
- Should this integrate with data-platform's PostgreSQL MCP server for live schema comparison?
|
|
- Support for NoSQL migration tools (Mongoose, etc.)?
|