Instructions for AI coding agents (and humans using one) proposing pull requests
to this repository. This complements `README.md` and `Maintainers.md`; when in
doubt, those human-facing docs win.
## Repo shape (quick map)
-`bootrom/`, `armsrc/` — ARM firmware for the device (Proxmark3
hardware targets), buildable via **either** the top-level
`Makefile`**or** their respective `CMakeLists.txt`. Keep both build definitions in sync.
-`client/` — host-side client, buildable via **either** the top-level
`Makefile`**or**`client/CMakeLists.txt`. Keep both build definitions in sync.
-`client/experimental_lib/` — experimental shared-lib build of the client,
has its own `CMakeLists.txt`. Any change to the client `client/CMakeLists.txt` almost always implies a change in `client/experimental_lib/CMakeLists.txt`.
-`common_arm/`, `common/` — shared code between firmware and/or client.
`ePassport`, etc.), each with its own `Makefile` and its own `check` target.
## Before opening a PR: build matrix
Do not treat "it compiles for me" as done. For any non-trivial change, verify
across the axes below (skip only the ones genuinely unaffected by your diff,
and say explicitly in the PR description which axes you *did* and *did not*
test):
1.**Zero warnings.**`make clean && make all` must complete with no compiler
warnings on the default toolchain (gcc). Warnings are effectively treated
as errors in this project's normal dev flow.
2.**Second compiler.** Also try building host client and host tools (if touched) with clang, e.g. `make clean && make client -j CC=clang CXX=clang++ LD=clang++`
and fix anything it flags that gcc didn't — clang's
diagnostics catch different classes of bugs (e.g. some format-string and
sign issues).
3.**Both client build systems.** If you touched client code, dependencies,
or build flags, update and test:
-`client/Makefile` (default `make client`)
-`client/CMakeLists.txt`
-`client/experimental_lib/CMakeLists.txt`
A file added to one and not the others is an incomplete PR.
4.**ARM firmware targets.** If you touched `armsrc/`, `bootrom/`,
`common_arm/`, or anything reachable from firmware, compile at least for **both**
main platform configs (`PLATFORM=` per `Makefile.platform`): PM3RDV4 and PM5.
Use also PLATFORM_EXTRAS if relevant to your changes.
5.**Cross-OS for platform-sensitive code.** Anything touching serial/USB
comms, filesystem paths, threading, or conditional `#ifdef _WIN32` /
`__APPLE__` / `__linux__` code needs to at least be reasoned through, and
ideally exercised, on all three supported environments: native Linux,
Windows (ProxSpace or WSL, per the project's documented Windows build
path), and macOS. Say in the PR which of these you actually ran.
6.**Offline tests.** Run `make check` (or the narrower `<target>/check`,
e.g. `client/check`, `armsrc/check`) and make sure it stays green. Add to
`tools/pm3_tests.sh` coverage if you're adding a new command/module that
can be exercised offline.
## Code style
- Respect the style used in this project: trailing
whitespace/EOL cleanup, Equivalent of `astyle` on `*.c`/`*.h` with