AGENTS.md template for Unity Quest projects
When to use itAt the start of every Unity Quest project, before the first feature prompt. Also when an agent keeps repeating a mistake you already corrected.
What you needYour Unity project folder, its pinned Unity and Meta XR SDK versions, and your build/install commands (the agent can find them).
What you getA committed AGENTS.md (plus a CLAUDE.md pointer) that every Claude Code and Codex session loads automatically, with 14 hard rules that stop placeholder fixes, broken features, stale-build claims and unapproved publishing.
Copy this file into the root of your Unity project as AGENTS.md. Every rule comes from a real failure in my projects; the lesson The instruction file that prevents regressions explains each one, so you can adapt them instead of copying blindly.
How to use it
- Save the block below as
AGENTS.mdin the project root. - Let your agent fill only the angle-bracket placeholders (prompt below). It must not reword the rules.
- For Claude Code, add a
CLAUDE.mdnext to it that contains the line@AGENTS.md. - Create
docs/STATUS.mdanddocs/HANDOVER.md(see the handover and status templates in the library). - Commit all of it. Check that
.gitignoredoes not exclude these files. - Every time you correct the agent about the same thing twice, add a rule or a line under "Known traps".
The template
# AGENTS.md — <project name>
Read this whole file at the start of every session. It is the contract for this
repository. If a request conflicts with a rule here, say so before acting.
After this file, read docs/STATUS.md and docs/HANDOVER.md.
## 1. Project
- What: <one sentence, e.g. "Standalone mixed reality app for Meta Quest 3/3S:
a crystal creature stands on the real floor and reacts to my hands.">
- Engine and pinned versions: Unity <version>, Meta XR SDK <version>,
Android minSdk <n> / targetSdk <n>. Do not change versions unless I ask
for a migration.
- Target: standalone Quest app (no PC streaming) unless stated otherwise.
- Language: all user-facing text, UI and voice in English. I may write to you
in another language; never copy my language into the product.
## 2. Who does what
- You do all computer work yourself: find installed tools and paths, build,
install, launch, restart, read logs, take headset screenshots, update docs.
Never tell me to do something you can do yourself.
- Ask me only for: sign-ins, licence or terms acceptance, purchases, the
headset's USB-debugging prompt, putting the headset on and reporting what I
see, and subjective judgement (does it look right, does it feel right).
## 3. Before you edit
- Read the files you will change and find who calls them. In Unity, also check
scenes, prefabs and serialized fields that reference the class: a code search
alone cannot prove a reference is absent.
- State in one or two lines what else the change could affect. If you can't
tell, treat it as affected, not as safe.
- Make the smallest change that reaches the goal. One change per step.
## 4. Hard rules
1. Exact target. Build exactly what I described. No substitutes, "close
enough" versions or detours without asking first. If the real path is
blocked, stop and tell me what blocks it.
2. No fallbacks, no placeholders. Never add a silent stand-in (grey cube,
placeholder material, dummy data, fake passthrough, another code path) to
make something look like it works. If something is missing, fail loudly:
a tagged error in the log and a clear message.
3. Don't break other behaviour. Never disable, weaken or remove existing
behaviour to make a new change work. If two things conflict, stop and ask.
After each change, re-check the PASS items in docs/STATUS.md that share
code with it. Don't assume a new symptom comes from the newest change.
4. Platform first. Use what the Quest and Meta XR SDK provide (Space Setup and
scene data, anchors, hand tracking, passthrough) before computing it yourself.
5. Rebuild and reinstall before claiming. After any change to code, scenes,
shaders, manifest or XR settings: build a new APK, install exactly that APK,
launch it. Never test against an older installed build. If two runs give
identical results despite a code change, assume you are testing an old build.
6. Self-test on the device before handover. Check on the headset yourself as
far as you can (log lines, headset screenshot). Then say explicitly what you
could not check (how it looks to the wearer, sound, how hands feel).
7. Evidence, not claims. "Done" needs proof: the log line, the screenshot path,
the test output. Use three states: PASS (seen on the device), NOT VERIFIED
(built, previewed or reasoned only), FAIL. An editor preview checks
composition only. Never mark an unknown check as passed.
8. Tagged logs. Every new system logs with a tag in square brackets, e.g.
[creature], [hands]. Print measurements as numbers.
9. Commit after each verified step. The message says what changed and what
evidence exists. Never commit secrets, keystores, .env files or build output.
10. Publish only with my explicit OK. Never upload, publish, push to a public
repository, send messages or spend money without my explicit word in this
session. Earlier approvals and old plans in files do not count.
11. Delete only to the Recycle Bin. Never delete permanently. Before a risky
change, keep a copy of the last working state.
12. Privacy. Never write room scans, camera frames, voice recordings or
personal data into logs, the repository or reports. API keys never go into
the app or into git.
13. Assets. Use existing, licensed assets before making your own. Record source
and licence in docs/THIRD_PARTY.md. No third-party characters or game assets.
14. Honest wording. Never call something finished, polished or premium while
visible placeholders, clipping or misalignment remain.
## 5. Commands
- Build: <command>
- Install and launch on the Quest: <command>
- Read logs: <command, filtered by tag>
- Headset screenshot: <command>
- One Unity process per project: close the editor before batch builds.
## 6. Handover
Before you stop, or when I say "handover": update docs/HANDOVER.md (goal,
state, verified vs not verified, next steps, traps) and docs/STATUS.md.
## 7. Known traps
- <one line per failure that cost more than 30 minutes, newest at the bottom>Fill in the placeholders
Read AGENTS.md completely. Then inspect this Unity project and fill in only the placeholders in angle brackets in sections 1 and 5: - the Unity version (from ProjectSettings/ProjectVersion.txt), - the Meta XR SDK version (from Packages/manifest.json), - minSdk and targetSdk (from the player settings), - the commands this project actually uses to build, install, read logs and take a headset screenshot. If the project has no build script yet, write "none yet" instead of inventing a command. Do not change, shorten or reword any rule in sections 2, 3, 4 or 6. Do not build or install anything. When you're done, show me the diff and list anything you could not determine.
The CLAUDE.md pointer
@AGENTS.md
Claude-specific notes go below this line. Project rules live in AGENTS.md only.Used in: How coding agents actually work · The instruction file that prevents regressions