arduino-code-generator — скилл для Claude Code: как установить
Генерирует код на C++ для плат UNO, ESP32 и RP2040: от опроса датчиков и устранения дребезга кнопок до конечных автоматов и сохранения в EEPROM.
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a claude-codeЧто делает arduino-code-generator
Скилл добавляет набор шаблонов и скриптов для написания прошивок под микроконтроллеры. В репозиторий входят готовые примеры под девять категорий задач: фильтрация шумов АЦП (медиана, Калман, скользящее среднее), шины I2C и SPI, планировщик задач на millis() без задержек delay(), а также запись в память EEPROM и на SD-карты.
Генерация опирается на утилиту scripts/generate_snippet.py, которую можно запускать через uv run в интерактивном режиме или с передачей флагов --pattern и --board. Для проверки компиляции под UNO, ESP32 и RP2040 встроены скрипты verify_patterns.sh и verify_patterns.ps1.
Флаг целевой платы в шаблонизаторе выбирает заготовки, но не гарантирует работу на похожих микросхемах других ревизий. Перед генерацией коду требуются точные параметры оборудования: рабочее напряжение, номера пинов, версии библиотек и ограничения памяти SRAM.
Какие задачи решает
- Настроить неблокирующий опрос датчиков и задач через
millis()без вызововdelay() - Добавить программный антидребезг кнопок с отслеживанием длинных нажатий
- Отфильтровать шум аналоговых входов скользящим средним, медианой или алгоритмом Калмана
- Наладить запись логов в EEPROM с контролем CRC или на карту памяти FAT32
Примеры запросов агенту
- Сгенерируй для ESP32 чтение датчика BME280 по шине I2C без блокирующих вызовов delay
- Создай скетч для Arduino UNO с программным антидребезгом кнопки на пине D2
- Сделай конечный автомат для платы RP2040 с записью показаний в EEPROM
Как установить arduino-code-generator
1Через Skills CLI (Vercel)
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a claude-code2Вручную: положить файлы
~/.claude/skills/arduino-code-generator/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/arduino-code-generator/
1Через Skills CLI (Vercel)
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a codex2Вручную: положить файлы
.agents/skills/arduino-code-generator/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a cursor2Вручную: положить файлы
.cursor/skills/arduino-code-generator/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install wedsamuel1230/embedded-engineering-skills arduino-code-generator2Вручную: положить файлы
.github/skills/arduino-code-generator/SKILL.md1Через Skills CLI (Vercel)
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a gemini-cli2Командой платформы
gemini skills install https://github.com/wedsamuel1230/embedded-engineering-skills --path skills/arduino-code-generatorВручную: положить файлы
.devin/skills/arduino-code-generator/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о arduino-code-generator
Как установить arduino-code-generator в Claude Code?
Выполните команду npx skills add wedsamuel1230/embedded-engineering-skills --skill arduino-code-generator -a claude-code.
Какие микроконтроллеры поддерживает скилл?
Встроенные шаблоны рассчитаны на Arduino UNO, ESP32 и RP2040. Для остальных плат нужно вручную передать распиновку и параметры периферии.
Что нужно сообщить агенту перед генерацией прошивки?
Укажите точную модель платы, используемый фреймворк, рабочее напряжение, номера пинов и версии внешних библиотек.
Исходный текст
SKILL.md · MIT
---
name: arduino-code-generator
description: Generate Arduino and embedded C++ snippets for sensors, actuators, buses, state machines, timing, data logging, and hardware abstraction. Use when a user requests implementation code and provide the exact board, framework, toolchain, pins, voltage, memory, and library versions first. Bundled templates target UNO, ESP32, and RP2040; document unsupported board or vendor-framework behavior instead of guessing.
metadata: {triggers: "generate Arduino code, C++, sensor, actuator, state machine"}
---
# Arduino Code Generator
Generate production-quality Arduino code snippets for sensors, actuators, communication, and embedded patterns.
## Quick Start
**Browse example sketches:**
```bash
# See 9 production-ready examples in examples/ folder
ls examples/
# config-example.ino, filtering-example.ino, buttons-example.ino,
# i2c-example.ino, csv-example.ino, scheduler-example.ino,
# state-machine-example.ino, hardware-detection-example.ino,
# data-logging-example.ino
```
**List available patterns:**
```bash
uv run --no-project scripts/generate_snippet.py --list
```
**Generate code for specific pattern and board:**
```bash
uv run --no-project scripts/generate_snippet.py --pattern i2c --board esp32
uv run --no-project scripts/generate_snippet.py --pattern buttons --board uno --output button.ino
```
**Interactive mode:**
```bash
uv run --no-project scripts/generate_snippet.py --interactive
```
## Target Gate
Read [the shared contract](../../docs/arduino-skill-contract.md) and the board
profile before selecting pins, APIs, or libraries. Keep board-specific branches
isolated, check memory and peripheral constraints, and state whether the result
has build proof only or also has upload, hardware, and system proof. The
generator's board flag is a template selector, not evidence that the generated
code works on a similar-looking board.
## Resources
- **examples/** - 9 production-ready example sketches (one per pattern category)
- **examples/README.md** - Detailed documentation for each example with wiring diagrams
- **scripts/generate_snippet.py** - CLI tool for code generation with 9 pattern templates
- **scripts/verify_patterns.ps1** - Compile examples for UNO/ESP32/RP2040 (PowerShell)
- **scripts/verify_patterns.sh** - Compile examples for UNO/ESP32/RP2040 (bash)
- **assets/workflow.mmd** - Mermaid diagram of code generation workflow
## Supported Patterns
### Hardware Abstraction
- Multi-board config.h with conditional compilation
- Pin definitions for UNO/ESP32/RP2040
- Memory budget tracking
See [patterns-config.md](references/patterns-config.md) | Example: [config-example.ino](examples/config-example.ino)
### Sensor Reading & Filtering
- ADC noise reduction (moving average, median, Kalman)
- DHT22, BME280, analog sensors
- Data validation and calibration
See [patterns-filtering.md](references/patterns-filtering.md) | Example: [filtering-example.ino](examples/filtering-example.ino)
### Input Handling
- Software button debouncing
- Edge detection (PRESSED/RELEASED/LONG_PRESS)
- Multi-button management
See [patterns-buttons.md](references/patterns-buttons.md) | Example: [buttons-example.ino](examples/buttons-example.ino)
### Communication
- I2C device scanning and diagnostics
- SPI configuration
- UART/Serial protocols
- CSV data output
See [patterns-i2c.md](references/patterns-i2c.md) and [patterns-csv.md](references/patterns-csv.md) | Examples: [i2c-example.ino](examples/i2c-example.ino), [csv-example.ino](examples/csv-example.ino)
### Timing & Concurrency
- Non-blocking millis() patterns
- Task scheduling without delay()
- Priority-based schedulers
- State machines
See [patterns-scheduler.md](references/patterns-scheduler.md) and [patterns-state-machine.md](references/patterns-state-machine.md) | Examples: [scheduler-example.ino](examples/scheduler-example.ino), [state-machine-example.ino](examples/state-machine-example.ino)
### Hardware Detection
- Auto-detect boards (UNO/ESP32/RP2040)
- SRAM usage monitoring
- Sensor fallback strategies
- Adaptive configuration
See [patterns-hardware-detection.md](references/patterns-hardware-detection.md) | Example: [hardware-detection-example.ino](examples/hardware-detection-example.ino)
### Data Persistence
- EEPROM with CRC validation
- SD card FAT32 logging
- Wear leveling for EEPROM
- Buffered writes
See [patterns-data-logging.md](references/patterns-data-logging.md) | Example: [data-logging-example.ino](examples/data-logging-example.ino)
## Code Generation Workflow
- [ ] **[Identify Pattern Type](workflow/step1-identify-pattern.md)** - Analyze user request to determine core pattern category
- [ ] **[Read Reference Documentation](workflow/step2-read-reference.md)** - Consult pattern-specific reference files for implementation details
- [ ] **[Generate Code](workflow/step3-generate-code.md)** - Create production-ready code following quality standards
- [ ] **[Provide Instructions](workflow/step4-provide-instructions.md)** - Include wiring diagrams and usage guidance
- [ ] **[Mention Integration](workflow/step5-mention-integration.md)** - Suggest combinations with other patterns when relevant
## Quality Standards & Rules
- [ ] **[Quality Standards](rules/quality-standards.md)** - Compilation, timing, memory safety, and error handling requirements
- [ ] **[Board Optimization](rules/board-optimization.md)** - UNO, ESP32, and RP2040 specific optimizations and features
- [ ] **[Common Pitfalls](rules/common-pitfalls.md)** - Critical mistakes to avoid in Arduino development
## Code Output Template
- [ ] **[Code Template](templates/code-output-template.md)** - Standardized structure for generated Arduino sketches
## Resources
- **examples/** - 9 production-ready example sketches (one per pattern category)
- **examples/README.md** - Detailed documentation for each example with wiring diagrams
- **scripts/generate_snippet.py** - CLI tool for code generation with 9 pattern templates
- **assets/workflow.mmd** - Mermaid diagram of code generation workflow
- **workflow/** - Step-by-step code generation process
- **rules/** - Quality standards and board-specific optimizations
- **templates/** - Code output templates and structure guidelines
- **references/** - Detailed pattern documentation and API references
- **references/README.md** - Reference structure and formatting guide
## Shared Output Contract
Use [the shared Arduino skill contract](../../docs/arduino-skill-contract.md):
state assumptions, required tools and versions, implementation steps,
tests/evidence by proof stage, known limitations, and recovery/security notes.
© wedsamuel1230 · MIT · wedsamuel1230/embedded-engineering-skills