C Cpp Patterns

Use when the user asks about embedded C or C++ firmware, register access, volatile, memory-mapped IO, ISR data sharing, ring buffers, struct packing, MISRA or linker scripts. Produces microcontroller C/C++ with static memory and safe register access. Not for RTOS task design (use rtos) or desktop C++ (use lang-cpp).

45 stars 6 forksProductivity & Notes

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill c-cpp-patterns
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/embedded-systems/c-cpp-patterns ~/.claude/skills/c-cpp-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Embedded C/C++ Patterns

## Purpose
Firmware bugs come from a short list: wrong register access, data shared with ISRs unsafely, heap fragmentation, undefined behaviour the optimiser exploits, and layout assumptions. This skill gives the patterns that avoid them in C (C11/C17) and in a restricted C++ (C++17/20 without exceptions/RTTI/heap) suitable for MCUs.

## Agent Protocol

### Trigger
"embedded C", "embedded C++", "firmware", "register access", "volatile", "memory-mapped IO", "ISR", "ring buffer", "struct packing", "alignment", "MISRA", "linker script".

### Input Context
- MCU/core and vendor SDK (CMSIS, STM32 HAL/LL, nRF SDK/Zephyr, ESP-IDF, Pico SDK)
- Toolchain (arm-none-eabi-gcc, Clang, IAR, Keil) and language standard
- Coding standard (MISRA C:2012/2023, AUTOSAR C++14, CERT C)

### Output Artifact
C/C++ code, review findings, or build flags. No file unless requested.

### Response Format
```
Target: {MCU, toolchain, -std}
Pattern: {name}
Code: {snippet}
Concurrency: {what can interrupt this and how it is protected}
Checks: {static analysis / MISRA rules touched}
```

## 1. Register Access
- Use the vendor CMSIS device header (`stm32f4xx.h`, `nrf52840.h`): it defines peripheral structs with `volatile` members (`__IO`) at the right addresses. Hand-written addresses only when no header exists:
```c
#define GPIOA_ODR (*(volatile uint32_t *)0x40020014u)   /* STM32F4 example */
```
Read the full skill on GitHub

Details

Skill name
c-cpp-patterns
Path
skills/embedded-systems/c-cpp-patterns/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the C Cpp Patterns skill do?

Use when the user asks about embedded C or C++ firmware, register access, volatile, memory-mapped IO, ISR data sharing, ring buffers, struct packing, MISRA or linker scripts. Produces microcontroller C/C++ with static memory and safe register access. Not for RTOS task design (use rtos) or desktop C++ (use lang-cpp).

How do I install the C Cpp Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill c-cpp-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is C Cpp Patterns popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Distributed Training

45

j4flmao/agent-skills

Use when the user asks about multi-GPU training, DDP, FSDP, ZeRO, DeepSpeed, torchrun, tensor/pipeline parallel, all-reduce or NCCL slowness. Produces a parallelism plan with per-GPU memory math, launch command and config. Not for fabric tuning (use rdma-roce) or experiment logging (use ml-experiment-tracking).

Productivity & Notes

Backend Transactional Email

45

j4flmao/agent-skills

Use when the user asks about transactional email, password reset emails that do not land in spam, SPF/DKIM/DMARC, Amazon SES, SendGrid, Resend, Postmark, MJML templates or bounce webhooks. Produces email sending with templates and deliverability setup. Not for marketing campaigns or SMS (use backend-sms-messaging).

Productivity & Notes

Ecmwf Observations

23

ecmwf/ecmwf-weather-skills

Retrieves weather station observations (SYNOP and METAR — 2 m temperature, dew point, humidity, wind, pressure, precipitation) from ECMWF's MARS archive, with the departures from ECMWF's first guess and analysis and QC flags — load it first for any request for observed or measured weather at a station or airport, past observations, a WMO station id or ICAO code, or comparing a forecast with what was observed. Use when a task mentions observations, station data, SYNOP, METAR, BUFR or ODB feedback, verifying or scoring a forecast against stations (bias, MAE, RMSE), observed heat index or humidex

Productivity & Notes

Browse the most popular Claude skills, all productivity & notes skills, or write your own with the skills generator.