cargo-workflows

Configure Cargo builds, lockfiles, features, and CI workflows for Rust workspaces.

2|1|Updated Aug 19, 2026
One-click install
npx skills add https://github.com/po4yka/rust-skills --skill cargo-workflows-po4yka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cargo-workflows
Source: https://github.com/po4yka/rust-skills/tree/main/skills/cargo-workflows
Command: npx skills add https://github.com/po4yka/rust-skills --skill cargo-workflows-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Rust workspaces break in subtle ways: unreproducible builds from missing --locked flags, feature unification surprises, MSRV drift, misconfigured cross-compilation, and CI caches that leak secrets. This Skill gives a coding agent concrete commands, triage tables, and policies for running Cargo correctly across local development, CI, and host build systems. ## Core Features & Use Cases - Lockfile and dependency policy: Enforce --locked usage, commit Cargo.lock, perform targeted cargo update -p changes, and review lock diffs safely. - Toolchain, MSRV, and resolver management: Pin rust-toolchain.toml, set rust-version with resolver 3, and prove MSRV with the real toolchain. - Feature flags, testing, and CI: Test supported feature matrices, configure cargo-nextest profiles, pin GitHub Actions to commit SHAs, and cache builds without leaking secrets. - Native artifacts and cross-compilation: Build cdylib/staticlib FFI crates with cargo rustc, configure .cargo/config.toml linkers and runners, and drive Cargo from Gradle, Xcode, or CMake. - Use Case: When a CI build fails with a --locked error after a manifest edit, the Skill directs the agent to resolve the lock with cargo metadata, vet new packages, commit the lock with the manifest, and rerun with --locked. ## Quick Start Ask the agent to set up a reproducible Cargo workspace CI pipeline with locked builds, nextest, and a pinned toolchain.

Frequently Asked Questions about cargo-workflows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a Cargo --locked build failure in CI?▼

A --locked failure means Cargo.lock is missing or a manifest edit needs a lock change. Resolve without building using cargo metadata --format-version 1, review the lock diff, commit the lock with the manifest, then rerun the original command with --locked.

Should I commit Cargo.lock for a Rust library?▼

Yes, commit Cargo.lock for every package including libraries, since every --locked command needs it. Library users still resolve from Cargo.toml, so add a scheduled CI job that runs cargo update and tests on current stable to catch upstream breakage.

How do I verify MSRV for a Rust workspace?▼

Set rust-version in [workspace.package] and inherit it in members, but treat it as a declaration, not proof. Prove MSRV by running rustup toolchain install <msrv> then cargo +<msrv> test --locked --workspace with the real toolchain.

Why does a build pass with -p but fail with --workspace?▼

Feature unification causes this: Cargo builds a shared dependency once with the union of features from all workspace members. Diagnose it with cargo tree --locked -e features -i <dep> and turn default features off in the [workspace.dependencies] entry.

How do I build a cdylib or staticlib from a Rust crate?▼

Use cargo rustc --crate-type to override the crate type per invocation, keeping the manifest a plain Rust library. Run cargo rustc --locked --profile <profile> --target <triple> --crate-type cdylib -p <ffi-crate> --lib for shared libraries or staticlib for iOS.

When should I not use this Cargo workflows skill?▼

Do not use it for Android or iOS packaging specifics such as NDK setup, XCFramework assembly, or Gradle jniLibs wiring. Those belong to the rust-android-build and rust-ios-build skills, while this skill covers general Cargo workspace, CI, and cross-compilation configuration.