Agent skill

Migration Analysis

by PlamenTSV in PlamenTSV/plamen

Trigger Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) - Covers Token type mismatches, stranded assets, interface incompatibilities

MITAuto-check passedDevelopment

Install Migration Analysis

skills CLI
$ npx skills add PlamenTSV/plamen --skill migration-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PlamenTSV/plamen migration-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/skills/evm/migration-analysis .claude/skills/migration-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
migration-analysis
GitHub stars
303
Token cost
~3k tokens
SKILL.md length
1,171 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Trigger Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) - Covers Token type mismatches, stranded assets, interface incompatibilities

  • Works in 6 steps: Identify Token Transitions → Check Interface Compatibility → Trace Token Flow Paths → …
  • Protocol has migration patterns (reinitializer
  • SKILL.md covers Trigger Patterns, Reasoning Template, Key Questions (Must Answer All) and Common False Positives, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Migration Analysis is an agent skill from PlamenTSV/plamen. Trigger Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) - Covers Token type mismatches, stranded assets, interface incompatibilities

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Legacy modernization and Smart contracts. The repository describes itself as: Autonomous Web3 security audit agent for Claude Code. The licence is MIT.

When your agent uses it

  • Protocol has migration patterns (reinitializer
  • Legacy) - Covers Token type mismatches
  • Stranded assets
  • Interface incompatibilities

Example prompts

  • “/migration-analysis”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Identify Token Transitions
  2. Check Interface Compatibility
  3. Trace Token Flow Paths
  4. Stranded Asset Analysis
  5. External Call Token Verification
  6. Downstream Integration Compatibility

What it can do on your machine

Read from SKILL.md and the folder at commit 795962b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Migration Analysis loads about 3k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 1,171 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PlamenTSV/plamen at commit 795962b, republished under its MIT licence (© PlamenTSV). 1,171 words, ~3,015 tokens.

Download SKILL.mdSave it as .claude/skills/migration-analysis/SKILL.md (or your agent's skills folder).
name
migration-analysis
description
Trigger Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) - Covers Token type mismatches, stranded assets, interface incompatibilities

Skill: MIGRATION_ANALYSIS

Trigger: Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) Covers: Token type mismatches, stranded assets, interface incompatibilities

Trigger Patterns

reinitializer|V2|V3|_deprecated|migrat|upgrade|legacy|oldToken|newToken

Reasoning Template

Step 1: Identify Token Transitions

Find all token migration patterns:

  • Old token -> New token (e.g., USDC v1 -> v2, DAI -> sDAI, TokenV1 -> TokenV2)
  • Legacy interfaces still referenced
  • Deprecated functions still callable

For each transition: | Old Token | New Token | Migration Function | Bidirectional? |

Step 2: Check Interface Compatibility

For each external call that involves migrated tokens:

  1. What token type does the CALLER expect?
  2. What token type does the CALLEE actually return/accept?
  3. Are they the same?
// Example mismatch:
interface IExternalProtocol {
    function deposit(address asset, uint256 amount) external returns (uint256);
    // Expects: canonical token
    // Actually returns: receipt token denominated in bridged variant?
}
Step 3: Trace Token Flow Paths

For each function that interacts with migrated tokens:

  1. Entry point: What token does the user provide?
  2. Internal flow: What token does the protocol track?
  3. External call: What token does the external contract expect?
  4. Return value: What token denomination is returned?

| Function | User Provides | Protocol Tracks | External Expects | Mismatch? |

Step 3b: External Side Effect Token Compatibility

When migration changes token types or interaction patterns, check whether external call side effects produce tokens that the current logic handles correctly.

For each external call that returns tokens or triggers side effects:

External CallPre-Migration Side EffectPost-Migration Side EffectLogic Handles Both?Mismatch?
{ext_call}Returns Token AReturns Token B (or same token, different accounting)YES/NO{describe}

Pattern: Migration changes the primary token (e.g., V1 -> V2), but external contracts still return the old token as rewards, receipts, or side effects. The new logic may not handle the old token type.

Check: For each external dependency, does the post-migration logic correctly handle ALL token types that external calls can produce -- including legacy types from pre-migration interactions still in flight?

Step 3c: Pre-Upgrade Balance Inventory

Before analyzing stranded asset paths, inventory what the contract CURRENTLY HOLDS:

Asset TypeHow It ArrivedCurrent Balance QueryPost-Upgrade Logic Handles?Exit Path Post-Upgrade?
{token_A}User depositstokenA.balanceOf(this)YES/NO{function or NONE}
{token_B}External rewardsClaimed via {ext_call}YES/NO{function or NONE}
{token_C}Legacy operationsHeld from V1 interactionsYES/NO{function or NONE}

Pattern: Upgrade changes which token the protocol uses (V1 -> V2), but the contract still holds V1 tokens from pre-upgrade operations. If the new logic only handles V2, V1 balances are stranded.

Check: For every asset type the contract can hold pre-upgrade:

  1. Does the post-upgrade logic reference this asset type?
  2. Is there a sweep/rescue function that covers it?
  3. If NEITHER -> STRANDED ASSET FINDING (apply Rule 9 severity floor)
Step 4: Stranded Asset Analysis

CRITICAL: This step uses exhaustive methodology to ensure no stranded asset scenarios are missed. Every sub-step is MANDATORY.

4a. Asset Inventory by Era

List ALL assets the protocol handles, categorized by migration era:

AssetV1 Entry PathV2 Entry PathV1 Exit PathV2 Exit Path
Token Adeposit_v1()deposit()withdraw_v1()withdraw()
Token Bstake_v1()stake()unstake_v1()unstake()

Rule: If V1 Entry exists but V2 Exit doesn't handle V1 state -> potential stranding

4b. Cross-Era Path Matrix

For EACH asset and EACH possible state combination:

Asset EraState ConditionAvailable Exit PathsWorks?Reason
V1 depositV2 logic activewithdraw()Y/N{why}
V1 depositV1 logic deprecatedwithdraw_v1()Y/N{why}
V1 depositIn-flight during upgrade???Y/N{why}

STRANDING RULE: If ALL exit paths = N for any state -> STRANDED ASSETS FINDING

4c. Recovery Function Inventory

Document ALL functions that could recover stranded assets:

FunctionWho Can CallWhat Assets Can RecoverLimitations
emergencyWithdraw()Admin onlyAll tokensRequires admin action
migrate()AnyoneV1 balancesOne-time only
sweep()Admin onlyUnaccounted tokensCannot recover user deposits

Question: Is there a recovery path for EVERY stranding scenario in 4b?

4d. Worst-Case Scenarios (MANDATORY)

Model these specific scenarios with code traces:

Scenario 1: V1 Deposit + V2 Logic

State: User deposited 100 tokens via V1 deposit()
Event: Protocol upgraded to V2
Question: Can user withdraw via V2 withdraw()?
Trace: [document code path]
Result: [SUCCESS/STRANDED + amount]

Scenario 2: In-Flight During Upgrade

State: User initiated withdrawal at V1 block N
Event: Upgrade happened at block N+1
Question: Can user complete withdrawal at block N+2?
Trace: [document code path]
Result: [SUCCESS/STRANDED + amount]

Scenario 3: External Token Type Mismatch

State: Protocol received TokenA from external contract
Event: External contract now returns TokenB
Question: Can protocol process/withdraw TokenA?
Trace: [document code path]
Result: [SUCCESS/STRANDED + amount]
4e. Step 4 Completion Checklist
  • 4a: ALL assets inventoried with entry/exit paths per era
  • 4b: Cross-era path matrix completed for all state combinations
  • 4c: Recovery functions enumerated with limitations
  • 4d: All three worst-case scenarios modeled with code traces
  • For EVERY stranding possibility: recovery path exists OR finding created

Step Execution Output: checkmark4a,4b,4c,4d,4e or ?4X(incomplete reason)

Step 5: External Call Token Verification

For each external call:

  1. Read the PRODUCTION external contract (not mock)
  2. Verify actual token type accepted/returned
  3. Compare with what the protocol sends/expects
markdown
| External Contract | Function | Protocol Sends | Contract Expects | Match? |
|-------------------|----------|----------------|------------------|--------|
| ExternalPool | deposit | depositAsset | depositAsset | YES |
| ExternalPool | withdraw | receiptTokens | receiptTokens | YES |
| PriceOracle | getPrice | - | Returns USD or ETH? | VERIFY |
Show full SKILL.md (454 more words)Show less
Step 4f: User-Blocks-Admin Scenarios

Check whether user actions can create state that prevents admin migration or management operations:

Admin/Migration FunctionPrecondition RequiredUser Action That Blocks ItTiming WindowSeverity
{admin_func}{precondition}{user_action creating conflicting state}{window size}{assess}

Pattern: Admin migration or management functions require certain state conditions (e.g., "no pending operations", "all users migrated", "no active requests"). Users performing normal operations (withdrawals, deposits, claims) may create state that blocks these admin functions.

Check for each admin/migration function:

  1. What state preconditions does this function require?
  2. Can a user create conflicting state using normal operations?
  3. Is the blocking permanent or temporary?
  4. Can the user be griefed into blocking (e.g., front-run with a small operation)?

If blocking is possible AND permanent -> minimum MEDIUM severity If blocking is temporary but repeatable -> assess with Rule 10 worst-state

Step 6: Downstream Integration Compatibility

When the protocol changes token types, interfaces, or behavior during migration, check how downstream consumers are affected:

Protocol ChangeDownstream Consumer TypeExpected Interface/TokenActual Post-MigrationBreaking Change?
{what changed}DeFi integrations (lending, DEX){expected}{actual}YES/NO
{what changed}Indexers/subgraphs{expected events/signatures}{actual}YES/NO
{what changed}Frontend/UI{expected token type}{actual}YES/NO
{what changed}Other protocol contracts{expected interface}{actual}YES/NO

Pattern: Protocol migrates from TokenV1 to TokenV2, but downstream integrators (other protocols, composability layers, frontends) still expect TokenV1 behavior. This creates silent failures or incorrect accounting in the integration layer.

Check:

  1. What external systems consume this protocol's outputs (tokens, events, view functions)?
  2. Does the migration change what those systems receive?
  3. Are downstream systems notified or do they auto-detect the change?
  4. If breaking -> FINDING with severity based on downstream impact scope

Key Questions (Must Answer All)

  1. Token Type: For each external interaction, what token type is ACTUALLY used in production?
  2. Migration Completeness: Can ALL V1 assets be migrated/withdrawn via V2 paths?
  3. Interface Drift: Have external contracts upgraded their interfaces independently?
  4. Stranded Path: Is there any combination of (old_state + new_logic) that traps funds?

Common False Positives

  1. Intentional deprecation: Old paths deliberately disabled with clear migration
  2. Wrapper equivalence: Old and new tokens are 1:1 wrapped versions
  3. Admin-controlled migration: Stranded assets recoverable via admin functions

Output Schema

For each finding:

markdown
## Finding [MG-N]: Title

**Verdict**: CONFIRMED / PARTIAL / REFUTED / CONTESTED
**Step Execution**: checkmark1,2,3,4,5 | xN(reason) | ?N(uncertain)
**Severity**: Critical/High/Medium/Low/Info
**Location**: Contract.sol:LineN

**Token Transition**:
- Old: {old_token}
- New: {new_token}
- Mismatch Point: {where types diverge}

**Description**: What's wrong
**Impact**: What can happen (stranded funds, wrong accounting, DoS)
**Evidence**: Code showing mismatch

### Precondition Analysis (if PARTIAL/REFUTED)
**Missing Precondition**: [What blocks exploitation]
**Precondition Type**: STATE / ACCESS / TIMING / EXTERNAL / BALANCE

### Postcondition Analysis (if CONFIRMED/PARTIAL)
**Postconditions Created**: [What conditions this creates]
**Postcondition Types**: [List applicable types]

Step Execution Checklist

After completing analysis, verify:

  • Step 1: All token transitions identified
  • Step 2: Interface compatibility checked for each
  • Step 3: Token flow traced through all paths
  • Step 3b: External side effect token compatibility checked
  • Step 3c: Pre-upgrade balance inventory completed
  • Step 4: Stranded asset scenarios enumerated (4a-4e)
  • Step 4f: User-blocks-admin scenarios checked
  • Step 5: External contracts verified against production
  • Step 6: Downstream integration compatibility assessed

If any step skipped, document valid reason (N/A, single token, no external deps, no downstream consumers).

© PlamenTSV, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agents/skills/evm/migration-analysis of PlamenTSV/plamen.

Open the folder on GitHubat commit 795962b

Compare with similar skills

Migration Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Migration Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Migration Analysis this skillPlamenTSV/plamen303—~3kAutomated safety check: PassMIT
Linea Dependency MaintenanceConsensys-Incorporated/linea-attestation-registry1771 repos~3.7kAutomated safety check: WarnMIT
Mark Task Executedethereum-optimism/superchain-ops100—~679Automated safety check: PassMIT
Gh Update PR Descriptionlidofinance/staking-modules119—~568Automated safety check: PassGPL-3.0
Debug Node Tracingworldcoin/world-chain116—~1.1kAutomated safety check: PassMIT
Chain Integrationshapeshift/web206—~20kAutomated safety check: NotesMIT

Similar skills

  • Linea Dependency Maintenance

    Consensys-Incorporated/linea-attestation-registry

    Safely plan and execute dependency maintenance for JavaScript/TypeScript (npm, pnpm) and GitHub Actions, including npm lockfiles, pnpm workspaces, catalogs, overrides, SHA-pinned action versions…

    177 GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: warnings
  • Mark Task Executed

    ethereum-optimism/superchain-ops

    Mark one or more superchain-ops tasks as EXECUTED by updating each task README's Status line to link the on-chain execution transaction, then open a PR.

    100 GitHub stars~679 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Gh Update PR Description

    lidofinance/staking-modules

    Update the current-branch GitHub PR title, description, and labels with gh CLI using this repository's PR template.

    119 GitHub stars~568 tokensUpdated today
    DevelopmentAuto-check passed
  • Debug Node Tracing

    worldcoin/world-chain

    Debug World Chain nodes with temporary admintracingDirectives log filters and targeted log collection.

    116 GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Chain Integration

    shapeshift/web

    Integrate a new blockchain as a second-class citizen in ShapeShift Web.

    206 GitHub stars~20k tokensUpdated today
    DevelopmentAuto-check: notes
  • Lightning Architecture Review

    sickn33/agentic-awesome-skills

    Review Bitcoin Lightning Network protocol designs, compare channel factory approaches, and analyze Layer 2 scaling tradeoffs.

    47k GitHub starsUsed in 2 repos~658 tokens
    DevelopmentAuto-check passed

More from PlamenTSV/plamen

All 87 skills in this repo
  • Audit Prep

    PlamenTSV/plamen

    Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project…

    303 GitHub stars~3.7k tokensUpdated 11 days ago
    Auto-check passed
  • Verification Protocol

    PlamenTSV/plamen

    Trigger Pattern Always (used by all verifier agents) - Inject Into security-verifier agents (Phase 5)

    303 GitHub stars~3.5k tokensUpdated 11 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.3k tokensUpdated 11 days ago
    Auto-check passed
  • Ability Analysis

    PlamenTSV/plamen

    Trigger Pattern Always (Sui Move) -- foundational security check - Inject Into Breadth agents, depth agents

    303 GitHub stars~3.2k tokensUpdated 11 days ago
    Auto-check passed
  • Account Lifecycle

    PlamenTSV/plamen

    Trigger Pattern ACCOUNTCLOSING flag detected (close/CloseAccount usage) - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.2k tokensUpdated 11 days ago
    Auto-check passed
  • Account Validation

    PlamenTSV/plamen

    Trigger Pattern Always required for Solana audits - Inject Into Breadth agents, depth agents

    303 GitHub stars~1.7k tokensUpdated 11 days ago
    Auto-check passed

Questions about Migration Analysis

What does Migration Analysis do?

Trigger Protocol has migration patterns (reinitializer, V2/V3, deprecated, upgrade, legacy) - Covers Token type mismatches, stranded assets, interface incompatibilities. Migration Analysis is an agent skill from PlamenTSV/plamen.

When should I use Migration Analysis?

Migration Analysis fits situations like: protocol has migration patterns (reinitializer; legacy) - Covers Token type mismatches; stranded assets; interface incompatibilities.

How do I install Migration Analysis in Claude Code?

Run `npx skills add PlamenTSV/plamen --skill migration-analysis -a claude-code`. Or copy the skill folder (agents/skills/evm/migration-analysis in PlamenTSV/plamen) into .claude/skills/migration-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Migration Analysis in Codex?

Run `npx skills add PlamenTSV/plamen --skill migration-analysis -a codex`. Or copy the skill folder (agents/skills/evm/migration-analysis in PlamenTSV/plamen) into .agents/skills/migration-analysis in your project. Codex loads it when a task matches its description.

Can I use Migration Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PlamenTSV/plamen --skill migration-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migration-analysis, .gemini/skills/migration-analysis, .github/skills/migration-analysis and .opencode/skills/migration-analysis in your project.

What does Migration Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Migration Analysis is instructions for the agent only.

Does Migration Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Migration Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Migration Analysis use?

Migration Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Migration Analysis use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Migration Analysis?

Skills that share tags, products or a category with Migration Analysis: Linea Dependency Maintenance (Consensys-Incorporated/linea-attestation-registry, 177 stars), Mark Task Executed (ethereum-optimism/superchain-ops, 100 stars), Gh Update PR Description (lidofinance/staking-modules, 119 stars) and Debug Node Tracing (worldcoin/world-chain, 116 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Migration Analysis?

PlamenTSV (a GitHub user) maintains it in PlamenTSV/plamen, which has 303 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on September 26, 2026.

Source: PlamenTSV/plamen on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.