Rust ecosystem

From jordanhubbard/literate-ai · View interactive version

Rust ecosystem is an AI agent skill from the GitHub repository jordanhubbard/literate-ai. Conventional Rust package layout and dependency authority.

How to use this skill

Skill file

Rust ecosystem layout

Use Cargo's conventional package layout with Cargo.toml at the package root,

implementation beneath src/, optional library code in src/lib.rs, binaries in

src/main.rs or declared src/bin/ targets, and generated runtime-test modules reachable

from the exported binary. Keep registry requirements in the manifest; the authorized

lifecycle derives the exact registry closure and Cargo.lock outside admitted source.

Treat Cargo's target directory, registry cache, and compiler intermediates as derived

state. Honor the lifecycle-provided CARGO_TARGET_DIR beneath OBJ_DIR; never create a

target/ directory in admitted source. Do not generate or commit Cargo.lock; the

post-authorization lifecycle derives and freezes it externally, then uses --locked for

metadata and builds so resolution cannot silently alter source authority.

Cargo treats each tests/*.rs file as a separate integration-test crate. Import a

library's public symbols by its crate name (replace package-name hyphens with

underscores, or use the explicit [lib].name); do not use super:: or crate:: to

reach the library from an integration-test crate root. Those paths remain valid in

the appropriate nested unit-test modules inside the library. Do not put a runtime-only

test helper at tests/litai_test.rs unless it also compiles independently as an

integration target; place binary-private helper modules beneath src/ instead.

For libraries, every generated target must pass cargo test --locked --all-targets

as well as the Standard binary's attributable --litai-test protocol. Native Cargo

success does not replace exact manifest-case evidence or independent acceptance.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.