Skip to content

Commit 9cc67a5

Browse files
committed
Add agent instructions for Jamulus
1 parent a1e2ac1 commit 9cc67a5

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Jamulus — Agent Instructions
2+
3+
Real-time networked music jamming app. Qt/C++ qmake project. Client and server share one codebase; entry point: `src/main.cpp`. Configure `CONFIG` flags in `Jamulus.pro`.
4+
5+
**Make the smallest possible change. One logical change per PR. Never mix refactoring with fixes/features.**
6+
7+
Priority order: Stability > Low latency / real-time safety > Backwards compatibility > Maintainability > New features. This order resolves conflicts only — new features are welcome.
8+
9+
---
10+
11+
## Build
12+
13+
Linux: `qmake && make` (use `qmake-qt5` on Fedora). Headless server: `qmake "CONFIG+=headless serveronly" && make`. First run: `git submodule update --init` (oboe for Android). Run `make distclean` before re-running `qmake` with different `CONFIG` flags. Full per-platform table: `COMPILING.md`.
14+
15+
macOS: `qmake QMAKE_APPLE_DEVICE_ARCHS=arm64 QT_ARCH=arm64 -spec macx-xcode Jamulus.pro`
16+
(Use `x86_64` on Intel Macs; `macx-clang` if using `make`). Then `xcodebuild build`,
17+
and `macdeployqt ./{Debug,Release}/Jamulus.app`.
18+
19+
**Testing:** run headless server (args `-s -n`), connect a client to `localhost`, exercise the change; use the JSON-RPC API (`docs/JSON-RPC.md`) where possible. State what you tested in the PR with evidence. GitHub Actions builds multiple platforms — on failure read the failing step's log.
20+
21+
## Never Do
22+
23+
**`Never Do` rules are absolute**
24+
25+
- Block/slow real-time paths: audio callbacks (`src/sound/`), sockets (`src/socket.cpp`), server mixing timer (`src/server.cpp`). No allocation, file I/O, or excessive logging there; preallocate buffers, keep lock-free — stalls = audible dropouts.
26+
- Trust values from remote clients — validate size/bounds on all network input (malformed input crashes).
27+
- Edit generated files (`moc_*.cpp`, `ui_*.h`, `qrc_*.cpp`, `*.qm`) — regenerate; don't edit/reformat third-party code in `libs/`.
28+
- Edit `ChangeLog` directly — use a `CHANGELOG:` line in the PR.
29+
30+
## Always
31+
32+
- Attach test evidence (logs/output) to the PR — never just assert something works.
33+
- Say so if you did not run or verify something.
34+
35+
## Ask first
36+
37+
- Architecture changes (networking/protocol, threading, build system) — open an issue to discuss (see `CONTRIBUTING.md`).
38+
39+
## Qt / portability
40+
41+
- Minimum Qt: **5.12.2**. Qt 6 recommended (iOS: Qt 5.15+ required, Qt 6 iOS buggy). Guard newer APIs with `#if QT_VERSION >= QT_VERSION_CHECK(...)`.
42+
- C++11 (C++17 on Android for Oboe).
43+
- Preserve platform support.
44+
- Desktop: Windows 10+, macOS 10.10+, Ubuntu 20.04+/Debian 11+.
45+
46+
## Style (C / C++ / Obj-C++)
47+
- **CI uses clang-format** (version in `.github/workflows/coding-style-check.yml`).
48+
- Run `make clang_format` before committing (works only after qmake).
49+
- CI runs **shellcheck + shfmt** on `.sh` files; **pylint** (config: `.pylintrc`) on `.py` files in `tools/`.
50+
- New contributions: AGPL 3.0+ license header. Pre-3.12.1dev code: GPL 3.0+ (see `CONTRIBUTING.md`).
51+
- Use `tr ( "Hello %1" ).arg ( name )` for user-facing strings — never string concatenation.
52+
53+
## JSON-RPC
54+
55+
- Changing RPC methods (e.g. `src/clientrpc.cpp` / `src/serverrpc.cpp`) requires regenerating `docs/JSON-RPC.md` with `tools/generate_json_rpc_docs.py` (CI fails otherwise).
56+
- Requires `--jsonrpcport` + `--jsonrpcsecretfile` at runtime. Binds to localhost by default. Secret requires ≥16 characters.
57+
58+
## PR expectations
59+
60+
- One logical change per PR — no unrelated cleanup or reformatting of untouched code. Discuss features in an issue before implementing. See `CONTRIBUTING.md`.
61+
- Branch names starting with `autobuild` trigger CI builds on your fork.
62+
- Follow `.github/pull_request_template.md`. Include `CHANGELOG:` line. Add `AUTOBUILD: Please build all targets` for skipped targets (iOS, Windows JACK, Linux armhf/arm64) if touched; see `.github/workflows/autobuild.yml`.
63+
- Builds? Tested? Smallest change possible? Self reviewed against "Priority order" above?
64+
- Disclose AI-generated text at the end of Comments/PRs. (e.g: `> Used AI: <model>, <harness>`) — never in code comments.
65+
66+
## Read when relevant
67+
68+
- `CONTRIBUTING.md` — process, style, licensing
69+
- `COMPILING.md` — full build per platform, CONFIG flags table
70+
- `docs/JAMULUS_PROTOCOL.md` — network protocol, packet IDs, ack rules
71+
- `SECURITY.md` — security reporting

0 commit comments

Comments
 (0)