These rules apply to humans and automated contributors working in this repository.
PyBLE (“Python over BLE”) is a free, MIT-licensed, tablet-first MicroPython IDE. The Flutter app communicates over Bluetooth Low Energy with a compatible board running MicroPython and the portable PyBLE agent.
- App:
app/ - Agent firmware:
firmware/ - Open wire protocol: PBLE/1, specified in
docs/specifications/protocol.md - Initial validated ports:
esp32,esp32-s3, andesp32-c3
Support is capability-defined, not tied to one chip family. A new port needs a maintained PBLE/1 agent, BLE GATT peripheral support, sufficient resources, and the project’s conformance and hardware-validation gates.
- All PyBLE-authored source is MIT licensed.
- Author changes fresh. Do not paste proprietary or unknown-licensed source, protocols, UUIDs, board profiles, examples, or product-specific pedagogy.
- Keep PyBLE identifiers independent:
PBLE/1,pble_*,pyble_*, the PyBLE UUID base, and thePyBLE-advertising prefix. - Run
tools/ci/no_leak.shbefore committing. The gate is the canonical, tested list of prohibited identifiers in shippable source. - Third-party dependencies remain under their own licenses and must be recorded in the relevant dependency and notice files.
docs/specifications/defines public behavior and architecture.- Change the relevant specification before implementation when a contract changes.
- Work red → green → refactor:
- add a failing test in a
[red]commit; - implement the minimum passing change in a
[green]commit; - clean up in a
[refactor]commit while tests remain green.
- add a failing test in a
- No behavior is complete without an automated test. Hardware behavior also needs the documented HIL evidence.
- Sign off every commit for DCO compliance:
git commit -s.
Allowed commit prefixes are [red], [green], [refactor], [docs],
[build], and [chore].
Keep the repository root limited to governance files and these directories:
.github/ app/ docs/ firmware/ protocol/ examples/ tests/ tools/
Root governance files are:
README.md LICENSE CONTRIBUTING.md CODE_OF_CONDUCT.md SECURITY.md
CHANGELOG.md AGENTS.md CLAUDE.md .gitignore .gitmodules
Put specifications and decisions under docs/, scripts under tools/ or
firmware/scripts/, and examples under examples/. Keep screenshots, signing
material, builds, assistant state, and local notes out of Git.
- Product and wordmark: PyBLE
- Domain:
pyble.dev - Protocol: PBLE/1
- Native modules:
pyble_agent,pyble_ble,pyble_runner,pyble_fs, and relatedpyble_*/pble_*files - Flutter packages:
lib/ble/,lib/pble/,lib/editor/,lib/console/,lib/files/,lib/blocks/, andlib/localization/
- Do not edit upstream MicroPython or Blockly in place. Pin upstream as
submodules; isolate any unavoidable MicroPython patch under
firmware/patches/with a written reason. - Do not make USB serial or Wi-Fi the primary workflow. PyBLE is BLE-first.
- Do not introduce paid or closed features.
- Do not ship compiled
.mpyexamples; use readable.pyfiles. - Do not commit credentials, signing assets, firmware binaries, IPA files, or generated build directories.