speckit.product-forge.migration-plan

speckit.product-forge.migration-plan is a command for Claude Code from VaiYav/speckit-product-forge. It costs 126 tokens per session (1,669 once invoked), scanned A, original, MIT.

A conditional database-migration planning step for features that change stored data. It prepares forward and rollback scripts, checks for validating the change, a backfill outline, and a risk review for a no-downtime migration.

In plain words
What is it for?
Use it after the implementation plan identifies schema changes in MongoDB, PostgreSQL, or MySQL. It determines the database type, compares the current and intended schema, and documents the migration.
Why use it?
Changing a database structure can interrupt a running product or leave old data inconsistent. Planning both directions gives the implementation team a safer way to update and undo the change.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the speckit-product-forge plugin — 31 commands shipped together

Good fit Use it after the implementation plan identifies schema changes in MongoDB, PostgreSQL, or MySQL. It determines the database type, compares the current and intended schema, and documents the migration.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/vaiyav/speckit-product-forge/migration-plan
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/VaiYav/speckit-product-forge

Made for: Claude Code.

Or install speckit-product-forge, the plugin that ships this one along with the rest of its 31 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for speckit.product-forge.migration-plan

README.md
[![agentmods](https://agentmods.dev/badge/commands/vaiyav/speckit-product-forge/migration-plan.svg)](https://agentmods.dev/commands/vaiyav/speckit-product-forge/migration-plan)
Your own site
<a href="https://agentmods.dev/commands/vaiyav/speckit-product-forge/migration-plan"><img src="https://agentmods.dev/badge/commands/vaiyav/speckit-product-forge/migration-plan.svg" alt="Measured on agentmods" height="20"></a>
Per session 126 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,669 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.01669
Opus 5 $0.00063 $0.00834
Sonnet 5 $0.00025 $0.00334
Haiku 4.5 $0.00013 $0.00167

Measured 8d ago against content hash 60823e2e7f03, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

speckit.product-forge.migration-plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/migration-plan.md · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Product Forge — Migration Plan (Phase 5.5)

You are the Migration Strategist for Product Forge. Your job: turn data-model changes in plan.md into an explicit, reversible, zero-downtime migration plan with real forward/backward scripts, so that Phase 6 (Implement) never has to improvise migrations under time pressure.

This phase is opt-in and conditional — trigger only when plan.md declares schema changes.

User Input

$ARGUMENTS

Parse for:

  • Feature slug (required).
  • --db=<kind>mongodb | postgres | mysql. If omitted, detect from project config / plan.md hints.

Step 0: Prerequisites

  1. plan.md exists AND its Data Model section is non-empty.
  2. Identify the DB kind:
    • From .product-forge/config.yml project_tech_stack if clear.
    • Otherwise from plan.md (Prisma schema ⇒ Postgres/MySQL; Mongoose schema ⇒ MongoDB; raw SQL ⇒ inspect).
  3. Confirm with the user before proceeding.

If plan.md has no schema changes, exit with: "No data-model changes detected in plan.md — migration plan not needed."


Step 1: Schema Diff

Extract the before/after schema:

  • Before: current schema from the codebase (read-only).
  • After: schema described in plan.md Data Model section.

Produce a diff:

Change Field / collection Type Reversible?
ADD User.push_token `string null`
MODIFY Subscription.status (enum active → trialing) enum ⚠️ data-dependent
DROP User.legacy_flag bool ❌ destructive

Flag any as HIGH RISK.


Step 2: Strategy Selection

Pick one strategy per change, defaulting toward safe:

Strategy When to use
Shadow column + dual-write Renames, type widenings, non-nullable additions on non-empty tables.
Expand–migrate–contract Any data backfill touching > 10k rows.
Blue-green Changes to hot paths where a short flip window is acceptable.
Big-bang Dev/staging only, or non-empty but small (< 1k rows), non-production-critical.

Read the full file on GitHub · 220 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 220 lines · 126 tokens per session scan A 60823e2e7f03

Subscribe to this mod's changes

speckit.product-forge.migration-plan is a command published in the GitHub repository VaiYav/speckit-product-forge (23 stars, last pushed 15d ago), licensed MIT. It adds 126 tokens to every session and 1,669 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.