Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AGENTS.md

52 lines4.6 KB

1# AGENTS.md
2​
3## Task Completion Requirements
4​
5- Keep local verification focused on the files and packages changed. Run the smallest relevant test set; do not run the full workspace test suite as a routine completion step.
6 - Use `vp test run <test-files>` for focused built-in Vite+ tests. Use `vp run test` only when the affected package specifically requires its `test` script.
7 - Backend changes must include and run focused tests for the changed behavior.
8 - Run targeted formatting, lint, and type checks for the affected scope when available.
9- Do not run repo-wide `vp check`, `vp run typecheck`, `vp run test`, or equivalent full-suite commands locally unless the user explicitly requests them. CI is responsible for the full verification suite.
10- After frontend feature development or any user-visible frontend behavior change, the primary agent must run one integrated verification pass for each affected client surface after integrating the work:
11 - Web: use the `test-t3-app` skill. Launch one isolated environment, authenticate through the printed pairing URL, and verify the affected flow in the controlled browser.
12 - Mobile: use the `test-t3-mobile` skill. Connect one representative iOS Simulator or Android Emulator available on the host to one isolated environment and verify the affected flow. On compatible macOS hosts, prefer iOS for cross-platform changes and stream it through serve-sim in the T3 Code in-app browser or another available agent browser; use Android when it is the affected or viable platform.
13 - Subagents must not independently launch dev servers or repeat integrated client verification unless their delegated task explicitly requires it.
14 - Stop dev servers, watchers, and other long-running verification processes when the focused verification is complete.
15​
16## Dev Servers
17​
18- In a linked git worktree, dev state defaults to that worktree's gitignored `.t3`. This deliberately outranks an ambient `T3CODE_HOME`, which could otherwise select the installed app's live `~/.t3/userdata` database. An explicit `--home-dir` still wins.
19- Start the web stack with `vp run dev`. Add `--share` when someone needs to open it from another device on the tailnet.
20- Browser dev is single-origin: Vite proxies `/api`, `/ws`, `/oauth`, and `/.well-known` to the backend. Do not set `VITE_HTTP_URL` or `VITE_WS_URL` for `dev`/`dev:web`.
21- Worktree paths supply stable preferred port offsets. Read the actual server and web ports from the `[dev-runner]` line because occupied ports can still shift them.
22- Before handing off a `--share` URL, open its origin in a controlled browser and confirm the app loads. A successful curl is insufficient because browsers reject some otherwise reachable ports.
23​
24## Package Roles
25​
26- `apps/server`: Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, and manages provider sessions.
27- `apps/web`: React/Vite UI. Owns session UX, conversation/event rendering, and client-side state. Connects to the server via WebSocket.
28- `packages/contracts`: Shared effect/Schema schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types. Keep this package schema-only — no runtime logic.
29- `packages/shared`: Shared runtime utilities consumed by both server and client applications. Uses explicit subpath exports (e.g. `@t3tools/shared/git`) — no barrel index.
30- `packages/client-runtime`: Shared runtime package for sharing client code across web and mobile.
31​
32## Reference Repos
33​
34- Open-source Codex repo: https://github.com/openai/codex
35​
36Use these as implementation references when designing protocol handling, UX flows, and operational safeguards.
37​
38## Vendored Repositories
39​
40This project vendors external repositories under `.repos/` as read-only reference material for coding
41agents.
42​
43- Prefer examples and patterns from the vendored source code over generated guesses or web search results.
44- Do not edit files under `.repos/` unless explicitly asked.
45- Do not import from `.repos/`; application code must continue importing from normal package dependencies.
46- Manage vendored subtrees with `vpr sync:repos`; use `vpr sync:repos --repo <id>` to sync one configured repository.
47- When updating a dependency with a configured vendored subtree, sync that subtree in the same change so
48 `.repos/` matches the installed dependency version.
49- When writing Effect code, read `.repos/effect-smol/LLMS.md` first and inspect `.repos/effect-smol/` for
50 examples of idiomatic usage, tests, module structure, and API design.
51- When writing relay infrastructure code with Alchemy, inspect `.repos/alchemy-effect/` for examples of
52 idiomatic usage, tests, module structure, and API design.