/kicad-electronica:platformiofrom Electrónica y PCB con KiCad
PlatformIO embedded development platform expertise. Project setup, configuration, building, debugging, and library management for Arduino, ESP-IDF, STM32, and more.
Ships in Electrónica y PCB con KiCad. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Complete reference for PlatformIO embedded development.
# Install via pip
pip install platformio
# Or via installer script
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python3 get-platformio.py
project/
├── platformio.ini # Project configuration
├── src/
│ └── main.cpp # Main source file
├── include/ # Header files
├── lib/ # Project-specific libraries
├── test/ # Unit tests
└── .pio/ # Build output (gitignored)
; Global options
[platformio]
default_envs = esp32dev
src_dir = src
include_dir = include
; Environment definition
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
| Platform | Board Examples | Frameworks |
|---|---|---|
espressif32 | esp32dev, esp32-s3-devkitc-1 | arduino, espidf |
espressif8266 | esp12e, d1_mini | arduino |
ststm32 | nucleo_f446re, bluepill_f103c8 | arduino, stm32cube |
raspberrypi | pico | arduino |
atmelavr | uno, nanoatmega328 | arduino |
; ESP32 with Arduino
[env:esp32-arduino]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600
lib_deps =
bblanchon/ArduinoJson@^7.0.0
; ESP32-S3 with PSRAM
[env:esp32s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
build_flags =
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
; ESP32 with ESP-IDF
[env:esp32-idf]
platform = espressif32
board = esp32dev
framework = espidf
monitor_speed = 115200
board_build.partitions = partitions.csv
; Nucleo F446RE
[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = arduino
upload_protocol = stlink
; Blue Pill
[env:bluepill]
platform = ststm32
board = bluepill_f103c8
framework = arduino
upload_protocol = stlink
; Raspberry Pi Pico
[env:pico]
platform = raspberrypi
board = pico
framework = arduino
; Pico W with WiFi
[env:picow]
platform = raspberrypi
board = rpipicow
framework = arduino
# Build default environment
pio run
# Build specific environment
pio run -e esp32dev
# Build with verbose output
pio run -v
# Clean build
pio run -t clean
# Full clean (remove .pio)
pio run -t cleanall
# Build and upload
pio run -t upload
# Upload to specific environment
pio run -e esp32dev -t upload
# Upload using specific port
pio run -t upload --upload-port /dev/ttyUSB0
# Start monitor
pio device monitor
# With specific baud rate
pio device monitor -b 115200
# With specific port
pio device monitor -p /dev/ttyUSB0
# Monitor with filters
pio device monitor --filter esp32_exception_decoder
# Run all tests
pio test
# Run tests for specific environment
pio test -e native
# Run specific test
pio test -f test_foo
# Verbose test output
pio test -v
# List connected devices
pio device list
# List available boards
pio boards
# Search boards
pio boards esp32
# Search libraries
pio pkg search "json"
# Install library
pio pkg install --library "bblanchon/ArduinoJson"
# Install specific version
pio pkg install --library "bblanchon/ArduinoJson@^7.0.0"
# List installed libraries
pio pkg list
# Update libraries
pio pkg update
build_flags =
-DDEBUG ; Define DEBUG macro
-DVERSION=\"1.0.0\" ; String define (escaped quotes)
-I include/extra ; Additional include path
-Wall ; Enable all warnings
-Wextra ; Extra warnings
-O2 ; Optimization level
build_flags =
-DCORE_DEBUG_LEVEL=3 ; Debug output level (0-5)
-DBOARD_HAS_PSRAM ; Enable PSRAM
-DCONFIG_ASYNC_TCP_RUNNING_CORE=1
build_flags =
${env.build_flags} ; Inherit from parent
$BUILD_FLAGS ; From environment variable
lib_deps =
; Library by owner/name
bblanchon/ArduinoJson@^7.0.0
; Library by name only
Adafruit Unified Sensor
; GitHub repository
https://github.com/me/mylib.git
; Specific branch/tag
https://github.com/me/mylib.git#develop
; Local library
file:///path/to/library
lib_deps =
[email protected] ; Exact version
library@^1.2.3 ; Compatible (>=1.2.3 <2.0.0)
library@~1.2.3 ; Approximate (>=1.2.3 <1.3.0)
library@>=1.0.0 ; Minimum version
[env]
; Shared across all environments
monitor_speed = 115200
lib_deps =
bblanchon/ArduinoJson@^7.0.0
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
[env:esp32s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
build_flags =
-DBOARD_HAS_PSRAM
[env:debug]
extends = env:esp32dev
build_type = debug
build_flags =
-DDEBUG=1
-g3
[env:release]
extends = env:esp32dev
build_type = release
build_flags =
-DNDEBUG
-O2
test/
├── test_main.cpp ; Native tests
├── test_embedded/
│ └── test_gpio.cpp ; On-device tests
└── unity.h ; Unity test framework (included)
#include <unity.h>
void setUp(void) {
// Runs before each test
}
void tearDown(void) {
// Runs after each test
}
void test_addition(void) {
TEST_ASSERT_EQUAL(4, 2 + 2);
}
void test_string(void) {
TEST_ASSERT_EQUAL_STRING("hello", "hello");
}
int main(int argc, char **argv) {
UNITY_BEGIN();
RUN_TEST(test_addition);
RUN_TEST(test_string);
UNITY_END();
}
[env:native]
platform = native
test_framework = unity
[env:debug]
platform = espressif32
board = esp32dev
framework = arduino
debug_tool = esp-prog
debug_init_break = tbreak setup
# Start debugger
pio debug
# Start with GDB
pio debug --interface=gdb
[env:esp32dev]
extra_scripts =
pre:scripts/pre_build.py
post:scripts/post_build.py
# scripts/pre_build.py
Import("env")
def before_build(source, target, env):
print("Before build!")
env.AddPreAction("buildprog", before_build)
| Issue | Solution |
|---|---|
| Upload failed | Check port, try lower upload_speed |
| Library not found | Use full owner/name format |
| Build error | Clean with pio run -t clean |
| Wrong board | Verify board ID with pio boards |
Note: PlatformIO supports 1000+ boards. Use
pio boards <search>to find your board.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lagzgabrielmuller-dot/kit-ingenieria-3d --plugin kicad-electronica16 skills in this plugin
/altium-designerAutomate Altium Designer PCB workflows with DXP scripts, design-rule checks, OutJob fabrication outputs, and routing configuration./bomBOM (Bill of Materials) management for electronics projects — the workflow skill that coordinates DigiKey, Mouser, LCSC, element14, JLCPCB, PCBWay, and KiCad skills around a unified BOM lifecycle. Create, update, and maintain BOMs with part numbers, costs, quantities stored as KiCad symbol properties. ALWAYS trigger this skill for any task involving component sourcing, pricing, ordering, distributor searches, BOM export, or fabrication preparation — even if the user names a specific distributor or fab house (e.g. "search DigiKey for...", "generate JLCPCB BOM", "order from Mouser"). This skill analyzes the schematic for sourcing gaps, recommends which distributor/fab skills to call for each gap, and writes results back as symbol properties — the agent (or user) performs the actual searches via the called skills. Also trigger on phrases like "what parts do I need", "order components", "how much will this cost", "export for JLCPCB", "find parts for this board", "compare pricing", or "check stock"./datasheetsExtract structured specifications from electronic component datasheet PDFs — pinouts, electrical characteristics, peripherals, topology, and features. Cache extractions per project for consumption by schematic and PCB analyzers. Primary consumer infrastructure for `kicad`, `emc`, `spice`, and `thermal` analyzers. Use this skill whenever the user asks to extract, verify, or read specs from a component datasheet; when analyzers need verified IC knowledge (EN pin thresholds, PG presence, USB peripheral speed); or when a review mentions datasheet coverage, extraction quality, or per-MPN specifications. Also triggers on "extract this datasheet", "what are the specs for MPN X", "verify datasheet extraction", or "check pin functions for part Y"./digikeySearch DigiKey for electronic components and download datasheets — primary source for prototype orders and the preferred API method for fetching datasheets. Find parts by keyword or MPN, check pricing/stock, download datasheets via API, analyze specifications. Sync and maintain a local datasheets directory — extract components from schematics, download missing datasheets, keep them up to date. Also supports batch MPN-list seeding (`--mpn-list`) for bulk workflows without a KiCad project. Use when the user asks about electronic components, part specs, datasheets, pricing, stock, footprints, or needs to download a datasheet — even without mentioning "DigiKey". Also for "sync datasheets", "download datasheets for my board/project", or mentions a datasheets directory. DigiKey is the default distributor for prototyping. For BOM workflows, see the bom skill./element14Search Newark, Farnell, and element14 for electronic components — find parts by MPN or distributor part number, check pricing/stock, download datasheets, analyze specifications. One unified API covers all three storefronts (Newark for US, Farnell for UK/EU, element14 for APAC). Free API key, simple query-parameter auth, no OAuth. Datasheets download directly from farnell.com CDN with no bot protection. Sync and maintain a local datasheets directory for a KiCad project, or use batch MPN-list seeding (`--mpn-list`) for bulk workflows without a project. Use this skill when the user mentions Newark, Farnell, element14, needs parts from a non-US distributor, wants to compare pricing across regions, or needs datasheets from a source that doesn't require complex API auth. For package cross-reference tables and BOM workflow, see the `bom` skill./emcEMC pre-compliance risk analysis for KiCad PCB designs — 18 check categories, 44 rule IDs covering ground planes, decoupling, I/O filtering, switching harmonics, clock routing, differential pair skew, board edge radiation, PDN impedance, return paths, crosstalk, ESD protection, shielding, and magnetic leakage from switching inductors. Produces severity-ranked risk report with pre-compliance test plan. Supports FCC Part 15, CISPR 32, CISPR 25 (automotive), MIL-STD-461G. SPICE-enhanced when available. Use when the user asks about EMC, EMI, radiated/conducted emissions, FCC compliance, CE marking, CISPR, ground plane issues, decoupling strategy, clock routing EMC, switching noise, differential pair skew, or whether their board will pass EMC testing. Also for "will this pass FCC?", "check my EMC", "is my ground plane okay?", "check my decoupling", or "generate an EMC test plan".