meshcore-open
AGENTS.md658 starsChanged 7 days agoMITView on GitHub
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Follow flutter_lints, use lowerCamelCase/UpperCamelCase/snake_case, prefer StatelessWidget + Consumer, and use const constructors.
- Distinctive: line 31
Keep screens simple, handle disconnects by returning to the scanner, and avoid premature abstractions (don't add a helper until it is …
- Distinctive: line 32
Avoid unnecessary comments, feature flags, and backwards-compatibility shims.
- Distinctive: line 38
Keep commit subjects short and action-focused.
- Very specific: line 42
Keep user instructions in documentation/ and use ble-protocol.md as the canonical protocol reference.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Guidelines
Project Structure & Module Organization
- Core Flutter code is in
lib/, with BLE protocol definitions inlib/connector/meshcore_protocol.dartand BLE transport/state inlib/connector/meshcore_connector.dart. - UI lives in
lib/screens/andlib/widgets/, models inlib/models/, tests intest/, and platform runners inandroid/,ios/,macos/,linux/,windows/,web/.
BLE Frames & Protocol Notes
- Nordic UART Service (NUS) UUIDs: Service
6e400001-b5a3-f393-e0a9-e50e24dcca9e, RX6e400002-b5a3-f393-e0a9-e50e24dcca9e, TX6e400003-b5a3-f393-e0a9-e50e24dcca9e. - Discovery: scans for the Nordic UART Service UUID; known name prefixes are reference values, not filters.
- Frames are capped at
maxFrameSize = 172bytes; byte 0 is the command/response/push code. I/O isMeshCoreConnector.sendFrameandMeshCoreConnector.receivedFrames. - Command codes (to device):
cmdAppStart=1,cmdSendTxtMsg=2,cmdSendChannelTxtMsg=3,cmdGetContacts=4,cmdGetDeviceTime=5,cmdSetDeviceTime=6,cmdSendSelfAdvert=7,cmdSetAdvertName=8,cmdAddUpdateContact=9,cmdSyncNextMessage=10,cmdSetRadioParams=11,cmdSetRadioTxPower=12,cmdResetPath=13,cmdSetAdvertLatLon=14,cmdRemoveContact=15,cmdShareContact=16,cmdExportContact=17,cmdImportContact=18,cmdReboot=19,cmdSendLogin=26,cmdGetChannel=31,cmdSetChannel=32,cmdGetStats=56,cmdSendAnonReq=57,cmdSetAutoAddConfig=58,cmdGetAutoAddConfig=59,cmdSetPathHashMode=61,cmdSendChannelData=62. - Response codes (from device):
respCodeOk=0,respCodeErr=1,respCodeContactsStart=2,respCodeContact=3,respCodeEndOfContacts=4,respCodeSelfInfo=5,respCodeSent=6,respCodeContactMsgRecv=7,respCodeChannelMsgRecv=8,respCodeCurrTime=9,respCodeNoMoreMessages=10,respCodeContactMsgRecvV3=16,respCodeChannelMsgRecvV3=17,respCodeChannelInfo=18,respCodeStats=24,respCodeAutoAddConfig=25,respCodeChannelDataRecv=27. - Push codes (async):
pushCodeAdvert=0x80,pushCodePathUpdated=0x81,pushCodeSendConfirmed=0x82,pushCodeMsgWaiting=0x83,pushCodeLoginSuccess=0x85,pushCodeLoginFail=0x86,pushCodeLogRxData=0x88,pushCodeNewAdvert=0x8A. - Device info:
cmdAppStarttriggersrespCodeSelfInfowith tx power, pubkey, lat/lon, telemetry flags, radio params, and node name (see offsets inlib/connector/meshcore_connector.dart). - Radio/time helpers: radio settings come from self-info; companion stats use
cmdGetStats→respCodeStats;cmdGetDeviceTime→respCodeCurrTime;cmdSetDeviceTimeupdates device time. - Reboot: companion Settings calls
rebootDevice()→buildRebootFrame(); remote repeater management uses CLIreboot. - Companion radio format:
cmdSendTxtMsgexpects[cmd][txt_type][attempt][timestamp x4][pub_key_prefix x6][text...](no flags/full pubkey). CLI commands usetxtTypeCliDatain the same format, and the app mapsforceFloodto attempt3when sending. - Group text packets (
PAYLOAD_TYPE_GRP_TXT): payload is[channel_hash (1)][MAC (2)][encrypted data...]. Decrypted data layout is[timestamp x4][txt_type][text...]where text is"sender: message"(see MeshCoreBaseChatMesh::sendGroupMessage). Sender identity is not in the payload; usePUSH_CODE_LOG_RX_DATAraw packet path bytes for origin hash when available. - Routing hashes are public-key prefixes. Firmware negotiation currently supports 1–3 bytes per hop; packed path metadata must be decoded before counting or reversing hops. Use per-path hash width, not a fixed one-byte stride. See routing paths.
- Regions: channel messages retain their send region; incoming regions are resolved from raw transport-flood codes against locally known names. Replies use a known original region by default, with an opt-out chip. See regions.
- Images: channel GRP_DATA framing is defined in
lib/services/image_chunk_transport.dart. Native codec/model requirements are documented in image messages.
Build, Test, and Development Commands
- Commands assume Flutter/Dart on PATH (or use your SDK's absolute path); see CLAUDE.md for the full list.
flutter pub getinstalls dependencies;flutter runlaunches the app;flutter build apk --release/flutter build ios --releaseproduce release builds.- CI checks:
dart format --output=none --set-exit-if-changed .,flutter analyze --fatal-infos --fatal-warnings, andflutter test.
Coding Style & Naming Conventions
- Follow
flutter_lints, uselowerCamelCase/UpperCamelCase/snake_case, preferStatelessWidget+Consumer, and useconstconstructors. - Material widgets only (no Cupertino); center app bar titles (
centerTitle: true); prefix private members with_. - Keep screens simple, handle disconnects by returning to the scanner, and avoid premature abstractions (don't add a helper until it is needed in 3+ places).
- Avoid unnecessary comments, feature flags, and backwards-compatibility shims.
Testing Guidelines
- Tests use
flutter_test; add*_test.dartundertest/and runflutter testbefore UI/protocol changes.
Commit & Pull Request Guidelines
- Keep commit subjects short and action-focused; PRs should describe behavior changes, link issues, include screenshots for UI changes, and call out BLE protocol changes explicitly.
Documentation maintenance
Keep user instructions in documentation/ and use ble-protocol.md as the canonical protocol reference. Update affected guides, feature limitations, and screenshots when changing user-facing behavior. Read CONTRIBUTING.md for branch and review requirements.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

