Index of every page on this site: llms.txt
All skills
fubits1 avatar

/migration

@a024d57
by Iljafubits1/svelte-skills11 stars
2
Run it yourself

Use when upgrading a framework version, migrating APIs, bumping major dependencies, or any task where "before" and "after" states must be compared. Auto-invoke when user mentions migration, upgrade, breaking changes, or version bumps.

Use this Skill: https://skilld.dev/gh/fubits1/svelte-skills/migration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈61 tokens for metadata: the name and description. ≈1.7k when used: this file.

Description uses 3.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈246 characters, or 3.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Migration

Framework upgrades, major dep bumps, config migrations. The core challenge is proving zero regressions, which requires baselines captured on the TRUE pre-change state.

Rule Zero: Check Working Tree FIRST

Before planning, researching, or writing anything:

git status
git diff package.json

If package.json is already modified, deps may already be upgraded. Baselines taken now reflect post-upgrade state and are WORTHLESS for comparison. You must restore old deps before capturing baselines (see Phase 3a).

If package.json is clean, capture all baselines before touching it.

This is non-negotiable. Baselines on upgraded deps cannot prove zero regressions. Ask yourself: "What state was the code in BEFORE any migration work started?" That is the state you baseline against.

Phase 1: Research

REQUIRED: Use agent:research skill. All four channels, local investigation, docs/MCPs, online research, verify and synthesize.

For each breaking change found in the migration guide, grep the codebase to check if it applies. Don't assume, verify.

Output: A list of concrete changes needed, with file paths and line numbers.

Phase 2: Ask Before Assuming

Do NOT assume version numbers (.nvmrc, TypeScript, etc.), which config blocks to keep or remove, or whether a deprecated pattern should be cleaned up. ASK.

Phase 3: Baseline Capture

3a: Restore Pre-Upgrade State (if deps already changed)

git stash
pnpm install
# verify project builds with OLD deps

3b: Capture Baselines

  1. Build output: full log, page count
  2. Sitemap: copy XML files, extract every <loc> URL to flat list
  3. Screenshot every route: Playwright MCP, every sitemap URL, assert no console errors
  4. Measure page sections: per frontend:pixel-perfect: getBoundingClientRect() on every visible section, save as JSON
  5. Run existing tests: save output, record pass/fail counts

3c: Restore Upgraded State

git stash pop
pnpm install

Phase 4: Write Regression Tests BEFORE Code Changes

Existing tests probably don't cover all routes. Write new tests that:

  1. Route coverage: read sitemap dynamically, navigate every URL, assert each loads with content
  2. Section coverage: assert each page section exists and is visible
  3. i18n coverage: test both language variants

Run new tests, they must pass on current state BEFORE any migration edits.

Phase 5: Make Changes

Per frontend:validate: edit ONE file, validate (build + lint + type-check), confirm 0 new errors, then next file. Never batch edits without validating between them.

Phase 6: Post-Migration Verification

Per agent:done:

  1. Build: page count must match baseline
  2. Sitemap diff: must be identical to baseline URLs
  3. Run ALL tests: old + new regression tests
  4. Screenshot every route: compare to baseline
  5. Measure sections: per frontend:pixel-perfect, report diff table, 0px diff required
  6. Full validation: lint, type-check, svelte-check, exit 0
  7. Report with proof: exit codes, page counts, sitemap diff, test results, measurement table

Referenced Skills

Not optional during migration:

  • agent:research: Phase 1
  • frontend:pixel-perfect: Phase 3b and 6 measurements
  • frontend:validate: Phase 5 per-file validation
  • agent:done: Phase 6 completion checklist
  • frontend:playwright: all browser verification

Anti-Patterns

These are real failures from an actual migration attempt:

Failure Why It's Wrong
Taking "before" baselines after deps upgraded Baselines reflect post-upgrade state, comparison is meaningless
Assuming version numbers instead of asking User wanted Node 24, not 22. ASK.
"Run build and check browser" as verification Proves nothing about regressions without baselines to compare against
Not using sitemap as route source of truth Guessing at routes misses pages
Not writing new tests before migration If existing tests don't cover all routes, regressions slip through
Batch-editing files without validating between Impossible to tell which change broke what
Skipping section measurements Screenshots alone prove nothing per pixel-perfect
Not checking git status first Led to worthless baselines

Reference: Example Plan (Astro 5 to 6)

# Astro 6 Migration Plan

**Current state (from `git diff package.json`):**

- package.json is MODIFIED but NOT committed
- Old (committed): Astro 5.17.3, TS 5.9.3, Svelte 5.53, vite-plugin-svelte 6.2.4
- New (working tree): Astro 6.1.2, TS 6.0.2, Svelte 5.55.1, vite-plugin-svelte 7.0.0
- pnpm-lock.yaml also modified

**Implication:** Baselines MUST be captured after git stash restores old deps.

### Task 0: Restore old deps for baseline capture

- [ ] git stash (save upgraded package.json + lockfile)
- [ ] pnpm install (restore old lockfile)
- [ ] pnpm astro build — verify project builds with old deps

### Task 1: Capture baselines on OLD deps

- [ ] Build: save full log, record exact page count
- [ ] Sitemap: copy all XML files, extract every <loc> URL to flat list
- [ ] Screenshots: every sitemap URL via Playwright, assert no console errors
- [ ] Sections: measure every visible section via getBoundingClientRect(), save JSON
- [ ] Tests: run existing tests, save output, record pass/fail counts

### Task 2: Restore upgraded deps

- [ ] git stash pop
- [ ] pnpm install
- [ ] pnpm astro build (verify still works)

### Task 3: Write regression tests BEFORE code changes

- [ ] tests/routes.spec.ts — sitemap-driven, every URL, assert loads with content
- [ ] tests/sections.spec.ts — homepage sections + detail pages (DE+EN)
- [ ] Run all tests — must pass before any migration edits

### Task 4-7: Code changes (one file, validate after each)

- .nvmrc: update version (ASK which — don't assume)
- content.config.ts: z import from astro:content → astro/zod
- content.config.ts: deprecated Zod validators → Zod 4 equivalents
- astro.config.mjs: remove stale config blocks (ASK which — don't assume)

### Task 8: Post-migration verification

- [ ] Build: page count matches baseline exactly
- [ ] Sitemap diff: identical to baseline URL list
- [ ] All tests pass (old + new)
- [ ] Screenshot every route, compare to baseline
- [ ] Measure sections, compare to baseline (0px diff required)
- [ ] Full validation (lint, type-check, svelte-check) exits 0
- [ ] Report with proof: exit codes, page counts, sitemap diff, test results, measurement table

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning4mo3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    This skill provides a structured workflow for performing software migrations and framework upgrades. It emphasizes baseline capture, regression testing, and incremental validation. A low risk is noted regarding the processing of external data such as sitemaps and research results which could theoretically contain indirect prompt injections.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

Signed by skilld at a024d57. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Activeupdated 5 months ago
user-invocable
true

README badge

README badge for fubits1/svelte-skills/migration