Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
actionbook avatar

Domain Embedded

  • 1.2k installs
  • 1.3k repo stars
  • Updated May 24, 2026
  • actionbook/rust-skills

domain-embedded is a Rust skill for no_std embedded constraints on microcontrollers.

About

The domain-embedded skill defines Layer 3 domain constraints for embedded and no_std Rust on microcontrollers and bare-metal targets. Rules forbid heap allocation, require interrupt-safe shared state with critical sections, and enforce HAL peripheral ownership to prevent conflicting hardware access. It maps constraints to heapless collections, Mutex patterns, and singleton peripherals across ARM, RISC-V, ESP32, STM32, and nRF platforms. Agents trace embedded decisions down to companion concurrency and lifecycle skills for firmware services. no_std and no-heap embedded Rust domain constraints. Interrupt-safe shared state with critical sections. HAL peripheral ownership and singleton patterns. heapless collections and static buffer sizing. Targets MCU, bare metal, and firmware HAL workflows. Apply embedded no_std Rust constraints for microcontrollers, HAL ownership, and interrupt safety.

  • no_std and no-heap embedded Rust domain constraints.
  • Interrupt-safe shared state with critical sections.
  • HAL peripheral ownership and singleton patterns.
  • heapless collections and static buffer sizing.
  • Targets MCU, bare metal, and firmware HAL workflows.

Domain Embedded by the numbers

  • 1,196 all-time installs (skills.sh)
  • +48 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #356 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
From the docs

What domain-embedded says it does

RULE: Cannot use heap (no allocator)
SKILL.md
npx skills add https://github.com/actionbook/rust-skills --skill domain-embedded

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.2k
repo stars1.3k
Security audit2 / 3 scanners passed
Last updatedMay 24, 2026
Repositoryactionbook/rust-skills

What Rust patterns satisfy embedded no_std and interrupt safety requirements?

Apply embedded no_std Rust constraints for microcontrollers, HAL ownership, and interrupt safety.

Who is it for?

Rust developers building MCU firmware, HAL drivers, or bare-metal systems.

Skip if: Skip for hosted std Rust servers without embedded hardware constraints.

When should I use this skill?

User builds embedded Rust, no_std firmware, HAL code, or MCU projects.

What you get

Constraint-backed firmware designs with heapless data and HAL ownership.

  • embedded Rust guidance
  • domain-constraint-aware code suggestions

By the numbers

  • Activates on 2 globs: Cargo.toml and .cargo/config.toml

Files

SKILL.mdMarkdownGitHub ↗

Project Context (Auto-Injected)

Target configuration: !cat .cargo/config.toml 2>/dev/null || echo "No .cargo/config.toml found"

---

Embedded Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
No heapStack allocationheapless, no Box/Vec
No stdCore only#![no_std]
Real-timePredictable timingNo dynamic alloc
Resource limitedMinimal memoryStatic buffers
Hardware safetySafe peripheral accessHAL + ownership
Interrupt safeNo blocking in ISRAtomic, critical sections

---

Critical Constraints

No Dynamic Allocation

RULE: Cannot use heap (no allocator)
WHY: Deterministic memory, no OOM
RUST: heapless::Vec<T, N>, arrays

Interrupt Safety

RULE: Shared state must be interrupt-safe
WHY: ISR can preempt at any time
RUST: Mutex<RefCell<T>> + critical section

Hardware Ownership

RULE: Peripherals must have clear ownership
WHY: Prevent conflicting access
RUST: HAL takes ownership, singletons

---

Trace Down ↓

From constraints to design (Layer 2):

"Need no_std compatible data structures"
    ↓ m02-resource: heapless collections
    ↓ Static sizing: heapless::Vec<T, N>

"Need interrupt-safe state"
    ↓ m03-mutability: Mutex<RefCell<Option<T>>>
    ↓ m07-concurrency: Critical sections

"Need peripheral ownership"
    ↓ m01-ownership: Singleton pattern
    ↓ m12-lifecycle: RAII for hardware

---

Layer Stack

LayerExamplesPurpose
PACstm32f4, esp32c3Register access
HALstm32f4xx-halHardware abstraction
FrameworkRTIC, EmbassyConcurrency
Traitsembedded-halPortable drivers

Framework Comparison

FrameworkStyleBest For
RTICPriority-basedInterrupt-driven apps
EmbassyAsyncComplex state machines
Bare metalManualSimple apps

Key Crates

PurposeCrate
Runtime (ARM)cortex-m-rt
Panic handlerpanic-halt, panic-probe
Collectionsheapless
HAL traitsembedded-hal
Loggingdefmt
Flash/debugprobe-run

Design Patterns

PatternPurposeImplementation
no_std setupBare metal#![no_std] + #![no_main]
Entry pointStartup#[entry] or embassy
Static stateISR accessMutex<RefCell<Option<T>>>
Fixed buffersNo heapheapless::Vec<T, N>

Code Pattern: Static Peripheral

#![no_std]
#![no_main]

use cortex_m::interrupt::{self, Mutex};
use core::cell::RefCell;

static LED: Mutex<RefCell<Option<Led>>> = Mutex::new(RefCell::new(None));

#[entry]
fn main() -> ! {
    let dp = pac::Peripherals::take().unwrap();
    let led = Led::new(dp.GPIOA);

    interrupt::free(|cs| {
        LED.borrow(cs).replace(Some(led));
    });

    loop {
        interrupt::free(|cs| {
            if let Some(led) = LED.borrow(cs).borrow_mut().as_mut() {
                led.toggle();
            }
        });
    }
}

---

Common Mistakes

MistakeDomain ViolationFix
Using VecHeap allocationheapless::Vec
No critical sectionRace with ISRMutex + interrupt::free
Blocking in ISRMissed interruptsDefer to main loop
Unsafe peripheralHardware conflictHAL ownership

---

Trace to Layer 1

ConstraintLayer 2 PatternLayer 1 Implementation
No heapStatic collectionsheapless::Vec<T, N>
ISR safetyCritical sectionsMutex<RefCell<T>>
Hardware ownershipSingletontake().unwrap()
no_stdCore-only#![no_std], #![no_main]

---

Related Skills

WhenSee
Static memorym02-resource
Interior mutabilitym03-mutability
Interrupt patternsm07-concurrency
Unsafe for hardwareunsafe-checker

Related skills

Forks & variants (1)

Domain Embedded has 1 known copy in the catalog totaling 639 installs. They canonicalize to this original listing.

How it compares

Choose Domain Embedded over general Rust skills when writing firmware or bare-metal MCU code with no_std, HAL, and interrupt constraints.

FAQ

Can heap allocation be used?

No; heapless static buffers and arrays are required in embedded domains.

How is ISR state handled?

Mutex with critical sections for interrupt-safe shared state.

Which platforms are referenced?

ARM, RISC-V, ESP32, STM32, nRF, and bare-metal MCU targets.

Is Domain Embedded safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.