Skip to main content

Agent & Skill Workflow Guide

How to use the 6 agents, 46 skills, and 6 lifecycle commands to design, verify, fix, and release the ESP32 Emu Turbo PCB.


Architecture Overview​

Agent architecture: the user, the team-lead, the three worker agents and their sync points


When to Use What​

Decision Tree​

Which command to run for each need, and the pipeline it starts


Scenario 1 — New PCB from Scratch​

New PCB from scratch: bootstrap, design, generate, verify with a fix loop, sync firmware, release

When to invoke the team-lead agent​

Use /team-lead (or just describe a complex task) when changes span multiple domains:

  • "Add a new audio amplifier" → team-lead dispatches pcb-engineer (footprint + routing) + software-dev (I2S driver) + cad-engineer (speaker cutout)
  • "Change the display from SPI to parallel" → all three agents need updates

Scenario 2 — Fix a DFM Issue​

After JLCPCB DFM report or verify_dfm_v2.py failure:

Fix a DFM issue: from the report or /verify to /dfm-fix, regenerate, re-verify, guard test, release-prep

Key: the fix cycle​

The fix cycle: verify, fix, regenerate, re-verify, then add a guard and release


Scenario 3 — Pre-Release Verification​

Full verification sweep before ordering from JLCPCB:

Pre-release verification: the eight skills /verify-pcb composes

Hard gates (must pass for release)​

GateScriptWhat it catches
Fab shortsverify_trace_through_pad.pyTrace over unnetted pad
Trace crossingsverify_trace_crossings.pySame-layer different-net overlap
Copper clearanceverify_copper_clearance.py< 0.10mm copper gap (Shapely)
Net connectivityverify_net_connectivity.pyFragmented copper per net

Scenario 4 — Release to JLCPCB​

Release to JLCPCB: the nine steps /release-pcb runs through /full-release

After release:

  1. Upload release_jlcpcb/gerbers.zip to jlcpcb.com
  2. Upload bom.csv + cpl.csv for SMT assembly
  3. Verify 3D viewer alignment for bottom-side components
  4. Order 5x PCBs, 4-layer, 1.6mm, ENIG, SMT both sides

Scenario 5 — Hardware Audit (Deep Review)​

Hardware audit: Layer 1 automated gates, then Layer 2 domain-by-domain review, output hardware-audit-bugs.md


Scenario 6 — GPIO / Component Change​

When you change a GPIO assignment or add/remove a component:

GPIO or component change: edit config.py, /pcb-to-firmware, /generate-pcb, /verify-pcb, /firmware-sync


Scenario 7 — Enclosure Update​

After PCB board outline or component position changes:

Enclosure update: design, render, export


Quick Reference — Skill Categories​

Design Phase (create from scratch)​

SkillWhat it does
/pcb-schematicDefine GPIO nets, generate .kicad_sch sheets
/pcb-boardSet board outline, layers, mounting holes
/pcb-componentsPlace all component footprints
/pcb-routingRoute traces, vias, copper zones
/pcb-libraryQuery footprint pad info

Generate Phase (build artifacts)​

SkillWhat it does
/generatePython scripts -> .kicad_pcb + BOM + CPL + gerbers
/checkDRC + 3D render + gerbers + DFM quick check
/renderSVG layer views + animation GIF
/pcba-render13 photorealistic 3D PCBA views (raytracer)

Verify Phase (find problems)​

SkillWhat it does
/verify124 DFM + 9 DFA + 24 JLCPCB + connectivity
/drc-nativeKiCad DRC with smart filtering + baseline delta
/drc-auditFull electrical classification (shorts, unconnected, dangling)
/pcb-review8-domain 100-point scored review
/datasheet-verify267 pin-to-net checks vs component datasheets
/design-intent357 cross-source adversary (GPIO, power, signal chains)
/pad-analysisPad spacing distance table
/jlcpcb-alignmentIC/connector rotation + position vs CPL
/jlcpcb-validate24 JLCPCB-specific manufacturing rules
/dfm-testDFM regression guard test generator
/pcb-optimize5-module 100-point layout optimization score

Fix Phase (resolve issues)​

SkillWhat it does
/dfm-fixFix DFM violations from report + add guard test
/fix-rotationFix CPL rotation for JLCPCB assembly
/jlcpcb-checkCheck 3D alignment for a specific component
/jlcpcb-partsCheck BOM stock + find alternative LCSC parts

Release Phase (ship to fab)​

SkillWhat it does
/release-prepQuick: generate + verify + gerbers + sync release_jlcpcb/
/releaseManual: prepare release without auto-commit
/full-releaseComplete: all verify + renders + gerbers + commit + tag

Audit Phase (deep review)​

SkillWhat it does
/hardware-auditLayer 1 (22 automated gates) + Layer 2 (8-domain prose)
/electrical-reviewStrapping + decoupling + power sequence + SPICE

Firmware / Docs​

SkillWhat it does
/pcb-to-firmwarePropagate PCB changes to board_config.h + docs
/firmware-buildBuild/flash ESP-IDF firmware via Docker
/firmware-syncVerify GPIO match between config.py and board_config.h
/hardware-test-genRegenerate/build/run the bring-up firmware from board_config.h
/docAudit docs vs source-of-truth, fix outdated values
/website-devBuild/deploy Docusaurus site

Audit & Meta​

SkillWhat it does
/hardware-auditLayer 1 automated gates + Layer 2 domain-by-domain prose review
/electrical-reviewStrapping + decoupling + power sequence + SPICE
/isolation-checkEvery conductor connected where intended, isolated everywhere else
/external-dfmKiBot + Tracespace DFM analysis via Docker
/first-article-checkPre-payment 3D-preview orientation check + photo-vs-render on arrival
/pipeline-resumeResume an interrupted release pipeline
/create-skillAuthor a new skill for this project
/user-feedbackRecord user preferences and distribute them
/memory-maintenanceAudit and condense the persistent project memory

CAD​

SkillWhat it does
/enclosure-designOpenSCAD parametric enclosure design
/enclosure-renderRender enclosure PNG views via Docker
/enclosure-exportExport STL for 3D printing

Lifecycle Commands (composed workflows)​

CommandComposesUse when
/design-pcbschematic -> board -> components -> routingNew PCB or major redesign
/generate-pcbgenerate -> checkAfter any design change
/verify-pcbverify -> drc -> audit -> pad -> jlcpcb -> datasheet -> intent -> reviewBefore release
/fix-pcbdfm-fix -> fix-rotation -> jlcpcb-check -> jlcpcb-partsAfter verify failures
/release-pcbfull-release (verify + render + gerbers + commit)Ship to JLCPCB
/bootstrap-new-pcbscaffold new projectStarting fresh

Source of Truth Hierarchy​

Source of truth hierarchy: config.py down to the generated .kicad_pcb and .kicad_sch

Rule: changes flow DOWN this hierarchy. Never edit .kicad_pcb directly. Never let board_config.h drive config.py. Use /pcb-to-firmware to propagate changes downward.


Hooks (Auto-Triggers)​

These run automatically — no manual invocation needed:

WhenWhat happens
Every promptSkill suggestions based on keywords
Before any Edit/WriteBlocks direct .kicad_pcb edits
After generate_pcb or releaseReminds to run verify_dfa.py
After any PCB file editReminds to run DFA verification
Before context compactionSaves session backup
After Claude stops respondingAuto-runs DFM if PCB files changed

Agent Coordination Examples​

Example 1: "Add battery voltage monitoring"​

User -> team-lead:
"Add battery voltage ADC reading to the design"

team-lead dispatches:
1. pcb-engineer: add R divider on BAT+ → GPIO (ADC2 channel)
-> /pcb-schematic (add R divider to power sheet)
-> /pcb-components (place 2x 0805 resistors)
-> /pcb-routing (route divider to ESP32 ADC pin)
-> /generate + /verify

2. software-dev: add ADC reading to firmware
-> /pcb-to-firmware (sync new GPIO)
-> edit power.c (add adc_oneshot_read)
-> /firmware-build (verify compilation)

3. cad-engineer: no changes needed (no new external component)

Example 2: "The display doesn't work"​

User -> /hardware-audit

Layer 1 gates run → all PASS
Layer 2 Step 3 (Display) investigates:
- LCD_D0-D7 routing vs J4 FPC pinout
- LCD_WR clock frequency vs ILI9488 datasheet
- Backlight current path
- FPC connector orientation

Finding: LCD_RD tied to wrong voltage → fix in routing.py
-> /dfm-fix
-> /generate-pcb
-> /verify-pcb
-> /release-pcb

Example 3: "JLCPCB says my gerbers have DFM issues"​

User uploads JLCDFM report PDF

1. Read the report (OCR if needed)
2. Categorize findings:
- Trace spacing → /dfm-fix
- Pin alignment → /fix-rotation or /jlcpcb-check
- Parts stock → /jlcpcb-parts check
- Silk overlap → move gr_text in board.py
3. /generate-pcb (regen)
4. /verify-pcb (confirm fix)
5. /release-pcb (new gerbers)
6. Re-upload to JLCDFM and confirm