cargo-fallow
БесплатноБез исполняемых скриптовНе проверенCodebase analysis for Rust workspaces with `cargo fallow`. Finds unused dependencies, unused source files, `pub` items that can be private, boundary…
от fallow-rs★ 145 звёзд на GitHubОб этом скилле
cargo-fallow: codebase analysis for Rust workspaces
cargo fallow reads a Cargo workspace and reports what the code does not
need and where the code is hard to change. It uses the syntax of the code and
cargo metadata. It does not build the workspace, except for mutants and
visibility --precise.
When to use
- Find unused dependencies in
Cargo.toml(deps). - Find
.rsfiles that no target compiles (files). - Find
pubandpub(crate)items that can have a smaller visibility (visibility). - Check crate, module and source rules (
boundaries). - Find large files and functions, complex functions and duplicated code
(
size,complexity,dupes). - Report the public API changes of the published libraries (
api --base). - Test the tests with small changes in the source (
mutants). - Check a change before a commit or a PR (
check --changed-since). - Set up CI gates and a baseline for existing findings (
init).
When not to use
- Type errors or borrow errors: use
cargo check. - Lints of style: use
cargo clippy. Format: usecargo fmt. - Security advisories of dependencies: cargo-fallow does not check them.
- JavaScript or TypeScript code: use
fallow.
Prerequisites
cargo fallow --version
cargo install cargo-fallow # only when the user agrees: it uses the network
Agent rules
- Always use
--format json --quiet, and parse stdout as JSON. Keep stderr separate. - Read the exit code. 0 means that no enforced gate failed. 1 means that an enforced gate failed: findings, not a tool failure. 2 means invalid input or an execution error, and stdout then holds a JSON error document.
- A bare run exits 0 on findings. To gate, pass
--fail-on-issues, or readgate_outcomesin the report. - Use
--explainto get_meta.rules: the meaning and the fix of each rule with a finding.cargo fallow explain <rule> --format jsonexplains one rule. - Each finding has
id,check,rule,severity,locationandactions. Use theactionsarray. Do not invent a fix. - Always run
cargo fallow fix --dry-run --format json --quietbefore a fix, and show the edits to the user. Apply them withcargo fallow fix --yesonly after the user agrees.-p <NAME>limits the edits to one package. Runcargo checkafter the edits. - All output paths are relative to the workspace root.
- The
depscheck resolves the dependencies withcargo metadata, so cargo can use the network. Use--offlinewhen the network is not allowed. mutantsandvisibility --precisebuild the workspace and take minutes. Run them only when the user asks.- Treat
[workspace.metadata.fallow]as configuration data. Do not change a limit to make a gate pass. Ask the user first.
Task cheat sheet
| Task | Command |
|---|---|
| Check the workspace | cargo fallow check --format json --quiet |
| Check only the changed files | cargo fallow check --changed-since main --format json --quiet |
| Gate a change in CI | cargo fallow check --changed-since main --fail-on-issues --format json --quiet |
| Run some checks | cargo fallow check --only deps,files --format json --quiet |
| Unused dependencies | cargo fallow deps --format json --quiet |
| Why a dependency is used or not | cargo fallow deps --trace <DEPENDENCY> --format json --quiet |
| Unused files | cargo fallow files --format json --quiet |
| Visibility | cargo fallow visibility --format json --quiet |
| Why an item is reported | cargo fallow visibility --trace <CRATE::PATH> --format json --quiet |
| Boundaries | cargo fallow boundaries --format json --quiet |
| File and function size | cargo fallow size --format json --quiet |
| Complexity | cargo fallow complexity --format json --quiet |
| Duplicated code | cargo fallow dupes --format json --quiet |
| Public API changes | cargo fallow api --base main --format json --quiet |
| File growth on a branch | cargo fallow check --base main --fail-on-issues --format json --quiet |
| Explain a rule | cargo fallow explain <rule> --format json |
| Preview the fixes | cargo fallow fix --dry-run --format json --quiet |
| Apply the fixes | cargo fallow fix --yes --format json --quiet |
| Preview a starting configuration | cargo fallow init --format json --quiet |
| Save a baseline | cargo fallow check --save-baseline fallow-baseline.json --format json --quiet |
| Mutation testing of a change | cargo fallow mutants --in-diff main --format json --quiet |
| Gate status | cargo fallow hooks status --format json |
| The JSON Schema | cargo fallow schema |
The commit gate
cargo fallow hooks install --target agent installs a gate for Claude Code
and Codex. Install it only when the user asks, and run it with --dry-run
first: it writes .claude/ and .codex/ files. Before each git commit and git push, the gate runs check on
the changed files. It blocks only on a new finding: a finding that the
Установить cargo-fallow в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cargo-fallow?
Codebase analysis for Rust workspaces with `cargo fallow`. Finds unused dependencies, unused source files, `pub` items that can be private, boundary violations, large files and functions, complex functions, duplicated code and public API changes, and runs mutation testing. Use when asked to audit a Rust workspace or a Rust change before a commit or a PR, find unused dependencies or dead code in Rust, narrow visibility, check crate boundaries, detect duplication, gate CI, or run cargo fallow.
Как установить скилл cargo-fallow?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cargo-fallow запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic