pw-embedded-c-style_skill

This skill helps you create consistent embedded C project structures and coding styles for 51/STM32, with snake_case by default and optional camelCase.
  • TypeScript

19

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill plugins-world/pw-skills --skill pw-embedded-c-style

  • SKILL.md8.7 KB

Overview

This skill is an embedded C style assistant tailored to 8051-style teaching projects and small STM32 targets. It enforces a default snake_case naming convention (optional camelCase on request), generates project skeletons, and produces hardware driver templates following practical embedded patterns. The goal is readable, portable code and consistent project organization for MCU projects.

How this skill works

The assistant analyzes desired functionality or input code and emits C source and header files using the chosen naming style. It can create single-file examples for quick prototypes or multi-file modules (config.h, module.h, module.c, main.c) and driver templates for peripherals like timers, UART, LCD, RTC, and keys. It also suggests refactors, naming fixes, interrupt-safe patterns, and inline comments consistent with 8051/STM32 embedded constraints.

When to use it

  • Start a new small embedded C project (51 series, STM32F1/F4)
  • Generate a peripheral driver template (timer, UART, LCD, DS1302, etc.)
  • Refactor or standardize naming and file organization in an existing firmware repo
  • Add interrupt-safe patterns and volatile/global handling guidance
  • Create a single-file prototype for quick hardware validation

Best practices

  • Default to snake_case for functions and variables; macros remain UPPER_SNAKE
  • Keep ISRs minimal: set flags in interrupt, handle logic in main loop
  • Modularize each peripheral into .h/.c pairs and isolate hardware macros in config.h
  • Use volatile for shared flags and code/pdata for large lookup tables when supported
  • Document key register setups with concise inline comments and a file header

Example use cases

  • Create a main.c that blinks an LED using timer0 with proper compensation and flag-driven loop
  • Generate lcd1602.h/c and key.h/c modules plus config.h for an LCD+key project
  • Produce a UART driver template with RX/TX buffers, overflow protection, and interrupt hook
  • Refactor a noisy key-scan routine into a debounced driver using shift-register method
  • Convert a monolithic demo into a multi-file project with consistent naming and extern declarations

FAQ

Yes — specify "use camelCase" in your instruction and generated code will follow camelCase/PascalCase rules for identifiers.

Which targets are supported?

Designed for 8051-family MCUs (AT89C51, STC89C52, STC15) and common STM32 series (F103, F407). Register definitions may need minor adjustments for non-listed chips.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational