Task
Generate or update a WIRING.md file for the project at $1 (relative path under packages/<domain>/).
Process
Read the project source code to discover pin assignments, components, and peripherals:
main/*.c and main/*.h — look for #define pin assignments, gpio_config(), i2c_config(), spi_bus_config(), LEDC, UART, ADC usage
main/CMakeLists.txt — REQUIRES list reveals components (mdns, driver, esp_wifi, led_strip, etc.)
sdkconfig.defaults — enabled features, stack sizes, Bluetooth mode
justfile — target chip, build variants
README.md / CLAUDE.md — existing hardware description
Kconfig.projbuild — user-configurable pin assignments
Identify the board from sdkconfig.defaults (CONFIG_IDF_TARGET), CLAUDE.md, or justfile. Note any board-specific constraints (e.g., ESP32-CAM PSRAM conflicts, TTGO LoRa pin reservations, ESP32-S3 USB PHY sharing).
Generate WIRING.md following the template below. Include ONLY sections relevant to the project — omit empty sections rather than adding placeholder text.
Template
Follow this exact structure. Every section shown is optional except Board and Pin Assignments — include a section only when the project uses it.
# <Project Name> — Wiring Guide
## Board
<Board name and variant>. Note any special constraints (PSRAM pins, onboard peripherals, USB PHY sharing).
## Pin Assignments
| GPIO | Function | Direction | Component | Notes |
|------|----------|-----------|-----------|-------|
Group related pins together (SPI bus, I2C bus, UART, etc.) with a blank row or subheading between groups.
Direction values: `Output`, `Input`, `Bidirectional`, `—` (for power/ground).
## Wiring Diagram
ASCII art showing physical connections. Keep it compact — one diagram for the whole project if possible.
ESP32
| |
| GPIOx |──── Component
| ... |
|________|
## Components
| Component | Specification | Notes |
|-----------|--------------|-------|
Include only components that require wiring. Wireless peripherals (Bluetooth controllers, WiFi) get a one-line mention in Notes, not a table row.
## Bus Configuration
### I2C / SPI / UART
Only include if the project uses these buses. Show address, speed, or baud rate. Note any bus contention issues (e.g., shared SPI with onboard LoRa).
## Power
- Power source (USB, battery, external supply)
- Voltage rails (3.3V, 5V) and which components use each
- Current requirements (peak and typical)
- Deep sleep current if applicable
- Battery management notes if applicable
**Do not include generic ESP32 power specs** — only project-specific information.
## LED / Status Indicators
| State | Color/Pattern | Meaning |
|-------|--------------|---------|
Only include if the project has status LEDs with defined states.
## Safety Notes
Bullet list of project-specific warnings. Examples:
- Voltage level mismatches (5V component on 3.3V GPIO → needs level shifter or voltage divider)
- Components that must NOT receive 5V
- Current limits that require transistor drivers
- Pin conflicts with boot strapping
**Do not include generic electronics safety advice.**
## Troubleshooting
Only include if there are non-obvious failure modes specific to this hardware configuration.
Style Rules
- Concise over comprehensive — a 50-line WIRING.md that covers all connections beats a 300-line tutorial
- No generic content — omit GPIO reference tables, "safe pin" lists, breadboard ASCII art, expansion ideas, component substitutions, and enclosure advice unless directly relevant
- Pin numbers are authoritative — derive from source code
#define values, not README prose. If they conflict, flag the discrepancy
- ASCII diagrams over Mermaid — renders everywhere without a renderer
- Decimal GPIO numbers — use
GPIO4 not IO4 or Pin 4
- One table for all pins — don't split across multiple tables unless bus grouping genuinely aids readability
- Notes column — use for pull-up/down requirements, strapping pin warnings, "input-only" constraints, or alternative pin options
1---2name: wiring-doc3description: Generate a standardized WIRING.md for an ESP32 project by analyzing source code pin assignments4---56## Task78Generate or update a `WIRING.md` file for the project at `$1` (relative path under `packages/<domain>/`).910## Process11121. **Read the project source code** to discover pin assignments, components, and peripherals:13 - `main/*.c` and `main/*.h` — look for `#define` pin assignments, `gpio_config()`, `i2c_config()`, `spi_bus_config()`, LEDC, UART, ADC usage14 - `main/CMakeLists.txt` — `REQUIRES` list reveals components (mdns, driver, esp_wifi, led_strip, etc.)15 - `sdkconfig.defaults` — enabled features, stack sizes, Bluetooth mode16 - `justfile` — target chip, build variants17 - `README.md` / `CLAUDE.md` — existing hardware description18 - `Kconfig.projbuild` — user-configurable pin assignments19202. **Identify the board** from sdkconfig.defaults (`CONFIG_IDF_TARGET`), CLAUDE.md, or justfile. Note any board-specific constraints (e.g., ESP32-CAM PSRAM conflicts, TTGO LoRa pin reservations, ESP32-S3 USB PHY sharing).21223. **Generate WIRING.md** following the template below. Include ONLY sections relevant to the project — omit empty sections rather than adding placeholder text.2324## Template2526Follow this exact structure. Every section shown is optional except **Board** and **Pin Assignments** — include a section only when the project uses it.2728```markdown29# <Project Name> — Wiring Guide3031## Board3233<Board name and variant>. Note any special constraints (PSRAM pins, onboard peripherals, USB PHY sharing).3435## Pin Assignments3637| GPIO | Function | Direction | Component | Notes |38|------|----------|-----------|-----------|-------|3940Group related pins together (SPI bus, I2C bus, UART, etc.) with a blank row or subheading between groups.4142Direction values: `Output`, `Input`, `Bidirectional`, `—` (for power/ground).4344## Wiring Diagram4546ASCII art showing physical connections. Keep it compact — one diagram for the whole project if possible.4748```49ESP3250 ________51| |52| GPIOx |──── Component53| ... |54|________|55```5657## Components5859| Component | Specification | Notes |60|-----------|--------------|-------|6162Include only components that require wiring. Wireless peripherals (Bluetooth controllers, WiFi) get a one-line mention in Notes, not a table row.6364## Bus Configuration6566### I2C / SPI / UART6768Only include if the project uses these buses. Show address, speed, or baud rate. Note any bus contention issues (e.g., shared SPI with onboard LoRa).6970## Power7172- Power source (USB, battery, external supply)73- Voltage rails (3.3V, 5V) and which components use each74- Current requirements (peak and typical)75- Deep sleep current if applicable76- Battery management notes if applicable7778**Do not include generic ESP32 power specs** — only project-specific information.7980## LED / Status Indicators8182| State | Color/Pattern | Meaning |83|-------|--------------|---------|8485Only include if the project has status LEDs with defined states.8687## Safety Notes8889Bullet list of project-specific warnings. Examples:90- Voltage level mismatches (5V component on 3.3V GPIO → needs level shifter or voltage divider)91- Components that must NOT receive 5V92- Current limits that require transistor drivers93- Pin conflicts with boot strapping9495**Do not include generic electronics safety advice.**9697## Troubleshooting9899Only include if there are non-obvious failure modes specific to this hardware configuration.100```101102## Style Rules103104- **Concise over comprehensive** — a 50-line WIRING.md that covers all connections beats a 300-line tutorial105- **No generic content** — omit GPIO reference tables, "safe pin" lists, breadboard ASCII art, expansion ideas, component substitutions, and enclosure advice unless directly relevant106- **Pin numbers are authoritative** — derive from source code `#define` values, not README prose. If they conflict, flag the discrepancy107- **ASCII diagrams** over Mermaid — renders everywhere without a renderer108- **Decimal GPIO numbers** — use `GPIO4` not `IO4` or `Pin 4`109- **One table for all pins** — don't split across multiple tables unless bus grouping genuinely aids readability110- **Notes column** — use for pull-up/down requirements, strapping pin warnings, "input-only" constraints, or alternative pin options