AGENT SKILL

legacy

Detect deprecated Rust edition, crate, and language patterns and propose a safe migration path.

License 许可
MIT
最近更新
2026-11-11
Stars
★ 1
Forks
0

01 前言 Front Matter

name
legacy
tags
[ "backend", "audit", "rust" ]
author
François-Xavier Guillois
version
0.5.2
description
Detect deprecated Rust edition, crate, and language patterns and propose a safe migration path.
permissions
[ "bash", "files" ]
vibe_version
>=1.0.0

02 资源文件 5

03 SKILL.md 正文

Read host portability before resolving plugin files, invoking sibling skills, or persisting project guidance.

sc-rust Legacy

Detects edition-specific patterns and deprecated APIs in the Rust codebase, then produces a migration plan and applies changes file by file — migrating to a newer edition or updating breaking crate API changes.

Available actions

# Action Role Input
01 scan Detect edition/API gaps and deprecated patterns path, target edition
02 migrate Apply edition migration and crate API transformations scan manifest

Default flow

Always sequential: scan → migrate.

  1. scan reads Cargo.toml, detects current edition, finds deprecated patterns and outdated crate API usage, emits a structured manifest
  2. migrate reads the manifest and applies transformations file by file

References

  • references/rust-editions.md — edition-by-edition change tables (2015→2018→2021→2024)
  • references/api-deprecations.md — std deprecations and crate migrations (failure, futures 0.1, rand, serde)

Transversal rules

  • Always detect the current Rust edition from Cargo.toml (edition = "2015"/"2018"/"2021"/"2024") before scanning.
  • Never remove a working pattern without providing its replacement inline.
  • For breaking changes: show a diff of what will change and ask for confirmation before writing.
  • extern crate removal: verify the crate is in the standard prelude or Rust 2018+ implicit imports before removing.
  • Error handling migration (failure/error-chain → anyhow/thiserror): prefer anyhow for binaries/applications, thiserror for library crates.
  • Never touch target/ or generated build.rs output.

04 同仓库更多 Skills