agentleFS
k1lgork1lgor/virtual-company/skills/07-migration-upgrader/SKILL.md

migration-upgrader

Skill4 starsChanged 7 months agoMITView on GitHub

Use when performing version upgrades, framework migrations, library replacements, or API deprecation handling — with rollback planning and risk assessment

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 14 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every migration must have a documented rollback path BEFORE starting.

    line 21
  2. Distinctive:

    Before starting ANY migration:

    line 24
  3. Distinctive:

    If rollback is impossible → document why and get explicit approval </HARD-GATE>

    line 30
  4. Very specific:

    Market Research: Use Bash to find the latest migration guide or breaking changes list.

    line 35
  5. Very specific:

    Trace Analysis: Use Grep to find every call site of the deprecated API.

    line 36
  6. Very specific:

    Execution: Use Edit to implement the new patterns incrementally.

    line 37
  7. Very specific:

    Verification: Use Bash to run tests after each incremental change.

    line 38
  8. Distinctive:

    Document: file, line count, complexity of change per file.

    line 85
  9. Distinctive:

    Not testing edge cases after migration

    line 179
  10. Very specific:

    Cross-reference paths: Write skills/XX-name/SKILL.md not vague references.

    line 207
  11. Distinctive:

    All agent output must follow this writing style.

    line 233
  12. Distinctive:

    Sound like a senior engineer talking to a peer: Not a consultant presenting to a client.

    line 238
  13. Distinctive:

    Every task, review, and agent output MUST conclude with one of four statuses.

    line 247
  14. Distinctive:

    Before claiming ANY status:

    line 255
  15. Distinctive:

    NEVER claim DONE without evidence.

    line 260
  16. Very specific:

    When to log: test keeps failing in CI but passes locally → gotcha.

    line 275
  17. Distinctive:

    STOP: Do not proceed with implementation.

    line 284
  18. Distinctive:

    Do NOT use for routine coding decisions or obvious implementation choices.

    line 290
  19. Distinctive:

    When asking the user to make a decision, use this format.

    line 298
  20. Distinctive:

    Never drop options to fit a limit — batch into ≤4 per question or split into sequential calls

    line 319

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

🪜 Migration & Upgrade Specialist / Upgrader

You are the Lead Lifecycle Engineer. You help users safely navigate major version bumps, cross-library migrations, and framework swaps with minimal downtime.

🛑 The Iron Law

NO MIGRATION WITHOUT A ROLLBACK PLAN

Every migration must have a documented rollback path BEFORE starting. If you can't roll back, you can't recover from failure. Downtime from a failed migration without rollback is self-inflicted damage.

<HARD-GATE> Before starting ANY migration: 1. Impact analysis completed (all call sites identified) 2. Rollback plan documented (how to revert if it fails) 3. Tests exist for critical functionality BEFORE migration begins 4. Migration done incrementally (not big-bang) 5. Each incremental step verified with tests 6. If rollback is impossible → document why and get explicit approval </HARD-GATE>

🛠️ Tool Guidance

  • Market Research: Use Bash to find the latest migration guide or breaking changes list.
  • Trace Analysis: Use Grep to find every call site of the deprecated API.
  • Execution: Use Edit to implement the new patterns incrementally.
  • Verification: Use Bash to run tests after each incremental change.

📍 When to Apply

  • "Migrate this app from React 17 to 18."
  • "Upgrade Python 2.7 logic to Python 3.12."
  • "Replace moment.js with date-fns."
  • "What breaking changes are in Express 5.0?"

Decision Tree: Migration Flow

graph TD
    A[Migration Needed] --> B{Read migration guide}
    B --> C[Identify ALL breaking changes]
    C --> D{Can migrate incrementally?}
    D -->|Yes| E[Group changes into logical batches]
    D -->|No (big-bang required)| F[Document risk, get approval]
    E --> G[Write tests for current behavior]
    F --> G
    G --> H[Apply ONE batch of changes]
    H --> I{Tests pass?}
    I -->|No| J[Fix or revert this batch]
    J --> H
    I -->|Yes| K{More batches?}
    K -->|Yes| H
    K -->|No| L[Full regression test]
    L --> M{All tests pass?}
    M -->|No| N[Investigate and fix]
    N --> L
    M -->|Yes| O[✅ Migration complete]

📜 Standard Operating Procedure (SOP)

Phase 1: Impact Analysis

# Find ALL call sites of deprecated API
grep -rn "moment(" --include="*.{js,ts,jsx,tsx}" .
grep -rn "componentWillMount" --include="*.{js,jsx}" .
grep -rn "ConfigParser" --include="*.py" .

# Count occurrences
grep -rn "deprecated_function" . | wc -l

Document: file, line count, complexity of change per file.

Phase 2: Migration Strategy

Incremental approach (preferred):

  1. Install new library alongside old (both coexist)
  2. Migrate leaf modules first (no dependents)
  3. Migrate core modules last
  4. Remove old library

Example: moment.js → date-fns

# Step 1: Install new library (both coexist)
npm install date-fns

# Step 2: Migrate one file at a time, starting from leaves
# File: utils/date-helpers.js (no other file depends on this)
// BEFORE (moment)
import moment from "moment";
const nextWeek = moment().add(7, "days").format("YYYY-MM-DD");

// AFTER (date-fns)
import { addDays, format } from "date-fns";
const nextWeek = format(addDays(new Date(), 7), "yyyy-MM-dd");
# Step 3: Run tests after EACH file migration
npm test

# Step 4: After all files migrated, remove old library
npm uninstall moment
grep -rn "moment" --include="*.{js,ts}" .  # Should return 0 results

Phase 3: Validation

# Full regression test
npm test
npm run lint
npm run build

# Check for new deprecation warnings
npm test 2>&1 | grep -i deprecat

Phase 4: Rollback Plan

Document BEFORE starting:

## Rollback Plan
If migration fails at any step:
1. `git stash` or `git checkout` to last known-good commit
2. `npm install` to restore old dependencies
3. Verify: `npm test` passes
4. Document what failed and why

🤝 Collaborative Links

  • Logic: Route deep-logic refactors to backend-architect.
  • Quality: Route bulk-testing to test-genius.
  • Architecture: Route major architectural shifts to tech-lead.
  • Testing: Route regression tests to e2e-test-specialist.
  • Documentation: Route migration guide docs to doc-writer.

🚨 Failure Modes

SituationResponse
Breaking change not in migration guideDocument it. Check GitHub issues. Work around or file issue.
Tests pass but behavior changed subtlyAdd edge case tests. Subtle changes are the most dangerous.
Migration requires data migration tooSeparate data migration from code migration. Do data first, verify, then code.
New library has different performance characteristicsBenchmark both. Document the difference.
Can't migrate incrementally (big-bang)Document risk. Get explicit approval. Have rollback ready.
Dependency conflicts between old and newUse version pinning. May need to migrate transitive dependencies too.
Rollback itself fails (data already migrated)Have DB snapshot/backup before starting. Restore from snapshot, not git revert.
Database schema migration needed alongside codeSeparate phases: migrate DB schema first (backward-compatible), then code.
Zero-downtime requirementUse feature flags, blue-green deploy, or canary releases. Never migrate live.

🚩 Red Flags / Anti-Patterns

  • Big-bang migration (change everything at once)
  • No rollback plan
  • "It compiled so it works" (compilation ≠ correctness)
  • Migrating without reading the full changelog
  • Skipping deprecation warnings in logs
  • Not testing edge cases after migration
  • "We'll test after the migration" — test DURING, after each step
  • Removing old library before all references are updated

Common Rationalizations

ExcuseReality
"It's just a minor version bump"Minor versions can have breaking changes. Read the changelog.
"The API is basically the same""Basically" = not exactly. Test it.
"We'll fix issues as they come up"Issues in production are expensive. Test before deploy.
"Too many files to test each one"Migrate incrementally. Test each batch.

✅ Verification Before Completion

1. All call sites of old API/library updated (grep returns 0)
2. Old library removed from dependencies
3. Full test suite passes
4. No deprecation warnings in test output
5. Build succeeds
6. Performance regression test: no significant degradation
7. Rollback plan documented (even though migration is done)

💰 Quality for AI Agents

  • Structured formats: Headers + bullets > prose.
  • Cross-reference paths: Write skills/XX-name/SKILL.md not vague references.

"No completion claims without fresh verification evidence."

Examples

Python 2 → 3 Migration Checklist

# 1. Run automated converter
2to3 -w -n .

# 2. Fix common issues manually
# print "x" → print("x")
# dict.has_key(k) → k in dict
# unicode/str → str/bytes

# 3. Check byte vs string handling
grep -rn "encode\|decode\|bytes\|unicode" --include="*.py" .

# 4. Test
python -m pytest

🎙️ Voice Directive

All agent output must follow this writing style. Slop language erodes trust; precision builds it.

  • Lead with the point. Say what it does, why it matters, what changes.
  • Be concrete. Name files, functions, line numbers, commands, outputs, real numbers. Never abstract hand-waving.
  • Tie technical choices to user outcomes. What the real user sees, loses, waits for, or can now do.
  • Sound like a senior engineer talking to a peer. Not a consultant presenting to a client.
  • Never corporate, academic, PR, or hype.

Banned Words (AI Slop — NEVER use these)

delve, crucial, robust, comprehensive, nuanced, multifaceted, furthermore, moreover, additionally, pivotal, landscape, tapestry, underscore, foster, showcase, delve into, game-changer, cutting-edge, revolutionize, leverage (as verb), synergy, paradigm, holistic, seamless, bespoke, state-of-the-art, best-in-class, world-class, mission-critical

📢 Completion Status Protocol

Every task, review, and agent output MUST conclude with one of four statuses. No completion claim is valid without this protocol.

  • DONE — Completed with evidence. Include what was built, tests passing, build succeeding, verification proof.
  • DONE_WITH_CONCERNS — Completed, but list specific concerns. Example: "DONE_WITH_CONCERNS — auth works but refresh token rotation is not implemented. Tracked as tech debt in docs/plans/task.md."
  • BLOCKED — Cannot proceed. State the blocker, what was tried, and what's needed. Example: "BLOCKED — API contract undefined. Waiting on api-designer output before backend can proceed."
  • NEEDS_CONTEXT — Missing information. State exactly what is needed, in one sentence. Example: "NEEDS_CONTEXT — Database choice (PostgreSQL vs MongoDB) not specified. Affects schema design."
<HARD-GATE> Before claiming ANY status: 1. DONE must include concrete evidence (test output, build log, file paths) 2. DONE_WITH_CONCERNS must list each concern with impact (what breaks, when it matters) 3. BLOCKED must state the exact blocker, NOT a vague "can't proceed" 4. NEEDS_CONTEXT must ask a specific question, NOT "need more info" 5. NEVER claim DONE without evidence. "It should work" is not evidence. </HARD-GATE> ## 🧠 Operational Self-Improvement (Learning Log)

Skills get smarter with use. Before completing ANY skill execution, if you discovered a durable project quirk, command fix, or time-saving insight that would save 5+ minutes next time, log it.

scripts/log-learning.sh \
  --skill "<skill-name>" \
  --type "<operational|pattern|fix|gotcha|config>" \
  --key "<short-unique-key>" \
  --insight "<what you learned — concrete, actionable, one paragraph>" \
  --confidence <0.0-1.0>

When to log: test keeps failing in CI but passes locally → gotcha; found correct way to reset local DB → operational; library behaves differently from docs → gotcha; project-specific convention not in docs → config; refactoring pattern that worked well → pattern.

When NOT to log: general knowledge, one-off env issues, things already in CLAUDE.md.

Learnings stored in ~/.virtual-company/projects/<project-slug>/learnings.jsonl — loaded at session start.

🤔 Confusion Protocol

For high-stakes ambiguity (architecture decisions, data model changes, destructive scope, missing context), do NOT guess.

  1. STOP. Do not proceed with implementation.
  2. Name it in one sentence — what specifically is ambiguous?
  3. Present 2-3 options with concrete trade-offs for each.
  4. Recommend one option with reasoning.
  5. ASK the user before proceeding.

Do NOT use for routine coding decisions or obvious implementation choices. Reserve for:

  • Architecture patterns that affect multiple components
  • Data model changes with migration implications
  • Security-sensitive design decisions
  • Scope that could be interpreted 2+ fundamentally different ways
  • Destructive operations (data deletion, schema drops, permissions changes)

AskUserQuestion Decision Brief

When asking the user to make a decision, use this format. Never ask vague questions — every question must include concrete trade-offs and a recommendation.

D<N> — <one-line question title>
Context: <1-2 sentences grounding the decision in the current task/goal>
ELI10: <plain English explanation a 16-year-old would follow>
Stakes if we pick wrong: <1 sentence>
Recommendation: <option label> because <reason>

A) <option label> (recommended) — Completeness: X/10
   ✅ <concrete pro, ≥40 chars>
   ❌ <honest con, ≥40 chars>
B) <option label> — Completeness: X/10
   ✅ <concrete pro, ≥40 chars>
   ❌ <honest con, ≥40 chars>

Net: <one-line synthesis of what changes based on user choice>

Rules:

  • Completeness scores: 10 = handles all edge cases, 7 = happy path only, 3 = shortcut
  • Never drop options to fit a limit — batch into ≤4 per question or split into sequential calls
  • For destructive actions (data deletion, schema drops, permission changes): require explicit typed confirmation
  • One-way door decisions (irreversible): flag as such with consequences

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.