fbuild is a PlatformIO-compatible embedded build tool (11 crates). See @docs/CLAUDE.md for which architecture doc to read based on what you're working on.
- Always use
soldroruv run soldrto execute Rust commands. Bare cargo/rustc and legacyuv run cargoshims are blocked by hook. soldr usesrustup whichto pick the rustup-managed toolchain fromrust-toolchain.toml. The standard Cargo path issoldr cargo ..., so repo Rust builds get soldr's managed zccache path by default; do not add repo-specificRUSTC_WRAPPERwiring for normal builds. - Always use
uvfor Python. Barepython/pipare blocked by hook. Useuv run ...oruv pip .... - MSRV: 1.94.1 | Edition: 2021 | Toolchain: 1.94.1 pinned in
rust-toolchain.toml(clippy + rustfmt) - CI: Linux, macOS, Windows. All warnings denied (
RUSTFLAGS="-D warnings") - Every directory with files must have a README.md (enforced by hook)
uv run test # unit tests only
uv run test --full # unit + stress + integration tests
uv run test -p <crate> -- <test_name>
uv run soldr cargo check --workspace --all-targets
uv run soldr cargo clippy --workspace --all-targets -- -D warnings
uv run soldr cargo fmt --all
RUSTDOCFLAGS="-D warnings" uv run soldr cargo doc --workspace --no-deps
# Public deploy API conventions
uv run soldr cargo run -p fbuild-cli -- deploy tests/platform/uno -e uno --to emu
uv run soldr cargo run -p fbuild-cli -- deploy tests/platform/uno -e uno --to emu --monitor
uv run soldr cargo run -p fbuild-cli -- deploy tests/platform/esp32dev -e esp32dev-qemu --to emu --emulator qemu
# test-emu: build + run in emulator (CI-friendly, exits with emulator exit code)
uv run soldr cargo run -p fbuild-cli -- test-emu tests/platform/uno -e uno
uv run soldr cargo run -p fbuild-cli -- test-emu tests/platform/esp32s3 -e esp32s3 --timeout 10
uv run soldr cargo run -p fbuild-cli -- test-emu tests/platform/mega -e megaatmega2560 --emulator simavr
# Direct soldr commands (alternative to uv run soldr)
soldr cargo check --workspace --all-targets
soldr cargo clippy --workspace --all-targets -- -D warnings
soldr rustfmt --check <file.rs>
# Board definition management
uv run python ci/validate_boards.py # validate against PlatformIO
uv run python ci/validate_boards.py --external # compare against Arduino + Zephyr
uv run python ci/board_sources.py --search QUERY # search all external sources
uv run python ci/board_sources.py --compare # find boards missing from fbuild
uv run python ci/board_sources.py --list-arduino # list Arduino package index boards
uv run python ci/board_sources.py --list-zephyr # list Zephyr boards
uv run soldr cargo run -p fbuild-config --bin enrich_boards # enrich from local PlatformIONative binaries are built via GitHub Actions and downloaded locally for packaging. PyPI is the distribution channel — no Python in the runtime hot path.
# Build all platforms (triggers GH Actions, waits, downloads to dist/)
uv run python ci/build_dist.py --ref main
# Publish to PyPI
./publishOptional wrapper-mode only; do not use for standard soldr builds:
uv run python ci/zccache_setup.py # writes rustc-wrapper = "zccache"All hooks are Python scripts in ci/hooks/, invoked via uv run:
- UserPromptSubmit:
ci/hooks/board_context.pydetects board-related prompts and injects skill guidance (board lookup workflow, external source URLs, relevant commands) - PreToolUse:
ci/hooks/tool_guard.pyblocks bare Rust commands and legacyuv run cargoshims (must usesoldroruv run soldr) and barepython/pip(must useuv) across supported shell tools, not just Bash - PostToolUse:
ci/hooks/lint.pyauto-formats + runs clippy on edited .rs files - PostToolUse:
ci/hooks/readme_guard.pyerrors if directory lacks README.md - SessionStart:
ci/hooks/check-on-start.pycaptures git fingerprint - Stop:
ci/hooks/code-review-on-stop.pytriggers/code-reviewskill if source files changed - Stop:
ci/hooks/check-on-stop.pyruns full workspace lint + tests (skips if no changes)
Custom Claude Code skills in .claude/skills/:
/board-support— Diagnose and fix board definition issues. Searches fbuild's database, PlatformIO, Arduino package indices, and Zephyr boards. Auto-suggested by theboard_context.pyhook when board-related prompts are detected./code-review— End-of-session code review. Checks for hardcoded values (should be in JSON), code that belongs in core instead of platform crates, board/MCU JSON quality, orchestrator completeness, and bugs. Auto-triggered by Stop hook.
- Python is only for CI scripts, packaging, hooks, and PyO3 bindings. All tests, benchmarks, and application logic must be written in Rust.
uv runis required only because hooks enforce it for toolchain management — it is not an endorsement of Python for project code.- Exception:
fbuild-pythoncrate provides PyO3 bindings so FastLED canfrom fbuild.api import SerialMonitor. - When in doubt, write it in Rust.
- Red → Green → Refactor. Write failing tests first, then implement the minimum code to make them pass, then refactor.
- Tests are the spec. If the test suite passes, the feature works. If behavior isn't tested, it doesn't exist.
- Comprehensive tests over comprehensive docs. Tests are executable documentation.
- Test real behavior: use
tempfilefor filesystem tests, not mocks. Test the contract, not the implementation. - A/B testing: FastLED can switch between
--platformioand fbuild. The Python integration tests in~/dev/fbuild/tests/are the acceptance criteria.
- Simplicity first. Minimal code impact. No over-engineering.
- No laziness. Root causes only. Senior developer standards.
- Verify before done. Run tests, demonstrate correctness.
- Plan non-trivial work in
tasks/todo.md. Capture lessons intasks/lessons.md.
- No file-based locks — all locking through daemon's in-memory managers
- Dev mode isolation —
FBUILD_DEV_MODE=1→ port 8865,~/.fbuild/dev/ - HTTP API compatibility — same endpoints and JSON schemas as the Python daemon
- Windows USB-CDC — 30 retries, aggressive buffer drain, DTR/RTS toggling after flash
- Emulator CLI convention — prefer
fbuild test-emufor CI;fbuild deploy --to emu [--emulator <kind>]for interactive use; keep--targetand--qemuonly as compatibility aliases
- Python fbuild:
~/dev/fbuild(production) andmainbranch of this repo - zccache:
~/dev/zccache(Rust workspace pattern, CI, distribution) - FastLED:
~/dev/fastled(consumer of fbuild's serial API)