A set of my Codemod that help Rust projects adopt new library versions and handle breaking changes with less manual work.
Open Codemod registry and search for:
| Codemod | Migration | Registry |
|---|---|---|
axum-0-7-to-0-8 |
axum v0.7 → v0.8 route path syntax (/:param → /{param}) |
registry |
clap-v3-to-v4 |
clap v3 → v4 (derive, builder API, error-kind renames) |
registry |
hyper-0-14-to-1-0 |
hyper v0.14 → v1.x (legacy client import/path rewrites) |
registry |
rand-0-8-to-0-9 |
rand v0.8 → v0.9 (thread_rng → rng, gen* → random*) |
registry |
tree-sitter-0-24-to-0-25 |
tree-sitter v0.24 → v0.25 (child_containing_descendant renames) |
registry |
ratatui-0-24-to-0-30 |
ratatui v0.24–v0.30 (Frame::size→area, Spans→Line, etc.) |
registry |
bunx codemod <codemod-name> --target /path/to/rust/projectbunx codemod workflow run -w codemods/<slug>/workflow.yamlBy default, codemods run in the current folder. Add --target /path/to/repo to run elsewhere.
Caution
Codemods modify code. Run them only on Git-tracked files, and commit or stash changes first.
- VT Code: Full Dependency Migration — End-to-end migration across all codemods with use-case tables and reproduction steps.
- VT Code: rand 0.8 to 0.9 — Deterministic
randAPI rewrites reduce migration toil; distribution edge cases left for manual follow-up. - VT Code: tree-sitter 0.24 to 0.25 —
child_containing_descendantremoval across all call forms. - VT Code: ratatui 0.24 to 0.30 — TUI layer migration from ratatui 0.28/0.29 to 0.30.
codemods/<slug>/
workflow.yaml
codemod.yaml
package.json
tsconfig.json
scripts/
tests/
rules/
agents/skill/<slug>/
SKILL.md
references/
README.md
types/
codemod-ast-grep.d.ts
case-studies/
.github/
ISSUE_TEMPLATE/
workflows/
Each codemod is self-contained so maintainers can validate and publish packages independently.
- Scaffold:
bunx codemod init - Implement Rust rewrites as AST-targeted
js-ast-greptransforms; avoid whole-file string replacement for source migrations - Use Codemod MCP when symbol definitions or cross-file references matter
- Validate:
bunx codemod workflow validate -w codemods/<slug>/workflow.yaml - Test:
bunx codemod jssg test -l rust ./scripts/codemod.ts -v --strictness loose
Contributions are welcome. See CONTRIBUTING.md for how to add a new codemod, validate it, and prepare it for release. Open a tracking issue with the quality gate template when you are ready.
MIT. See LICENSE.