| name | generate-wiring-diagram-spec |
| description | Produce a textual wiring specification — pin map, connection table, and power distribution — suitable for handoff to a diagram tool (Fritzing, KiCad, Wokwi, draw.io) or for direct use during breadboarding. Not a graphical diagram itself. |
Generate Wiring Diagram Spec
Translate a BOM into an unambiguous wiring spec.
Inputs
- Project slug →
bom.json, compatibility.md if present, datasheets/*.md for pinouts.
Output
Write <projects_dir>/<slug>/wiring.md:
1. Pin map
A table per part with: ref designator, part name, pin number, pin function, connected-to (MCU pin or rail).
2. MCU pin assignments
A reverse table: each used MCU GPIO → function (e.g. "GPIO21 → I2C SDA (BME280, SSD1306)"). Include strapping-pin warnings inline.
3. Power distribution
- Source (USB / battery / barrel jack).
- Regulator(s) and rails (3.3V, 5V).
- Per-rail load total and headroom.
- Decoupling caps where required by datasheets.
4. Bus topology
- I2C: SDA/SCL, pull-up values, every device's address.
- SPI: MOSI/MISO/SCK shared, CS per device.
- UART: per-port assignments.
5. Bench / breadboard notes
Practical notes — rail orientation, recommended jumper colours by signal class (red=Vcc, black=GND, etc.), suggested test points.
Hand-off
End the file with a "Diagram tool input" section that re-states the connection list in a format easy to paste into Fritzing parts notes or Wokwi diagram.json. Mention generate-mockups if the user wants a visual representation, or generate-pcb-design to take the wiring spec to a custom board.