← Commit history
SKILL.mdadded+122
@@ -0,0 +1,122 @@+---+name: kicad-board-audit+description: >-+  Audit a KiCad board (.kicad_sch + .kicad_pcb) for design errors before fab:+  run real ERC/DRC via kicad-cli or the Adom desktop KiCad bridge, extract the+  pad-level netlist from the PCB file, then walk a checklist that catches what+  ERC cannot — floating mandatory pins (VCAP-type), supply pins tied to GND,+  wrong strap/boot-pin encodings, regulator feedback dividers computed with the+  wrong variant's VFB, missing pull-ups on open-drain buses, crystal load-cap+  math, impedance net-class misassignment, unrouted nets, keepout misconfig.+  Verify findings against datasheets/EVB schematics, deliver a severity-ranked+  report with fixes. Trigger words: audit board, board audit, review my board,+  board review, check my PCB, review this board for errors, kicad audit,+  schematic review, design review, pre-fab check, netlist review, run ERC,+  run DRC, find board errors, tapeout check.+user-invocable: true+---++# Audit a KiCad board++Given a KiCad project, find everything wrong, verify each suspicion against a+primary source, and deliver a severity-ranked report. Works on any board; the+checklist below is ordered by how often each step finds real bugs.++## 1. Run the real checkers first++- Local KiCad: `kicad-cli sch erc <root.kicad_sch>` (KiCad ≥8) and+  `kicad-cli pcb drc <board.kicad_pcb>` (≥7). The installed KiCad must be ≥ the+  file format version (check the `(version …)` header).+- Adom cloud container without KiCad: send the project to the user's desktop and+  use the KiCad bridge — `send_files` → `kicad_run_erc` / `kicad_run_drc`.+- Before trusting either result, read the project's silenced rules:+  `.kicad_pro` → `erc.rule_severities` and+  `board.design_settings.rule_severities` — anything on `"ignore"` makes a+  clean pass hollow.+- DRC `unconnected_items` = unrouted copper = fab blocker. Report those first.+- Group the rest of the DRC list by root cause before reporting — hundreds of+  violations usually collapse to a handful of causes (one bad footprint, one+  keepout flag, one via style).++## 2. Never trust a clean ERC++Three blind spots hide critical bugs behind a 0/0 ERC:++- **Symbol pin types.** `power_out` and `bidirectional` pins float silently.+  Classic: MCU VCAP pins with no capacitors — board dead, ERC green. List every+  unconnected pin from the PCB side and judge each yourself.+- **Mistyped power pins.** A custom symbol will happily let a supply pin sit on+  GND without complaint. Trust the datasheet pin table, not the symbol.+- **Placeholder values.** `Value` fields like "LED" or the symbol name mean an+  unorderable BOM and unverifiable load caps / LED currents.++## 3. Extract the pad-level netlist++The `.kicad_pcb` is the synced ground truth. `assets/kicad_netlist.py+<board.kicad_pcb>` prints: components (ref / value / footprint / DNP), per-net+pin lists with pin functions, pads with no net, and per-net routed length + via+count. Format gotchas it already handles: pad nets are `(net N "name")` before+v10 but `(net "name")` from v10, and the tokenizer must be quote-aware because+pin names contain parentheses. (Multi-instance hierarchical sheets store their+references in `(instances …)` blocks — don't diagnose "missing from schematic"+from the default Reference property.)++## 4. Electrical audit — walk the netlist per IC++- **Power pins.** Every supply pin on the right rail. Traps: pins named+  `*COM` / `E_*` that read like grounds but are supplies ("common **block**+  supply", not "common"); supply pins left floating; one 100 nF per VDD pin+  plus bulk.+- **Mandatory passives.** Core/VCAP caps, bias and reference resistors+  (EXTRES / ISET / RBIAS): exact value *and* tolerance from the datasheet —+  sibling parts differ (6.04 k vs 12.1 k is a real trap).+- **Resets.** Every reset pin needs a defined source (RC, supervisor, or GPIO)+  meeting the documented supplies-stable-to-release time. Straps latch on the+  reset rising edge, so a floating reset also breaks strap latching.+- **Straps / boot pins.** Build the full table (pin, pull, latched value) and+  check each row against the datasheet encoding table — not intuition. Wrong+  MODE encodings that half-work (e.g. advertise only one speed) are common.+- **Regulators.** Recompute every feedback divider with the exact orderable+  variant's VFB — siblings differ (0.6 / 0.763 / 0.8 V). Check LDO dissipation+  ((Vin−Vout)×I vs package θJA) and compare rail sizing to the vendor EVB.+- **Chip-to-chip buses.** Verify pin-direction mapping end to end. PHY/MAC-mode+  function swaps are the classic crossover — confirm against the vendor EVB+  schematic, never the pin names. Open-drain buses (MDIO, I2C, IRQ) need+  pull-ups. Series terminations belong at the driver end.+- **Crystals.** Caps from the crystal's CL: CL = C1·C2/(C1+C2) + 2–5 pF stray.+  Require a real MPN in the Value field.+- **Connectors.** Shield/tab pins bonded to GND, unused pins terminated per+  datasheet, input protection on power entries.++## 5. Layout audit — scriptable from the file++- **Net classes.** List the class patterns and confirm every+  controlled-impedance net matches one — a net matching no pattern silently+  gets Default (classic: USB D+/D−). Then check each class's geometry gives the+  interface's required impedance on this stackup (USB 90 Ω, Ethernet pairs+  100 Ω).+- **Diff pairs.** Intra-pair skew from the script's per-net lengths.+- **Vias.** Every via style vs the board's min drill / annular constraints —+  mixed styles are the usual violation source.+- **Keepouts.** Check the allow-flags: a keepout drawn around a part but set to+  disallow *pads* flags the part's own pads.+- **Zones.** Plane layers and intended voids present; delete leftover+  auto-placement zones, dangling stubs, one-layer vias.++## 6. Verify before reporting++Every suspicious finding gets a primary source: datasheet, vendor hardware+design checklist, or EVB schematic. Check Adom wiki component pages and+`*-usage` skills first — they encode the exact variant (a "wrong" divider is+how the 0.763 V-VFB variant looks when you assume 0.6 V). For multi-IC boards,+fan out one research agent per major IC with numbered questions; require quoted+evidence and a confidence level. Anything unconfirmed stays flagged "verify+against datasheet", never asserted.++## 7. Report++Severity-ranked: **Critical** (won't work / won't fab) → **High** (works wrong+or marginal) → **Medium** (fix next spin) → **Low** (advisory). Each finding:+refs + pin numbers, why (with source), and one concrete fix. Include a+**verified-correct** section for cleared suspicions — it stops the next+reviewer re-flagging good design.
assets/kicad_netlist.pyadded+92
@@ -0,0 +1,92 @@+#!/usr/bin/env python3+"""Pad-level netlist + layout stats from a .kicad_pcb (KiCad 7-10, stdlib only).++Usage: kicad_netlist.py <board.kicad_pcb>++Prints: components (ref/value/footprint/layer/DNP-attrs), per-net pin lists+with pin functions, pads with no net, per-net routed track length + via count.+Handles both pad-net forms: (net N "name") pre-v10, (net "name") v10+.+"""+import math, re, sys+from collections import defaultdict++def parse(text):+    # quote-aware tokenizer: pin names may contain parentheses+    toks = re.findall(r'"(?:[^"\\]|\\.)*"|\(|\)|[^\s()"]+', text)+    stack = [[]]+    for t in toks:+        if t == '(':+            new = []+            stack[-1].append(new)+            stack.append(new)+        elif t == ')':+            stack.pop()+        else:+            if t.startswith('"'):+                t = t[1:-1].replace('\\"', '"').replace('\\\\', '\\')+            stack[-1].append(t)+    return stack[0]++def first(node, tag):+    for c in node:+        if isinstance(c, list) and c and c[0] == tag:+            return c+    return None++def atom(node, tag, idx=1):+    n = first(node, tag)+    return n[idx] if n and len(n) > idx and not isinstance(n[idx], list) else None++def pad_net(pad):+    n = first(pad, 'net')+    if not n:+        return None+    return n[2] if len(n) >= 3 else n[1]   # (net N "name") | (net "name")++def refkey(ref):+    m = re.match(r'([A-Za-z_#]+)(\d*)', ref)+    return (m.group(1), int(m.group(2) or 0))++def main(path):+    root = parse(open(path, encoding='utf-8').read())[0]+    comps, net_pins, no_net = [], defaultdict(list), []+    for fp in (c for c in root if isinstance(c, list) and c and c[0] == 'footprint'):+        props = {p[1]: p[2] for p in fp+                 if isinstance(p, list) and p and p[0] == 'property'+                 and len(p) >= 3 and not isinstance(p[2], list)}+        ref = props.get('Reference', '?')+        attrs = first(fp, 'attr')+        flags = [a for a in (attrs[1:] if attrs else []) if not isinstance(a, list)]+        comps.append((ref, props.get('Value', '?'), fp[1], atom(fp, 'layer') or '?', ','.join(flags)))+        for pad in (c for c in fp if isinstance(c, list) and c and c[0] == 'pad'):+            net, fn = pad_net(pad), atom(pad, 'pinfunction')+            tag = f"{ref}.{pad[1]}" + (f"({fn})" if fn else "")+            if net:+                net_pins[net].append(tag)+            elif pad[2] in ('smd', 'thru_hole'):+                no_net.append(tag)++    netlen, vias = defaultdict(float), defaultdict(int)+    for c in root:+        if isinstance(c, list) and c and c[0] == 'segment':+            s, e = first(c, 'start'), first(c, 'end')+            netlen[atom(c, 'net')] += math.hypot(+                float(e[1]) - float(s[1]), float(e[2]) - float(s[2]))+        elif isinstance(c, list) and c and c[0] == 'via':+            vias[atom(c, 'net')] += 1++    print(f"== COMPONENTS ({len(comps)}) ==")+    for ref, val, fpname, layer, flags in sorted(comps, key=lambda x: refkey(x[0])):+        print(f"{ref:10s} {val[:38]:38s} {fpname[:52]:52s} {layer} {flags}")+    print(f"\n== NETS ({len(net_pins)}): pins | routed mm | vias ==")+    for net in sorted(net_pins):+        print(f"{net}  [{len(net_pins[net])} pins, {netlen.get(net, 0):.1f}mm, {vias.get(net, 0)} vias]")+        print("    " + " ".join(sorted(net_pins[net])))+    print(f"\n== PADS WITH NO NET ({len(no_net)}) ==")+    for t in no_net:+        print("  " + t)++if __name__ == '__main__':+    if len(sys.argv) != 2:+        sys.exit(__doc__)+    main(sys.argv[1])
docs/HERO.mdadded+8
@@ -0,0 +1,8 @@+Generate `hero.png` for this folder in Hero Studio. It is the page-header image, reused on the homepage and the screensaver; the page overlays live stats on its lower third, so the image carries the title and artwork only.++New app/skill heroes MUST come from Hero Studio (the server rejects anything else with HERO_STUDIO_REQUIRED; the studio stamps provenance into the PNG and exports at 2000x1250):++1. `adom-wiki pkg install adom/hero-studio`+2. start it (`hero-studio`, port 8846) and open the webview so the human sees it+3. pose the hero (the UI, or POST /state), then Generate+4. copy `generated/latest.png` here as `docs/hero.png`
docs/hero.pngadded
⋯ 1 unchanged line ⋯
install.shadded+7
@@ -0,0 +1,7 @@+#!/bin/sh+set -e++# Link the skill into the agent's skill directory so edits/updates propagate.+mkdir -p "$HOME/.claude/skills"+ln -sfn "$PWD" "$HOME/.claude/skills/kicad-board-audit"+echo "installed: ~/.claude/skills/kicad-board-audit -> $PWD"
package.jsonadded+47
@@ -0,0 +1,47 @@+{+  "slug": "kicad-board-audit",+  "title": "KiCad Board Audit",+  "type": "skill",+  "version": "1.0.0",+  "description": "Agent skill for auditing any KiCad board before fab: real ERC/DRC, pad-level netlist extraction from the .kicad_pcb, and a checklist for the bugs ERC can't see — floating mandatory pins, supply pins on GND, wrong straps, wrong-variant feedback dividers, missing pull-ups, impedance class misassignment — verified against datasheets and reported by severity.",+  "tags": [+    "skill",+    "kicad",+    "pcb",+    "design-review",+    "erc",+    "drc",+    "hardware"+  ],+  "dependencies": {},+  "discovery_triggers": [+    "audit this board",+    "review my board for errors",+    "check my PCB before I order it",+    "kicad design review",+    "run ERC and DRC on my project",+    "find mistakes in my schematic"+  ],+  "discovery_pitch": "Reach for kicad-board-audit whenever a user asks to review, audit, or error-check a KiCad schematic or PCB before fabrication.",+  "sample_prompts": [+    {+      "label": "Full audit",+      "prompt": "Review this board for any and all errors: ~/projects/MyBoard/MyBoard.kicad_pro"+    },+    {+      "label": "Pre-order check",+      "prompt": "I'm about to order this PCB from JLCPCB — audit it first"+    },+    {+      "label": "Netlist only",+      "prompt": "Extract the netlist from my .kicad_pcb and check every IC's power and strap pins"+    }+  ],+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "hero": {+    "path": "docs/hero.png"+  }+}
uninstall.shadded+5
@@ -0,0 +1,5 @@+#!/bin/sh+set -e++rm -f "$HOME/.claude/skills/kicad-board-audit"+echo "uninstalled"