
rust-cargo-build
Configure, operate, diagnose, and automate Cargo for Rust packages and workspaces. Cover manifests and targets, commands, dependency resolution and features, profiles, build scripts, configuration and environment variables, caches and build diagnostics, cross-compilation, registries, packaging, publishing, metadata, CI reproducibility, and stable-versus-nightly feature gates. Use for Cargo.toml, Cargo.lock, .cargo/config.toml, cargo build/check/run/tree/metadata/package/publish, resolver or feature problems, build output and performance, private registries, and beginner Cargo workflows. Route crate selection and supply-chain audits to rust-dependencies, workspace topology to rust-workspace, test design to rust-testing, documentation design to rust-documentation, lint policy to rust-style-clippy, and API compatibility decisions to rust-semver.
- Installs
- 123
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-cargo-build- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads rust-cargo-build automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Rust Cargo Build System
Use Cargo as a versioned package manager, build orchestrator, and automation interface. Base decisions on the project's actual Cargo version, MSRV, workspace root, targets, and release model. Use the official Cargo Book as the authority; keep this skill focused on task selection, execution, and validation.
Preflight
Run the smallest relevant subset:
rustc --version --verbose
cargo --version
cargo locate-project --workspace
cargo metadata --no-deps --format-version 1
Determine:
- whether the root manifest is a package or virtual workspace;
- the declared
edition,rust-version, resolver, and lockfile policy; - selected packages, targets, features, profiles, and target triples;
- dependency sources, registry configuration, and offline constraints;
- whether the requested behavior is stable on the installed Cargo version.
Route to the Right Reference
Read only the reference needed for the current task:
| Task | Reference |
|---|---|
| Find the authoritative Cargo Guide, Reference, command, or changelog page | Official Documentation Map |
| Select a Cargo command and understand its side effects | Cargo Command Map |
| Start, build, run, test, document, or add CI to a package | Cargo Guide Workflow |
| Configure package metadata and lib/bin/example/test/bench targets | Manifest and Targets |
| Configure dependency sources, features, overrides, or resolvers | Dependencies, Features, and Resolvers |
| Configure members and inherited workspace fields | Workspaces |
Configure .cargo/config.toml, environment variables, aliases, network, or target settings | Configuration and Environment |
| Tune dev/release/custom profiles | Profiles |
Generate code, compile native dependencies, or emit Cargo instructions from build.rs | Build Scripts |
| Diagnose rebuilds, duplicate compilation, cache layout, timings, or future incompatibilities | Build Cache and Diagnostics |
| Configure a linker, runner, or non-host target | Cross-compilation |
| Configure registries, source replacement, vendoring, credentials, or authentication | Registries and Authentication |
| Inspect package contents, publish, manage owners, or yank a version | Packaging and Publishing |
| Build scripts and tooling around stable Cargo JSON or package IDs | Metadata and Automation |
Evaluate cargo-features, -Z, or other nightly-only behavior | Unstable Cargo Features |
Core Workflow
- Locate the root — Confirm the workspace root and effective manifest before editing.
- Declare compatibility — Record edition, MSRV, supported targets, stable/nightly policy, and feature contract.
- Inspect effective state — Use
cargo metadata,cargo tree, and the effective configuration rather than inferring from one manifest. - Make the smallest change — Prefer conventional targets, additive features, workspace inheritance, and stable Cargo behavior.
- Exercise the requested matrix — Select packages, targets, features, profiles, and target triples explicitly.
- Diagnose before optimizing — Use timings, dependency edges, verbose output, and rebuild evidence before changing profiles or caches.
- Verify artifacts and side effects — Inspect generated files, package contents, lockfile changes, registry targets, and credentials handling.
Decision Rules
Manifest, MSRV, and Resolver
- Do not equate an edition with MSRV; declare
package.rust-versionand test that toolchain. - Treat the resolver as workspace-wide. Explicitly set it in virtual workspaces.
- Verify resolver defaults and version-gated fields against the installed Cargo documentation or changelog.
- Keep explicit target tables only when Cargo's conventional paths are insufficient.
Cargo.lock and Reproducibility
- When in doubt, commit
Cargo.lock; the current Cargo Guide recommends version control by default. - Decide exceptions from the repository's release, CI, and dependency-verification policy, not from a blanket “applications yes, libraries no” rule.
- Use
--lockedwhen a committed lockfile must not change. - Use
--frozenonly when both lockfile mutation and network access must be prohibited. - Review lockfile diffs; do not delete the lockfile or run broad updates merely to bypass CI failures.
Dependencies and Features
- Treat features as additive and validate unification with
cargo tree -e features. - Use target-specific dependencies for platform selection; do not put
cfg(feature = "...")in target dependency tables. - Pin Git dependencies to a revision when reproducibility requires them.
- Use
[patch], source replacement, and vendoring only for their documented purposes; do not treat them as interchangeable.
Configuration and Environment
- Distinguish manifest configuration from hierarchical Cargo configuration.
- Verify
.cargo/config.tomldiscovery from the command's working directory. - Keep secrets out of committed configuration and command history.
- Separate host settings for build scripts and proc macros from target settings used for final artifacts.
Build Scripts
- Write generated artifacts only to
OUT_DIR. - Emit precise
cargo::rerun-if-changedandcargo::rerun-if-env-changedinstructions. - Keep outputs reproducible and avoid network access during builds.
- Treat native link directives and
linksmetadata as public integration contracts.
Profiles, Cache, and Diagnostics
- Measure the workflow being optimized:
check, incremental development, tests, CI, release linking, runtime, or binary size. - Keep profile definitions at the workspace root.
- Treat the build-directory layout as Cargo-internal unless the Reference documents an output location.
- Prefer
cargo build --timings,cargo tree -d, and future-incompatibility reports over speculative cache deletion.
Registries and Publishing
- Distinguish registries, source replacement, directory sources, and vendoring.
- Resolve credential providers and registry identity before login or publish operations.
- Run
cargo package --listand package verification before publishing. - Require explicit authorization before login, owner changes, publishing, yanking, or modifying credentials.
Stable and Nightly
- Prefer stable Cargo behavior.
- Before recommending nightly, identify the exact unstable feature, invocation form, tracking issue, fallback, and removal condition.
- Never present
cargo-features,-Z, or[unstable]configuration as stable. - Re-check the changelog because unstable interfaces can stabilize, change, or disappear.
Validation
Adapt the matrix instead of running unsupported combinations blindly:
cargo metadata --format-version 1
cargo fmt --all --check
cargo check --workspace --all-targets --all-features
cargo test --workspace --all-targets --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo package --list
Append --locked to supported Cargo commands when the repository commits or requires a lockfile. If the workspace intentionally excludes some features or targets, define an explicit matrix and record why.
Boundaries
- Crate selection, advisories, licenses, bans, and supply-chain policy →
rust-dependencies - Workspace and crate topology →
rust-workspace - Test architecture, fixtures, property tests, and coverage →
rust-testing - rustdoc content and documentation architecture →
rust-documentation - rustfmt, Clippy policy, and edition migration →
rust-style-clippy - Runtime performance and allocation behavior →
rust-performance - API compatibility and version-bump decisions →
rust-semver - Embedded target runtime and hardware integration →
rust-embedded
Cargo command mechanics may remain here even when the higher-level decision belongs to another skill.
Completion Criteria
- Identify the effective workspace, Cargo version, MSRV, target, feature, and profile context.
- Link the relevant official Cargo page for version-sensitive behavior.
- Separate stable behavior from nightly experiments.
- Validate the effective dependency graph and configuration.
- Preserve reproducibility and credential safety.
- Confirm artifact, package, or registry side effects before declaring success.
Data Privacy
This skill does not collect, store, or transmit user data. Treat registry tokens, Git credentials, environment variables, generated artifacts, and package contents as potentially sensitive.
FAQ
What does the rust-cargo-build skill do?
Configure, operate, diagnose, and automate Cargo for Rust packages and workspaces. Cover manifests and targets, commands, dependency resolution and features, profiles, build scripts, configuration and environment variables, caches and build diagnostics, cross-compilation, registries, packaging, publishing, metadata, CI reproducibility, and stable-versus-nightly feature gates. Use for Cargo.toml, Cargo.lock, .cargo/config.toml, cargo build/check/run/tree/metadata/package/publish, resolver or feature problems, build output and performance, private registries, and beginner Cargo workflows. Route crate selection and supply-chain audits to rust-dependencies, workspace topology to rust-workspace, test design to rust-testing, documentation design to rust-documentation, lint policy to rust-style-clippy, and API compatibility decisions to rust-semver.
How do I install rust-cargo-build?
Run npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-cargo-build in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rust-cargo-build/ (personal) or .claude/skills/rust-cargo-build/ (project).
Which AI agents can use rust-cargo-build?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is rust-cargo-build safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains rust-cargo-build?
It is published by full-stack-skills in full-stack-skills/rust-skills. It has 123 recorded installs.
More from full-stack-skills/rust-skills
rust-testing
full-stack-skills/rust-skills
Design, implement, and validate Rust tests, including unit, integration, doctest, compile-fail, property, fuzz, benchmark, coverage, async, concurrency, process, daemon, IPC, terminal, platform, and hardware-facing test strategies. Use when users ask for Rust test architecture, flaky-test diagnosis, coverage gates, benchmarks, trybuild, cargo-nextest, real-process tests, or failure-path verification.
rust-concurrency
full-stack-skills/rust-skills
Design, implement, diagnose, and test Rust concurrency and parallelism with threads, Send and Sync, locks, atomics, channels, Tokio, Rayon, Crossbeam, bounded backpressure, actor ownership, task supervision, graceful shutdown, runtime diagnostics, and Loom model tests. Use when users ask about shared state, deadlocks, async tasks, CPU parallelism, high concurrency, daemon resource budgets, slow consumers, worker pools, lock-free structures, or concurrent correctness.
rust-style-clippy
full-stack-skills/rust-skills
Apply and diagnose Rust style, rustfmt, Clippy, compiler diagnostics, Edition migrations, lint policy, idiomatic control flow, error handling, allocation behavior, production Rust conventions, and the Rust API Guidelines ↔ Clippy lint mapping. Use when users ask to format or lint Rust, fix warning or error codes, migrate editions, review unwrap or clone usage, improve idioms, map a C- API guideline rule to the enforcing Clippy lint, or establish CI quality gates. Route API shape decisions (naming conventions, type/trait design, module layout, full C- guideline review) to the rust-api-design skill.
rust-performance
full-stack-skills/rust-skills
Measure, profile, optimize, and regression-test Rust performance across latency, throughput, CPU, allocations, memory, binary size, and compile time using representative workloads, Criterion, iai-callgrind, cargo-flamegraph, samply, DHAT, heap or pprof tools, cargo-bloat, cargo-llvm-lines, and build timings. Use when users report slow Rust code, high memory or CPU, large binaries, noisy benchmarks, tail-latency regressions, or need performance budgets and evidence-backed optimization.
rust-code-review
full-stack-skills/rust-skills
Review Rust changes for correctness, memory and thread safety, error semantics, unnecessary allocation or cloning, lock scope, API compatibility, test gaps, documentation, and dependency risk, applying the Rust API Guidelines checklist (C-PANIC, C-UNWRAP, C-TRANSMUTE, C-BOOL, C-NEWTYPE, C-COMMON-TRAITS, C-CONVERT, C-SEALED, C-NON-EXHAUSTIVE). Use when reviewing Rust diffs, pull requests, libraries, unsafe boundaries, or production incidents; report actionable findings by severity before summaries, route automated formatting or lint policy to rust-style-clippy, and route API shape decisions (trait sealing, error taxonomy, newtype design, builder patterns) to rust-api-design.
rust-workspace
full-stack-skills/rust-skills
Design Rust project topology — single-crate packages, project-sized multi-crate workspaces (small root-flat, hybrid/domain-grouped, contained crates/, nested, or root-package layouts), workspace-level configuration, dependency DAGs, and crate-boundary decisions. Use when users ask how to split a project into crates, choose paths from the resulting project scale instead of copying a source-language module tree, configure a workspace, avoid dependency cycles, refactor a mixed root-package workspace, or decide between modules and crates. For in-crate src/ layout, see rust-module-layout.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.