opencode-mobile-next
AGENTS.md186 starsChanged 25 days agoMITView on GitHub
Working notes for coding agents in this repository. The app is native Kotlin (Kotlin Multiplatform, Jetpack Compose) under native/. Read native/AGENTS.md first: its toolchain, module rules and tasks bind you. The human-facing equivalent is CONTRIBUTING.md. The old Flutter app is retired (its last release was 2.1.5); nothing about lib/, Shorebird or its test gates applies. Issues, pull requests and forks written against it describe that old app: before saying a feature is missing, look for it in the native code…
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 35,196 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 repository2 other files it gives its agents.
- native/AGENTS.mdAGENTS.md
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run target tasks only, from native/: :<module>:desktopTest (KMP), :<module>:test (JVM), :quality:test, :tools:strings:test after copy …
- Very specific: line 21
Run the WHOLE :quality:test before calling a branch ready.
- Very specific: line 43
Kit only: every UI component comes from native/ui/kit*.
- Very specific: line 65
Every URL the app did not author goes through ExternalLinkPolicy → ExternalLinkOpener.
- Very specific: line 67
Never echo provider credentials: /config/providers returns API keys.
- Distinctive: line 117
One active product slice: Write a one-sentence finish line and an explicit non-goal before editing.
- Distinctive: line 127
Budget the full run: Run the full lane at an agreed batch boundary and record the revision, the run and its failures.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
AGENTS.md
Working notes for coding agents in this repository. The app is native Kotlin (Kotlin Multiplatform, Jetpack Compose)
under native/. Read native/AGENTS.md first: its toolchain, module rules and tasks bind you. The
human-facing equivalent is CONTRIBUTING.md.
The old Flutter app is retired (its last release was 2.1.5); nothing about lib/, Shorebird or its test gates applies.
Issues, pull requests and forks written against it describe that old app: before saying a feature is missing, look for
it in the native code and in the English strings (native/ui/words/.../values/*.xml).
Toolchain and commands
- Gradle runs on JDK 21; JDK 17 must be installed too (module bytecode targets 17). Android SDK
platforms;android-37.1,build-tools;37.0.0. - Run target tasks only, from
native/::<module>:desktopTest(KMP),:<module>:test(JVM),:quality:test,:tools:strings:testafter copy changes,-p build-logic testafter build-logic changes,:androidApp:assembleDebugfor an APK. Never./gradlew build. Name test classes with--tests. - On a machine without the capacity for Gradle, push the branch and dispatch
native-ci.ymlon it (-f tasks="..."for named tasks,-f lane=fast -f base=<branch>for the changed modules,-f apk_only=truefor an APK). Onetasks=run per ref at a time: a second one cancels the first. - Run the WHOLE
:quality:testbefore calling a branch ready. It holds the architecture rules (features arrange kit parts only, and feature code may use only a small set of coroutine calls) and it runs in the release gates, so a branch that skipped it blocks a release. - A CI run only counts if its tests ran: read the verdict from the reports (
native/tool/ci/summary.py), not from the colour of the jobs.
Testing traps
- Picture-gate scenes (
*GateTest,*.rb.*) are red on purpose while the look is rebuilt; a broad filter buries your result.native/tool/ci/known_failures.txtlists what CI absorbs. - Tests assert behaviour, not implementation; find by visible text; add a test tag only where a test needs a handle.
- Name every test after its catalog row:
B-AREA-NNN what it proves, red first. Prove a fix by watching its test fail without the fix. A test that "also fails on the base" is old only if it fails at the last green commit. - Tests do not catch cut labels. Before a release, render the real screens with demo data at 360 dp (text 1.0 and 1.3) and look at each one.
- A new commit, even a test-only or docs-only one, voids a release candidate's CI verdict, dry run and device smoke.
Release notes (
docs/releases/<tag>.md) and tooling fixes go in before the last candidate.
Architecture boundaries
- Layers:
core,protocol(OpenCode 2, Codex, Paseo clients),engine,ui(kit, words, routes, shell),feature,android(platform bridges),tools. The build enforces which may depend on which. - Kit only: every UI component comes from
native/ui/kit*. Features only arrange kit parts. A missing part is added to the kit by its owner, never drawn in a feature. The:qualityguards enforce this; never add exceptions. - UI gates on
ServerCapabilities/PlatformCapabilities, never on the kind of backend. - Single-owner units: shared modules (kit, words, routes, shell, core, connection, transcript); propose, don't edit.
- OpenCode 2's event stream is volatile: after a reconnect, reconcile by refetch, not replay.
Behaviour rules that reviews enforce
- Waiting is not failing. While something the app itself started is still starting (the phone's Linux, its server, the agents' helper, an agent), show the waiting state and name the real stage. A failure appears only when the bounded wait has ended or the thing truly refused, and it never flashes and clears by itself.
- One name for one thing everywhere a person sees it. Actions name their target. No raw error text as copy: plain words and a way forward, technical text under Details.
- Nothing is cut at 360 dp. Frame text scales to 1.3 at most; reading text scales fully. Every kit part has a maximum width. No new bar or row level: status folds into an existing row.
- Large downloads wait for an unmetered network or ask first, and show their size and progress.
- Usage reports leave the phone only behind the opt-in switch. The "What we collect" page and the bundled policy name every field and every recipient; a guard test keeps them in step with the code.
- A broken thing is fixed, not hidden. Hidden gestures ship with a tip.
Security invariants: breaking these is a security regression
- Every URL the app did not author goes through
ExternalLinkPolicy→ExternalLinkOpener. - Per-profile keys are
oc.<what>.<profileId>and registered withProfileScope, so deleting a profile deletes them. - Never echo provider credentials:
/config/providersreturns API keys; they must not reach logs, diagnostics, notification copy or test output. Log only throughAppLog. - The repository is public: no home-folder paths, private addresses, e-mails, device serials or token-like strings in
committed files or commit messages.
native/tool/scan_push.shchecks a push. - Secrets ride on command lines: never print a process list with full arguments, and never pass a secret as an argument. Kill processes by exact PID, never by pattern.
Repository facts
native/engine/agents/pins/agent-pins.jsonis the source of the agent pins (a pin moves only with an app release);AgentPinsJson.ktis its byte-for-byte copy.native/tools/strings/frozen/holds the frozen string sources the drift check compares with; new copy goes into the:ui:wordsXML through the strings pipeline (translate.py plan/apply).engine/is the AI Team engine (Rust);scripts/byo-host/the BYO host half;tool/host/the AI Team host front;docs/site/the website (pages.yml)..claude/skills/is gitignored third-party content. Do not commit it.native/BUILD_NUMBERS.mdis the ledger of build numbers: one row per number, always above every number ever installed. Every public release has its own version name, never reused; a build that is not the public release carries-test.<build>in its version name, so reports can tell who is on what.- Nothing in background code may assume unbounded lifetime: Android 15+ caps
dataSyncforeground services at six background hours per rolling 24 hours. - Verifying against a live OpenCode 2 server: a scratch
opencode2 serveon an unused port, HTTP Basic useropencodewith the per-run password it prints; never commit or echo that password. Kill test servers by exact PID, never by pattern.
Workflow
- Each feature gets its own branch and Git worktree, owned by one agent: the complete user journey, implementation,
strings, tests, screenshots and local commits. Never edit another agent's checkout. The coordinator reviews the
whole branch, resolves conflicts and merges after validation. Never
git stash,checkoutorresetin a checkout another agent shares. - Phones and emulators: never screenshot or record a maintainer's personal phone; read text only, and only this app's screens. Always pass an emulator's serial and check nobody else is using it. Never type a password, key or code, and never sign in: the maintainer does.
- CI budget is limited: every commit carries
[skip ci]; runs are dispatched on purpose. Pushes, PRs, signing and releases each need a fresh explicit request. - A replacement APK must be signed with the same certificate as the build on the maintainer's phone, or Android
refuses the update and only an uninstall (which loses local data) gets past it. Compare
apksigner verify --print-certswith the installed signer before delivery. Known signers: Public CI842284B27AA297FB74CF831779FD16498517E1BC2104451459FEC2EA7AC11D1C, local release key1DE5BF08146F269BCD9EB5C2FFC94469CE4617D37806285955F978A62494D60C. Never substitute or rotate a signer. - The release key file is
native/key.properties(git-ignored) or the fileOC_KEY_PROPERTIESnames. Never read, copy or print a key or keystore. - Releases go through
scripts/native-release.sh(master only, clean tree, dry run by default) and thenative-release.ymldraft. Never publish, tag or use signing secrets without explicit maintainer approval. - PRs need: tests and the CI run that ran them, screenshots for UI changes, accessibility notes, privacy/security notes for credential/data changes, migration notes for stored-format changes.
Productivity rules: finish usable slices
- One active product slice. Write a one-sentence finish line and an explicit non-goal before editing. Finish engine → UI → persistence/deletion before opening another feature. A scaffold is groundwork, not a feature.
- Check feasibility before building adapters. Confirm the current callable contract, supported authentication and permitted credential use first. If the prerequisite fails, keep the feature unavailable.
- Bound discovery. Answer a bounded question from the current source and existing evidence; then implement, name a blocker, or explain why more research is needed. Reopen it only for a new contradiction.
- Parallelize execution, not repeated audits. Freeze method names, arguments, results and errors before parallel editing. Shared modules stay single-owner. Reviewers never launch test processes.
- Use a check ladder. Format changed files only; run the affected test classes once the change is ready; after
a failure rerun that class or test, not the repository; run
:quality:testat an integration checkpoint. - Budget the full run. Run the full lane at an agreed batch boundary and record the revision, the run and its failures. Later relevant edits invalidate it; never call partial coverage a pass.
- Keep an evidence budget. Say what now works, what remains and the next concrete action. Report states (done, in tests, waiting on X, blocked by Y), never time estimates or deadlines.
- Separate shipping states. Report implemented / enabled / verified / committed / deployed / released distinctly. "Get shipping" is not permission to touch live servers, credentials, tags, signing keys or releases.
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.

