g1joshi/agent-skills/cargo
Claude Code and agent skill by g1joshi/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Expert Cargo Rust package manager assistance covering workspaces, dependencies, feature flags, cross-compilation, and release profiles. Use when building, testing, and packaging Rust projects.
Install
npx vskill@latest install g1joshi/agent-skills/cargoSKILL.md
The same SKILL.md was published earlier as g1joshi/agent-skills/cargo.
Cargo
Cargo is Rust's build system and package manager. It is famous for its reliability and developer experience.
When to Use
- Rust Dependency & Build Management: Compiling, building, packaging, and publishing Rust packages and crates.
- Workspace Multi-Crate Architectures: Managing monorepos with shared dependencies and unified lockfiles.
- Continuous Integration & Static Analysis: Running
cargo test,cargo clippy,cargo fmt, andcargo audit. - Release Optimization & Cross-Compilation: Building stripped, LTO-optimized release binaries for production.
Quick Start
Core Concepts
Cargo Workspace Configuration (Cargo.toml)
Managing multiple interdependent crates in a monorepo:
High-Speed Testing, Benchmarking & Lints
Automating quality checks in CI/CD pipelines:
Adding and Managing Dependencies
Adding pinned crates with specific feature sets:
Common Patterns
Optimized Release Profile with LTO and Symbol Stripping
Problem: Default Rust release binaries are bloated and larger than necessary for container deployment.
Solution: Configure release profile optimizations in Cargo.toml:
Best Practices
Do:
- Use
lto = "fat",codegen-units = 1, andstrip = truein release profiles to minimize binary size. - Commit
Cargo.lockfor all binary application crates to guarantee reproducible builds. - Run
cargo clippy -- -D warningsandcargo auditin all CI pipelines. - Leverage workspace-level dependencies (
workspace.dependencies) to synchronize versions across crates.
Don't:
- Ignore
Cargo.lockin application repositories (only libraries should consider omitting it). - Enable heavy, unneeded crate features; include only the specific feature flags your application uses.
- Deploy debug build artifacts (
target/debug); always compile production releases withcargo build --release.
Troubleshooting
| Error | Cause | Solution | |
|---|---|---|---|
error: failed to select a version for the requirement | Incompatible dependency version constraints in Cargo.toml. | Run cargo update or inspect conflicts in Cargo.lock. | |
error: could not compile ... (exit status: 101) | Compile error in code or missing native C library dependencies. | Install missing system packages (e.g. libssl-dev or pkg-config). | |
linking with cc failed: exit code: 1 | Missing linker or C toolchain on host system. | Install build essentials: sudo apt-get install build-essential. |
References
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/devops/cargo/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 2
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/g1joshi/agent-skills/cargo)