rust-project-init

Initialize Rust projects with Cargo.toml templates, workspace configuration, and directory structure guidance.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/luckyegg168/rust-skill --skill rust-project-init-luckyegg168
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-project-init
Source: https://github.com/luckyegg168/rust-skill/tree/main/rust-skills/rust-project-init
Command: npx skills add https://github.com/luckyegg168/rust-skill --skill rust-project-init-luckyegg168

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up a new Rust project involves many decisions: binary vs library crate, workspace layout, Cargo.toml manifest fields, edition settings, features, and build profiles. This Skill provides structured templates and best practices so AI agents and developers can scaffold correct, idiomatic Rust projects without memorizing Cargo configuration details. ## Core Features & Use Cases - Project Scaffolding: Guidance for cargo new, cargo init, binary vs library crates, and recommended directory layouts including tests, benches, and examples. - Cargo.toml Templates: Ready-to-use manifest templates covering edition 2024, rust-version, features with optional dependencies, release profile optimization (lto, strip, codegen-units), and clippy lint configuration. - Workspace Management: Multi-crate workspace setup with resolver v2, workspace.package inheritance, and workspace.dependencies for centralized version control. - Use Case: When starting a new Rust CLI tool, ask the AI to generate the project structure and it will produce a complete Cargo.toml with proper profiles, lints, and a modular src layout with config and error modules. ## Quick Start Ask the AI to initialize a new Rust project with a Cargo.toml configured for edition 2024, release optimizations, and clippy lints.

Frequently Asked Questions about rust-project-init

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

FAQPage Schema
How do I create a new Rust project with Cargo?▼

Run cargo new my-app for a binary crate or cargo new my-lib --lib for a library crate. Use cargo init to initialize a project in an existing directory. Then set edition = "2024" and rust-version = "1.85" in Cargo.toml.

How to set up a Cargo workspace with multiple crates?▼

Create a root Cargo.toml with a [workspace] section listing members like crates/*. Use [workspace.package] for shared metadata and [workspace.dependencies] to centralize dependency versions across all member crates.

What Cargo.toml settings optimize Rust release builds?▼

Set opt-level = 3, lto = "thin", strip = true, and codegen-units = 1 under [profile.release]. These settings reduce binary size and improve runtime performance at the cost of longer compile times.

Does Rust edition 2024 require a specific toolchain version?▼

Yes, edition 2024 requires Rust 1.85 or later. If you see the error "edition 2024 is not supported", run rustup update to upgrade your toolchain before building.

Why does Cargo say no targets specified in the manifest?▼

This error occurs when the project lacks src/main.rs for a binary or src/lib.rs for a library. Create the appropriate entry file, or explicitly declare [[bin]] or [lib] targets in Cargo.toml.