home / skills / plurigrid / asi / cargo
This skill helps you manage Rust projects with cargo by guiding builds, dependencies, publishing, and workspace workflows for faster, error-free development.
npx playbooks add skill plurigrid/asi --skill cargoReview the files below or copy the command above to add this skill to your agents.
---
name: cargo
description: Rust package manager (36 subcommands).
version: 1.0.0
---
# cargo
Rust package manager (36 subcommands).
## Build
```bash
cargo build --release
cargo check
cargo test
cargo run
cargo bench
```
## Package
```bash
cargo new myproject
cargo init
cargo add serde
cargo remove tokio
```
## Dependencies
```bash
cargo tree
cargo update
cargo fetch
```
## Publish
```bash
cargo publish
cargo search regex
cargo install ripgrep
```
## Workspace
```toml
# Cargo.toml
[workspace]
members = ["crates/*"]
[dependencies]
serde = { version = "1.0", features = ["derive"] }
```
## Fix
```bash
cargo fix --edition
cargo clippy --fix
cargo fmt
```
## Scientific Skill Interleaving
This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:
### Graph Theory
- **networkx** [○] via bicomodule
- Universal graph hub
### Bibliography References
- `general`: 734 citations in bib.duckdb
## SDF Interleaving
This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):
### Primary Chapter: 3. Variations on an Arithmetic Theme
**Concepts**: generic arithmetic, coercion, symbolic, numeric
### GF(3) Balanced Triad
```
cargo (+) + SDF.Ch3 (○) + [balancer] (−) = 0
```
**Skill Trit**: 1 (PLUS - generation)
### Connection Pattern
Generic arithmetic crosses type boundaries. This skill handles heterogeneous data.
## Cat# Integration
This skill maps to **Cat# = Comod(P)** as a bicomodule in the equipment structure:
```
Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826
```
### GF(3) Naturality
The skill participates in triads satisfying:
```
(-1) + (0) + (+1) ≡ 0 (mod 3)
```
This ensures compositional coherence in the Cat# equipment structure.This skill provides concise, actionable guidance for using cargo, the Rust package manager covering its 36 subcommands and common workflows. It focuses on build/test/publish cycles, dependency management, workspace configuration, and automated fixes. The goal is to help developers run, maintain, and publish Rust projects reliably.
It documents the primary cargo commands and common flags for building, testing, benchmarking, and running crates, plus package creation and dependency inspection. It explains workspace layout and Cargo.toml snippets, dependency graph commands, and commands to publish or install crates. It also covers automated fixes and formatting via cargo fix, clippy, and fmt.
When should I commit Cargo.lock?
Commit Cargo.lock for binaries and application repositories to lock exact dependency versions; libraries should generally not commit it so downstream users can resolve appropriate versions.
How do I share dependencies across multiple crates?
Use a workspace with a top-level Cargo.toml listing members. Put shared dependency versions in each crate’s [dependencies] or centralize common tooling in workspace-level dev-dependencies where appropriate.