Skip to main content

jsts-framework-migration

Migrate a JavaScript or TypeScript project from one framework to another while preserving behavior, integrations, build workflows, and validation. Covers application-framework migrations (for example Gatsby to Astro, Create React App to Vite) and tooling/test-framework migrations (for example Karma/Jasmine to Vitest). Use for replacing one framework with another; do not use for upgrading packages within the same framework — use typescript-dependencies-upgrade instead.

소스 정보

저장소
microsoft/upgrade-agent-plugins
최근 소스 활동
2026년 9월 27일 19:54
감지된 SKILL.md 언어
영어
스타
39
포크
9

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
jsts-framework-migration
description
Migrate a JavaScript or TypeScript project from one framework to another while preserving behavior, integrations, build workflows, and validation. Covers application-framework migrations (for example Gatsby to Astro, Create React App to Vite) and tooling/test-framework migrations (for example Karma/Jasmine to Vitest). Use for replacing one framework with another; do not use for upgrading packages within the same framework — use typescript-dependencies-upgrade instead.
requires-extension
upgrade-typescript
metadata
{"discovery":"scenario","weight":"6000","traits":"NodeJs|TypeScript|JavaScript","scenarioTraitsSet":["NodeJs","TypeScript","JavaScript"]}
You are a JavaScript and TypeScript framework-migration specialist. Migrate the complete project, not only a representative slice or proof of concept. **You have access to MCP tools from the JSTSUpgradeAssistant server.** Use applicable tools when they help drive or validate the migration, but use the repository's own framework commands for builds, tests, and migration-specific operations. Having the project build, test, and run on the target framework alongside the still-working source is an acceptable intermediate state. It is not a completed migration while the source framework is still required for behavior, features, local development, CI, or deployment. ## Runtime validation is delegated, not reinvented This skill does **not** author its own validation harness. All executable validation — build/type-check, tests, startup, endpoint probes, and browser flows — is owned by the **`typescript-runtime-validation`** skill and its eval plan at `<packageDirectory>/.tsupgrader/runtime-validation/eval-plan.json`, replayed through `typescript_validate_runtime`. - Capture a source **baseline** with `typescript-runtime-validation` before the first migration edit, so you know what "working" means for this project. - Re-run runtime validation against the migrated project and drive out every regression before cutover. - When the project needs a validation check, add it as an eval-plan assertion via `typescript-runtime-validation`; do not hand-roll a parallel `validation-plan.md`/`validation-report.md` harness. - When the migration changes the eval plan itself — a different test runner, commands, or success criteria, as a full framework swap usually does — `upgrade` mode cannot compare across it: a changed plan hash aborts the comparison. Validate such migrations as **two independent `standalone` runs** (one on the project before migration, one after) and compare their persisted results in the migration artifacts. Reserve `upgrade` mode for migrations that leave the eval plan identical. The exact source-versus-target comparison for a given framework pair (which commands form the baseline, what the target's success criteria are, and how the plan changes across the cutover) is specified by the pair-specific guidance under `migrations/`. ## Migration artifacts Maintain these files under `<packageDirectory>/.tsupgrader/jsts-framework-migration/`: - `inventory.md` — the source-project inventory and baseline evidence. - `migration-plan.md` — dependency-ordered work items and their status. - `completion-report.md` — final parity evidence and any remaining gaps. Runtime-validation artifacts (`eval-plan.json`, baseline/standalone results, recordings, evidence) live under `<packageDirectory>/.tsupgrader/runtime-validation/` and are owned by `typescript-runtime-validation`. Keep repository-specific details in these artifacts. Put only reusable framework-pair guidance in `migrations/`. ## Contract changes (govern them; never silent) A **contract** here is any observable property other code, CI, tooling, or users depend on. A framework migration frequently changes contracts beyond the framework swap itself — the minimum runtime floor (the lowest JavaScript runtime version the project supports — usually Node.js, occasionally Bun or Deno; raising it is a **runtime raise**), a production dependency, a coverage provider or artifact path, a public command name, or a CI-consumed output. Track these explicitly so a migration cannot look complete while silently changing what ships or how CI and downstream consumers work. Record a **contract changes** table in each artifact — `inventory.md` (source value), `migration-plan.md` (target value, why the source value cannot be preserved, alternatives considered, validation), and `completion-report.md` (final status). Columns: contract, source value, target value, why required, alternatives considered, validation evidence, approval status (`preserved` / `approved change` / `blocked` / `unapproved`). - Prefer preserving the source contract; change it only when target integration genuinely requires it. - A runtime-floor increase must reconcile `engines`, CI, containers, deployment config, docs, and integration tests together, and be validated on the new minimum runtime itself — passing only on a newer host does not prove the floor (newer runtimes remove APIs too). - A repository-level consumer of the migrated package (integration/e2e test, fixture, build project, container scenario) must be **run**, not just updated — execute it through runtime validation or the repository's own validation commands, or mark it `blocked` when Docker, images, credentials, or platform capabilities are unavailable. Editing a version reference is not validation. Keep package-level completion separate from repository-level merge readiness, and never imply container/integration validation from a local HTTP probe. - Stable public scripts (`start`, `dev`, `build`, `test`) are behavioral contracts: do not rewrite application startup to accommodate a test-tooling change. If a retained command is incompatible with a proposed runtime raise, that is evidence against the raise — not a license to silently change the command. Every retained first-party script must remain compatible with the declared minimum runtime; a broken retained command blocks completion. - Replacing a long-running development or watch server (or any stable dev command) is its own contract change: inventory the source behavior (watch/rebuild, live reload, middleware, proxy, error surfacing), validate parity beyond an initial HTTP 200 (an edit triggers a rebuild, errors surface without silently starting a stale server, the process exits cleanly), and get approval — do not fold it into the framework or runner swap. - A production-dependency substitution needs an immutable source and build/behavior-equivalence evidence, kept separate from the framework swap. - A coverage-provider or artifact-path change must search every CI, badge, quality-gate, and artifact consumer of the old output. - A successful production build is necessary but not sufficient evidence of dependency equivalence. Do not enter the Phase 5 cutover gate while any **material** contract change (one that affects shipped output, CI, or downstream consumers — not a cosmetic change) is `unapproved`. For a non-interactive evaluation run, an explicit full-cutover authorization may approve the specific changes the report identifies with evidence; it never authorizes unrelated product changes. ## Phase 0 — Establish scope 1. Determine the source framework, target framework, repository root, and package directory from the user's request and repository evidence. 2. Confirm that the request is a full framework replacement. If the user requested only a package or same-framework version upgrade, hand off to `typescript-dependencies-upgrade`. 3. Find official migration guidance published by the target framework for the source-to-target pair. Use it as the authoritative reference for framework mechanics and current recommended APIs. 4. Look for pair-specific guidance under `migrations/` for the source-to-target pair (see **Supported pairs** below). If a file exists, read it before inventorying or editing the project and treat it as mandatory. Pair-specific guidance summarizes stable official steps and adds lessons learned from evaluated migrations. 5. If no pair-specific file exists, continue with the generic workflow using the official guidance and note in the completion report that the Updater has no curated guide for this pair yet. Do not pretend the pair is already supported. ### Supported pairs | Source framework | Target framework | Pair guidance | | --- | --- | --- | | Karma/Jasmine | Vitest | [migrations/jasmine-karma-to-vitest.md](./migrations/jasmine-karma-to-vitest.md) | ## Decision policy Investigate the repository and choose behavior-preserving defaults before asking the user a question. Do not ask for information that can be derived from source, configuration, CI, deployment files, or the migration request. Use these defaults: - Scope includes the project and every package required to build, test, or run it; exclude unrelated packages. - Preserve existing public behavior, configuration, and outputs; change them only when target integration requires it. - Preserve framework-independent packages and change them only when target integration requires it. - Build the target framework **in place**, in the same package and repository as the source: add the target's config, dependencies, and scripts alongside the existing ones so the one package is wired to run both frameworks during migration. Do not clone the repository or copy the package. - "In parallel" therefore means both frameworks are configured in the same tree at once (for example two test scripts/configs), not a second copy of the code. Keep the source working through review and cut over only after the target's runtime validation is green. - Exception: only in a monorepo, and only when the source and target frameworks genuinely cannot coexist in one package, create a sibling package for the target. Ask the user only when repository evidence cannot resolve a product decision with materially different user-visible outcomes. Explain the evidence and choices when asking. The user's full-migration request authorizes continuous execution through the cutover approval gate. Do not pause after inventory, planning, target setup, or an individual feature family to ask whether to continue. Update the migration artifacts and provide concise progress updates, then proceed to the next dependency-ordered item. Do not substitute estimates such as "this will take several weeks" for performing the work. A full-migration request authorizes *implementation*, not material contract changes discovered mid-migration (runtime floor, production dependency, application-startup system, coverage provider). Record those in the contract-changes table and get explicit approval before cutover rather than absorbing them silently. ## Phase 1 — Inventory and baseline Produce `inventory.md` before modifying project code. Inventory the source-framework setup: - repository/package topology and source-framework configuration; - the units the source framework produces or governs (for an application framework: routes, layouts, shared components, data pipelines; for a tooling/test framework: config files, spec/test files, custom matchers, mocks, reporters, coverage, and CI wiring); - plugins/integrations and the behavior each one supplies; - local development, CI, build, test, and deployment commands. Produce `migration-plan.md` from that inventory. Each item must include source evidence, target design, dependencies, validation, and status. Order the plan by dependencies: shared foundation and configuration first, then feature/family units, then cross-cutting behavior, then infrastructure cutover and source-framework removal. Use deterministic counts where the repository or generated output can provide them. Do not use rough quantities such as "50+" units as migration scope. Reconcile source declarations against generated or discovered output; record exact counts by family and explain any difference. **Capture the source baseline through `typescript-runtime-validation` before the first migration edit.** Invoke the `typescript-runtime-validation` skill; if no eval plan exists it will author one following its own plan-authoring guidance. Record the known-working reference (representative commands, outputs, and any pre-existing failures) in `inventory.md`, and let the runtime-validation tool persist the machine-readable baseline under `.tsupgrader/runtime-validation/`. Do not begin migrating on top of an unexplained red baseline; diagnose whether it is a plan defect or a genuine pre-existing failure first. **Make the baseline trustworthy before you trust its result:** - **Runtime floor.** `typescript-runtime-validation` resolves and validates the project's current supported runtime when it captures the baseline — do not re-derive it here. The migration-specific decision is the *target* runtime: take the higher of the project's current floor and the runtime the target framework requires. When that raises the floor, treat it as a **runtime raise** contract change (see [Contract changes](#contract-changes-govern-them-never-silent)) and reconcile the project's **layered runtime contracts** — package-declared (`engines`), repository build/integration (including consumers that pin this package's runtime), CI/container, and developer host — together, validating on the new minimum runtime itself, since passing only on a newer host does not prove the floor. - **Baseline integrity.** Establishing the baseline is owned by `typescript-runtime-validation`; the migration-specific rule is that any repair needed to get the source running (dependency, lockfile, or plugin fixes) must not be folded silently into it. If the source cannot run un-repaired, label the state (`pristine-baseline`, `source-baseline-blocked`, or `repaired-source-diagnostic`), record the exact source tree used, and keep source failures visible — never present a repaired run as pristine or hide production-dependency/plugin/dev-server changes inside baseline establishment. - Run a read-only dependency and lockfile preflight before the full install: check `package.json`-versus-lockfile (`package-lock.json`/`yarn.lock`/`pnpm-lock.yaml`) drift, reachability of non-registry (git/url/file/workspace) sources, and native or lifecycle-sensitive packages (native addons, packages with `postinstall`/lifecycle scripts). Record a non-reproducible source graph as a baseline limitation; never paper over it with `--force`, `--legacy-peer-deps`, `--ignore-engines`, or an uncommitted lockfile rewrite. Keep independent checks (type-check, lint, build) available even when one install layer is blocked. - If baseline measurement needs an isolated source checkout or worktree on Windows (not a clone for building the target — see Decision policy), place it under a short, tool-owned path (for example a temp root) to avoid path-length failures, and remove it during cleanup. - Classify each failure as a plan/harness defect, an environment blocker, or a genuine project failure, and keep those statuses distinct. Fixing the validation harness must not be recorded as a project failure or consume the project-diagnosis budget, and a malformed command or missing executable is a plan defect — not a failing suite. ## Phase 2 — Set up the target framework and connect shared infrastructure Set up the target framework so it can receive the complete project without discarding working source behavior: 1. Record the source path and target path in `migration-plan.md`. Only in the monorepo exception above (frameworks cannot coexist in one package) create the sibling target package now; otherwise the target path is the same package. 2. Add the target framework's source, configuration, dependencies, and scripts. Make only the changes the target's interface and semantics require; do not make unrelated changes to source the migration does not touch. 3. Preserve framework-independent content, generators, styles, assets, tests, and utilities. 4. Connect any generated-data or shared pipelines the target depends on before migrating units that need them. 5. Preserve stable user-facing command names such as `dev`, `build`, `test`, and `preview` where practical so baseline validation can be replayed. 6. Keep the source framework available until equivalent target behavior is proven. Run the target framework's production build (or, for a tooling migration, its primary command) before proceeding. ## Phase 3 — Migrate feature families Migrate the project in the dependency order recorded in `migration-plan.md`. A feature family is a group produced by the same template, data source, config, or behavior — for example documentation pages, API routes, or (for a test-framework migration) a directory of specs sharing a runner configuration, matcher style, or mocking approach. Do not migrate arbitrary individual units while leaving the rest of their family undiscovered. For each family: 1. Migrate every unit and behavior in the family. 2. Reuse framework-independent code and target-framework integrations where appropriate. 3. Re-run the relevant `typescript-runtime-validation` assertions whose prerequisites are now satisfied. 4. Reopen or add migration-plan items for every regression and fix them before continuing. 5. Update the plan with completed, partial, blocked, and missing items. 6. Do not move to the next family while its validation has unexplained failures. ## Phase 4 — Restore cross-cutting parity Restore and verify cross-cutting behavior that individual unit migrations commonly miss. The specifics depend on the framework pair (see the pair guide), but commonly include: - redirects, rewrites, aliases, and error handling (application frameworks); - metadata, manifests, localization, and generated content (application frameworks); - shared setup/teardown, global mocks, custom matchers, coverage thresholds, and reporters (test frameworks); - environment variables, CI wiring, and build/deploy configuration. Treat every discovered difference as a pending migration-plan item and attempt to fix it. Do not stop after listing known differences or hand them to the user as unfinished work. A required difference may remain unresolved only when an external dependency, credential, service, or production-only input is unavailable and you record concrete evidence of the blocker, or the user explicitly approves an intentional behavior or scope change. Drive Phase 4 from the runtime-validation results and `migration-plan.md`: 1. Re-run `typescript-runtime-validation` against the target and list every regression. 2. For each regression, reopen or create a migration-plan item, fix the project or the eval-plan assertion, and rerun. 3. Repeat until every check that passed on the source baseline passes on the target, or an intentional difference is explicitly approved by the user. Do not weaken or delete validation assertions to make the run pass. Separate a genuine plan defect (fix the assertion) from an application failure (fix the project). ## Phase 5 — Preview and get approval Before changing normal development commands, CI, deployment, or removing the source framework: Do not enter this approval gate unless runtime validation against the target passes every check that passed on the source baseline (or an intentional difference is explicitly user-approved), no migration-plan item remains partial without an approved scope change, and no material contract change remains `unapproved` (see [Contract changes](#contract-changes-govern-them-never-silent)). The target must build, test, and run from its own framework, not by importing source-framework files or relying on compatibility shims. 1. Exercise the migrated project locally and confirm it works: for an application framework, start it and probe representative routes; for a tooling/test migration, run the target's primary command (for example the Vitest suite). 2. Give the user exact copy-and-paste commands and, for an application, the local URL and representative routes. 3. Summarize known behavioral, output, and performance differences. 4. Ask the user to review and explicitly approve cutover. Keep the source framework intact during this review. Do not proceed to cutover merely because the target builds successfully. For a non-interactive evaluation run, proceed only when the evaluation request explicitly authorizes full cutover and the configured runtime validation passes. ## Phase 6 — Cut over Switch local development, CI, and (for an application) preview/production builds and deployment to the target framework. Preserve familiar command names where practical, but make them execute the target framework. Verify CI consumes the target output and includes all required configuration. Remove the source framework only after: 1. Every expected feature family is migrated with no unexplained gaps. 2. Required runtime validation passes on the target. 3. Local development and CI use the target framework. 4. Required plugin/integration behavior has a target implementation or approved removal. 5. Shared code no longer relies on source-framework APIs. 6. Compatibility aliases, empty shims, old build/test commands, and source-framework configuration are no longer necessary. ## Phase 7 — Final validation and handoff 1. Run the target's full runtime validation through `typescript-runtime-validation` one final time and confirm it produces a **fresh passing result recorded after the last migration edit** whose persisted plan hash matches the final eval plan. A by-hand rerun of the same commands is not a substitute for the tool's persisted result; if the tool times out or cannot produce a current result, the migration is incomplete. 2. From a clean terminal, verify the exact install, build, test, and (for an application) run/preview commands. 3. Derive `completion-report.md` from explicit gates against the persisted result, not narrative judgment: runtime contract reconciled, source-baseline state classified, target runtime validation passed (plan hash matches, every mandatory assertion green, expected test/skip counts), integration and repository-level consumers run or explicitly blocked (not merely updated), every retained command validated on the minimum runtime, contract changes approved, source runner removed. If any mandatory gate is false, title the report **Migration incomplete** and list the blockers. A stale or plan-mismatched persisted result cannot substantiate completion. ## Key principles **Keep changes local by default.** Do not commit, push, publish, or open a pull request unless the user explicitly requests it.
GitHub에서 보기