/odin-native:rust-no-stdfrom ODIN Native
Guides writing #![no_std] Rust crates: splitting core/alloc/std, selecting panic handlers, implementing global allocators, and testing on the host.
Ships in ODIN Native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | The user writes or debugs #![no_std] Rust, splits code between core, alloc, and std, implements a global allocator, selects a panic handler, or tests a no_std crate on the host. |
| Authority | Reversible local: writes only local no_std crate source, Cargo.toml feature gates, and report files; rollback is git checkout -- or rm for new files. No remote mutation. |
| Side effect | Local lib.rs, Cargo.toml, and test files may change; chat emits guidance. |
| Done | The crate builds for the target, the allocator or panic handler is wired, or the host test runs pass. |
x86_64-unknown-linux-gnu for host tests.core/alloc/std boundaries, global allocator, panic handler, or host testing.linked-list-allocator, buddy-alloc, dlmalloc, or talc.rustc --version and rustup target list --installed. Confirm the target triple is installed. Done when: the target and Rust version are known.no_std crate structure. Add #![no_std] at the top of src/lib.rs. Gate alloc behind a feature with extern crate alloc under #[cfg(feature = "alloc")]. Keep dependencies no_std-compatible. Done when: cargo check --no-default-features and cargo check --all-features pass.core versus alloc versus std. State that core needs no OS or heap, alloc needs a global allocator, and std needs an OS. List the modules available in core. Done when: the user can choose the right crate for each API.alloc is enabled. Add the #[global_allocator] static, initialize it with the heap start and size, and call the init function before any allocation. Done when: alloc::vec::Vec and alloc::string::String work on the target.#[panic_handler] fn panic(_info: &PanicInfo) -> !. Choose loop {} for a halt, defmt plus cortex_m::asm::udf() for a debug probe, or a panic-halt/panic-reset/panic-probe crate. Done when: the binary links without a missing panic handler.no_std libraries. Return borrowed data from core APIs and put alloc APIs behind #[cfg(feature = "alloc")]. Use borrowed slices for the core path. Done when: the library builds with and without the alloc feature.#![cfg_attr(not(test), no_std)] to keep std available to the test harness, or run cargo test --target x86_64-unknown-linux-gnu for logic tests. For bare-metal targets, use cargo check --target <triple>. Done when: host tests pass or the target build succeeds.| Failure class | Behavior |
|---|---|
no_std crate still links std | Check dependencies for std features and remove or replace them. |
alloc types fail to compile | Confirm extern crate alloc and a #[global_allocator] are present and initialized. |
| Missing panic handler | Add #[panic_handler] or depend on a panic-* crate. |
Host tests pull in std code | Use cfg_attr(not(test), no_std) and keep tests separate from library std use. |
| Bare-metal target has no test runner | Run pure logic tests on the host or use an embedded test harness such as defmt-test. |
no_std crate structure with feature-gated alloc.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-native138 skills in this plugin
/abi-and-calling-conventionsUse when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi./adc-dac-baremetalUse when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal./af-xdpUse when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.Other plugins' skills for the same job