New Crate Scaffolder
Create a new crate in the Aion workspace following project conventions. The crate name is provided as $ARGUMENTS (without the aion_ prefix, e.g., /new-crate lsp).
Steps
- •
Validate the name: Ensure the crate doesn't already exist under
crates/aion_<name>/. - •
Create the directory structure:
codecrates/aion_<name>/ crates/aion_<name>/src/ crates/aion_<name>/src/lib.rs crates/aion_<name>/Cargo.toml
- •
Generate
Cargo.tomlfollowing workspace conventions:toml[package] name = "aion_<name>" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" description = "<ask user or infer from name>" [dependencies] # Add common deps based on crate purpose [dev-dependencies]
- •
Generate
src/lib.rswith standard boilerplate:rust#![warn(missing_docs)] //! <Crate-level documentation describing what this crate does.> #[cfg(test)] mod tests { use super::*; #[test] fn smoke_test() { // TODO: Replace with real tests } } - •
Add the crate to the workspace
Cargo.tomlmembers list. - •
Verify it compiles:
bashcargo check -p aion_<name>
- •
Report what was created and remind the user to:
- •Add proper dependencies
- •Implement the crate following the technical spec
- •Write comprehensive tests
Conventions
- •All crates use
edition = "2021" - •All crates have
#![warn(missing_docs)]as the first line - •All
lib.rsfiles have//!crate-level documentation - •All public items need
///doc comments - •Tests go in
#[cfg(test)] mod tests {}within the same file - •Check
docs/aion-technical-spec.mdfor the crate's planned API