About esp-idf
An ESP-IDF firmware engineering skill for developers building, configuring, and debugging ESP-IDF applications. It guides project setup, builds, hardware validation, and dependency selection while emphasizing authorization and safe handling of device changes.
Key features
- 01ESP-IDF project setup and environment checks
- 02Build and configuration guidance
- 03Authorized flashing and runtime checks
- 04Crash diagnosis with decoded monitor output
- 05Component Registry dependency selection
Use cases
- 01Starting an ESP-IDF firmware project
- 02Investigating build or dependency failures
- 03Diagnosing runtime crashes
- 04Validating firmware on authorized hardware
MCP support
The skill recommends using ESP Component Registry MCP tools when available to search for dependencies; the public REST API is a fallback.
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ pedrominatel/ awesome-esp-ai --skill esp-idfAfter installing, type/esp-idfin Claude Code to confirm it loaded.
Bundled filescomponent_registry.md
Details
From the project READMEESP-IDF Firmware Engineering
When to Use
- Developing or configuring ESP-IDF firmware applications.
- Troubleshooting compilation errors or dependency issues in ESP-IDF projects.
- Flashing authorized hardware and verifying runtime behavior.
- Debugging run-time crashes using the decoded monitor output.
Project and Environment
- Locate the project root containing the top-level
CMakeLists.txt. In a multi-application repository, identify every affected project root. - Read the README, CI configuration,
sdkconfig.defaults*, manifests, and build scripts to determine the required ESP-IDF version, targets, and validation. - When creating a project, use
idf.py create-project <PROJECT_NAME>rather than manually generating scaffold files. - Verify the environment with
idf.py --version. Prefer repository-prescribed setup; otherwise use EIM:eim --versioneim listto find installed versions, selected version, and absolute pathseim select <ESP_IDF_VERSION>eim run "idf.py --version" <ESP_IDF_VERSION>eim run "idf.py <command>" <ESP_IDF_VERSION>eim install -i <ESP_IDF_VERSION>only when installation is authorizedeim wizardonly when interactive installation is requested
- If EIM is unavailable but the required ESP-IDF environment is already valid, continue with that environment. Do not block work solely to install EIM.
- Use version-matched ESP-IDF documentation and migration guides.
Target and Hardware Identification
- Determine the project target from configuration and build output before probing hardware.
- Ask before
idf.py set-target <TARGET>. It clearsbuild/, movessdkconfigtosdkconfig.old, and reconfigures the project; do not follow it with a redundantfullclean. - Probe hardware only when the task requires it and a port is confirmed. Check
the installed esptool help and use its supported syntax, for example:
- Current:
esptool --port <PORT> chip-id - Legacy:
esptool.py --port <PORT> chip_id
- Current:
- If automatic bootloader entry fails, ask the user to place the device in download mode before retrying.
- Compare the configured target with the physical chip, boot-time flash settings, and application metadata. Do not report a device MAC address unless required.
Build and Configuration
- Use
idf.py buildfor normal incremental builds and inspect the first relevant errors plus referenced logs when a build fails. - Treat
sdkconfigas generated. Put intentional defaults insdkconfig.defaults*; a target-specific defaults file requires a basesdkconfig.defaults, even if the base file is empty. - After changing
KconfigorKconfig.projbuild, ask whether to runidf.py reconfigure. A build normally detects Kconfig definition changes, but a changed default may not override a value already stored insdkconfig. - Never edit
build/,managed_components/, ordependencies.lockmanually. - Use
idf.py fullcleanonly for demonstrated stale-build problems and only with user approval.
Flash, Monitor, and Diagnose
- Never flash merely because a board is connected. Flash only when requested or explicitly authorized after confirming the port, target, and that the device is safe to overwrite.
- Flash with
idf.py -p <PORT> flash; useidf.py -p <PORT> flash monitorwhen runtime validation is authorized. - Use
idf.py -p <PORT> monitorfor crash analysis so addresses in backtraces are decoded to source locations. - Capture output until the requested behavior or crash occurs, stop the monitor cleanly, and summarize the relevant evidence.
- Send interactive input only when the firmware exposes a console and the terminal supports it.
- Treat the linenoise warning about unsupported escape sequences as harmless; it disables line editing and history, not firmware behavior.
- For suspected memory corruption or leaks, first inspect available evidence, then propose the appropriate heap tracing or debugging configuration and obtain approval before changing configuration.
ESP-IDF Code Conventions
- Keep the entry point as
void app_main(void). - Prefer ESP-IDF APIs and includes over ad-hoc platform code.
- Use
ESP_LOGI/W/Einstead of excessiveprintfunless required. - Register components with
idf_component_register(...); declare dependencies withREQUIRESorPRIV_REQUIRES. - Handle
esp_err_tresults explicitly and avoid long blocking operations without yielding where appropriate.
Component Registry
- Search the ESP Component Registry before implementing a dependency locally.
- Prefer the Registry MCP tools when available; use the public REST API as a fallback.
- Add dependencies from the project root with
idf.py add-dependency "namespace/component^<VERSION>". Use--component=<NAME>or--path=<PATH>when the dependency belongs to a component other thanmain. - If several candidates satisfy the request, compare compatibility, maintenance, licensing, and API fit. Ask the user only when the choice remains material.
- For REST endpoints and examples, read component_registry.md.
Handoff
- Report commands run, ESP-IDF version, target, tests, and hardware used.
- Summarize configuration changes and clearly identify anything not validated.
Comments
Markdown supported