{"id":"cf5215e6-6bb2-46f7-882a-6890ee672411","entityType":"agent","slug":"clawhub-movecall-claw-esp-expert","name":"Claw ESP Expert","canonicalUrl":"https://www.xpersona.co/agent/clawhub-movecall-claw-esp-expert","canonicalPath":"/agent/clawhub-movecall-claw-esp-expert","generatedAt":"2026-10-12T17:39:43.248Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":null},"description":"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Skill: Claw ESP Expert Owner: movecall Summary: ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Tags: latest:0.0.4 Version history: v0.0.4 | 2026-03-19T10:30:19.306Z | user Remove runtime third-party Node dependencies and simplify the published bundle. v0.0.3 | 2026-03-19T10:01:27.792Z | user Add skill package manifest and tighten ClawHub runtime expectations. v0.0.2 | 2026-03-19T09:55:47.526Z | user Tighten ClawHub-f","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 957 downloads reported by the source. Last updated 10/12/2026.","installCommand":"clawhub skill install s17dmkbycqgr9k7jn0zkj2w3qn83jdxt:claw-esp-expert","sourceUrl":"https://clawhub.ai/movecall/claw-esp-expert","homepage":"https://clawhub.ai/movecall/skills/claw-esp-expert","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/movecall/claw-esp-expert","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/movecall/skills/claw-esp-expert","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Skill: Claw ESP Expert Owner: movecall Summary: ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Tags: latest:0.0.4"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":null},"stars":null,"forks":null,"downloads":957,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"0.0.4","tractionLabel":"957 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:09:58.169Z","emptyReason":null},"lastUpdatedAt":"2026-10-12T02:09:58.285Z","lastCrawledAt":"2026-10-12T02:09:58.169Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-13T02:09:58.169Z","lastVerifiedAt":null,"highlights":[{"version":"0.0.4","createdAt":"2026-03-19T10:30:19.306Z","changelog":"Remove runtime third-party Node dependencies and simplify the published bundle.","fileCount":41,"zipByteSize":53662},{"version":"0.0.3","createdAt":"2026-03-19T10:01:27.792Z","changelog":"Add skill package manifest and tighten ClawHub runtime expectations.","fileCount":37,"zipByteSize":51021},{"version":"0.0.2","createdAt":"2026-03-19T09:55:47.526Z","changelog":"Tighten ClawHub-facing metadata and switch install flow to manual guidance.","fileCount":36,"zipByteSize":50748},{"version":"0.0.1","createdAt":"2026-03-19T09:37:44.414Z","changelog":"Initial usable MVP for ESP-IDF diagnostics.","fileCount":36,"zipByteSize":50486}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dmkbycqgr9k7jn0zkj2w3qn83jdxt:claw-esp-expert","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T17:39:43.246Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-movecall-claw-esp-expert/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":null},"readme":"Skill: Claw ESP Expert\n\nOwner: movecall\n\nSummary: ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\n\nTags: latest:0.0.4\n\nVersion history:\n\nv0.0.4 | 2026-03-19T10:30:19.306Z | user\n\nRemove runtime third-party Node dependencies and simplify the published bundle.\n\nv0.0.3 | 2026-03-19T10:01:27.792Z | user\n\nAdd skill package manifest and tighten ClawHub runtime expectations.\n\nv0.0.2 | 2026-03-19T09:55:47.526Z | user\n\nTighten ClawHub-facing metadata and switch install flow to manual guidance.\n\nv0.0.1 | 2026-03-19T09:37:44.414Z | user\n\nInitial usable MVP for ESP-IDF diagnostics.\n\nArchive index:\n\nArchive v0.0.4: 41 files, 53662 bytes\n\nFiles: dist/build/AsyncBuildManager.d.ts (722b), dist/build/AsyncBuildManager.js (7626b), dist/build/PartitionAdvisor.d.ts (1304b), dist/build/PartitionAdvisor.js (9430b), dist/build/PinmuxAuditor.d.ts (1583b), dist/build/PinmuxAuditor.js (18399b), dist/common/fs.d.ts (143b), dist/common/fs.js (569b), dist/common/PatchSuggestion.d.ts (367b), dist/common/PatchSuggestion.js (369b), dist/common/process.d.ts (421b), dist/common/process.js (2463b), dist/data/soc/esp32.json (4041b), dist/data/soc/esp32c3.json (1973b), dist/data/soc/esp32c5.json (2122b), dist/data/soc/esp32c6.json (2106b), dist/data/soc/esp32h2.json (2208b), dist/data/soc/esp32p4.json (2035b), dist/data/soc/esp32s3.json (2271b), dist/env/index.d.ts (953b), dist/env/index.js (4036b), dist/index.d.ts (4609b), dist/index.js (6770b), dist/monitor/FlashMonitorManager.d.ts (1069b), dist/monitor/FlashMonitorManager.js (6511b), dist/monitor/MonitorAnalyzer.d.ts (636b), dist/monitor/MonitorAnalyzer.js (2691b), dist/monitor/PanicDecoder.d.ts (1115b), dist/monitor/PanicDecoder.js (6307b), dist/registry/ComponentManifest.d.ts (680b), dist/registry/ComponentManifest.js (6327b), dist/registry/ComponentRegistry.d.ts (1175b), dist/registry/ComponentRegistry.js (5128b), dist/search/ProjectNavigator.d.ts (960b), dist/search/ProjectNavigator.js (5201b), dist/workflow/ExecutionOrchestrator.d.ts (1040b), dist/workflow/ExecutionOrchestrator.js (2499b), scripts/run-tool.mjs (2913b), skill-card.md (2679b), SKILL.md (7530b), _meta.json (134b)\n\nFile v0.0.4:SKILL.md\n\n---\nname: claw-esp-expert\ndescription: \"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🦞\",\n        \"requires\": { \"bins\": [\"node\", \"idf.py\"] },\n        \"category\": \"developer-tools\",\n      },\n  }\n---\n\n# Claw ESP Expert\n\nUse this skill when the user needs help with ESP-IDF environment checks, example discovery, pin safety review, or build diagnostics.\n\n## What this bundle includes\n\nThis ClawHub-facing bundle exposes nine stable MVP tools:\n\n- `manage_env`\n- `explore_demo`\n- `resolve_component`\n- `analyze_partitions`\n- `decode_panic`\n- `analyze_monitor`\n- `flash_and_monitor`\n- `execute_project`\n- `safe_build`\n\nThese tools are implemented in the bundled runtime and are invoked through `scripts/run-tool.mjs`.\n\n## Safety contract\n\n- Treat this skill as a **diagnostic-first** ESP-IDF expert.\n- Default to **check and explain**, not silent modification.\n- Do not claim support for fully autonomous repair, deep serial-port management, or HIL automation unless the repository actually implements them.\n- Do not invent additional tools beyond the ones listed in this file.\n- Do not read arbitrary local config files unless the user explicitly asks; the MVP bundle does not require VS Code config scanning.\n- Do not modify project files or system permissions unless the user clearly asks for that action.\n\n## Tool contract\n\n### `manage_env`\nPurpose:\n- inspect local ESP-IDF availability\n- report `$IDF_PATH`, common install paths, `python/python3`, and `idf.py` availability\n- when explicitly asked, return mirror-aware manual installation guidance instead of running upstream install scripts automatically\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin\n```\n\n### `explore_demo`\nPurpose:\n- inspect local `$IDF_PATH/examples`\n- find matching demos by keyword\n- read the best matching `README.md` / `README_CN.md`\n- summarize hardware requirements and structure\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin\n```\n\n### `safe_build`\nPurpose:\n- run GPIO safety audit before build\n- reject fatal pin conflicts early\n- invoke `idf.py build` only after the audit passes\n- return structured build diagnostics, including partition overflow, memory overflow, missing headers, component resolution failures, config issues, and link errors\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin\n```\n\n### `analyze_partitions`\nPurpose:\n- parse `partitions.csv` from the current ESP-IDF project\n- identify the most likely app partition (`factory` / `ota_0`)\n- combine partition table data with overflow logs\n- return a recommended expanded partition size and an updated CSV draft\n- return a structured patch-style before/after suggestion for `partitions.csv`\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Part '\\''factory'\\'' ... overflow 0x20000\"}' | node scripts/run-tool.mjs analyze_partitions --stdin\n```\n\n### `decode_panic`\nPurpose:\n- parse ESP-IDF panic logs\n- extract exception reason, registers, and backtrace addresses\n- call the correct `addr2line` tool for Xtensa or RISC-V chips\n- return decoded source locations from the ELF file\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"Guru Meditation Error...\"}' | node scripts/run-tool.mjs decode_panic --stdin\n```\n\n### `analyze_monitor`\nPurpose:\n- inspect raw `idf.py monitor` output\n- detect panic/backtrace markers automatically\n- return the recent log excerpt\n- trigger panic decoding when an ELF path is available\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"...monitor output...\"}' | node scripts/run-tool.mjs analyze_monitor --stdin\n```\n\n### `flash_and_monitor`\nPurpose:\n- run `idf.py flash monitor`\n- capture combined stdout/stderr\n- analyze the resulting monitor log\n- automatically trigger panic decoding when panic markers appear and an ELF path is available\n- return stage status, stage summary, timeout info, recent log tail, and common serial/tool failure categories\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs flash_and_monitor --stdin\n```\n\n### `execute_project`\nPurpose:\n- run the minimum execution loop for an ESP-IDF project\n- perform hardware audit first\n- build the project\n- then run `flash_and_monitor`\n- return a single structured result for the whole flow\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs execute_project --stdin\n```\n\n### `resolve_component`\nPurpose:\n- query the official ESP Component Registry\n- prefer `espressif/*` when an official component is a strong match\n- suggest the best-matching component from official registry data\n- generate a minimal `idf_component.yml` dependency snippet\n- optionally merge that dependency into an existing manifest draft\n- return a structured patch-style before/after suggestion for the manifest\n- surface component docs, supported targets, and the matching version\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"led_strip\",\"target\":\"esp32s3\"}' | node scripts/run-tool.mjs resolve_component --stdin\n```\n\n## Runtime notes\n\n- `manage_env` can succeed even when ESP-IDF is not installed, because reporting `NOT_FOUND` is a valid diagnostic result.\n- `manage_env({ action: \"install\" })` returns manual install guidance; it does not clone repositories or run upstream install scripts inside the skill bundle.\n- `resolve_component` uses the official ESP Component Registry over the network and should be treated as an explicit online lookup step.\n- `decode_panic` needs the matching ELF file and a working `addr2line` binary from the ESP-IDF toolchain.\n- `analyze_monitor` is still log-driven; it does not open serial ports by itself in this MVP.\n- `flash_and_monitor` does execute `idf.py flash monitor`, so the serial port, permissions, and toolchain environment must already be working.\n- `safe_build` depends on a shell environment where `idf.py` is executable.\n- The current hardware rules cover `esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, and `esp32p4`.\n- Common SKU names are normalized to family rules, for example `ESP32-C6FH4 -> esp32c6` and `ESP32-S3-PICO-1-N8R2 -> esp32s3`.\n- Audit results can include `file`, `line`, and `evidence` fields so the host can point back to the exact source location.\n- The pin audit can resolve several common patterns beyond direct literals, including `pin_bit_mask`, common `..._io_num` fields, macro chains, simple assignment aliases, and `#define` / `const gpio_num_t` aliases.\n- Pass user-controlled text through stdin JSON, not shell interpolation.\n\n## Files\n\n- `scripts/run-tool.mjs` — minimal stdin-driven tool runner for ClawHub-safe execution\n- `dist/index.js` — bundled runtime entry\n- `dist/data/soc/*.json` — current SoC rules database (`esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, `esp32p4`)\n\n## Out of scope for this MVP bundle\n\nThe following ideas are roadmap items, not current bundle guarantees:\n\n- automatic `idf_component.yml` maintenance\n- automatic `partitions.csv` edits\n- deep serial-port management UX\n- HIL automation with `pytest-embedded`\n\nFile v0.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn75ymnxwcbqm3tzdzdgfpkqp582w35g\",\n  \"slug\": \"claw-esp-expert\",\n  \"version\": \"0.0.4\",\n  \"publishedAt\": 1773916219306\n}\n\nFile v0.0.4:skill-card.md\n\n## Description:\n\nESP-IDF expert skill for environment checks, example discovery, GPIO safety review, build diagnostics, panic decoding, monitor analysis, flashing, and component lookup.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[movecall](https://clawhub.ai/user/movecall)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to inspect ESP-IDF environments, navigate examples, audit ESP32-family GPIO choices, diagnose builds and monitor logs, decode panics, and generate reviewable component or partition suggestions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can read ESP-IDF project files and local examples during diagnostics.\n\nMitigation: Use it only on intended project directories and review file paths surfaced in results.\n\nRisk: Build, flash, and monitor tools can run idf.py against connected hardware when invoked.\n\nMitigation: Confirm the project path, chip target, serial port, and ESP-IDF environment before invoking execution tools.\n\nRisk: Component lookup contacts the official Espressif component registry and may return dependency snippets or patch-style suggestions.\n\nMitigation: Review registry results, dependency snippets, and manifest changes before applying them to a project.\n\nRisk: Generated shell-command suggestions may be inappropriate for a specific workstation or project state.\n\nMitigation: Treat commands as proposals and review them before running.\n\n## Reference(s):\n\n- [Claw ESP Expert skill page](https://clawhub.ai/movecall/skills/claw-esp-expert)\n- [Publisher profile](https://clawhub.ai/user/movecall)\n- [Espressif ESP-IDF repository](https://github.com/espressif/esp-idf.git)\n- [Espressif ESP-IDF Gitee mirror](https://gitee.com/EspressifSystems/esp-idf.git)\n- [Espressif GitHub assets mirror](https://dl.espressif.cn/github_assets)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [JSON tool results and Markdown guidance with shell command and configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Patch-style before/after suggestions may be returned for partition tables or component manifests; generated dependency and command suggestions should be reviewed before use.]\n\n## Skill Version(s):\n\n0.0.4 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.0.4:dist/data/soc/esp32.json\n\n{\n  \"chip\": \"esp32\",\n  \"series\": \"Classic ESP32 (Dual-core / Single-core)\",\n  \"arch\": \"Xtensa® Dual-Core 32-bit LX6\",\n  \"vendor\": \"Espressif\",\n\n  \"physical_limits\": {\n    \"gpio_range\": [0, 39],\n    \"total_gpios\": 40,\n    \"input_only_pins\": {\n      \"pins\": [34, 35, 36, 37, 38, 39],\n      \"restriction\": \"INPUT_ONLY\",\n      \"has_internal_pull\": false,\n      \"warning\": \"这些引脚没有输出驱动能力，且缺少内部上下拉电阻。若外接按键必须加物理上拉。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [6, 7, 8, 9, 10, 11],\n      \"interface\": \"SPI_MUX\",\n      \"warning\": \"连接内部 Flash/PSRAM。代码中禁用这些 GPIO，否则触发 Cache Error 导致系统死机。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 2, 5, 12, 15],\n      \"critical_logic\": {\n        \"0\": \"Boot模式控制：启动时须为高电平；低电平进入下载模式。\",\n        \"2\": \"下载模式控制：烧录时须为低电平或悬空。\",\n        \"5\": \"SDIO定时控制：启动瞬间电平会影响硬件初始化。\",\n        \"12\": \"MTDI/Flash电压：启动时高电平设Flash为1.8V，低电平为3.3V（极易导致启动失败）。\",\n        \"15\": \"控制启动时 UART0 调试日志的输出开关。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n\n  \"performance\": {\n    \"cpu_frequency\": {\n      \"min_mhz\": 2,\n      \"max_mhz\": 240,\n      \"standard_steps\": [80, 160, 240],\n      \"constraints\": {\n        \"wifi_bt_min_mhz\": 80,\n        \"warning\": \"开启 Wi-Fi/BT 时主频不得低于 80MHz，否则协议栈崩溃。\"\n      }\n    },\n    \"bus_frequency\": {\n      \"apb_max_mhz\": 80,\n      \"note\": \"CPU降频会同步导致APB降频，需注意UART/I2C波特率偏移。\"\n    }\n  },\n\n  \"power_management\": {\n    \"voltage\": {\n      \"min_v\": 2.3,\n      \"max_v\": 3.6,\n      \"recommended\": 3.3\n    },\n    \"modes\": {\n      \"active\": {\n        \"current_ma\": [160, 260],\n        \"note\": \"取决于 RF 功率和 CPU 负载，建议供电能力 >500mA。\"\n      },\n      \"modem_sleep\": {\n        \"current_ma\": [30, 68],\n        \"condition\": \"CPU运行，无源无线电\"\n      },\n      \"light_sleep\": {\n        \"current_ma\": 0.8,\n        \"wakeup_latency_us\": 50\n      },\n      \"deep_sleep\": {\n        \"current_ua\": 10,\n        \"requirement\": \"进入前须调用 gpio_hold_en() 锁定引脚状态防止漏电。\"\n      },\n      \"hibernation\": {\n        \"current_ua\": 5,\n        \"note\": \"仅 RTC 定时器工作，基本关闭所有内存。\"\n      }\n    }\n  },\n\n  \"storage\": {\n    \"flash_modes\": {\n      \"QIO\": {\n        \"pins_required\": 4,\n        \"speed\": \"HIGHEST\",\n        \"hardware_req\": \"必须连接 GPIO 9(WP) 和 10(HD)\"\n      },\n      \"DIO\": {\n        \"pins_required\": 2,\n        \"speed\": \"STABLE\",\n        \"note\": \"最通用的模式，兼容性最高\"\n      }\n    },\n    \"flash_voltage_warning\": \"若使用 3.3V Flash，须确保 GPIO 12 在启动瞬间不被外部电路拉高，否则 Flash 会因 1.8V 供电不足而无法加载程序。\"\n  },\n\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [32, 33, 34, 35, 36, 37, 38, 39],\n      \"adc2\": [0, 2, 4, 12, 13, 14, 15, 25, 26, 27],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"Wi-Fi 开启时 ADC2 无法使用，请优先选用 ADC1 引脚。\"\n      }\n    },\n    \"dac\": [25, 26],\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 1, \"rx\": 3, \"role\": \"Flash/Debug\" }\n    }\n  },\n\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 6-11 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 Flash 专用引脚的操作，这将导致系统 Crash。\"\n    },\n    {\n      \"id\": \"WARN_INPUT_ONLY\",\n      \"condition\": \"GPIO 34-39 configured as OUTPUT\",\n      \"level\": \"ERROR\",\n      \"message\": \"GPIO 34-39 物理上不支持输出模式。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_FREQ\",\n      \"condition\": \"Wi-Fi enabled AND CPU Freq < 80MHz\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下主频过低将导致系统断连或崩溃。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32c3.json\n\n{\n  \"chip\": \"esp32c3\",\n  \"series\": \"ESP32-C3\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 21],\n    \"total_gpios\": 22,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C3 没有独立的纯输入 GPIO 域，但保留引脚和启动引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [12, 13, 14, 15, 16, 17],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 12-17 为内部 SPI Flash 保留引脚，不能作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9],\n      \"critical_logic\": {\n        \"2\": \"启动配置相关引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置相关引脚；上电瞬间不宜被外设强驱动。\",\n        \"9\": \"下载/启动相关引脚；错误外部电平会导致无法正常启动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4],\n      \"adc2\": [5],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C3 打开 Wi-Fi 时，ADC2 资源会被占用，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 21, \"rx\": 20, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 12-17 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C3 SPI Flash 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32c5.json\n\n{\n  \"chip\": \"esp32c5\",\n  \"series\": \"ESP32-C5\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 28],\n    \"total_gpios\": 29,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C5 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚与 SPI0/1 保留引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27, 28],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO23-28 通常用于 SPI0/1（常见为 SPI Flash/封装内存），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9, 24, 25],\n      \"critical_logic\": {\n        \"2\": \"启动配置引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置引脚；错误电平可能导致启动模式异常。\",\n        \"9\": \"下载/启动相关引脚；上电期间不宜被外设强驱动。\",\n        \"24\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\",\n        \"25\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C5 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为公开资料主要聚焦 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-28 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C5 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C5 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32c6.json\n\n{\n  \"chip\": \"esp32c6\",\n  \"series\": \"ESP32-C6\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 30],\n    \"total_gpios\": 31,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C6 没有经典 ESP32 风格的纯输入 GPIO 域，但仍需避免误用启动引脚和 SPI0/1 保留引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [24, 25, 26, 27, 28, 29, 30],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO24-30 通常用于 SPI0/1（常见为 SPI Flash），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [4, 5, 8, 9, 15],\n      \"critical_logic\": {\n        \"4\": \"启动配置引脚；上电时的外部电平会影响启动与调试行为。\",\n        \"5\": \"启动配置引脚；与上电启动判定相关，外部强驱动需谨慎。\",\n        \"8\": \"启动配置引脚；错误上下拉可能导致下载或启动行为异常。\",\n        \"9\": \"启动配置引脚；外部电平会影响启动模式选择。\",\n        \"15\": \"启动配置引脚；上电期间不宜被外设强驱动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C6 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为官方 GPIO/ADC 文档主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 24-30 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C6 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C6 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32h2.json\n\n{\n  \"chip\": \"esp32h2\",\n  \"series\": \"ESP32-H2\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 27],\n    \"total_gpios\": 28,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-H2 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚、USB/JTAG 引脚和封装内存相关引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27],\n      \"interface\": \"FSPI/SiP Flash\",\n      \"warning\": \"根据 ESP32-H2 GPIO 与硬件设计文档，GPIO23-27 与封装内 Flash/FSPI/USB-JTAG 复用关系密切；在通用项目中应优先视为保留引脚。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 8, 9, 25],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；上电外部电平会影响调试接口选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试行为。\",\n        \"8\": \"Boot strap 引脚；与 GPIO9 组合决定下载/启动模式。\",\n        \"9\": \"Boot strap 引脚；默认建议上拉，且不应外挂大电容，否则可能误入下载模式。\",\n        \"25\": \"Strapping 引脚；同时与 FSPI/封装内存复用，外部强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"802.15.4/BLE\",\n        \"warning\": \"ESP32-H2 当前规则库未启用 ADC2 无线冲突审计，公开资料主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 24, \"rx\": 23, \"role\": \"Console/Download (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-27 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-H2 FSPI/封装内存相关引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-H2 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32p4.json\n\n{\n  \"chip\": \"esp32p4\",\n  \"series\": \"ESP32-P4\",\n  \"arch\": \"RISC-V Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 54],\n    \"total_gpios\": 55,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-P4 以高性能外设/HMI 为主，没有经典 ESP32 风格的纯输入域，但仍需避免误用启动与 SPI0/1 相关引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档与公开资料，ESP32-P4 的部分高编号 IO 会保留给 SPI0/1 Flash/PSRAM 通路；这里先采用保守审计策略。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 4, 5],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；启动瞬间被拉低会影响调试路径选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；外部电平会影响上电行为。\",\n        \"4\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试状态。\",\n        \"5\": \"JTAG/启动相关配置引脚；上电时外设强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-P4 不带片上 Wi-Fi/BT，本规则库当前不启用 ADC/Wi-Fi 冲突审计。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 37, \"rx\": 38, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-31 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-P4 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"JTAG/boot strap pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-P4 的 JTAG/启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.4:dist/data/soc/esp32s3.json\n\n{\n  \"chip\": \"esp32s3\",\n  \"series\": \"ESP32-S3\",\n  \"arch\": \"Xtensa LX7 Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 48],\n    \"total_gpios\": 49,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-S3 没有经典 ESP32 那种 34-39 纯输入域，但仍需避免将保留引脚用于普通 GPIO。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31, 32],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 26-32 通常连接 SPI Flash/PSRAM。部分八线 Flash/PSRAM 变体还会继续占用更高编号引脚，因此量产板卡务必结合原理图确认。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 3, 45, 46],\n      \"critical_logic\": {\n        \"0\": \"下载模式相关启动引脚；上电时外部强拉会改变启动行为。\",\n        \"3\": \"JTAG/启动相关配置引脚；启动瞬间电平会影响调试与启动行为。\",\n        \"45\": \"启动配置相关引脚；外部驱动可能影响电源域或启动模式。\",\n        \"46\": \"启动配置相关引脚；常用于下载/启动判定，外部强拉需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n      \"adc2\": [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-S3 在 Wi-Fi 打开时，ADC2 读数会受到占用影响，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 43, \"rx\": 44, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-32 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-S3 SPI Flash/PSRAM 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-S3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nArchive v0.0.3: 37 files, 51021 bytes\n\nFiles: dist/build/AsyncBuildManager.d.ts (722b), dist/build/AsyncBuildManager.js (7843b), dist/build/PartitionAdvisor.d.ts (1304b), dist/build/PartitionAdvisor.js (9434b), dist/build/PinmuxAuditor.d.ts (1583b), dist/build/PinmuxAuditor.js (18411b), dist/common/PatchSuggestion.d.ts (367b), dist/common/PatchSuggestion.js (369b), dist/data/soc/esp32.json (4041b), dist/data/soc/esp32c3.json (1973b), dist/data/soc/esp32c5.json (2122b), dist/data/soc/esp32c6.json (2106b), dist/data/soc/esp32h2.json (2208b), dist/data/soc/esp32p4.json (2035b), dist/data/soc/esp32s3.json (2271b), dist/env/index.d.ts (938b), dist/env/index.js (4707b), dist/index.d.ts (4446b), dist/index.js (6782b), dist/monitor/FlashMonitorManager.d.ts (1069b), dist/monitor/FlashMonitorManager.js (6724b), dist/monitor/MonitorAnalyzer.d.ts (636b), dist/monitor/MonitorAnalyzer.js (2691b), dist/monitor/PanicDecoder.d.ts (1115b), dist/monitor/PanicDecoder.js (6455b), dist/registry/ComponentManifest.d.ts (680b), dist/registry/ComponentManifest.js (6327b), dist/registry/ComponentRegistry.d.ts (1016b), dist/registry/ComponentRegistry.js (4679b), dist/search/ProjectNavigator.d.ts (960b), dist/search/ProjectNavigator.js (5192b), dist/workflow/ExecutionOrchestrator.d.ts (1040b), dist/workflow/ExecutionOrchestrator.js (2499b), package.json (161b), scripts/run-tool.mjs (2913b), SKILL.md (7615b), _meta.json (134b)\n\nFile v0.0.3:SKILL.md\n\n---\nname: claw-esp-expert\ndescription: \"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🦞\",\n        \"requires\": { \"bins\": [\"node\", \"idf.py\"] },\n        \"category\": \"developer-tools\",\n      },\n  }\n---\n\n# Claw ESP Expert\n\nUse this skill when the user needs help with ESP-IDF environment checks, example discovery, pin safety review, or build diagnostics.\n\n## What this bundle includes\n\nThis ClawHub-facing bundle exposes nine stable MVP tools:\n\n- `manage_env`\n- `explore_demo`\n- `resolve_component`\n- `analyze_partitions`\n- `decode_panic`\n- `analyze_monitor`\n- `flash_and_monitor`\n- `execute_project`\n- `safe_build`\n\nThese tools are implemented in the bundled runtime and are invoked through `scripts/run-tool.mjs`.\n\n## Safety contract\n\n- Treat this skill as a **diagnostic-first** ESP-IDF expert.\n- Default to **check and explain**, not silent modification.\n- Do not claim support for fully autonomous repair, deep serial-port management, or HIL automation unless the repository actually implements them.\n- Do not invent additional tools beyond the ones listed in this file.\n- Do not read arbitrary local config files unless the user explicitly asks; the MVP bundle does not require VS Code config scanning.\n- Do not modify project files or system permissions unless the user clearly asks for that action.\n\n## Tool contract\n\n### `manage_env`\nPurpose:\n- inspect local ESP-IDF availability\n- report `$IDF_PATH`, common install paths, `python/python3`, and `idf.py` availability\n- when explicitly asked, return mirror-aware manual installation guidance instead of running upstream install scripts automatically\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin\n```\n\n### `explore_demo`\nPurpose:\n- inspect local `$IDF_PATH/examples`\n- find matching demos by keyword\n- read the best matching `README.md` / `README_CN.md`\n- summarize hardware requirements and structure\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin\n```\n\n### `safe_build`\nPurpose:\n- run GPIO safety audit before build\n- reject fatal pin conflicts early\n- invoke `idf.py build` only after the audit passes\n- return structured build diagnostics, including partition overflow, memory overflow, missing headers, component resolution failures, config issues, and link errors\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin\n```\n\n### `analyze_partitions`\nPurpose:\n- parse `partitions.csv` from the current ESP-IDF project\n- identify the most likely app partition (`factory` / `ota_0`)\n- combine partition table data with overflow logs\n- return a recommended expanded partition size and an updated CSV draft\n- return a structured patch-style before/after suggestion for `partitions.csv`\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Part '\\''factory'\\'' ... overflow 0x20000\"}' | node scripts/run-tool.mjs analyze_partitions --stdin\n```\n\n### `decode_panic`\nPurpose:\n- parse ESP-IDF panic logs\n- extract exception reason, registers, and backtrace addresses\n- call the correct `addr2line` tool for Xtensa or RISC-V chips\n- return decoded source locations from the ELF file\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"Guru Meditation Error...\"}' | node scripts/run-tool.mjs decode_panic --stdin\n```\n\n### `analyze_monitor`\nPurpose:\n- inspect raw `idf.py monitor` output\n- detect panic/backtrace markers automatically\n- return the recent log excerpt\n- trigger panic decoding when an ELF path is available\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"...monitor output...\"}' | node scripts/run-tool.mjs analyze_monitor --stdin\n```\n\n### `flash_and_monitor`\nPurpose:\n- run `idf.py flash monitor`\n- capture combined stdout/stderr\n- analyze the resulting monitor log\n- automatically trigger panic decoding when panic markers appear and an ELF path is available\n- return stage status, stage summary, timeout info, recent log tail, and common serial/tool failure categories\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs flash_and_monitor --stdin\n```\n\n### `execute_project`\nPurpose:\n- run the minimum execution loop for an ESP-IDF project\n- perform hardware audit first\n- build the project\n- then run `flash_and_monitor`\n- return a single structured result for the whole flow\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs execute_project --stdin\n```\n\n### `resolve_component`\nPurpose:\n- query the official ESP Component Registry\n- prefer `espressif/*` when an official component is a strong match\n- suggest the best-matching component from official registry data\n- generate a minimal `idf_component.yml` dependency snippet\n- optionally merge that dependency into an existing manifest draft\n- return a structured patch-style before/after suggestion for the manifest\n- surface component docs, supported targets, and the matching version\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"led_strip\",\"target\":\"esp32s3\"}' | node scripts/run-tool.mjs resolve_component --stdin\n```\n\n## Runtime notes\n\n- `manage_env` can succeed even when ESP-IDF is not installed, because reporting `NOT_FOUND` is a valid diagnostic result.\n- `manage_env({ action: \"install\" })` returns manual install guidance; it does not clone repositories or run upstream install scripts inside the skill bundle.\n- `resolve_component` uses the official ESP Component Registry over the network and should be treated as an explicit online lookup step.\n- `decode_panic` needs the matching ELF file and a working `addr2line` binary from the ESP-IDF toolchain.\n- `analyze_monitor` is still log-driven; it does not open serial ports by itself in this MVP.\n- `flash_and_monitor` does execute `idf.py flash monitor`, so the serial port, permissions, and toolchain environment must already be working.\n- `safe_build` depends on a shell environment where `idf.py` is executable.\n- The current hardware rules cover `esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, and `esp32p4`.\n- Common SKU names are normalized to family rules, for example `ESP32-C6FH4 -> esp32c6` and `ESP32-S3-PICO-1-N8R2 -> esp32s3`.\n- Audit results can include `file`, `line`, and `evidence` fields so the host can point back to the exact source location.\n- The pin audit can resolve several common patterns beyond direct literals, including `pin_bit_mask`, common `..._io_num` fields, macro chains, simple assignment aliases, and `#define` / `const gpio_num_t` aliases.\n- Pass user-controlled text through stdin JSON, not shell interpolation.\n\n## Files\n\n- `scripts/run-tool.mjs` — minimal stdin-driven tool runner for ClawHub-safe execution\n- `package.json` — runtime Node dependency manifest for the published skill bundle\n- `dist/index.js` — bundled runtime entry\n- `dist/data/soc/*.json` — current SoC rules database (`esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, `esp32p4`)\n\n## Out of scope for this MVP bundle\n\nThe following ideas are roadmap items, not current bundle guarantees:\n\n- automatic `idf_component.yml` maintenance\n- automatic `partitions.csv` edits\n- deep serial-port management UX\n- HIL automation with `pytest-embedded`\n\nFile v0.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn75ymnxwcbqm3tzdzdgfpkqp582w35g\",\n  \"slug\": \"claw-esp-expert\",\n  \"version\": \"0.0.3\",\n  \"publishedAt\": 1773914487792\n}\n\nFile v0.0.3:dist/data/soc/esp32.json\n\n{\n  \"chip\": \"esp32\",\n  \"series\": \"Classic ESP32 (Dual-core / Single-core)\",\n  \"arch\": \"Xtensa® Dual-Core 32-bit LX6\",\n  \"vendor\": \"Espressif\",\n\n  \"physical_limits\": {\n    \"gpio_range\": [0, 39],\n    \"total_gpios\": 40,\n    \"input_only_pins\": {\n      \"pins\": [34, 35, 36, 37, 38, 39],\n      \"restriction\": \"INPUT_ONLY\",\n      \"has_internal_pull\": false,\n      \"warning\": \"这些引脚没有输出驱动能力，且缺少内部上下拉电阻。若外接按键必须加物理上拉。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [6, 7, 8, 9, 10, 11],\n      \"interface\": \"SPI_MUX\",\n      \"warning\": \"连接内部 Flash/PSRAM。代码中禁用这些 GPIO，否则触发 Cache Error 导致系统死机。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 2, 5, 12, 15],\n      \"critical_logic\": {\n        \"0\": \"Boot模式控制：启动时须为高电平；低电平进入下载模式。\",\n        \"2\": \"下载模式控制：烧录时须为低电平或悬空。\",\n        \"5\": \"SDIO定时控制：启动瞬间电平会影响硬件初始化。\",\n        \"12\": \"MTDI/Flash电压：启动时高电平设Flash为1.8V，低电平为3.3V（极易导致启动失败）。\",\n        \"15\": \"控制启动时 UART0 调试日志的输出开关。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n\n  \"performance\": {\n    \"cpu_frequency\": {\n      \"min_mhz\": 2,\n      \"max_mhz\": 240,\n      \"standard_steps\": [80, 160, 240],\n      \"constraints\": {\n        \"wifi_bt_min_mhz\": 80,\n        \"warning\": \"开启 Wi-Fi/BT 时主频不得低于 80MHz，否则协议栈崩溃。\"\n      }\n    },\n    \"bus_frequency\": {\n      \"apb_max_mhz\": 80,\n      \"note\": \"CPU降频会同步导致APB降频，需注意UART/I2C波特率偏移。\"\n    }\n  },\n\n  \"power_management\": {\n    \"voltage\": {\n      \"min_v\": 2.3,\n      \"max_v\": 3.6,\n      \"recommended\": 3.3\n    },\n    \"modes\": {\n      \"active\": {\n        \"current_ma\": [160, 260],\n        \"note\": \"取决于 RF 功率和 CPU 负载，建议供电能力 >500mA。\"\n      },\n      \"modem_sleep\": {\n        \"current_ma\": [30, 68],\n        \"condition\": \"CPU运行，无源无线电\"\n      },\n      \"light_sleep\": {\n        \"current_ma\": 0.8,\n        \"wakeup_latency_us\": 50\n      },\n      \"deep_sleep\": {\n        \"current_ua\": 10,\n        \"requirement\": \"进入前须调用 gpio_hold_en() 锁定引脚状态防止漏电。\"\n      },\n      \"hibernation\": {\n        \"current_ua\": 5,\n        \"note\": \"仅 RTC 定时器工作，基本关闭所有内存。\"\n      }\n    }\n  },\n\n  \"storage\": {\n    \"flash_modes\": {\n      \"QIO\": {\n        \"pins_required\": 4,\n        \"speed\": \"HIGHEST\",\n        \"hardware_req\": \"必须连接 GPIO 9(WP) 和 10(HD)\"\n      },\n      \"DIO\": {\n        \"pins_required\": 2,\n        \"speed\": \"STABLE\",\n        \"note\": \"最通用的模式，兼容性最高\"\n      }\n    },\n    \"flash_voltage_warning\": \"若使用 3.3V Flash，须确保 GPIO 12 在启动瞬间不被外部电路拉高，否则 Flash 会因 1.8V 供电不足而无法加载程序。\"\n  },\n\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [32, 33, 34, 35, 36, 37, 38, 39],\n      \"adc2\": [0, 2, 4, 12, 13, 14, 15, 25, 26, 27],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"Wi-Fi 开启时 ADC2 无法使用，请优先选用 ADC1 引脚。\"\n      }\n    },\n    \"dac\": [25, 26],\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 1, \"rx\": 3, \"role\": \"Flash/Debug\" }\n    }\n  },\n\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 6-11 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 Flash 专用引脚的操作，这将导致系统 Crash。\"\n    },\n    {\n      \"id\": \"WARN_INPUT_ONLY\",\n      \"condition\": \"GPIO 34-39 configured as OUTPUT\",\n      \"level\": \"ERROR\",\n      \"message\": \"GPIO 34-39 物理上不支持输出模式。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_FREQ\",\n      \"condition\": \"Wi-Fi enabled AND CPU Freq < 80MHz\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下主频过低将导致系统断连或崩溃。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32c3.json\n\n{\n  \"chip\": \"esp32c3\",\n  \"series\": \"ESP32-C3\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 21],\n    \"total_gpios\": 22,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C3 没有独立的纯输入 GPIO 域，但保留引脚和启动引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [12, 13, 14, 15, 16, 17],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 12-17 为内部 SPI Flash 保留引脚，不能作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9],\n      \"critical_logic\": {\n        \"2\": \"启动配置相关引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置相关引脚；上电瞬间不宜被外设强驱动。\",\n        \"9\": \"下载/启动相关引脚；错误外部电平会导致无法正常启动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4],\n      \"adc2\": [5],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C3 打开 Wi-Fi 时，ADC2 资源会被占用，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 21, \"rx\": 20, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 12-17 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C3 SPI Flash 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32c5.json\n\n{\n  \"chip\": \"esp32c5\",\n  \"series\": \"ESP32-C5\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 28],\n    \"total_gpios\": 29,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C5 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚与 SPI0/1 保留引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27, 28],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO23-28 通常用于 SPI0/1（常见为 SPI Flash/封装内存），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9, 24, 25],\n      \"critical_logic\": {\n        \"2\": \"启动配置引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置引脚；错误电平可能导致启动模式异常。\",\n        \"9\": \"下载/启动相关引脚；上电期间不宜被外设强驱动。\",\n        \"24\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\",\n        \"25\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C5 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为公开资料主要聚焦 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-28 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C5 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C5 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32c6.json\n\n{\n  \"chip\": \"esp32c6\",\n  \"series\": \"ESP32-C6\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 30],\n    \"total_gpios\": 31,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C6 没有经典 ESP32 风格的纯输入 GPIO 域，但仍需避免误用启动引脚和 SPI0/1 保留引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [24, 25, 26, 27, 28, 29, 30],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO24-30 通常用于 SPI0/1（常见为 SPI Flash），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [4, 5, 8, 9, 15],\n      \"critical_logic\": {\n        \"4\": \"启动配置引脚；上电时的外部电平会影响启动与调试行为。\",\n        \"5\": \"启动配置引脚；与上电启动判定相关，外部强驱动需谨慎。\",\n        \"8\": \"启动配置引脚；错误上下拉可能导致下载或启动行为异常。\",\n        \"9\": \"启动配置引脚；外部电平会影响启动模式选择。\",\n        \"15\": \"启动配置引脚；上电期间不宜被外设强驱动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C6 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为官方 GPIO/ADC 文档主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 24-30 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C6 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C6 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32h2.json\n\n{\n  \"chip\": \"esp32h2\",\n  \"series\": \"ESP32-H2\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 27],\n    \"total_gpios\": 28,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-H2 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚、USB/JTAG 引脚和封装内存相关引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27],\n      \"interface\": \"FSPI/SiP Flash\",\n      \"warning\": \"根据 ESP32-H2 GPIO 与硬件设计文档，GPIO23-27 与封装内 Flash/FSPI/USB-JTAG 复用关系密切；在通用项目中应优先视为保留引脚。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 8, 9, 25],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；上电外部电平会影响调试接口选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试行为。\",\n        \"8\": \"Boot strap 引脚；与 GPIO9 组合决定下载/启动模式。\",\n        \"9\": \"Boot strap 引脚；默认建议上拉，且不应外挂大电容，否则可能误入下载模式。\",\n        \"25\": \"Strapping 引脚；同时与 FSPI/封装内存复用，外部强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"802.15.4/BLE\",\n        \"warning\": \"ESP32-H2 当前规则库未启用 ADC2 无线冲突审计，公开资料主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 24, \"rx\": 23, \"role\": \"Console/Download (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-27 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-H2 FSPI/封装内存相关引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-H2 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32p4.json\n\n{\n  \"chip\": \"esp32p4\",\n  \"series\": \"ESP32-P4\",\n  \"arch\": \"RISC-V Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 54],\n    \"total_gpios\": 55,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-P4 以高性能外设/HMI 为主，没有经典 ESP32 风格的纯输入域，但仍需避免误用启动与 SPI0/1 相关引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档与公开资料，ESP32-P4 的部分高编号 IO 会保留给 SPI0/1 Flash/PSRAM 通路；这里先采用保守审计策略。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 4, 5],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；启动瞬间被拉低会影响调试路径选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；外部电平会影响上电行为。\",\n        \"4\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试状态。\",\n        \"5\": \"JTAG/启动相关配置引脚；上电时外设强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-P4 不带片上 Wi-Fi/BT，本规则库当前不启用 ADC/Wi-Fi 冲突审计。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 37, \"rx\": 38, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-31 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-P4 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"JTAG/boot strap pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-P4 的 JTAG/启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.3:dist/data/soc/esp32s3.json\n\n{\n  \"chip\": \"esp32s3\",\n  \"series\": \"ESP32-S3\",\n  \"arch\": \"Xtensa LX7 Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 48],\n    \"total_gpios\": 49,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-S3 没有经典 ESP32 那种 34-39 纯输入域，但仍需避免将保留引脚用于普通 GPIO。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31, 32],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 26-32 通常连接 SPI Flash/PSRAM。部分八线 Flash/PSRAM 变体还会继续占用更高编号引脚，因此量产板卡务必结合原理图确认。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 3, 45, 46],\n      \"critical_logic\": {\n        \"0\": \"下载模式相关启动引脚；上电时外部强拉会改变启动行为。\",\n        \"3\": \"JTAG/启动相关配置引脚；启动瞬间电平会影响调试与启动行为。\",\n        \"45\": \"启动配置相关引脚；外部驱动可能影响电源域或启动模式。\",\n        \"46\": \"启动配置相关引脚；常用于下载/启动判定，外部强拉需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n      \"adc2\": [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-S3 在 Wi-Fi 打开时，ADC2 读数会受到占用影响，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 43, \"rx\": 44, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-32 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-S3 SPI Flash/PSRAM 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-S3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nFile v0.0.3:package.json\n\n{\n  \"name\": \"claw-esp-expert-skill-bundle\",\n  \"private\": true,\n  \"dependencies\": {\n    \"axios\": \"^1.6.0\",\n    \"execa\": \"^8.0.1\",\n    \"fs-extra\": \"^11.1.1\"\n  }\n}\n\nArchive v0.0.2: 36 files, 50748 bytes\n\nFiles: dist/build/AsyncBuildManager.d.ts (722b), dist/build/AsyncBuildManager.js (7843b), dist/build/PartitionAdvisor.d.ts (1304b), dist/build/PartitionAdvisor.js (9434b), dist/build/PinmuxAuditor.d.ts (1583b), dist/build/PinmuxAuditor.js (18411b), dist/common/PatchSuggestion.d.ts (367b), dist/common/PatchSuggestion.js (369b), dist/data/soc/esp32.json (4041b), dist/data/soc/esp32c3.json (1973b), dist/data/soc/esp32c5.json (2122b), dist/data/soc/esp32c6.json (2106b), dist/data/soc/esp32h2.json (2208b), dist/data/soc/esp32p4.json (2035b), dist/data/soc/esp32s3.json (2271b), dist/env/index.d.ts (938b), dist/env/index.js (4707b), dist/index.d.ts (4446b), dist/index.js (6782b), dist/monitor/FlashMonitorManager.d.ts (1069b), dist/monitor/FlashMonitorManager.js (6724b), dist/monitor/MonitorAnalyzer.d.ts (636b), dist/monitor/MonitorAnalyzer.js (2691b), dist/monitor/PanicDecoder.d.ts (1115b), dist/monitor/PanicDecoder.js (6455b), dist/registry/ComponentManifest.d.ts (680b), dist/registry/ComponentManifest.js (6327b), dist/registry/ComponentRegistry.d.ts (1016b), dist/registry/ComponentRegistry.js (4679b), dist/search/ProjectNavigator.d.ts (960b), dist/search/ProjectNavigator.js (5192b), dist/workflow/ExecutionOrchestrator.d.ts (1040b), dist/workflow/ExecutionOrchestrator.js (2499b), scripts/run-tool.mjs (2913b), SKILL.md (7530b), _meta.json (134b)\n\nFile v0.0.2:SKILL.md\n\n---\nname: claw-esp-expert\ndescription: \"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🦞\",\n        \"requires\": { \"bins\": [\"node\", \"idf.py\"] },\n        \"category\": \"developer-tools\",\n      },\n  }\n---\n\n# Claw ESP Expert\n\nUse this skill when the user needs help with ESP-IDF environment checks, example discovery, pin safety review, or build diagnostics.\n\n## What this bundle includes\n\nThis ClawHub-facing bundle exposes nine stable MVP tools:\n\n- `manage_env`\n- `explore_demo`\n- `resolve_component`\n- `analyze_partitions`\n- `decode_panic`\n- `analyze_monitor`\n- `flash_and_monitor`\n- `execute_project`\n- `safe_build`\n\nThese tools are implemented in the bundled runtime and are invoked through `scripts/run-tool.mjs`.\n\n## Safety contract\n\n- Treat this skill as a **diagnostic-first** ESP-IDF expert.\n- Default to **check and explain**, not silent modification.\n- Do not claim support for fully autonomous repair, deep serial-port management, or HIL automation unless the repository actually implements them.\n- Do not invent additional tools beyond the ones listed in this file.\n- Do not read arbitrary local config files unless the user explicitly asks; the MVP bundle does not require VS Code config scanning.\n- Do not modify project files or system permissions unless the user clearly asks for that action.\n\n## Tool contract\n\n### `manage_env`\nPurpose:\n- inspect local ESP-IDF availability\n- report `$IDF_PATH`, common install paths, `python/python3`, and `idf.py` availability\n- when explicitly asked, return mirror-aware manual installation guidance instead of running upstream install scripts automatically\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin\n```\n\n### `explore_demo`\nPurpose:\n- inspect local `$IDF_PATH/examples`\n- find matching demos by keyword\n- read the best matching `README.md` / `README_CN.md`\n- summarize hardware requirements and structure\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin\n```\n\n### `safe_build`\nPurpose:\n- run GPIO safety audit before build\n- reject fatal pin conflicts early\n- invoke `idf.py build` only after the audit passes\n- return structured build diagnostics, including partition overflow, memory overflow, missing headers, component resolution failures, config issues, and link errors\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin\n```\n\n### `analyze_partitions`\nPurpose:\n- parse `partitions.csv` from the current ESP-IDF project\n- identify the most likely app partition (`factory` / `ota_0`)\n- combine partition table data with overflow logs\n- return a recommended expanded partition size and an updated CSV draft\n- return a structured patch-style before/after suggestion for `partitions.csv`\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Part '\\''factory'\\'' ... overflow 0x20000\"}' | node scripts/run-tool.mjs analyze_partitions --stdin\n```\n\n### `decode_panic`\nPurpose:\n- parse ESP-IDF panic logs\n- extract exception reason, registers, and backtrace addresses\n- call the correct `addr2line` tool for Xtensa or RISC-V chips\n- return decoded source locations from the ELF file\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"Guru Meditation Error...\"}' | node scripts/run-tool.mjs decode_panic --stdin\n```\n\n### `analyze_monitor`\nPurpose:\n- inspect raw `idf.py monitor` output\n- detect panic/backtrace markers automatically\n- return the recent log excerpt\n- trigger panic decoding when an ELF path is available\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"...monitor output...\"}' | node scripts/run-tool.mjs analyze_monitor --stdin\n```\n\n### `flash_and_monitor`\nPurpose:\n- run `idf.py flash monitor`\n- capture combined stdout/stderr\n- analyze the resulting monitor log\n- automatically trigger panic decoding when panic markers appear and an ELF path is available\n- return stage status, stage summary, timeout info, recent log tail, and common serial/tool failure categories\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs flash_and_monitor --stdin\n```\n\n### `execute_project`\nPurpose:\n- run the minimum execution loop for an ESP-IDF project\n- perform hardware audit first\n- build the project\n- then run `flash_and_monitor`\n- return a single structured result for the whole flow\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs execute_project --stdin\n```\n\n### `resolve_component`\nPurpose:\n- query the official ESP Component Registry\n- prefer `espressif/*` when an official component is a strong match\n- suggest the best-matching component from official registry data\n- generate a minimal `idf_component.yml` dependency snippet\n- optionally merge that dependency into an existing manifest draft\n- return a structured patch-style before/after suggestion for the manifest\n- surface component docs, supported targets, and the matching version\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"led_strip\",\"target\":\"esp32s3\"}' | node scripts/run-tool.mjs resolve_component --stdin\n```\n\n## Runtime notes\n\n- `manage_env` can succeed even when ESP-IDF is not installed, because reporting `NOT_FOUND` is a valid diagnostic result.\n- `manage_env({ action: \"install\" })` returns manual install guidance; it does not clone repositories or run upstream install scripts inside the skill bundle.\n- `resolve_component` uses the official ESP Component Registry over the network and should be treated as an explicit online lookup step.\n- `decode_panic` needs the matching ELF file and a working `addr2line` binary from the ESP-IDF toolchain.\n- `analyze_monitor` is still log-driven; it does not open serial ports by itself in this MVP.\n- `flash_and_monitor` does execute `idf.py flash monitor`, so the serial port, permissions, and toolchain environment must already be working.\n- `safe_build` depends on a shell environment where `idf.py` is executable.\n- The current hardware rules cover `esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, and `esp32p4`.\n- Common SKU names are normalized to family rules, for example `ESP32-C6FH4 -> esp32c6` and `ESP32-S3-PICO-1-N8R2 -> esp32s3`.\n- Audit results can include `file`, `line`, and `evidence` fields so the host can point back to the exact source location.\n- The pin audit can resolve several common patterns beyond direct literals, including `pin_bit_mask`, common `..._io_num` fields, macro chains, simple assignment aliases, and `#define` / `const gpio_num_t` aliases.\n- Pass user-controlled text through stdin JSON, not shell interpolation.\n\n## Files\n\n- `scripts/run-tool.mjs` — minimal stdin-driven tool runner for ClawHub-safe execution\n- `dist/index.js` — bundled runtime entry\n- `dist/data/soc/*.json` — current SoC rules database (`esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, `esp32p4`)\n\n## Out of scope for this MVP bundle\n\nThe following ideas are roadmap items, not current bundle guarantees:\n\n- automatic `idf_component.yml` maintenance\n- automatic `partitions.csv` edits\n- deep serial-port management UX\n- HIL automation with `pytest-embedded`\n\nFile v0.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn75ymnxwcbqm3tzdzdgfpkqp582w35g\",\n  \"slug\": \"claw-esp-expert\",\n  \"version\": \"0.0.2\",\n  \"publishedAt\": 1773914147526\n}\n\nFile v0.0.2:dist/data/soc/esp32.json\n\n{\n  \"chip\": \"esp32\",\n  \"series\": \"Classic ESP32 (Dual-core / Single-core)\",\n  \"arch\": \"Xtensa® Dual-Core 32-bit LX6\",\n  \"vendor\": \"Espressif\",\n\n  \"physical_limits\": {\n    \"gpio_range\": [0, 39],\n    \"total_gpios\": 40,\n    \"input_only_pins\": {\n      \"pins\": [34, 35, 36, 37, 38, 39],\n      \"restriction\": \"INPUT_ONLY\",\n      \"has_internal_pull\": false,\n      \"warning\": \"这些引脚没有输出驱动能力，且缺少内部上下拉电阻。若外接按键必须加物理上拉。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [6, 7, 8, 9, 10, 11],\n      \"interface\": \"SPI_MUX\",\n      \"warning\": \"连接内部 Flash/PSRAM。代码中禁用这些 GPIO，否则触发 Cache Error 导致系统死机。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 2, 5, 12, 15],\n      \"critical_logic\": {\n        \"0\": \"Boot模式控制：启动时须为高电平；低电平进入下载模式。\",\n        \"2\": \"下载模式控制：烧录时须为低电平或悬空。\",\n        \"5\": \"SDIO定时控制：启动瞬间电平会影响硬件初始化。\",\n        \"12\": \"MTDI/Flash电压：启动时高电平设Flash为1.8V，低电平为3.3V（极易导致启动失败）。\",\n        \"15\": \"控制启动时 UART0 调试日志的输出开关。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n\n  \"performance\": {\n    \"cpu_frequency\": {\n      \"min_mhz\": 2,\n      \"max_mhz\": 240,\n      \"standard_steps\": [80, 160, 240],\n      \"constraints\": {\n        \"wifi_bt_min_mhz\": 80,\n        \"warning\": \"开启 Wi-Fi/BT 时主频不得低于 80MHz，否则协议栈崩溃。\"\n      }\n    },\n    \"bus_frequency\": {\n      \"apb_max_mhz\": 80,\n      \"note\": \"CPU降频会同步导致APB降频，需注意UART/I2C波特率偏移。\"\n    }\n  },\n\n  \"power_management\": {\n    \"voltage\": {\n      \"min_v\": 2.3,\n      \"max_v\": 3.6,\n      \"recommended\": 3.3\n    },\n    \"modes\": {\n      \"active\": {\n        \"current_ma\": [160, 260],\n        \"note\": \"取决于 RF 功率和 CPU 负载，建议供电能力 >500mA。\"\n      },\n      \"modem_sleep\": {\n        \"current_ma\": [30, 68],\n        \"condition\": \"CPU运行，无源无线电\"\n      },\n      \"light_sleep\": {\n        \"current_ma\": 0.8,\n        \"wakeup_latency_us\": 50\n      },\n      \"deep_sleep\": {\n        \"current_ua\": 10,\n        \"requirement\": \"进入前须调用 gpio_hold_en() 锁定引脚状态防止漏电。\"\n      },\n      \"hibernation\": {\n        \"current_ua\": 5,\n        \"note\": \"仅 RTC 定时器工作，基本关闭所有内存。\"\n      }\n    }\n  },\n\n  \"storage\": {\n    \"flash_modes\": {\n      \"QIO\": {\n        \"pins_required\": 4,\n        \"speed\": \"HIGHEST\",\n        \"hardware_req\": \"必须连接 GPIO 9(WP) 和 10(HD)\"\n      },\n      \"DIO\": {\n        \"pins_required\": 2,\n        \"speed\": \"STABLE\",\n        \"note\": \"最通用的模式，兼容性最高\"\n      }\n    },\n    \"flash_voltage_warning\": \"若使用 3.3V Flash，须确保 GPIO 12 在启动瞬间不被外部电路拉高，否则 Flash 会因 1.8V 供电不足而无法加载程序。\"\n  },\n\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [32, 33, 34, 35, 36, 37, 38, 39],\n      \"adc2\": [0, 2, 4, 12, 13, 14, 15, 25, 26, 27],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"Wi-Fi 开启时 ADC2 无法使用，请优先选用 ADC1 引脚。\"\n      }\n    },\n    \"dac\": [25, 26],\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 1, \"rx\": 3, \"role\": \"Flash/Debug\" }\n    }\n  },\n\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 6-11 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 Flash 专用引脚的操作，这将导致系统 Crash。\"\n    },\n    {\n      \"id\": \"WARN_INPUT_ONLY\",\n      \"condition\": \"GPIO 34-39 configured as OUTPUT\",\n      \"level\": \"ERROR\",\n      \"message\": \"GPIO 34-39 物理上不支持输出模式。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_FREQ\",\n      \"condition\": \"Wi-Fi enabled AND CPU Freq < 80MHz\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下主频过低将导致系统断连或崩溃。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32c3.json\n\n{\n  \"chip\": \"esp32c3\",\n  \"series\": \"ESP32-C3\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 21],\n    \"total_gpios\": 22,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C3 没有独立的纯输入 GPIO 域，但保留引脚和启动引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [12, 13, 14, 15, 16, 17],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 12-17 为内部 SPI Flash 保留引脚，不能作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9],\n      \"critical_logic\": {\n        \"2\": \"启动配置相关引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置相关引脚；上电瞬间不宜被外设强驱动。\",\n        \"9\": \"下载/启动相关引脚；错误外部电平会导致无法正常启动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4],\n      \"adc2\": [5],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C3 打开 Wi-Fi 时，ADC2 资源会被占用，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 21, \"rx\": 20, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 12-17 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C3 SPI Flash 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32c5.json\n\n{\n  \"chip\": \"esp32c5\",\n  \"series\": \"ESP32-C5\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 28],\n    \"total_gpios\": 29,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C5 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚与 SPI0/1 保留引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27, 28],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO23-28 通常用于 SPI0/1（常见为 SPI Flash/封装内存），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9, 24, 25],\n      \"critical_logic\": {\n        \"2\": \"启动配置引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置引脚；错误电平可能导致启动模式异常。\",\n        \"9\": \"下载/启动相关引脚；上电期间不宜被外设强驱动。\",\n        \"24\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\",\n        \"25\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C5 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为公开资料主要聚焦 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-28 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C5 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C5 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32c6.json\n\n{\n  \"chip\": \"esp32c6\",\n  \"series\": \"ESP32-C6\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 30],\n    \"total_gpios\": 31,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C6 没有经典 ESP32 风格的纯输入 GPIO 域，但仍需避免误用启动引脚和 SPI0/1 保留引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [24, 25, 26, 27, 28, 29, 30],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO24-30 通常用于 SPI0/1（常见为 SPI Flash），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [4, 5, 8, 9, 15],\n      \"critical_logic\": {\n        \"4\": \"启动配置引脚；上电时的外部电平会影响启动与调试行为。\",\n        \"5\": \"启动配置引脚；与上电启动判定相关，外部强驱动需谨慎。\",\n        \"8\": \"启动配置引脚；错误上下拉可能导致下载或启动行为异常。\",\n        \"9\": \"启动配置引脚；外部电平会影响启动模式选择。\",\n        \"15\": \"启动配置引脚；上电期间不宜被外设强驱动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C6 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为官方 GPIO/ADC 文档主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 24-30 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C6 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C6 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32h2.json\n\n{\n  \"chip\": \"esp32h2\",\n  \"series\": \"ESP32-H2\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 27],\n    \"total_gpios\": 28,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-H2 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚、USB/JTAG 引脚和封装内存相关引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27],\n      \"interface\": \"FSPI/SiP Flash\",\n      \"warning\": \"根据 ESP32-H2 GPIO 与硬件设计文档，GPIO23-27 与封装内 Flash/FSPI/USB-JTAG 复用关系密切；在通用项目中应优先视为保留引脚。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 8, 9, 25],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；上电外部电平会影响调试接口选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试行为。\",\n        \"8\": \"Boot strap 引脚；与 GPIO9 组合决定下载/启动模式。\",\n        \"9\": \"Boot strap 引脚；默认建议上拉，且不应外挂大电容，否则可能误入下载模式。\",\n        \"25\": \"Strapping 引脚；同时与 FSPI/封装内存复用，外部强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"802.15.4/BLE\",\n        \"warning\": \"ESP32-H2 当前规则库未启用 ADC2 无线冲突审计，公开资料主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 24, \"rx\": 23, \"role\": \"Console/Download (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-27 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-H2 FSPI/封装内存相关引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-H2 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32p4.json\n\n{\n  \"chip\": \"esp32p4\",\n  \"series\": \"ESP32-P4\",\n  \"arch\": \"RISC-V Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 54],\n    \"total_gpios\": 55,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-P4 以高性能外设/HMI 为主，没有经典 ESP32 风格的纯输入域，但仍需避免误用启动与 SPI0/1 相关引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档与公开资料，ESP32-P4 的部分高编号 IO 会保留给 SPI0/1 Flash/PSRAM 通路；这里先采用保守审计策略。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 4, 5],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；启动瞬间被拉低会影响调试路径选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；外部电平会影响上电行为。\",\n        \"4\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试状态。\",\n        \"5\": \"JTAG/启动相关配置引脚；上电时外设强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-P4 不带片上 Wi-Fi/BT，本规则库当前不启用 ADC/Wi-Fi 冲突审计。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 37, \"rx\": 38, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-31 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-P4 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"JTAG/boot strap pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-P4 的 JTAG/启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.2:dist/data/soc/esp32s3.json\n\n{\n  \"chip\": \"esp32s3\",\n  \"series\": \"ESP32-S3\",\n  \"arch\": \"Xtensa LX7 Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 48],\n    \"total_gpios\": 49,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-S3 没有经典 ESP32 那种 34-39 纯输入域，但仍需避免将保留引脚用于普通 GPIO。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31, 32],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 26-32 通常连接 SPI Flash/PSRAM。部分八线 Flash/PSRAM 变体还会继续占用更高编号引脚，因此量产板卡务必结合原理图确认。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 3, 45, 46],\n      \"critical_logic\": {\n        \"0\": \"下载模式相关启动引脚；上电时外部强拉会改变启动行为。\",\n        \"3\": \"JTAG/启动相关配置引脚；启动瞬间电平会影响调试与启动行为。\",\n        \"45\": \"启动配置相关引脚；外部驱动可能影响电源域或启动模式。\",\n        \"46\": \"启动配置相关引脚；常用于下载/启动判定，外部强拉需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n      \"adc2\": [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-S3 在 Wi-Fi 打开时，ADC2 读数会受到占用影响，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 43, \"rx\": 44, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-32 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-S3 SPI Flash/PSRAM 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-S3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nArchive v0.0.1: 36 files, 50486 bytes\n\nFiles: dist/build/AsyncBuildManager.d.ts (722b), dist/build/AsyncBuildManager.js (7843b), dist/build/PartitionAdvisor.d.ts (1304b), dist/build/PartitionAdvisor.js (9434b), dist/build/PinmuxAuditor.d.ts (1583b), dist/build/PinmuxAuditor.js (18411b), dist/common/PatchSuggestion.d.ts (367b), dist/common/PatchSuggestion.js (369b), dist/data/soc/esp32.json (4041b), dist/data/soc/esp32c3.json (1973b), dist/data/soc/esp32c5.json (2122b), dist/data/soc/esp32c6.json (2106b), dist/data/soc/esp32h2.json (2208b), dist/data/soc/esp32p4.json (2035b), dist/data/soc/esp32s3.json (2271b), dist/env/index.d.ts (746b), dist/env/index.js (4151b), dist/index.d.ts (4318b), dist/index.js (6782b), dist/monitor/FlashMonitorManager.d.ts (1069b), dist/monitor/FlashMonitorManager.js (6724b), dist/monitor/MonitorAnalyzer.d.ts (636b), dist/monitor/MonitorAnalyzer.js (2691b), dist/monitor/PanicDecoder.d.ts (1115b), dist/monitor/PanicDecoder.js (6455b), dist/registry/ComponentManifest.d.ts (680b), dist/registry/ComponentManifest.js (6327b), dist/registry/ComponentRegistry.d.ts (1016b), dist/registry/ComponentRegistry.js (4679b), dist/search/ProjectNavigator.d.ts (960b), dist/search/ProjectNavigator.js (5192b), dist/workflow/ExecutionOrchestrator.d.ts (1040b), dist/workflow/ExecutionOrchestrator.js (2499b), scripts/run-tool.mjs (2913b), SKILL.md (7297b), _meta.json (134b)\n\nFile v0.0.1:SKILL.md\n\n---\nname: claw-esp-expert\ndescription: \"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🦞\",\n        \"requires\": { \"bins\": [\"node\"] },\n        \"category\": \"developer-tools\",\n      },\n  }\n---\n\n# Claw ESP Expert\n\nUse this skill when the user needs help with ESP-IDF environment checks, example discovery, pin safety review, or build diagnostics.\n\n## What this bundle includes\n\nThis ClawHub-facing bundle exposes nine stable MVP tools:\n\n- `manage_env`\n- `explore_demo`\n- `resolve_component`\n- `analyze_partitions`\n- `decode_panic`\n- `analyze_monitor`\n- `flash_and_monitor`\n- `execute_project`\n- `safe_build`\n\nThese tools are implemented in the bundled runtime and are invoked through `scripts/run-tool.mjs`.\n\n## Safety contract\n\n- Treat this skill as a **diagnostic-first** ESP-IDF expert.\n- Default to **check and explain**, not silent modification.\n- Do not claim support for fully autonomous repair, deep serial-port management, or HIL automation unless the repository actually implements them.\n- Do not invent additional tools beyond the ones listed in this file.\n- Do not read arbitrary local config files unless the user explicitly asks; the MVP bundle does not require VS Code config scanning.\n- Do not modify project files or system permissions unless the user clearly asks for that action.\n\n## Tool contract\n\n### `manage_env`\nPurpose:\n- inspect local ESP-IDF availability\n- report `$IDF_PATH`, common install paths, `python/python3`, and `idf.py` availability\n- optionally start the installer flow when the user explicitly asks\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin\n```\n\n### `explore_demo`\nPurpose:\n- inspect local `$IDF_PATH/examples`\n- find matching demos by keyword\n- read the best matching `README.md` / `README_CN.md`\n- summarize hardware requirements and structure\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin\n```\n\n### `safe_build`\nPurpose:\n- run GPIO safety audit before build\n- reject fatal pin conflicts early\n- invoke `idf.py build` only after the audit passes\n- return structured build diagnostics, including partition overflow, memory overflow, missing headers, component resolution failures, config issues, and link errors\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin\n```\n\n### `analyze_partitions`\nPurpose:\n- parse `partitions.csv` from the current ESP-IDF project\n- identify the most likely app partition (`factory` / `ota_0`)\n- combine partition table data with overflow logs\n- return a recommended expanded partition size and an updated CSV draft\n- return a structured patch-style before/after suggestion for `partitions.csv`\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Part '\\''factory'\\'' ... overflow 0x20000\"}' | node scripts/run-tool.mjs analyze_partitions --stdin\n```\n\n### `decode_panic`\nPurpose:\n- parse ESP-IDF panic logs\n- extract exception reason, registers, and backtrace addresses\n- call the correct `addr2line` tool for Xtensa or RISC-V chips\n- return decoded source locations from the ELF file\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"Guru Meditation Error...\"}' | node scripts/run-tool.mjs decode_panic --stdin\n```\n\n### `analyze_monitor`\nPurpose:\n- inspect raw `idf.py monitor` output\n- detect panic/backtrace markers automatically\n- return the recent log excerpt\n- trigger panic decoding when an ELF path is available\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"...monitor output...\"}' | node scripts/run-tool.mjs analyze_monitor --stdin\n```\n\n### `flash_and_monitor`\nPurpose:\n- run `idf.py flash monitor`\n- capture combined stdout/stderr\n- analyze the resulting monitor log\n- automatically trigger panic decoding when panic markers appear and an ELF path is available\n- return stage status, stage summary, timeout info, recent log tail, and common serial/tool failure categories\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs flash_and_monitor --stdin\n```\n\n### `execute_project`\nPurpose:\n- run the minimum execution loop for an ESP-IDF project\n- perform hardware audit first\n- build the project\n- then run `flash_and_monitor`\n- return a single structured result for the whole flow\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32s3\",\"port\":\"/dev/ttyUSB0\"}' | node scripts/run-tool.mjs execute_project --stdin\n```\n\n### `resolve_component`\nPurpose:\n- query the official ESP Component Registry\n- prefer `espressif/*` when an official component is a strong match\n- suggest the best-matching component from official registry data\n- generate a minimal `idf_component.yml` dependency snippet\n- optionally merge that dependency into an existing manifest draft\n- return a structured patch-style before/after suggestion for the manifest\n- surface component docs, supported targets, and the matching version\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"led_strip\",\"target\":\"esp32s3\"}' | node scripts/run-tool.mjs resolve_component --stdin\n```\n\n## Runtime notes\n\n- `manage_env` can succeed even when ESP-IDF is not installed, because reporting `NOT_FOUND` is a valid diagnostic result.\n- `resolve_component` uses the official ESP Component Registry over the network and should be treated as an explicit online lookup step.\n- `decode_panic` needs the matching ELF file and a working `addr2line` binary from the ESP-IDF toolchain.\n- `analyze_monitor` is still log-driven; it does not open serial ports by itself in this MVP.\n- `flash_and_monitor` does execute `idf.py flash monitor`, so the serial port, permissions, and toolchain environment must already be working.\n- `safe_build` depends on a shell environment where `idf.py` is executable.\n- The current hardware rules cover `esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, and `esp32p4`.\n- Common SKU names are normalized to family rules, for example `ESP32-C6FH4 -> esp32c6` and `ESP32-S3-PICO-1-N8R2 -> esp32s3`.\n- Audit results can include `file`, `line`, and `evidence` fields so the host can point back to the exact source location.\n- The pin audit can resolve several common patterns beyond direct literals, including `pin_bit_mask`, common `..._io_num` fields, macro chains, simple assignment aliases, and `#define` / `const gpio_num_t` aliases.\n- Pass user-controlled text through stdin JSON, not shell interpolation.\n\n## Files\n\n- `scripts/run-tool.mjs` — minimal stdin-driven tool runner for ClawHub-safe execution\n- `dist/index.js` — bundled runtime entry\n- `dist/data/soc/*.json` — current SoC rules database (`esp32`, `esp32s3`, `esp32c3`, `esp32c6`, `esp32c5`, `esp32h2`, `esp32p4`)\n\n## Out of scope for this MVP bundle\n\nThe following ideas are roadmap items, not current bundle guarantees:\n\n- automatic `idf_component.yml` maintenance\n- automatic `partitions.csv` edits\n- deep serial-port management UX\n- HIL automation with `pytest-embedded`\n\nFile v0.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn75ymnxwcbqm3tzdzdgfpkqp582w35g\",\n  \"slug\": \"claw-esp-expert\",\n  \"version\": \"0.0.1\",\n  \"publishedAt\": 1773913064414\n}\n\nFile v0.0.1:dist/data/soc/esp32.json\n\n{\n  \"chip\": \"esp32\",\n  \"series\": \"Classic ESP32 (Dual-core / Single-core)\",\n  \"arch\": \"Xtensa® Dual-Core 32-bit LX6\",\n  \"vendor\": \"Espressif\",\n\n  \"physical_limits\": {\n    \"gpio_range\": [0, 39],\n    \"total_gpios\": 40,\n    \"input_only_pins\": {\n      \"pins\": [34, 35, 36, 37, 38, 39],\n      \"restriction\": \"INPUT_ONLY\",\n      \"has_internal_pull\": false,\n      \"warning\": \"这些引脚没有输出驱动能力，且缺少内部上下拉电阻。若外接按键必须加物理上拉。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [6, 7, 8, 9, 10, 11],\n      \"interface\": \"SPI_MUX\",\n      \"warning\": \"连接内部 Flash/PSRAM。代码中禁用这些 GPIO，否则触发 Cache Error 导致系统死机。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 2, 5, 12, 15],\n      \"critical_logic\": {\n        \"0\": \"Boot模式控制：启动时须为高电平；低电平进入下载模式。\",\n        \"2\": \"下载模式控制：烧录时须为低电平或悬空。\",\n        \"5\": \"SDIO定时控制：启动瞬间电平会影响硬件初始化。\",\n        \"12\": \"MTDI/Flash电压：启动时高电平设Flash为1.8V，低电平为3.3V（极易导致启动失败）。\",\n        \"15\": \"控制启动时 UART0 调试日志的输出开关。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n\n  \"performance\": {\n    \"cpu_frequency\": {\n      \"min_mhz\": 2,\n      \"max_mhz\": 240,\n      \"standard_steps\": [80, 160, 240],\n      \"constraints\": {\n        \"wifi_bt_min_mhz\": 80,\n        \"warning\": \"开启 Wi-Fi/BT 时主频不得低于 80MHz，否则协议栈崩溃。\"\n      }\n    },\n    \"bus_frequency\": {\n      \"apb_max_mhz\": 80,\n      \"note\": \"CPU降频会同步导致APB降频，需注意UART/I2C波特率偏移。\"\n    }\n  },\n\n  \"power_management\": {\n    \"voltage\": {\n      \"min_v\": 2.3,\n      \"max_v\": 3.6,\n      \"recommended\": 3.3\n    },\n    \"modes\": {\n      \"active\": {\n        \"current_ma\": [160, 260],\n        \"note\": \"取决于 RF 功率和 CPU 负载，建议供电能力 >500mA。\"\n      },\n      \"modem_sleep\": {\n        \"current_ma\": [30, 68],\n        \"condition\": \"CPU运行，无源无线电\"\n      },\n      \"light_sleep\": {\n        \"current_ma\": 0.8,\n        \"wakeup_latency_us\": 50\n      },\n      \"deep_sleep\": {\n        \"current_ua\": 10,\n        \"requirement\": \"进入前须调用 gpio_hold_en() 锁定引脚状态防止漏电。\"\n      },\n      \"hibernation\": {\n        \"current_ua\": 5,\n        \"note\": \"仅 RTC 定时器工作，基本关闭所有内存。\"\n      }\n    }\n  },\n\n  \"storage\": {\n    \"flash_modes\": {\n      \"QIO\": {\n        \"pins_required\": 4,\n        \"speed\": \"HIGHEST\",\n        \"hardware_req\": \"必须连接 GPIO 9(WP) 和 10(HD)\"\n      },\n      \"DIO\": {\n        \"pins_required\": 2,\n        \"speed\": \"STABLE\",\n        \"note\": \"最通用的模式，兼容性最高\"\n      }\n    },\n    \"flash_voltage_warning\": \"若使用 3.3V Flash，须确保 GPIO 12 在启动瞬间不被外部电路拉高，否则 Flash 会因 1.8V 供电不足而无法加载程序。\"\n  },\n\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [32, 33, 34, 35, 36, 37, 38, 39],\n      \"adc2\": [0, 2, 4, 12, 13, 14, 15, 25, 26, 27],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"Wi-Fi 开启时 ADC2 无法使用，请优先选用 ADC1 引脚。\"\n      }\n    },\n    \"dac\": [25, 26],\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 1, \"rx\": 3, \"role\": \"Flash/Debug\" }\n    }\n  },\n\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 6-11 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 Flash 专用引脚的操作，这将导致系统 Crash。\"\n    },\n    {\n      \"id\": \"WARN_INPUT_ONLY\",\n      \"condition\": \"GPIO 34-39 configured as OUTPUT\",\n      \"level\": \"ERROR\",\n      \"message\": \"GPIO 34-39 物理上不支持输出模式。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_FREQ\",\n      \"condition\": \"Wi-Fi enabled AND CPU Freq < 80MHz\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下主频过低将导致系统断连或崩溃。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32c3.json\n\n{\n  \"chip\": \"esp32c3\",\n  \"series\": \"ESP32-C3\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 21],\n    \"total_gpios\": 22,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C3 没有独立的纯输入 GPIO 域，但保留引脚和启动引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [12, 13, 14, 15, 16, 17],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 12-17 为内部 SPI Flash 保留引脚，不能作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9],\n      \"critical_logic\": {\n        \"2\": \"启动配置相关引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置相关引脚；上电瞬间不宜被外设强驱动。\",\n        \"9\": \"下载/启动相关引脚；错误外部电平会导致无法正常启动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4],\n      \"adc2\": [5],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C3 打开 Wi-Fi 时，ADC2 资源会被占用，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 21, \"rx\": 20, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 12-17 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C3 SPI Flash 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32c5.json\n\n{\n  \"chip\": \"esp32c5\",\n  \"series\": \"ESP32-C5\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 28],\n    \"total_gpios\": 29,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C5 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚与 SPI0/1 保留引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27, 28],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO23-28 通常用于 SPI0/1（常见为 SPI Flash/封装内存），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9, 24, 25],\n      \"critical_logic\": {\n        \"2\": \"启动配置引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置引脚；错误电平可能导致启动模式异常。\",\n        \"9\": \"下载/启动相关引脚；上电期间不宜被外设强驱动。\",\n        \"24\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\",\n        \"25\": \"该引脚兼具启动配置与 SPI0/1 保留属性，严禁作为通用 GPIO 依赖。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C5 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为公开资料主要聚焦 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-28 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C5 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C5 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32c6.json\n\n{\n  \"chip\": \"esp32c6\",\n  \"series\": \"ESP32-C6\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 30],\n    \"total_gpios\": 31,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C6 没有经典 ESP32 风格的纯输入 GPIO 域，但仍需避免误用启动引脚和 SPI0/1 保留引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [24, 25, 26, 27, 28, 29, 30],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档，GPIO24-30 通常用于 SPI0/1（常见为 SPI Flash），不建议作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [4, 5, 8, 9, 15],\n      \"critical_logic\": {\n        \"4\": \"启动配置引脚；上电时的外部电平会影响启动与调试行为。\",\n        \"5\": \"启动配置引脚；与上电启动判定相关，外部强驱动需谨慎。\",\n        \"8\": \"启动配置引脚；错误上下拉可能导致下载或启动行为异常。\",\n        \"9\": \"启动配置引脚；外部电平会影响启动模式选择。\",\n        \"15\": \"启动配置引脚；上电期间不宜被外设强驱动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4, 5, 6],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C6 当前规则库未启用 ADC2/Wi-Fi 冲突审计，因为官方 GPIO/ADC 文档主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 16, \"rx\": 17, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 24-30 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C6 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C6 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32h2.json\n\n{\n  \"chip\": \"esp32h2\",\n  \"series\": \"ESP32-H2\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 27],\n    \"total_gpios\": 28,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-H2 没有经典 ESP32 风格的纯输入 GPIO 域，但启动引脚、USB/JTAG 引脚和封装内存相关引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [23, 24, 25, 26, 27],\n      \"interface\": \"FSPI/SiP Flash\",\n      \"warning\": \"根据 ESP32-H2 GPIO 与硬件设计文档，GPIO23-27 与封装内 Flash/FSPI/USB-JTAG 复用关系密切；在通用项目中应优先视为保留引脚。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 8, 9, 25],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；上电外部电平会影响调试接口选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试行为。\",\n        \"8\": \"Boot strap 引脚；与 GPIO9 组合决定下载/启动模式。\",\n        \"9\": \"Boot strap 引脚；默认建议上拉，且不应外挂大电容，否则可能误入下载模式。\",\n        \"25\": \"Strapping 引脚；同时与 FSPI/封装内存复用，外部强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"802.15.4/BLE\",\n        \"warning\": \"ESP32-H2 当前规则库未启用 ADC2 无线冲突审计，公开资料主要暴露 ADC1 通道。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 24, \"rx\": 23, \"role\": \"Console/Download (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 23-27 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-H2 FSPI/封装内存相关引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-H2 启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32p4.json\n\n{\n  \"chip\": \"esp32p4\",\n  \"series\": \"ESP32-P4\",\n  \"arch\": \"RISC-V Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 54],\n    \"total_gpios\": 55,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-P4 以高性能外设/HMI 为主，没有经典 ESP32 风格的纯输入域，但仍需避免误用启动与 SPI0/1 相关引脚。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"根据 ESP-IDF GPIO 文档与公开资料，ESP32-P4 的部分高编号 IO 会保留给 SPI0/1 Flash/PSRAM 通路；这里先采用保守审计策略。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 3, 4, 5],\n      \"critical_logic\": {\n        \"2\": \"JTAG/启动相关配置引脚；启动瞬间被拉低会影响调试路径选择。\",\n        \"3\": \"JTAG/启动相关配置引脚；外部电平会影响上电行为。\",\n        \"4\": \"JTAG/启动相关配置引脚；错误上下拉会影响启动/调试状态。\",\n        \"5\": \"JTAG/启动相关配置引脚；上电时外设强驱动需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [],\n      \"adc2\": [],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-P4 不带片上 Wi-Fi/BT，本规则库当前不启用 ADC/Wi-Fi 冲突审计。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 37, \"rx\": 38, \"role\": \"Console/Log (board-dependent)\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-31 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-P4 SPI0/1 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"JTAG/boot strap pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-P4 的 JTAG/启动配置引脚需要谨慎使用。\"\n    }\n  ]\n}\n\nFile v0.0.1:dist/data/soc/esp32s3.json\n\n{\n  \"chip\": \"esp32s3\",\n  \"series\": \"ESP32-S3\",\n  \"arch\": \"Xtensa LX7 Dual-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 48],\n    \"total_gpios\": 49,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-S3 没有经典 ESP32 那种 34-39 纯输入域，但仍需避免将保留引脚用于普通 GPIO。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [26, 27, 28, 29, 30, 31, 32],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 26-32 通常连接 SPI Flash/PSRAM。部分八线 Flash/PSRAM 变体还会继续占用更高编号引脚，因此量产板卡务必结合原理图确认。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 3, 45, 46],\n      \"critical_logic\": {\n        \"0\": \"下载模式相关启动引脚；上电时外部强拉会改变启动行为。\",\n        \"3\": \"JTAG/启动相关配置引脚；启动瞬间电平会影响调试与启动行为。\",\n        \"45\": \"启动配置相关引脚；外部驱动可能影响电源域或启动模式。\",\n        \"46\": \"启动配置相关引脚；常用于下载/启动判定，外部强拉需谨慎。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n      \"adc2\": [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-S3 在 Wi-Fi 打开时，ADC2 读数会受到占用影响，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 43, \"rx\": 44, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 26-32 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-S3 SPI Flash/PSRAM 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-S3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}","readmeExcerpt":"Skill: Claw ESP Expert Owner: movecall Summary: ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Tags: latest:0.0.4 Version history: v0.0.4 | 2026-03-19T10:30:19.306Z | user Remove runtime third-party Node dependencies and simplify the published bundle. v0.0.3 | 2026-03-19T10:01:27.792Z | user Add skill package manifest and tighten ClawHub runtime expectations. v0.0.2 | 2026-03-19T09:55:47.526Z | user Tighten ClawHub-f","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"printf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin"},{"language":"bash","snippet":"printf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin"},{"language":"bash","snippet":"printf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin"},{"language":"bash","snippet":"printf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Part '\\''factory'\\'' ... overflow 0x20000\"}' | node scripts/run-tool.mjs analyze_partitions --stdin"},{"language":"bash","snippet":"printf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"Guru Meditation Error...\"}' | node scripts/run-tool.mjs decode_panic --stdin"},{"language":"bash","snippet":"printf '%s' '{\"chip\":\"esp32s3\",\"elfPath\":\"/path/to/app.elf\",\"log\":\"...monitor output...\"}' | node scripts/run-tool.mjs analyze_monitor --stdin"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: claw-esp-expert\ndescription: \"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🦞\",\n        \"requires\": { \"bins\": [\"node\", \"idf.py\"] },\n        \"category\": \"developer-tools\",\n      },\n  }\n---\n\n# Claw ESP Expert\n\nUse this skill when the user needs help with ESP-IDF environment checks, example discovery, pin safety review, or build diagnostics.\n\n## What this bundle includes\n\nThis ClawHub-facing bundle exposes nine stable MVP tools:\n\n- `manage_env`\n- `explore_demo`\n- `resolve_component`\n- `analyze_partitions`\n- `decode_panic`\n- `analyze_monitor`\n- `flash_and_monitor`\n- `execute_project`\n- `safe_build`\n\nThese tools are implemented in the bundled runtime and are invoked through `scripts/run-tool.mjs`.\n\n## Safety contract\n\n- Treat this skill as a **diagnostic-first** ESP-IDF expert.\n- Default to **check and explain**, not silent modification.\n- Do not claim support for fully autonomous repair, deep serial-port management, or HIL automation unless the repository actually implements them.\n- Do not invent additional tools beyond the ones listed in this file.\n- Do not read arbitrary local config files unless the user explicitly asks; the MVP bundle does not require VS Code config scanning.\n- Do not modify project files or system permissions unless the user clearly asks for that action.\n\n## Tool contract\n\n### `manage_env`\nPurpose:\n- inspect local ESP-IDF availability\n- report `$IDF_PATH`, common install paths, `python/python3`, and `idf.py` availability\n- when explicitly asked, return mirror-aware manual installation guidance instead of running upstream install scripts automatically\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"action\":\"check\"}' | node scripts/run-tool.mjs manage_env --stdin\n```\n\n### `explore_demo`\nPurpose:\n- inspect local `$IDF_PATH/examples`\n- find matching demos by keyword\n- read the best matching `README.md` / `README_CN.md`\n- summarize hardware requirements and structure\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"query\":\"gpio\"}' | node scripts/run-tool.mjs explore_demo --stdin\n```\n\n### `safe_build`\nPurpose:\n- run GPIO safety audit before build\n- reject fatal pin conflicts early\n- invoke `idf.py build` only after the audit passes\n- return structured build diagnostics, including partition overflow, memory overflow, missing headers, component resolution failures, config issues, and link errors\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"chip\":\"esp32\"}' | node scripts/run-tool.mjs safe_build --stdin\n```\n\n### `analyze_partitions`\nPurpose:\n- parse `partitions.csv` from the current ESP-IDF project\n- identify the most likely app partition (`factory` / `ota_0`)\n- combine partition table data with overflow logs\n- return a recommended expanded partition size and an updated CSV draft\n- return a structured patch-style before/after suggestion for `partitions.csv`\n\nExample invocation:\n\n```bash\nprintf '%s' '{\"projectPath\":\"/path/to/project\",\"rawLog\":\"Pa"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75ymnxwcbqm3tzdzdgfpkqp582w35g\",\n  \"slug\": \"claw-esp-expert\",\n  \"version\": \"0.0.4\",\n  \"publishedAt\": 1773916219306\n}"},{"path":"skill-card.md","content":"## Description:\n\nESP-IDF expert skill for environment checks, example discovery, GPIO safety review, build diagnostics, panic decoding, monitor analysis, flashing, and component lookup.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[movecall](https://clawhub.ai/user/movecall)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to inspect ESP-IDF environments, navigate examples, audit ESP32-family GPIO choices, diagnose builds and monitor logs, decode panics, and generate reviewable component or partition suggestions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can read ESP-IDF project files and local examples during diagnostics.\n\nMitigation: Use it only on intended project directories and review file paths surfaced in results.\n\nRisk: Build, flash, and monitor tools can run idf.py against connected hardware when invoked.\n\nMitigation: Confirm the project path, chip target, serial port, and ESP-IDF environment before invoking execution tools.\n\nRisk: Component lookup contacts the official Espressif component registry and may return dependency snippets or patch-style suggestions.\n\nMitigation: Review registry results, dependency snippets, and manifest changes before applying them to a project.\n\nRisk: Generated shell-command suggestions may be inappropriate for a specific workstation or project state.\n\nMitigation: Treat commands as proposals and review them before running.\n\n## Reference(s):\n\n- [Claw ESP Expert skill page](https://clawhub.ai/movecall/skills/claw-esp-expert)\n- [Publisher profile](https://clawhub.ai/user/movecall)\n- [Espressif ESP-IDF repository](https://github.com/espressif/esp-idf.git)\n- [Espressif ESP-IDF Gitee mirror](https://gitee.com/EspressifSystems/esp-idf.git)\n- [Espressif GitHub assets mirror](https://dl.espressif.cn/github_assets)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [JSON tool results and Markdown guidance with shell command and configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Patch-style before/after suggestions may be returned for partition tables or component manifests; generated dependency and command suggestions should be reviewed before use.]\n\n## Skill Version(s):\n\n0.0.4 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"dist/data/soc/esp32.json","content":"{\n  \"chip\": \"esp32\",\n  \"series\": \"Classic ESP32 (Dual-core / Single-core)\",\n  \"arch\": \"Xtensa® Dual-Core 32-bit LX6\",\n  \"vendor\": \"Espressif\",\n\n  \"physical_limits\": {\n    \"gpio_range\": [0, 39],\n    \"total_gpios\": 40,\n    \"input_only_pins\": {\n      \"pins\": [34, 35, 36, 37, 38, 39],\n      \"restriction\": \"INPUT_ONLY\",\n      \"has_internal_pull\": false,\n      \"warning\": \"这些引脚没有输出驱动能力，且缺少内部上下拉电阻。若外接按键必须加物理上拉。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [6, 7, 8, 9, 10, 11],\n      \"interface\": \"SPI_MUX\",\n      \"warning\": \"连接内部 Flash/PSRAM。代码中禁用这些 GPIO，否则触发 Cache Error 导致系统死机。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [0, 2, 5, 12, 15],\n      \"critical_logic\": {\n        \"0\": \"Boot模式控制：启动时须为高电平；低电平进入下载模式。\",\n        \"2\": \"下载模式控制：烧录时须为低电平或悬空。\",\n        \"5\": \"SDIO定时控制：启动瞬间电平会影响硬件初始化。\",\n        \"12\": \"MTDI/Flash电压：启动时高电平设Flash为1.8V，低电平为3.3V（极易导致启动失败）。\",\n        \"15\": \"控制启动时 UART0 调试日志的输出开关。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n\n  \"performance\": {\n    \"cpu_frequency\": {\n      \"min_mhz\": 2,\n      \"max_mhz\": 240,\n      \"standard_steps\": [80, 160, 240],\n      \"constraints\": {\n        \"wifi_bt_min_mhz\": 80,\n        \"warning\": \"开启 Wi-Fi/BT 时主频不得低于 80MHz，否则协议栈崩溃。\"\n      }\n    },\n    \"bus_frequency\": {\n      \"apb_max_mhz\": 80,\n      \"note\": \"CPU降频会同步导致APB降频，需注意UART/I2C波特率偏移。\"\n    }\n  },\n\n  \"power_management\": {\n    \"voltage\": {\n      \"min_v\": 2.3,\n      \"max_v\": 3.6,\n      \"recommended\": 3.3\n    },\n    \"modes\": {\n      \"active\": {\n        \"current_ma\": [160, 260],\n        \"note\": \"取决于 RF 功率和 CPU 负载，建议供电能力 >500mA。\"\n      },\n      \"modem_sleep\": {\n        \"current_ma\": [30, 68],\n        \"condition\": \"CPU运行，无源无线电\"\n      },\n      \"light_sleep\": {\n        \"current_ma\": 0.8,\n        \"wakeup_latency_us\": 50\n      },\n      \"deep_sleep\": {\n        \"current_ua\": 10,\n        \"requirement\": \"进入前须调用 gpio_hold_en() 锁定引脚状态防止漏电。\"\n      },\n      \"hibernation\": {\n        \"current_ua\": 5,\n        \"note\": \"仅 RTC 定时器工作，基本关闭所有内存。\"\n      }\n    }\n  },\n\n  \"storage\": {\n    \"flash_modes\": {\n      \"QIO\": {\n        \"pins_required\": 4,\n        \"speed\": \"HIGHEST\",\n        \"hardware_req\": \"必须连接 GPIO 9(WP) 和 10(HD)\"\n      },\n      \"DIO\": {\n        \"pins_required\": 2,\n        \"speed\": \"STABLE\",\n        \"note\": \"最通用的模式，兼容性最高\"\n      }\n    },\n    \"flash_voltage_warning\": \"若使用 3.3V Flash，须确保 GPIO 12 在启动瞬间不被外部电路拉高，否则 Flash 会因 1.8V 供电不足而无法加载程序。\"\n  },\n\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [32, 33, 34, 35, 36, 37, 38, 39],\n      \"adc2\": [0, 2, 4, 12, 13, 14, 15, 25, 26, 27],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"Wi-Fi 开启时 ADC2 无法使用，请优先选用 ADC1 引脚。\"\n      }\n    },\n    \"dac\": [25, 26],\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 1, \"rx\": 3, \"role\": \"Flash/Debug\" }\n    }\n  },\n\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 6-11 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 Flash 专用引脚的操作，这将导致系统 Crash。\"\n    },\n    {\n      \"id\": \"WARN_INPUT_ONLY\",\n      \"condition\":"},{"path":"dist/data/soc/esp32c3.json","content":"{\n  \"chip\": \"esp32c3\",\n  \"series\": \"ESP32-C3\",\n  \"arch\": \"RISC-V Single-Core\",\n  \"vendor\": \"Espressif\",\n  \"physical_limits\": {\n    \"gpio_range\": [0, 21],\n    \"total_gpios\": 22,\n    \"input_only_pins\": {\n      \"pins\": [],\n      \"restriction\": \"NONE\",\n      \"has_internal_pull\": true,\n      \"warning\": \"ESP32-C3 没有独立的纯输入 GPIO 域，但保留引脚和启动引脚仍需严格审计。\"\n    },\n    \"internal_flash_psram\": {\n      \"pins\": [12, 13, 14, 15, 16, 17],\n      \"interface\": \"SPI0_SPI1\",\n      \"warning\": \"GPIO 12-17 为内部 SPI Flash 保留引脚，不能作为普通 GPIO 使用。\"\n    },\n    \"strapping_pins\": {\n      \"pins\": [2, 8, 9],\n      \"critical_logic\": {\n        \"2\": \"启动配置相关引脚；外部上下拉会影响下载/启动行为。\",\n        \"8\": \"启动配置相关引脚；上电瞬间不宜被外设强驱动。\",\n        \"9\": \"下载/启动相关引脚；错误外部电平会导致无法正常启动。\"\n      },\n      \"audit_level\": \"CRITICAL\"\n    }\n  },\n  \"peripherals\": {\n    \"adc\": {\n      \"adc1\": [0, 1, 2, 3, 4],\n      \"adc2\": [5],\n      \"conflict\": {\n        \"target\": \"adc2\",\n        \"with\": \"Wi-Fi\",\n        \"warning\": \"ESP32-C3 打开 Wi-Fi 时，ADC2 资源会被占用，请优先使用 ADC1。\"\n      }\n    },\n    \"uart_default\": {\n      \"uart0\": { \"tx\": 21, \"rx\": 20, \"role\": \"Download/Log\" }\n    }\n  },\n  \"expert_audit_rules\": [\n    {\n      \"id\": \"ERR_FLASH_PINS\",\n      \"condition\": \"GPIO 12-17 configured as I/O\",\n      \"level\": \"FATAL\",\n      \"message\": \"检测到对 ESP32-C3 SPI Flash 保留引脚的操作。\"\n    },\n    {\n      \"id\": \"WARN_STRAPPING\",\n      \"condition\": \"Strapping pin configured or externally driven\",\n      \"level\": \"WARNING\",\n      \"message\": \"ESP32-C3 启动配置引脚需要谨慎使用。\"\n    },\n    {\n      \"id\": \"WARN_WIFI_ADC2\",\n      \"condition\": \"Wi-Fi enabled AND ADC2 used\",\n      \"level\": \"CRITICAL\",\n      \"message\": \"Wi-Fi 模式下 ADC2 资源冲突。\"\n    }\n  ]\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Skill: Claw ESP Expert Owner: movecall Summary: ESP-IDF 专家型技能：环境检查、examples 导航、GPIO 规则审计与构建诊断。 Tags: latest:0.0.4 Version history: v0.0.4 | 2026-03-19T10:30:19.306Z | user Remove runtime third-party Node dependencies and simplify the published bundle. v0.0.3 | 2026-03-19T10:01:27.792Z | user Add skill package manifest and tighten ClawHub runtime expectations. v0.0.2 | 2026-03-19T09:55:47.526Z | user Tighten ClawHub-f","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1488,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:09:58.285Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T17:39:43.248Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}