Document a migration between two projects in three steps:
- Discovery (
discovery.md): infer the technology stack of both projects and map the equivalences between source and target. - Validation preparation (
validation.md+ foldervalidation/): from the Golden Master Testing opportunities of the discovery, prepare the validation cases and gather their inputs (reference inputs/outputs). - Plan (
plan.md): from the discovery and the validation, define the current state, the proposed change, the Golden Master validation and the implementation plan.
The user indicates what is going to be migrated and from which source project to which target project. All files are generated inside the migration folder in the target project.
The flow is sequential and with gates: do not advance to the next step
while the document of the previous step is not in Ready.
When the plan ends, this skill offers to continue with the implementation: if the
user accepts and the plan.md is in Ready, it does handoff to the skill
work-implement (see "Continue with the implementation" in
references/flow.md).
The detailed procedure of the three steps, the detail of the fragmented target and the handoff live in references/flow.md. Here the summary and the pointers remain.
Language resolution
The language of the generated documents (discovery.md, validation.md, plan.md) and of the messages to the user is decided in this order; stop at the first step that applies:
- If a user language preference exists in the session context, use it.
- If not, use the language of the user's message and ask the user whether they want to persist their language preference in memory.
- If it cannot be inferred, ask the user which language they prefer and, after their answer, ask whether they want to persist their language preference in memory; do not decide the language on your own.
Migration folder structure
Each migration lives in <destino>/docs/specs/migrations/MG-XXX-{slug}/:
docs/specs/migrations/
└── MG-XXX-{slug}/
├── discovery.md # Paso 1
├── validation.md # Paso 2
├── validation/ # recursos de validación (JSON, imágenes, Mermaid, …)
└── plan.md # Paso 3
Inputs you need from the user
- What is going to be migrated (a module, a feature, dependencies, the whole project, etc.).
- Source project and target project(s): ideally the paths to the repos/folders. The target can be one or several projects (e.g., a monolith that is split into several services). If you are only given descriptions, work with that information, but record the assumptions.
If any of these data are missing, ask for them briefly before continuing. Do not invent paths or stacks.
Single destination vs. fragmented destination
- Single destination: run the flow only once and generate
discovery.md,validation.md(with its foldervalidation/) andplan.mdin that destination project. - Fragmented destination (the source is split across several destination
projects): each destination project must have its own migration folder
with its
discovery.md,validation.mdandplan.mdscoped to the portion of the source it receives. Use the sameMG-XXX-{slug}in all projects (calculateXXXas the next free sequential number considering the highest number among all thedocs/specs/migrations/involved). Full details in references/flow.md.
When the destination is fragmented, "the destination" refers to each destination project.
Summary of the three steps
The detailed procedure for each step is in
references/flow.md. Each document is generated by copying its
template from assets/ and renaming it; the template indicates how to fill it in.
-
Discovery (
discovery.md) — templateassets/discovery-template.md. Infer the stack of both projects (with version), calculate the IDMG-XXX, create the folderMG-XXX-{slug}/and build:- The technology mapping (Element, Source, Destination, Equivalence).
- The existing verification strategy and the source environment (test URL for the Chrome MCP).
- The opportunities for Golden Master Testing and the risks.
The Equivalence column classifies each row:
Equivalence Meaning Direct A nearly 1:1 replacement exists Adaptation A replacement exists but requires changes Redesign No direct replacement exists; it must be redesigned Remove It is no longer necessary in the destination Pending Not yet decided -
Validation preparation (
validation.md) — templateassets/validation-template.md. It only starts with the discovery inReady. For each case/opportunity follow references/golden-master-testing.md: create the cases, obtain their reference inputs/outputs (reusing artifacts from the source or capturing its output) and save the resources in the foldervalidation/. -
Plan (
plan.md) — templateassets/plan-template.md. It is only created with the discovery and the validation inReady. It contains the current state (source file tree), the proposed change (destination file tree), Golden Master validation tests and an implementation plan in phases with an incremental strategy of references/migration-strategies.md.
Common header of the three: fixed title, Estado, Fecha (YYYY-MM-DD),
Proyecto origen/Proyecto destino; validation.md and plan.md link to the
discovery with [discovery.md](./discovery.md).
States
There are two state levels distinct: that of the document and, within
validation.md, that of each case.
Document (Draft / Ready) — controls the flow gates:
- discovery.md →
Readyif there are no pending items inNotasand no element remains in equivalence Pending; otherwise,Draft. - validation.md →
Readyif there are no cases inPendientenor pending items inNotas; otherwise,Draft. - plan.md →
Draftas long as it has incomplete or pending sections inNotas;Readywhen it is complete and ready to be executed.
Validation is not prepared nor planned if the discovery is not in Ready, and
the plan is not created until discovery and validation are both in Ready.
Per case (within validation.md) — different from the document state:
Pendiente: the case is missing inputs (reference inputs or outputs).Listo: the case has all its inputs / golden master ready.
(work-implement checks the cases in Pendiente before implementing.)
Reference map
- references/flow.md: detailed procedure of the three
steps, detail of the fragmented destination, "Result" section and "Continue with the
implementation" (handoff to
work-implement). - references/golden-master-testing.md: procedure for preparing Golden Master Testing cases (Step 2).
- references/migration-strategies.md: incremental migration strategies for the implementation plan (Step 3).
assets/discovery-template.md,assets/validation-template.md,assets/plan-template.md: templates for each document with their filling instructions.