add-rust-dependency
БесплатноБез исполняемых скриптовНе проверенAdd a Rust crate dependency: latest stable version, minimal features, a recorded version reason, cargo machete. Use when adding a dependency or choosing a…
от torrust★ 539 звёзд на GitHubОб этом скилле
Adding a Rust Dependency
Use this workflow when introducing a new crate to Cargo.toml.
Goal
Add only necessary dependencies, prefer the latest stable version, and keep the resulting change reviewable, justified, and maintainable.
Skill Links
AGENTS.md.claude/skills/implement-task/SKILL.md.claude/agents/implementer.md.claude/skills/update-dependencies/SKILL.md
Workflow
Step 1: Confirm a new dependency is necessary
Before adding a crate, check whether the need can be met by:
- the Rust standard library,
- an existing workspace dependency,
- a small local implementation with lower long-term cost.
If one of these options is sufficient, do not add a new crate.
Step 2: Check the latest stable version first
Identify the latest stable crates.io version before choosing a version.
cargo search <crate-name> --limit 1
Start from the latest stable version by default.
If you must choose an older version, document the reason in the PR/issue spec and, when useful, in a nearby code comment.
Step 3: Choose the minimal feature set
Prefer default-features = false when appropriate and enable only required features.
[dependencies]
example-crate = { version = "<latest-stable>", default-features = false, features = ["needed-feature"] }
Avoid broad feature enables without a concrete need.
Step 4: Apply and verify
After editing Cargo.toml/Cargo.lock:
cargo update -p <crate-name>
cargo machete
./contrib/dev-tools/git/hooks/pre-commit.sh --format=json
If the run fails and more diagnostics are needed, retry with:
./contrib/dev-tools/git/hooks/pre-commit.sh --format=text --verbosity=verbose
If checks fail, resolve issues or revert the dependency addition.
Step 5: Document rationale
In commit/PR/issue notes, record:
- why this crate is needed,
- why alternatives were not selected,
- why a non-latest version is used (if applicable),
- any noteworthy feature-flag choices.
Constraints
- Do not introduce a dependency without checking latest stable first.
- Do not keep a non-latest version without explicit rationale.
- Do not add dependency bloat when existing dependencies already solve the problem.
- Do not skip
cargo macheteand pre-commit validation.
Related Skills
- Update existing dependencies:
.claude/skills/update-dependencies/SKILL.md - Commit workflow:
.claude/skills/commit-changes/SKILL.md
Установить add-rust-dependency в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-rust-dependency?
Add a Rust crate dependency: latest stable version, minimal features, a recorded version reason, cargo machete. Use when adding a dependency or choosing a crate version.
Как установить скилл add-rust-dependency?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-rust-dependency запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic