/embedded-workbench:embedded-firmware-devfrom embedded-workbench
Guides writing and reviewing embedded C firmware with FreeRTOS, ISR handlers, NVM/flash storage, and sensor driver state machines.
Ships in embedded-workbench. 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.
// CORRECT: every async flag cleared in stop path. No stale state survives restart.
uint8_t comm_stop_sample(void) {
g_comm.data_ready = false;
g_comm.state = COMM_STATE_IDLE;
g_comm.activating = false;
g_comm.command_fail_count = 0;
g_comm.protocol_locked = false;
g_comm.communication_lost = false;
g_comm.warmup_start_time = 0;
comm_command_complete(); // Release any pending I/O
memset(&g_comm_data, 0, sizeof(g_comm_data));// Reset cached data
comm_process_faults(false); // Clear fault detection state
return COMM_OK;
}
// BAD: half the flags survive — next start inherits stale state
void comm_stop_bad(void) {
g_comm.state = COMM_STATE_IDLE; // Only state changed
// Missing: data_ready, protocol_locked, communication_lost, fail_count...
// Next start: data_ready==true blocks first sample; fail_count persists
}
// CALLER GUARD: clear stale flags at power-off boundaries before re-init
void comm_handler(void) {
if (!power_get_status() && g_comm.command_pending) {
comm_command_complete(); // Clear before deinit
}
if (power_get_status()) {
comm_state_process();
}
}
// Atomic check-and-clear: every consumer sees the event exactly once
static volatile uint32_t event_latch;
uint32_t event_consume(uint32_t mask) {
uint32_t primask = __get_PRIMASK();
__disable_irq();
uint32_t pending = event_latch & mask;
event_latch &= ~mask; // Clear consumed bits atomically
if (!primask) __enable_irq();
return pending; // Non-zero = event occurred this cycle
}
// Each consumer independently observes — no races between consumers
void ui_consume(void) {
if (event_consume(EVT_SENSOR_READY)) update_display();
}
void log_consume(void) {
if (event_consume(EVT_SENSOR_READY)) write_log();
}
This skill's references/ directory contains in-depth material. Load when you need more than the core rules:
| Reference | Topic | Load When |
|---|---|---|
architecture-principles.md | 12 architecture design principles | Designing module boundaries, state ownership, or GUI architecture |
embedded-patterns.md | GIF timer safety, async lifecycle, state latches | Debugging timer crashes, stale flags, or state corruption |
lvgl-pitfalls.md | LVGL layout, alignment, alpha, and mask traps | Debugging LVGL rendering artifacts or HardFault in draw paths |
See also: Skill("state-machine-design") for state transition rules, Skill("debug-methodology") for debugging process, Skill("hardfault-triage") for stack overflow and ISR crash triage.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub amethystluna/embedded-workbench --plugin embedded-workbench8 skills in this plugin
/c-cpp-devUse when writing, reviewing, or refactoring C/C++ code, especially on 32-bit ARM embedded targets. NOT for formatting-only changes, simple file reads, non-embedded C/C++ (desktop/server), or C#/Java despite the 'C' in the name./debug-methodologyUse when debugging embedded firmware issues — analyzing crash logs, investigating state machine lockups, tracing sensor/signal anomalies, or performing structured root-cause analysis after a crash has been located. For fault-register and stack-frame triage, load hardfault-triage first./embedded-workbenchUse when starting any non-trivial coding task — loads risk-proportional workflows, engineering policies, and principles for embedded C/C++ firmware development. NOT for trivial single-line fixes, formatting-only changes, or read-only queries.Other plugins' skills for the same job