Bootstrap cargo project
Skill gaelic-ghost/socket/plugins/rust-skills/skills/bootstrap-cargo-project
The Source for macOS Agent Workflows
npx -y skills add gaelic-ghost/socket --skill bootstrap-cargo-projectAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Bootstrap or guide a reproducible Rust Cargo project with explicit package or workspace shape, cargo new or cargo init usage, edition and MSRV checks, rust-toolchain handling, test layout, and initial validation commands. Use after the Rust project shape is settled or when adding a new Cargo package to an existing repository.
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.8 KB, 990 tokens by cl100k_base, as published. Nobody here has run it
Bootstrap Cargo Project
Purpose
Create or guide a reproducible Rust project scaffold without hiding important Cargo, edition, MSRV, or workspace decisions.
The user should leave with a clear package or workspace layout and validation commands that prove the scaffold works.
Source Check
Use repo-local Rust files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Rust docsets, and then official Rust documentation when Dash/local coverage is missing or stale:
Cargo currently defaults new packages to the current Rust edition documented by Cargo. Do not hard-code an older edition in new scaffolds unless the repository compatibility policy calls for it.
Required Inputs
- target path
- package or workspace name
- project shape
- binary, library, or workspace expectation
- edition expectation
- MSRV expectation
- test expectation
- toolchain pinning expectation
- git initialization or commit expectation
If the user has not selected a package or workspace shape, use rust:choose-project-shape first.
Guidance Workflow
- Inspect the target:
- existing files
- git state
Cargo.tomlCargo.lockrust-toolchain.tomlorrust-toolchain.cargo/config.toml- CI workflows
- Confirm the project shape and target path.
- Choose Cargo creation command:
- use
cargo newfor a new package directory - use
cargo initfor an existing directory - use
--binfor executable packages - use
--libfor library packages - use
--vcs nonewhen inside an existing repository
- use
- Choose edition and MSRV behavior:
- preserve existing edition in established repos
- use Cargo's current default for new standalone packages unless the user asks for a specific edition
- add
rust-toolchain.tomlonly when reproducibility or contributor setup needs it - do not invent an MSRV without a repository or user decision
- Add test layout:
- unit tests near implementation for private behavior
tests/for integration tests that use the crate externally- doctests when public examples should compile
- Run validation appropriate to the scaffold.
- Report generated paths and exact commands.
Command Recipes
Binary package:
cargo new my-tool --bin
cd my-tool
cargo test
Library package:
cargo new my-library --lib
cd my-library
cargo test
Package inside an existing Git repository:
cargo new crates/my-crate --lib --vcs none
cargo test -p my-crate
Existing directory:
cargo init --lib --vcs none
cargo test
Minimal workspace root:
[workspace]
resolver = "3"
members = [
"crates/my-crate",
]
Check the resolver against the repository's edition and Cargo policy before adding it.
Validation
Prefer the smallest validation that proves the scaffold:
cargo fmt --check
cargo clippy --all-targets --all-features
cargo test
Use cargo build when tests are intentionally absent. Use cargo package only for publishable crate surfaces.
Output Shape
Return:
Created or planned layout: package, crate targets, workspace members, tests, and examples.Cargo commands: exact commands run or recommended.Compatibility behavior: edition, MSRV, toolchain, and feature constraints.Validation: format, lint, build, test, or package results.Next skill: implementation, testing, or tooling handoff.
Guardrails
- Do not scaffold into a non-empty directory without checking the user's intent.
- Do not initialize nested Git repositories inside an existing repository unless the user explicitly asks for that.
- Do not add
rust-toolchain.tomlor pin nightly without a concrete reproducibility reason. - Do not add dependencies before the project shape and validation path are clear.
- Do not commit generated files unless the user asks for a commit or the active repo workflow calls for one.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.