Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Firmware Build

ASecurity

Implements microcontroller firmware within hard limits: static memory, bounded interrupt handlers, a testable HAL boundary, measured stack and flash budgets, and on-target verification. Use for embedded work on an MCU, driver or RTOS task code, or a change that must be proven on hardware rather than in a test runner.

9 stars
0 votes
0 copies
0 views
Added 9/27/2026
ai-agentstestingdebugging

Security Analysis

A100/100

Scanned 9/27/2026

Install to Claude Code

$npx -y skills add khuynh22/agent-dev-team --skill firmware-build --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Firmware Build?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Firmware Build
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khuynh22-firmware-build/badge)](https://www.skillsdirectory.com/skills/khuynh22-firmware-build)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: firmware-build
description: Implements microcontroller firmware within hard limits: static memory, bounded interrupt handlers, a testable HAL boundary, measured stack and flash budgets, and on-target verification. Use for embedded work on an MCU, driver or RTOS task code, or a change that must be proven on hardware rather than in a test runner.
license: MIT
metadata:
  phase: build
  owners: [firmware-engineer]
  version: "0.1.0"
---

# Firmware Build

Server habits break devices. No heap, bounded interrupt handlers, every wait has a
timeout, and nothing is verified without a number.

Standing reference: `references/firmware-constraints.md`.

## Before writing code

1. **Read the datasheet section and the errata.** Cite the section in a comment where the
   required register order is not obvious. An erratum found after two days of debugging is
   two days lost.
2. **Write the memory budget.** RAM, stack per task, flash, and which section each large
   object lands in. Check the map file rather than assuming; a `const` table that lands in
   RAM instead of flash is a common and expensive surprise.
3. **Draw the HAL boundary.** Everything above it is host-testable logic. Everything below
   it touches registers. Logic that reads a register directly cannot be tested off-target,
   and off-target tests are orders of magnitude faster.

## While writing

- **No dynamic allocation after initialisation.** Static pools and fixed-size buffers.
  Fragmentation is unrecoverable on a device that runs for months.
- **Interrupt handlers do four things:** acknowledge the source, move data, signal, return.
  No blocking, no allocation, no logging, no long loop, no floating point unless the
  platform saves the FPU context.
- **Guard shared state properly.** `volatile` stops the compiler caching a value. It is not
  atomicity and not a memory barrier. Multi-byte state shared with an interrupt needs a
  critical section, kept as short as possible.
- **Bound every wait.** Every peripheral operation gets a timeout and a defined failure
  behavior. A bus that never asserts ready must not hang the device.
- **Prefer a state machine over a task per feature.** Fewer stacks, fewer races.
- **Handle rollover.** Tick arithmetic uses unsigned subtraction so a counter wrap behaves
  correctly.
- **Feed the watchdog from progress,** not from a timer interrupt. A watchdog fed by a
  timer keeps a wedged application alive, which defeats the purpose.

## Testing

- Host-test all logic through the HAL seam with a fake peripheral layer, using `tdd-loop`.
- On-target tests cover timing, interrupt behavior, and peripheral quirks only.
- Assert stack high-water mark and heap usage in the suite, not by eye.
- Build and test at the shipping optimisation level. A bug that disappears at `-O0` is a
  timing or `volatile` bug, and its disappearance is the diagnosis.

## On-target verification

Run before claiming the change works:

```markdown
- **Build:** <toolchain, version, optimisation level>
- **Flash:** <used> / <total>   (delta <n>)
- **RAM:** <used> / <total>     (delta <n>)
- **Stack high-water:** <per task, with margin>
- **Worst-case ISR duration:** <measured with a pin toggle or cycle counter>
- **Host tests:** <quoted summary>
- **On-target tests:** <what ran on hardware, quoted>
- **Power:** <current per state, if battery powered>
- **Soak:** <duration, result>
```

A change that reports no numbers has not been verified. Prefer a pin toggle and a logic
analyser over print statements: printing changes timing and hides the bug you are chasing.

If the device does not boot, the peripheral never responds, or the fault is below the
register level, that is `board-bringup-engineer`, not more application debugging.

## Update path

- Firmware update is atomic with a rollback slot. An update that can brick the device on
  power loss is not shippable.
- The build embeds a version and a commit readable from the device.
- Images are signed if the device is reachable by anyone but you.
- Brownout behavior is defined for anything that writes to non-volatile storage. A
  half-written record is a corrupted device.

## Red flags

| Thought | Reality |
|---------|---------|
| "One malloc at startup, so a bit more is fine" | Fragmentation is unrecoverable over months. Static pools. |
| "I'll print from the ISR to debug" | Printing changes timing and hides the bug. Toggle a pin. |
| "volatile makes it safe" | It prevents caching. Not atomicity, not ordering. |
| "The stack is probably fine" | Measure the high-water mark. Probably is how devices fault in the field. |
| "It works at -O0" | That is the diagnosis, not a workaround. |
| "I'll retry until it responds" | Bounded, with a timeout and a defined failure. Unbounded retries hang the device. |
| "It ran for ten minutes on the bench" | Soak it. These bugs appear over hours. |

Attribution

khuynh22khuynh22
View sourceMore from khuynh22 →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

694821 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →