/embedded-skills:embedded-architecturefrom embedded-skills
Enforces mandatory architecture rules for embedded firmware projects targeting STM32, GD32, ESP32, RP2040, NXP, Nordic MCUs. Covers project structure, dependency management, module boundaries, platform abstraction, and architecture validation.
Ships in embedded-skills. 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.
None: SKILL.md is the whole skill.
Define the mandatory architecture rules for embedded firmware projects.
The goal is to generate maintainable, portable, testable, and hardware-independent firmware suitable for STM32, GD32, ESP32, RP2040, NXP, Nordic, and similar MCU platforms.
This skill focuses on:
Generated firmware must follow:
The application layer must never depend directly on MCU vendor libraries.
Business logic must remain independent from STM32 HAL, CMSIS, FreeRTOS internals, or peripheral registers.
Firmware projects must use the following layout:
project/
├── app/
├── module/
├── interface/
├── bsp/
├── platform/
├── middleware/
├── docs/
├── tools/
└── tests/
app/ — Application Entry PointsContains:
Must not contain:
module/ — Business LogicExamples: motor/, imu/, control/, telemetry/, navigation/, power/
Modules may depend only on interface/.
Modules must not access directly: HAL, CMSIS, GPIO registers, UART registers, SPI registers.
interface/ — Hardware Abstraction ContractsExamples: gpio_if.h, uart_if.h, spi_if.h, pwm_if.h, timer_if.h
Defines contracts only. Must not contain implementation.
bsp/ — Board-Specific ImplementationExamples: led, button, buzzer, oled, imu_board
Responsible for mapping interfaces to hardware. May use platform layer.
platform/ — Vendor-Specific Codeplatform/
└── stm32f407/
├── core/
├── hal/
├── cmsis/
├── startup/
└── linker/
Contains: CubeMX generated code, HAL drivers, CMSIS, startup files, linker scripts.
Must never contain business logic.
middleware/ — Third-Party MiddlewareExamples: freertos/, lwip/, fatfs/, usb/
Should remain isolated from application logic.
Allowed direction (top-down only):
APP → MODULE → INTERFACE → BSP → PLATFORM
Forbidden:
APP → HALAPP → STM32_GPIO / STM32_UARTMODULE → HALMODULE → Register AccessMODULE → CMSISMODULE → FreeRTOS Internal APIsPLATFORM → MODULEPLATFORM → APPBSP → APPDependencies must always point downward. Circular dependencies are forbidden.
All MCU vendor files must reside inside platform/<target>/:
platform/stm32f407/
platform/stm32h743/
platform/gd32f450/
platform/esp32s3/
Never place generated vendor code directly in project root.
Forbidden at repository root: /Core, /Drivers — move them into the platform directory.
Every hardware service must expose an interface.
Example:
typedef struct {
int32_t (*write)(const uint8_t *data, uint32_t len);
int32_t (*read)(uint8_t *data, uint32_t len);
} uart_if_t;
Modules interact only with interfaces. Modules must not know: UART instance, GPIO port, DMA channel, MCU family.
Each module should own one responsibility.
Good: motor, imu, control, telemetry, storage
Bad: system_manager, all_in_one, utility, misc
Avoid god-modules.
RTOS task creation belongs to app/. Business logic belongs to module/.
Bad — task function contains sensor reading, control algorithm, logging, and communication all mixed together.
Good — task calls module API, which calls interface, which calls driver:
TASK → MODULE API → INTERFACE → DRIVER
Before accepting generated code, verify:
app/module/platform/platform/If violations are found:
Architecture correctness takes precedence over implementation convenience.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rovinax/embedded-skills --plugin embedded-skills6 skills in this plugin
/embedded-cstyleUse when generating, modifying, reviewing, or refactoring C code for embedded firmware projects (STM32, GD32, ESP32, FreeRTOS, bare-metal, driver development, robotics). Enforces engineering coding standards — naming, types, functions, variables, macros, headers, memory, concurrency, error handling, and documentation. Catches AI-common mistakes: global variables, magic numbers, missing static/const, volatile abuse, ignored return values, unchecked null pointers, and HAL calls leaking into business logic.
/embedded-documentationUse when creating or reviewing embedded firmware projects (STM32, FreeRTOS, drone, robotics) to ensure complete, consistent, and maintainable documentation. Automatically generates and validates project documentation: README, architecture docs, module design docs, interface specs, RTOS task design, ISR documentation, state machines, hardware pin mapping, and data flow diagrams. Triggers on new projects, new modules, new RTOS tasks/ISRs, state machine detection, or any undocumented component.
/embedded-driver-designUse when developing or reviewing peripheral drivers for embedded firmware (STM32, GD32, ESP32, FreeRTOS, drone flight controllers, robotics). Enforces layered driver architecture with bus abstraction, device context objects, register encapsulation, and strict separation between bus drivers, device drivers, BSP, and business modules. Prevents HAL/register leakage into device drivers and keeps control algorithms (PID, Kalman, attitude estimation) out of driver code.
/embedded-isr-designUse when generating or reviewing interrupt service routines (ISRs) for embedded firmware (STM32, GD32, ESP32, FreeRTOS, bare-metal, drone flight controllers, robotics). Enforces the "Fast In, Fast Out" principle — ISRs capture events and defer processing to task context. Prevents common AI mistakes: protocol parsing in ISR, control algorithms in ISR, printf/malloc in ISR, blocking calls, forgotten flag clearing, and missing FromISR API usage for RTOS integration.
/embedded-rtos-designUse when designing, generating, or reviewing RTOS-based embedded firmware (FreeRTOS, CMSIS-RTOS2, RT-Thread, Zephyr, ThreadX) for STM32, GD32, ESP32, drone flight controllers, and robotics projects. Enforces real-time system architecture — task decomposition, scheduling, priority assignment, inter-task communication, ISR cooperation, resource ownership, and watchdog monitoring. Prevents the common AI anti-pattern of creating monolithic super-tasks with mixed responsibilities and jitter-prone control loops coupled to communication timing.
Other plugins' skills for the same job