
cargo
by patrickhaahr
i use arch and neovim btw
SKILL.md
name: cargo description: Guide for managing Cargo dependencies using cargo CLI commands instead of manually editing Cargo.toml. Use this skill when working on Rust projects that need dependency management.
Overview
This skill ensures dependencies are always added to Rust projects using cargo add CLI commands rather than manually editing Cargo.toml. This guarantees the latest compatible versions are used and maintains proper dependency resolution.
Usage
Adding Dependencies
NEVER manually edit Cargo.toml to add dependencies. Always use:
cargo add crate_name
With features:
cargo add crate_name --features "feature1,feature2"
Dev dependencies:
cargo add crate_name --dev
Build dependencies:
cargo add crate_name --build
With version constraint (only when necessary):
cargo add crate_name --version "^1.0.0"
Removing Dependencies
Use cargo remove instead of manually deleting from Cargo.toml:
cargo remove crate_name
cargo remove crate_name --dev
cargo remove crate_name --build
Upgrading Dependencies
Use cargo upgrade to update dependencies (requires cargo-edit package):
cargo upgrade crate_name
cargo upgrade --all
cargo upgrade --dry-run
Checking Dependency Status
cargo tree
cargo outdated
When to Use
Use this skill whenever you need to:
- Add a new dependency to a Rust project
- Remove a dependency
- Update or upgrade dependencies
- Modify dependency features
Best Practices
- Always use
cargo add- Never hardcode versions unless explicitly required - Specify features - Always include required features with
--featuresflag - Check dependency tree - Use
cargo treeafter adding to verify transitive dependencies - Test after changes - Run
cargo buildandcargo testafter dependency changes - Use dry-run - When unsure, use
--dry-runflag to preview changes
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です