openagents
AGENTS.md469 starsChanged 6 days agoApache-2.0View on GitHub
What every agent working in this repository needs to know. Read INVARIANTS.md and the per-context invariants file for the area you touch, and add new invariants there. Follow docs/books/glossary.md for new identifiers, tables, registry IDs and wire fields. Full directory layout & command reference: docs/REPO-MAP.md.
- Commits and pushes
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,117 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 repository6 other files it gives its agents.
- arxivSkill
- coax-pitfallsSkill
- desktop-ship-verifySkill
- session-handoffSkill
- transcript-hillclimbSkill
- verse-realmSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 1 is common, 3 are distinctive, and 11 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 15
No polling: Never loop on manage_task(status) or sleep N.
- Very specific: line 16
Mandatory timeouts + watchdogs: Every live test, subprocess, or server probe MUST have a hard OS/script timeout (e.g., timeout 60 or …
- Very specific: line 17
Safe probes: Never run agy / OAuth diagnostic commands without SSH_CONNECTION=1 (macOS open ignores $BROWSER and hijacks Chrome).
- Very specific: line 19
Clarify upfront, don't trail: When requirements are genuinely ambiguous, ask structured questions upfront (e.g., ask_question) rather than …
- Very specific: line 21
No third-party branding leaks: Never display third-party/retired product names or logos (e.g., Zeron, Anthropic logo/API key next to …
- Distinctive: line 32
Check the red list before investigating a main failure.
- Distinctive: line 44
No UI that lies: Never write a fake marker file, flag, or state showing something installed/ready when it isn't.
- Very specific: line 50
Check first &
#authority: Write #test/#forall checks before the code. - Very specific: line 54
Headless browsers only (
--keep): Use coax/web/tool.sh shot URL OUT.png [WxH] [WAIT_MS] [--eval JS] [--keep] (or --headless=new … - Common: line 56
Secrets: Never print or commit keys, tokens, or mnemonics (seed words stay in Keychain/memory.
- Very specific: line 57
Protocol & wire registry: Start protocol changes in proto/ and the spec.
- Very specific: line 58
Untrusted code & fork PRs: Never run scripts from downloaded/cloned repos on this Mac.
- Very specific: line 59
Three rounds per problem: After three failed rounds on one bug/build/check, change approach or ask a person instead of repeating small …
- Very specific: line 66
Fast targeted iteration: Test only the units you touched (./coax/bin/coax test FILE --only SUBSTR, psionic/check.sh --only UNIT, …
- Distinctive: line 70
Never repeat a passing result: Don't rerun unchanged passing suites to "confirm" — cite the earlier result and commit.
≈ “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
What every agent working in this repository needs to know. Read INVARIANTS.md and the per-context invariants file for the area you touch, and add new invariants there. Follow docs/books/glossary.md for new identifiers, tables, registry IDs and wire fields. Full directory layout & command reference: docs/REPO-MAP.md.
Critical Contract (Read First)
- Worktree isolation & canonical
origin/main. Never edit files in the main checkout (/Users/christopherdavid/work/openagents). Alwaysgit fetch origin mainfirst, inspect canonical files viaorigin/main(not a potentially lagging local checkout), edit/build/test in your own worktree (git worktree add ../oa-<topic> origin/main; APFS-clonecoax/binwithcp -c -Rif helpful), rebase ontoorigin/main, push (git push origin HEAD:mainunless a PR/branch was explicitly requested), and remove temporary worktrees/branches when finished. Never stash, reset, or overwrite uncommitted changes in the main checkout. - Done means the real installed thing works end-to-end. Never declare done on compile checks, unit tests, static offscreen PNGs, synthetic stubs, or the wrong worker (
mcworker/inkywhen--minimalshipsoa-worker). Exercise the real user flow (real clicks/inputs/focus, live RPCs against real user state, coldreq#1streaming, installed/Applications/OpenAgents.app/Contents/Info.plistOACommit/OAProfile). Never hide a user-requested core flow behind a feature flag unless explicitly asked. - OpenAgents Desktop (
--minimalprimary),/Applications/OpenAgents.appownership & paired deploys. Always build/install--minimal(apps/openagents-desktop/build.sh/install.shdefault to--minimal; never build--fullunless explicitly asked). Commit and push tomainFIRST, then runapps/openagents-desktop/install.sh(never hand-copy an uncommitted branch build into/Applications/OpenAgents.app— the 15-mincom.openagents.desktop-updateLaunchAgent overwrites it fromorigin/main).- Never clobber
/Applications/OpenAgents.appor disablecom.openagents.desktop-update./Applications/OpenAgents.appbelongs exclusively toapps/openagents-desktop/install.sh. Companion/experimental apps (such asapps/openagents-macos/install.sh, which installs to/Applications/OpenAgentsMac.appby default) must never overwrite/Applications/OpenAgents.appor remove/bootout~/Library/LaunchAgents/com.openagents.desktop-update.plist. - Keep build/install freshness invariants intact.
apps/openagents-desktop/build.shmust always assemble into a clean staging.appbundle before atomic swap (never reuse an existing.appin place, so removed/renamed workers cannot linger and breakv1-bundle-check). Whenever you add, rename, or remove a bundled worker, shader, or root source folder read by Desktop, updatefixed/rootsand bumpinputs_schemainapps/openagents-desktop/install.shso cached$state/inputsnever skip rebuilds. - Verify real install vs staged deferral. Check the installed version via
apps/openagents-desktop/install.sh --statusorInfo.plist(OACommit,OAProfile,CFBundleVersion), neverls -ld .app. Exit code4means the build is staged (waiting:) and deferred because OpenAgents is running — report it as staged, not installed. Mobile protocol/flow changes must merge and reinstall the Mac Desktop +openagents-environmentdaemon too.
- Never clobber
- Commit trailers. Stage only files you changed. End every commit message with
Co-Authored-By: <model>andAgent: <id>. Never use--no-verify. Checkgit show --statbefore pushing so no critical file (AGENTS.md,INVARIANTS.md,contexts.txt) is accidentally emptied or clobbered. - Execution hygiene (zero hangs, zero polling, bounded output).
- No polling: Never loop on
manage_task(status)orsleep N. Run commands with an explicit timeout or start in the background and stop to wait for reactive completion notifications. - Mandatory timeouts + watchdogs: Every live test, subprocess, or server probe MUST have a hard OS/script timeout (e.g.,
timeout 60orselect/deadline). Never yield on an unbounded background test without aschedulewatchdog timer. - Safe probes: Never run
agy/ OAuth diagnostic commands withoutSSH_CONNECTION=1(macOSopenignores$BROWSERand hijacks Chrome). - Bounded output & targeted reads: Pipe verbose shell commands (
| head -n 80,--stat); userg/git grepinstead of dumping whole files; avoid re-reading unchanged lines. - Clarify upfront, don't trail: When requirements are genuinely ambiguous, ask structured questions upfront (e.g.,
ask_question) rather than guessing or appending trailing"Would you like me to...?"offers. - Long sessions: Persist baseline/delta metrics in a scratch ledger (
*_log.md/.json) so context compactions lose zero state; after ~4–6 compactions or a shipped milestone, write a concise handoff and recommend a fresh chat.
- No polling: Never loop on
- No third-party branding leaks. Never display third-party/retired product names or logos (e.g.,
Zeron, Anthropic logo/API key next to Inkling) in OpenAgents UI or docs.
Git & Green-Main Pipeline
- Work on
main(unless the user explicitly asks for a PR / side branch). Commit only the files you changed, rebase ontoorigin/mainbefore verifying and pushing, merge concurrent edits cleanly (version numbers, error codes, grammar), and remove temporary worktrees/branches. - Outside contributors work from a fork and open a PR (CONTRIBUTING.md); their local gate is
scripts/check.sh. - Hooks (
coax/remote/hooks/): Enabled once per clone viagit config core.hooksPath coax/remote/hooks(inherited by worktrees).prepare-commit-msgauto-appendsAgent: <id>whenOA_AGENT_ID/ harness env is set;commit-msgrejects missingAgent:immediately at commit time (OA_PREPUSH_HUMAN=1for humans).pre-push(~10–20s, max 2m) refuses: stale-snapshot clobbers undoing another agent's work from the last 24h (excused when your commit message names the file/folder/commit), missingAgent:trailer, critical-file wipes/truncations (AGENTS.md,INVARIANTS.md,contexts.txtunlessAllow-Truncate: PATH: why), and failingtools-check,everglade-parity,wire-check,layer-check,state-keep,agent-reference --check,drive-hit-check,wgsl-module --site --check,changelog-page --check,coax checkon roots above changed.coaxfiles, or touched suites (coax test+coax mutate --changedon#authoritysuites). Emergency only:OA_PREPUSH_BYPASS="why" git push ...(logged). Never--no-verify. Details: docs/metaverse/green-main-pipeline.md.
coax/remote/after.sh stateshowsmain,main-green, recent runs, and the red list. Whenmain-greenis behind and you need a passing base, branch fromorigin/main-green.- Allowlist counts (
coax/remote/counts.sh show:parity-known,parity-gaps,components-to-move,wire-allowlist,tools-port.txt,layer-check,sql-rules-routes) only fall. Raising one requiresRebaseline: NAME: why. - Check the red list before investigating a
mainfailure. If it names your commit, fixing it takes priority over new work (unfixed culprits are reverted after 30 minutes). - Owner actions (taps, keys, payments, sign-offs) go in
NEEDS_OWNER.md, not only in chat.
Repository Map
The repository was reset in the Nuke (0b401561a0, 2026-10-27); never restore old Rust/TypeScript workspaces wholesale (read history with git show 0b401561a0^:<path>). Top-level areas: coax/ (language, compiler, stdlib, web host, remote pipeline), psionic/ (ML/Metal/CUDA), coder/ (Inky/Agy/Host workers), apps/openagents-desktop/ (--minimal macOS/Linux/Win app), apps/openagents-ios/ (SwiftUI Antigravity-over-Tailscale), apps/openagents-web/, apps/openagents-cli/, apps/shared/, components/, metaverse-engine/, metaverse/, everglade/, gamebuilder/, rules/, pay/, bitcoin/, nostr/, openagents/, os/, proto/, evals/, assets/, docs/, .agents/. Full table, shared asset registry (coax/web/tool.sh assets-sync), and command index: docs/REPO-MAP.md.
Engineering Rules
- Done means the real thing works (owner, 2026-11-20).
- Can't do the real thing? Say so. Missing weights, hardware, secrets, access or time is a blocker: report it and stop, or keep the issue open with what is left. Never swap in a smaller task under the original's name.
- Close an issue only when every acceptance box holds, citing the exact verification command and real output. Don't mark a chapter
implementedor expose a model/feature until it actually runs. - No UI that lies. Never write a fake marker file, flag, or state showing something installed/ready when it isn't.
- Report only what you ran, with its real result. A killed, timed-out, deferred, or skipped check did not pass; name it honestly.
/goalchats in OpenAgents Desktop verify[GOAL_COMPLETE]with one extra turn that re-reads issues and runs the real thing (apps/openagents-desktop/page/goal.coax).
- Never hand-roll what already exists (docs/reuse.md). Reuse or extend
components/,metaverse-engine/,everglade/,coax/lib/,psionic/— no second Markdown parser, line wrapper, edit buffer, or UI chrome copy (coax/web/tool.sh components-check). - Tools are Coax too (coax/tools-in-coax.md). Write build scripts, checks, harnesses, and CLIs in Coax (
coax/web/tool.sh FILE.coax). Any new.ts/.py/.js/.sh/.cjsfile needs a header lineFirm reason: N (...)in its first 60 lines; verify withcoax/web/tool.sh tools-check. - Coax first. Product logic lives in Coax; Swift/C handle platform effects only (lifecycle, Keychain, network, GPU bindings). Python is tooling only, never shipped. Approved exceptions (2026-10-29): NVIDIA CUDA toolkit via Nix compiles Coax-generated GPU code (no hand-written kernels; cuBLAS only in opt-in parity/bench harnesses); host C links platform TLS / OpenSSL 3 for socket encryption only (WebSocket/Nostr/NIP-42/NIP-44 stay in Coax). Approved exception (2026-11-28,
#14167,#14168): Desktop and iOS UI presentation layers may embed the shared@effect/uistatic SPA built fromOpenAgentsInc/openagents.com(Contents/Resources/WebUI/on Desktop,WebUI/on iOS) inside OS-native WebViews (WKWebView/WebKitGTK/WebView2, zero Electron) while all agent runtimes (oa-worker,claudeworker),gitguard,coder-host,#authoritypolicies,desktop-core, and Psionic ML kernels remain in Coax. - Check first &
#authority. Write#test/#forallchecks before the code. Use#authority;for money, admission, or policy rules; mutate touched procedures (coax mutate FILE --changed origin/main) to zero surviving mutants (mark true equivalents// mutant: equivalentwith a checkable reason; never rewrite shipped code merely to suit the tool). - No GitHub Actions. Checks run locally or on our own build hosts.
- Shared OpenAgents files. App-owned persistent files live under
~/.openagents/(~/.openagents/aethyrforge/,~/.openagents/models/,~/.openagents/bin/). Explicit path overrides remain valid. - No global filesystem or macOS TCC scans. Scope all searches to the active workspace; never run broad walks (
find,rg,ls -R,du,mdfind) targeting/,~,$HOME,/Users,/Volumes,~/Library, or Desktop/Documents/Downloads/Photos outside cwd (blocked bycoax/lib/microcoder/git-guard.coax). - Headless browsers only (
--keep). Usecoax/web/tool.sh shot URL OUT.png [WxH] [WAIT_MS] [--eval JS] [--keep](or--headless=new --mute-audio --enable-unsafe-webgpu --use-angle=metal). Never open visible windows, steal focus, or play audio. Pass--keepafter the first shot (docs/metaverse/fast-shots.md). - OpenAgents v1.0 UI is USD credits only — NO Bitcoin, Lightning, or sats in v1 UI (owner, 2026-11-27). Never display
sats,Bitcoin,Lightning, orWalletbalances/links in OpenAgents v1.0 web/chat/account UI; show USD credits only (e.g.$10.00). (For any future crypto rails beyond v1.0: Bitcoin-only money — Lightning, on-chain Bitcoin, Spark (docs/lightning/README.md), Taproot Assets; never USDC, USDT, EVM, Solana, Tron, or Cashu.) - Secrets. Never print or commit keys, tokens, or mnemonics (seed words stay in Keychain/memory; committed Breez API key is a deliberate exception).
- Protocol & wire registry. Start protocol changes in
proto/and the spec; version new contracts instead of mutating in place; register every wire/stored shape inproto/registry.json(coax/web/tool.sh wire-check). - Untrusted code & fork PRs. Never run scripts from downloaded/cloned repos on this Mac. Review fork PRs with
gh pr diff Nonly — nevergh pr checkouton a team machine (core.hooksPathruns branch hooks). Only a human maintainer squash-merges fork PRs (docs/contributing/review.md). - Three rounds per problem. After three failed rounds on one bug/build/check, change approach or ask a person instead of repeating small tweaks.
Build, Test & Iteration Speed
- Start here for Coax: coax/start-here.md. Run
./coax/bin/coax vocab NAMEor./coax/bin/coax explain CODEbefore guessing on compiler errors. Always invoke./coax/bin/coax(not barecoax). - Getting the compiler fast:
coax/build.shinstalls the published build from~/.cache/coax-release/ release bucket / GitHub mirror in seconds (or APFS-clonecp -c -R /Users/christopherdavid/work/openagents/coax/bin <wt>/coax/bin). If missing, runCOAX_MUTATION=0 coax/build.shin background; in shallow clones rungit fetch --depth=2000 origin mainfirst (coax/RELEASE.md). - Heavy commands & remote build hosts: Route heavy builds/suites through
coax/remote/remote.sh run --(runs locally when Mac is idle, offloads automatically under load;OA_REMOTE=1forces host,--localforces Mac; docs/metaverse/remote-builds.md). The API suite (coax/web/api/test.sh) always runs withOA_REMOTE=1. For web pages in a fresh worktree, fetch built pages withcoax/remote/pages.sh origin/main(~10s) and rebuild only touched modules withwasm.sh. - Fast targeted iteration: Test only the units you touched (
./coax/bin/coax test FILE --only SUBSTR,psionic/check.sh --only UNIT,psionic/tests/check_elephant_slices.sh DIR,coax/tests/run.sh --part I/8,coax mutate FILE --changed). Never rerun whole-model CPU weights as a routine check. Full command list: docs/REPO-MAP.md. - Several small issues at once: Code all fixes first, rebase onto
origin/mainbefore verifying (not after), fetchpages.sh origin/mainbefore building modules, group suites viacoax/remote/check.sh only PATH, rerun only failures, and commit one commit per issue. - Check duration & progress:
- One command takes at most 15 minutes. Split longer checks into slices/shards (
coax mutate --shard) or run faster units; never sit waiting indefinitely. - Never repeat a passing result. Don't rerun unchanged passing suites to "confirm" — cite the earlier result and commit.
- Report progress at least every 30 minutes with what changed and what's left. Stop when a run exceeds its limit.
- One command takes at most 15 minutes. Split longer checks into slices/shards (
- iOS tests & TestFlight: See apps/openagents-ios/README.md. Run tests for what you touched.
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.

