agentleFS
agodianelagodianel/esp32-claude-workbench/.claude/skills/esp32_arch_review/SKILL.md

esp32_arch_review

Skill79 starsChanged 8 months agoMITView on GitHub

Review ESP32 firmware architecture for RTOS safety, memory management, error handling, and embedded best practices.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before merging significant changes.

    line 12
  2. Distinctive:

    When inheriting or auditing an existing project.

    line 14

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

ESP32 Architecture Review

Perform a structured review of firmware architecture focusing on embedded-specific safety and correctness.

When to Use

  • Before merging significant changes.
  • During implementation contract review.
  • When inheriting or auditing an existing project.
  • Periodically for long-running projects.

Review Checklist

1. FreeRTOS Safety

  • All tasks have explicitly sized stacks (no defaults).
  • Stack sizes are appropriate: ≥2048 for simple, ≥4096 for Wi-Fi/BLE tasks.
  • No blocking calls in ISRs.
  • ISR-safe API variants used where required (*FromISR functions).
  • Shared resources protected by mutexes.
  • No priority inversion risks (or priority inheritance mutexes used).
  • Task watchdog timer handled for long-running operations.
  • No unbounded loops without vTaskDelay() or taskYIELD().
  • Critical sections are short (< 1ms).
  • Queue/semaphore usage has appropriate timeouts (not portMAX_DELAY everywhere).

2. Memory Management

  • No large stack-allocated buffers (> 512 bytes).
  • Heap allocations checked for NULL.
  • DMA buffers allocated with heap_caps_malloc(MALLOC_CAP_DMA).
  • Free heap monitored at runtime.
  • No memory leaks in error paths (allocated memory freed on failure).
  • String buffers have bounds checking.
  • No malloc() inside ISRs.

3. Error Handling

  • All esp_err_t return values checked.
  • ESP_ERROR_CHECK() used only for fatal init errors.
  • Runtime errors handled gracefully (log + recover or degrade).
  • Network operations use retry with backoff.
  • Timeout values are defined and reasonable.
  • Error paths clean up resources (close handles, free memory).

4. Peripheral Safety

  • GPIO pins validated against reserved pin list.
  • Peripheral initialization checks for errors.
  • De-initialization / cleanup paths exist.
  • Bus recovery mechanisms for I2C/SPI.
  • ADC2 not used alongside Wi-Fi.
  • Pin map is documented and consistent with code.

5. Networking

  • Wi-Fi event handler registered properly.
  • Reconnection logic with backoff.
  • TLS certificates validated (not disabled).
  • Hostname/IP validation.
  • Socket timeouts configured.
  • DNS resolution errors handled.

6. Persistent Storage

  • NVS keys are namespaced.
  • NVS read errors handled (first-boot defaults).
  • Partition table matches sdkconfig.
  • OTA partition scheme is correct.
  • SPIFFS/LittleFS properly initialized and error-checked.

7. Logging Quality

  • Appropriate log levels used (E/W/I/D/V).
  • No sensitive data in logs (passwords, tokens).
  • Log tags match component names.
  • Verbose logs behind ESP_LOGD/ESP_LOGV (not ESP_LOGI).
  • Boot sequence is traceable through logs.

8. Build Configuration

  • Target chip matches actual hardware.
  • sdkconfig.defaults captures all non-default settings.
  • Component dependencies declared in CMakeLists.txt.
  • No unused components included.
  • Partition table appropriate for the use case.

Output

Generate a review report:

# Architecture Review Report

## Summary
[Overall assessment: PASS / PASS WITH NOTES / FAIL]

## Critical Issues
- [Issues that must be fixed]

## Warnings
- [Issues that should be addressed]

## Recommendations
- [Improvements to consider]

## Checklist Results
[Filled checklist from above]

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.