cargo-workflows

Cargo workflow skill for Rust projects. Use when managing workspaces, feature flags, build scripts, cargo cache, incremental builds, dependency auditing, or CI configuration with Cargo. Activates on queries about cargo workspaces, Cargo.toml features, build.rs, cargo nextest, cargo deny, cargo check

By mohitmishra786 · 438 installs

npx skills add mohitmishra786/low-level-dev-skills --skill cargo-workflows

Source repository · Upstream listing

Cargo Workflows Purpose Guide agents through Cargo workspaces, feature management, build scripts ( build.rs ), CI integration, incremental compilation, and the Cargo tool ecosystem. Triggers "How do I set up a Cargo workspace with multiple crates?" "How do features work in Cargo?" "How do I write a build.rs script?" "How do I speed up Cargo builds in CI?" "How do I audit my Rust dependencies?" "What is cargo nextest and should I use it?" Workflow 1. Workspace setup 2. Feature flags Feature gotchas: Features are additive: once enabled anywhere in the dependency graph, they stay enabled resolver = "2" prevents feature leakage between dev dependencies and regular deps Use dep:optional dep syntax (edition 2021) to avoid implicit feature creation 3. Build scripts (build.rs) println! directive Effect cargo:rerun if changed=FILE Re run build script if file changes cargo:rerun if env changed=VAR Re run if env var changes cargo:rustc link lib=NAME Link library cargo:rustc link search=PATH Add library search path cargo:rustc cfg=FLAG Enable [cfg(FLAG)] in code cargo:rustc env=KEY=VAL Set env!("KEY") at compile time cargo:warning=MSG Emit build warning 4. Incremental builds and CI caching 5. cargo nextest (faster test runner) nextest.toml : 6. Dependency management and auditing deny.toml : 7. Useful cargo commands For workspace patterns and dependency resolution details, see [references/workspace patterns.md](references/workspace patterns.md). Related skills Use skills/rust/rustc basics for compiler flags and profile configuration Use skills/rust/rust debugging for debugging Cargo built binaries Use skills/rust/rust ffi for build.rs with C library bindings Use skills/build systems/cmake when integrating Rust into a CMake build