skills/team/rust-migration-analyzer/SKILL.md
Analyzes Rust migration paths: C/C++ to Rust rewrites via incremental FFI strangler fig, and Rust modernization (edition upgrades 2015->2018->2021->2024, deprecated-crate replacement, sync to async). Assesses risk, quantifies effort, and produces a phased plan — does NOT perform the migration. Use when migrating C/C++ to Rust, upgrading editions, modernizing legacy Rust, replacing deprecated crates, or planning sync-to-async. Not when you want to execute the migration (assessment only), or the codebase is already current stable Rust with no legacy.
npx skillsauth add michaelalber/ai-toolkit rust-migration-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"The best migration is the one that never happens. The second best is the one that is incremental, reversible, and tested at every step." -- Migration Principle
"Rust's FFI is the seam. Rewrite module by module, behind a C ABI, with tests on both sides." -- C/C++ to Rust Migration Principle
Rust migration analysis covers two distinct contexts:
Context A: C/C++ → Rust Rewrite The FFI boundary is the migration seam. The strangler fig pattern applies: rewrite one module at a time, expose it through a C ABI, and let the C/C++ codebase call the Rust implementation. The C/C++ side does not know it is calling Rust. Tests run against the C/C++ behavior before rewriting; the same tests run against the Rust implementation after. When all modules are rewritten, the C/C++ wrapper is removed.
Context B: Rust Modernization
Edition upgrades (2015→2018→2021→2024) are largely mechanical — cargo fix --edition handles most of the work. Crate replacements require API compatibility analysis. Sync-to-async migration requires introducing a Tokio runtime and converting function signatures throughout the call chain.
This skill assesses, quantifies risk, and produces a phased migration plan. It does NOT perform the migration. The plan produced by this skill is the input to the implementation phase.
Non-Negotiable Constraints:
extern "C" boundary must be documented with the invariants that make it safe.cargo fix --edition handles most of the work. Manual intervention is required only for the cases it cannot handle.The 10 domain principles, the knowledge-base lookup map, and the anti-pattern catalog live in
references/assessment-principles.md. The AI discipline rules (assess-before-recommend,
characterization-tests-first, incremental-only) and error-recovery procedures live in
references/discipline-and-recovery.md.
SCAN (understand the current state)
[ ] Identify migration context: C/C++ rewrite OR Rust modernization
[ ] Count lines of code by category (pure Rust, unsafe, FFI, tests)
[ ] Run: cargo outdated (for Rust modernization)
[ ] Run: cargo audit (for Rust modernization)
[ ] Run: grep -rn "unsafe\|extern" src/ (for FFI analysis)
[ ] Measure test coverage: cargo tarpaulin or cargo llvm-cov
[ ] Identify Rust edition (for modernization)
[ ] Identify async runtime (for async migration)
|
v
ASSESS (risk scoring)
[ ] Score each migration scenario by: Effort, Risk, Blocker potential
(scoring dimensions + per-scenario detail: references/migration-risk-matrix.md)
[ ] Identify dependencies between migration steps
[ ] Identify the critical path
[ ] Identify quick wins (low effort, high value)
|
v
PLAN (phased migration)
[ ] Define migration phases in dependency order
[ ] For each phase: scope, effort estimate, risk, success criteria
[ ] Define rollback plan for each phase
[ ] Identify test requirements for each phase
[ ] For C/C++ rewrites, ground FFI mechanics in references/ffi-patterns.md
|
v
REPORT (templates: references/output-templates.md)
[ ] Risk matrix (scenarios × dimensions)
[ ] Migration phase plan
[ ] FFI boundary inventory (for C/C++ rewrites)
[ ] Dependency update plan (for Rust modernization)
[ ] Recommended tooling
Exit criteria: Risk matrix produced; phased migration plan delivered; FFI inventory complete (if applicable).
<rust-migration-state>
phase: SCAN | ASSESS | PLAN | REPORT | COMPLETE
migration_context: c_cpp_rewrite | rust_modernization | both | unknown
rust_edition: 2015 | 2018 | 2021 | 2024 | unknown
async_runtime: tokio | async-std | none | unknown
loc_total: [N]
loc_unsafe: [N]
loc_ffi: [N]
test_coverage: [percentage | unknown]
cargo_audit_status: clean | N CVEs | not-run
cargo_outdated_count: [N | not-run]
ffi_boundary_count: [N]
migration_phases_planned: [N]
last_action: [description]
next_action: [description]
</rust-migration-state>
The REPORT phase delivers up to four artifacts, with fill-in Markdown templates in
references/output-templates.md:
extern "C" function with direction, invariants, risk, and migration priority.cargo outdated / cargo audit findings with a per-crate replacement order.| Skill | Relationship |
|-------|-------------|
| rust-architecture-checklist | After migration, run rust-architecture-checklist to verify the migrated code follows Rust idioms. |
| rust-security-review | After migration, run rust-security-review to verify the migrated code is secure. |
| sqlx-migration-manager | If the migration includes database schema changes, use sqlx-migration-manager for the database migration lifecycle. |
| legacy-migration-analyzer | Parallel skill for .NET Framework → .NET 10 migrations. Same assessment philosophy; different ecosystem. |
| supply-chain-audit | When cargo audit finds CVEs during the assessment, supply-chain-audit provides deeper analysis. |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.