codex-relay
AGENTS.md733 starsChanged 2 months agoApache-2.0View on GitHub
This pnpm monorepo contains a mobile Codex client backed by a local server. apps/mobile is the Expo React Native app, with routes in src/app, UI in src/components, state in src/state, API helpers in src/lib, and assets in assets. packages/codex-relay contains the Hono Node server in src, Vitest tests in test, and shared Zod API contracts in src/api-schema.ts. Treat dogfood-output* as generated artifacts. Use TypeScript throughout. Formatting is owned by oxfmt; do not hand-format around it. The current style uses two-space…
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,774 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 repository12 other files it gives its agents.
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-native-skills/AGENTS.mdAGENTS.md
- agent-cdpSkill
- agent-deviceSkill
- deploy-iosSkill
- dogfoodSkill
- hot-updater-qa-shipSkill
- hot-updaterSkill
- react-devtoolsSkill
- react-native-best-practicesSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
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
- Distinctive: line 25
Prefer established UI primitives over hand-rolling fragile React Native layouts.
- Very specific: line 28
Do not create ad hoc Modal + dimmer + nested Pressable sheet structures in feature components.
- Very specific: line 29
Do not position bottom sheet row text with absolute.
- Distinctive: line 30
Put spacing, safe-area padding, dimmer behavior, accessibility roles, and iOS layout fixes inside reusable primitives rather than …
- Distinctive: line 31
If a new screen needs a layout pattern that is likely to recur, add or extend a UI primitive first, then compose the feature screen from …
- Distinctive: line 32
After changing mobile UI primitives or their callers, capture the affected screen in the iOS simulator or device when practical, especially …
- Very specific: line 44
Do not commit local secrets, device-specific URLs, or generated native build output.
≈ “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
This pnpm monorepo contains a mobile Codex client backed by a local server. apps/mobile is the Expo React Native app, with routes in src/app, UI in src/components, state in src/state, API helpers in src/lib, and assets in assets. packages/codex-relay contains the Hono Node server in src, Vitest tests in test, and shared Zod API contracts in src/api-schema.ts. Treat dogfood-output* as generated artifacts.
Build, Test, and Development Commands
pnpm install: install workspace dependencies with pnpm 10.pnpm dev: run the local server withtsx watch; it listens on port8787.pnpm dev:server: run the local server withtsx watch; it listens on port8787.pnpm dev:mobile: start Expo Metro for a development client.pnpm dev:mobile:ios/pnpm dev:mobile:android: build and run the native dev client.pnpm lint: run oxlint plus oxfmt checks acrossappsandpackages.pnpm lint:fix: apply oxlint fixes and format the repo.pnpm typecheck: runtsc --noEmitin every package.pnpm test: run the server Vitest suite.
Coding Style & Naming Conventions
Use TypeScript throughout. Formatting is owned by oxfmt; do not hand-format around it. The current style uses two-space indentation, double quotes, trailing commas where added, and ESM imports. React components use PascalCase file and export names, hooks use use-* file names and useX functions, and helpers use camelCase. Keep shared API shapes in packages/codex-relay/src/api-schema.ts.
Mobile UI Primitives
Prefer established UI primitives over hand-rolling fragile React Native layouts.
- For any mobile bottom sheet, use
AppBottomSheetandSheetActionRowfromapps/mobile/src/components/ui/bottom-sheet.tsx. - Do not create ad hoc
Modal+ dimmer + nestedPressablesheet structures in feature components. - Do not position bottom sheet row text with
absolute; keep rows as icon/text/trailing columns throughSheetActionRow. - Put spacing, safe-area padding, dimmer behavior, accessibility roles, and iOS layout fixes inside reusable primitives rather than duplicating them per screen.
- If a new screen needs a layout pattern that is likely to recur, add or extend a UI primitive first, then compose the feature screen from that primitive.
- After changing mobile UI primitives or their callers, capture the affected screen in the iOS simulator or device when practical, especially for modals, bottom sheets, keyboard-adjacent UI, and compact controls.
Testing Guidelines
Server tests use Vitest and live in packages/codex-relay/test with *.test.ts names. Add focused route or schema coverage when changing API behavior, validation, streaming, or thread state. Run pnpm test, then pnpm typecheck and pnpm lint before handing off broader changes. Mobile code currently relies on typechecking and manual/dev-client verification; document any device or simulator checks in the PR.
Commit & Pull Request Guidelines
The short Git history uses simple Conventional Commit-style messages such as chore: oxlint, oxfmt; prefer feat:, fix:, chore:, or test: with an imperative summary. PRs should include a brief description, validation commands run, linked issue if applicable, and screenshots or screen recordings for mobile UI changes. Mention configuration changes such as EXPO_PUBLIC_CODEX_RELAY_SERVER_URL or CODEX_RELAY_WORKSPACE_PATH.
Security & Configuration Tips
Do not commit local secrets, device-specific URLs, or generated native build output. Physical devices usually need EXPO_PUBLIC_CODEX_RELAY_SERVER_URL=http://<host-lan-ip>:8787; simulators and web can use the default 127.0.0.1 value.
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.

