rustgrade: a Rust scanner for the habits coding agents leave behind
Описание и применение
rustgrade — быстрый синтаксический сканер Rust, который обнаруживает типичные ошибки, оставляемые кодом, генерируемым агентами, и помогает их исправлять, интегрируясь с платформами AI‑кодинга.
Задача
Agents often generate Rust code with subtle anti‑patterns (e.g., .unwrap(), locks held across .await, unsafe blocks without comments) that compile but degrade quality.
Результат
In 27 Claude Code runs, rustgrade reduced .unwrap()/expect in library code from 5 to 0 when used via a hook or a short section in CLAUDE.md, with negligible cost increase.
Рабочий процесс
- 1. Install rustgrade via cargo binstall
- 2. Run rustgrade scan or audit on a crate
- 3. For agents, enable the rustgrade skill or use /audit or /harden commands
- 4. Review findings in CI or agent feedback
- 5. Fix flagged code or silence with rustgrade: allow(...) comments
Доказательства
I counted .unwrap()/expect in library code with cargo clippy --lib, so test code doesn't count.
rustgrade scan and rustgrade audit work in a terminal or in CI, with --fail-on thresholds and SARIF output for GitHub code scanning.
The scanner took about 20 ms on a 445‑line file on my machine, which is fast enough to run on every single edit an agent makes.
- Дата записи: 2026-11-01T07:28:50.566Z