agentleFS
leaf76leaf76/agent-skills/firmware-feature-writer/SKILL.md

firmware-feature-writer

Skill0 starsChanged 3 months agoMITView on GitHub

Use when implementing, debugging, or refactoring embedded firmware features (C/C++/Rust). Focus on deterministic behavior, peripheral/register correctness, RTOS/task safety, and testability on constrained devices.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 13 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add or refactor drivers, protocol handlers, control loops, sensor/actuator logic, state machines, power management, and error handling in …

    line 13
  2. Distinctive:

    Do not use this skill for hardware design or PCB/layout tasks.

    line 16
  3. Distinctive:

    Read the module/driver ABI and call graph first

    line 26
  4. Distinctive:

    Verify error codes/return conventions and retry policies

    line 28
  5. Distinctive:

    Keep ISR work minimal: capture + wake mechanism only.

    line 34
  6. Very specific:

    Use fixed-width integer types (uint8_t, uint16_t, etc.) and avoid ambiguous casts

    line 35
  7. Very specific:

    Add parameter validation and assert/error reporting to avoid silent failures

    line 38
  8. Distinctive:

    Document timing assumptions and measurement points for time-sensitive paths

    line 39
  9. Distinctive:

    Update init/shutdown ordering and sequence-sensitive flows to avoid interrupt-related regressions

    line 41
  10. Distinctive:

    Ensure low-power, reset, and watchdog flows do not violate new logic

    line 42
  11. Distinctive:

    Add diagnostic logging (non-sensitive values) for field troubleshooting

    line 43
  12. Distinctive:

    Do timeout and retry loops have hard limits and a reporting path to avoid infinite blocking?

    line 48
  13. Distinctive:

    Document key before/after behavior for critical code sections (avoid unrelated edits).

    line 56
  14. Distinctive:

    Do not hardcode vendor-specific private process details across projects.

    line 61
  15. Distinctive:

    If critical hardware information is missing (datasheet section, interrupt table, power-up sequence), request it before implementation.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Firmware Feature Writer

Goal: Deliver firmware logic that is behaviorally correct on real hardware and maintainable under constraints.

Scope

  • Add or refactor drivers, protocol handlers, control loops, sensor/actuator logic, state machines, power management, and error handling in embedded codebases.
  • C/C++/Rust firmware projects using HAL/SDK, RTOS, or bare-metal build systems.
  • Firmware feature tasks that require hardware constraints and timing awareness.
  • Do not use this skill for hardware design or PCB/layout tasks.

Workflow

  1. Confirm hardware boundaries
    • MCU/SoC family, clock, and memory limits
    • Relevant peripherals, pin map, and IRQ priorities
    • RTOS presence/version, and interfaces (I2C/SPI/UART/CAN/USB/ADC/PWM, etc.)
    • Power, timing, watchdog, and safety requirements
  2. Locate existing patterns and interfaces
    • Read the module/driver ABI and call graph first
    • Identify shared data paths (global state, ISR-to-task communication)
    • Verify error codes/return conventions and retry policies
  3. Define feature contract
    • Explicitly specify inputs, outputs, boundary conditions, error paths, timeouts, and fallback behavior
    • Define state transitions and invariants for safe and failure states
  4. Implement with a minimal first pass
    • Build the smallest verifiable version first, then add exception handling and optimization
    • Keep ISR work minimal: capture + wake mechanism only; move heavy processing to tasks/threads
    • Use fixed-width integer types (uint8_t, uint16_t, etc.) and avoid ambiguous casts
  5. Verify logical correctness
    • Set clear synchronization and memory-barrier rules across async/sync boundaries
    • Add parameter validation and assert/error reporting to avoid silent failures
    • Document timing assumptions and measurement points for time-sensitive paths
  6. Integrate and regression check
    • Update init/shutdown ordering and sequence-sensitive flows to avoid interrupt-related regressions
    • Ensure low-power, reset, and watchdog flows do not violate new logic
    • Add diagnostic logging (non-sensitive values) for field troubleshooting

Firmware Checklist

  • Is shared data protected from races (volatile, mutex/queue/critical sections as appropriate)?
  • Is ISR re-entry safe? Can ISR/task interleaving create ghost states?
  • Do timeout and retry loops have hard limits and a reporting path to avoid infinite blocking?
  • Are external inputs validated, debounced, and filtered when required?
  • Are integer overflow, fixed-point arithmetic, division-by-zero, and uninitialized values handled?
  • Are build warnings reduced to zero (at least in modified modules)?

Typical Output Format

  • Summarize requirement understanding first.
  • List changed modules and side effects per step.
  • Document key before/after behavior for critical code sections (avoid unrelated edits).
  • Include hardware validation plan (host test, HIL/SIL, bootloader/flash validation).

Default Guidance

  • Supported toolchains include CMake / Make / Zephyr / NuttX / ESP-IDF / STM32Cube / HAL.
  • Do not hardcode vendor-specific private process details across projects.
  • If critical hardware information is missing (datasheet section, interrupt table, power-up sequence), request it before implementation.
  • For timing-critical work, require measurement scripts and explicit boundary-condition tests.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.