KiCad - the KiCad Bridge
Public Made by Adomby adom
Drive your own KiCad from an AI, in the background: open every editor, read the whole board as data (the EDA Bridge Standard board model), stack-up, part heights, netlists, place, route, pour, DRC and exports.
install_symbol: 'No symbols found' on a valid .kicad_sym whose top-level symbol is at column 0 (regex requires indentation)
install_symbol "No symbols found in the provided file content" on a valid .kicad_sym whose top-level symbol is at column 0
Live, bridge 0.9.186, KiCad 10.0, Colby-ROG2. kicad_install_symbol fails on a valid, complete KiCad 10 symbol file:
kicad_install_symbol {fileContent:<base64 of lm1117.kicad_sym>, fileName:"lm1117.kicad_sym", quietInstall:true}
-> success:false, error:"No symbols found in the provided file content"
The file is well-formed: 2540 bytes, parens balanced (109/109), generator kicad_symbol_editor 10.0, (version 20251024), three (symbol "..." blocks: LM1117DT-3.3 (top level) + LM1117DT-3.3_0_1 + LM1117DT-3.3_1_1 (its sub-units). It renders fine in the wiki's own symbol viewer.
Root cause
bridges/kicad/adom_library.py extracts top-level symbols with a regex that REQUIRES leading whitespace:
# line 168
for m in re.finditer(r'^[ \t]+\(symbol\s+"([^"]+)"', text, re.MULTILINE):
...
if re.search(r"_\d+_\d+$", name): # skip sub-units
continue
# (and _SYMBOL_NAME_RE at line 26: r'^\s+\(symbol\s+"([^"]+)"')
But in this file the TOP-LEVEL symbol line has NO indentation, while the sub-units are indented two tabs:
line 5: (symbol "LM1117DT-3.3" <- column 0, no leading whitespace
line 87: \t\t(symbol "LM1117DT-3.3_0_1" <- indented
line 100: \t\t(symbol "LM1117DT-3.3_1_1" <- indented
So ^[ \t]+ matches only the two sub-units, which are then dropped by the _\d+_\d+ suffix filter -> zero top-level symbols -> "No symbols found". (Note the comment at adom_library.py:161-167 says ^[ \t]+ was itself the FIX for an earlier "No symbols found" where symbols were indented; this file is the mirror case.)
Why the file looks like that
Indentation is not semantic in s-expressions, and this file is inconsistent (version/generator are 1-tab indented, the top-level symbol is at column 0), so it was likely hand-edited or produced by a non-KiCad tool even though the generator stamp says kicad 10. The wiki serves it verbatim. The point is a robustness one: a valid .kicad_sym should install regardless of indentation.
Fix
Match a top-level (symbol with ZERO-OR-MORE leading whitespace, and rely on the existing _\d+_\d+ sub-unit filter to exclude nested units:
re.finditer(r'^[ \t]*\(symbol\s+"([^"]+)"', text, re.MULTILINE) # + the same on _SYMBOL_NAME_RE
That handles column-0 AND indented top-level symbols without re-admitting sub-units (they still carry the _N_N suffix). Repro file: https://wiki.adom.inc/ray/lm1117 (lm1117.kicad_sym). Happy to run the install live again after a fix.