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.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- esp32_crash_reviewSkill
- esp32_log_triageSkill
- esp32_pin_auditSkill
- esp32_test_planSkill
- feature_contractSkill
- esp32_hardware_checkSkill
- pr_prepareSkill
- repo_scoutSkill
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
- Distinctive: line 12
Before merging significant changes.
- Distinctive: line 14
When inheriting or auditing an existing project.
≈ “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.
Files
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 (
*FromISRfunctions). - 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()ortaskYIELD(). - Critical sections are short (< 1ms).
- Queue/semaphore usage has appropriate timeouts (not
portMAX_DELAYeverywhere).
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_treturn 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(notESP_LOGI). - Boot sequence is traceable through logs.
8. Build Configuration
- Target chip matches actual hardware.
sdkconfig.defaultscaptures 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]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
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.

