Embody
AGENTS.md213 starsChanged 2 months agoMITView on GitHub
This project uses Embody (TouchDesigner externalization) and Envoy (MCP server for AI coding tools). Note: For Claude Code users, a CLAUDE.md with modular .claude/rules/ and .claude/skills/ is also generated. This AGENTS.md is the universal fallback read by Codex, Cursor, GitHub Copilot, Windsurf, Gemini, and others. Skills: the same workflow skills ship as SKILL.md folders -- .claude/skills/ (Claude Code, OpenCode) and .agents/skills/ (Codex, Cursor, Gemini CLI, Antigravity). Read the matching skill BEFORE the action it governs: create-operator before creating or moving…
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,700 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 repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- web/llms-full.txtllms.txt
- web/llms.txtllms.txt
- add-mcp-toolSkill
- agent-testsSkill
- briefSkill
- build-uiSkill
- collabSkill
- create-extensionSkill
- create-operatorSkill
- debug-operatorSkill
- externalize-operatorSkill
- glsl-shadersSkill
- manage-annotationsSkill
- mcp-tools-referenceSkill
- merge-divergent-toxSkill
- movie-exportSkill
- multi-instanceSkill
- multi-session-etiquetteSkill
- operator-gotchasSkill
- parameter-designSkill
- pop-networksSkill
- publish-specimenSkill
- releaseSkill
- run-testsSkill
- specimen-authoringSkill
- td-api-referenceSkill
- td-recoverySkill
- testingSkill
- visual-aestheticsSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 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.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use the Configure For toggles on the Embody COMP's Envoy page to regenerate these files for your AI tool (more than one client can be on at …
- Very specific: line 27
If nothing is written: Embody Mode on Advanced - ask first defers config writes during project open (a log breadcrumb says so), and …
- Distinctive: line 36
Use Envoy MCP tools for live TD state and non-TDXN operators: - never say "I can't access that binary file." For operators not externalized …
- Very specific: line 37
Do NOT assume network paths: - use query_network on / to discover the actual root structure.
- Very specific: line 51
Toggle parameters: use 0/1 (not "True"/"False").
- Very specific: line 52
Use
opex(): when the operator must exist - raises immediately with a clear error. - Distinctive: line 54
NEVER access TD objects from a worker thread: - all TD operations must go through main-thread hooks.
- Distinctive: line 60
200-unit grid: All positions snap to multiples of 200.
- Very specific: line 64
Visual TOP work is output-first: create an Out TOP out1 and turn its display flag on BEFORE building the chain, then keep the working chain …
- Very specific: line 65
Every logical group gets an annotation: - use create_annotation around each cluster of related operators.
- Distinctive: line 114
NEVER cache extension references in variables: - always call inline.
≈ “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
<!-- Generated by Embody/Envoy -- do not edit manually - sha:0440cc49bfd29a89 -->Embody + Envoy - AI Instructions
This project uses Embody (TouchDesigner externalization) and Envoy (MCP server for AI coding tools).
- Embody externalizes TouchDesigner operators to version-controlled files (
.py,.tox,.tdxn,.json, etc.) - Envoy provides MCP tools for AI assistants to inspect and modify the live TD network
- Use the
Configure Fortoggles on the Embody COMP's Envoy page to regenerate these files for your AI tool (more than one client can be on at once)
Note: For Claude Code users, a
CLAUDE.mdwith modular.claude/rules/and.claude/skills/is also generated. ThisAGENTS.mdis the universal fallback read by Codex, Cursor, GitHub Copilot, Windsurf, Gemini, and others.Skills: the same workflow skills ship as
SKILL.mdfolders --.claude/skills/(Claude Code, OpenCode) and.agents/skills/(Codex, Cursor, Gemini CLI, Antigravity). Read the matching skill BEFORE the action it governs:create-operatorbefore creating or moving operators,td-api-referencebefore writing TD Python,mcp-tools-referencebefore the first MCP call,manage-annotations,create-extension,externalize-operator,parameter-design,visual-aesthetics,pop-networks,movie-export,debug-operator,td-recovery,multi-session-etiquette,merge-divergent-tox,glsl-shaders,operator-gotchas,testing,brief(user-invoked),collab(user-invoked). A client with no skills folder gets the identical text over MCP:get_guidance()lists topics,get_guidance(topic='create-operator')returns one.
No Envoy MCP tools? (fresh clone or handed-over project)
MCP config is deliberately not committed: every client's config file hard-codes absolute paths to one machine's Python venv and Envoy bridge. A clone arrives with this file and the rules/skills folders but no MCP config. Which file is missing depends on the client -- .mcp.json (Claude Code, and the baseline Embody always writes), .cursor/mcp.json, .vscode/mcp.json (VS Code, Copilot), .gemini/settings.json, .codex/config.toml, .agents/mcp_config.json (Antigravity), opencode.json.
A missing MCP config never means "this project has no path into TD." It means Envoy has not run on this machine yet. Tell the user:
- Open the project's
.toein TouchDesigner. - Envoy should start by itself -- the sender's committed
.embody/project.jsondeclares it, and a machine with no local settings adopts that. If the toolbar shows no port, turn on Enable Envoy on the Embody COMP by hand (the project may predate the declaration). - Restart the AI client once the Embody toolbar shows a port.
If nothing is written: Embody Mode on Advanced - ask first defers config writes during project open (a log breadcrumb says so), and Configure For on None writes no MCP config at all. op.Embody.InitEnvoy() applies the deferred writes -- an extension method, not a button.
Windsurf is the exception. Cascade reads only ~/.codeium/windsurf/mcp_config.json, which is shared by every project the user opens, so Embody never writes it -- pointing one global file at this project's bridge would hijack all their other projects. That config is always a one-time manual paste.
Critical Rules
- Prefer the externalized network file for reading TDXN-externalized COMPs - these are YAML on disk with complete network structure (operators, parameters, connections, positions, flags, DAT content, annotations). Reading them directly is faster than MCP round-trips. Never glob for an extension: Embody writes
.tdxn, and keeps writing.tdnfor any COMP externalized before Embody 6.1 - both are read and round-tripped forever, so a project can hold a mix. Letexternalizations.tsvorget_externalizationsname the exact file instead. The strategy column value istdxn- it readtdnbefore 6.2.30, and both are accepted on read. To edit: modify the file on disk, then callimport_networkvia MCP with the COMP path, the parsed network, andclear_first=Trueto reload it in TD. Use MCP when you need live runtime state (evaluated expressions, cook errors) or for non-TDXN operators. - Use Envoy MCP tools for live TD state and non-TDXN operators - never say "I can't access that binary file." For operators not externalized as TDXN, use MCP tools to inspect and modify them.
- Do NOT assume network paths - use
query_networkon/to discover the actual root structure. - Default new COMPs to Embody's container -
execute_pythonwithresult = op.Embody.parent().pathreturns the same home every run. Build inui.panes.current.owner.pathonly when you have deliberately navigated into a content network, and never treat the bare root/as that home. - Never edit
externalizations.tsvdirectly - managed exclusively by Embody's tracking system. - Always use forward slashes in file paths.
- Check for errors and warnings after each group of operator creations --
get_op_errorswithrecurse=trueonce the group is wired/positioned. - Batch repetitive MCP operations -- never make 3+ individual calls to the same tool. Use
batch_operationsfor repeated positioning, connecting, parameter, or flag edits; useexecute_pythonfor computed or looped logic. - Thread boundary: MCP server worker thread must never import TD modules. All TD access goes through
_execute_in_td().
TD Python Rules
- Always use
.eval()to get a parameter's current runtime value..valonly returns the constant-mode value. - Setting
.valsilently switches mode to CONSTANT - destroys any active expression. - Toggle parameters use
0/1(not"True"/"False"). - Use
opex()when the operator must exist - raises immediately with a clear error.op()returnsNonesilently. - Never call
op(),parent(), or access TD objects at module level - defer to methods. - NEVER access TD objects from a worker thread - all TD operations must go through main-thread hooks.
fetch()searches UP the parent hierarchy by default - passsearch=Falsefor local-only lookup.tdu.Dependency: Assign to.val(dep.val = 5), NOT the object itself. Call.modified()after mutating contents.
Network Layout Rules
- 200-unit grid: All positions snap to multiples of 200. Never place at arbitrary coordinates.
- 200 units horizontal between connected operators in a chain.
- Left to right signal flow: inputs on the left, outputs on the right.
- NEVER place an operator on top of another -- scan with
query_networkbefore placing, then verify the whole created/moved group withget_network_layout. - Visual TOP work is output-first: create an Out TOP
out1and turn its display flag on BEFORE building the chain, then keep the working chain wired into it -- the user watches live in the network backdrop. - Every logical group gets an annotation - use
create_annotationaround each cluster of related operators. - Annotations must enclose their operators:
nodeX/nodeYis the bottom-left corner -nodeYmust be below (less than) the lowest operator's Y. - TD Y-axis increases upward - new rows go downward (decreasing Y).
MCP Server Safety Rules
- Envoy must bind to
127.0.0.1, NEVER0.0.0.0. _execute_in_td()times out at 30 seconds.- The MCP server runs as a
standalone=TrueTDTask (long-lived, outside the worker pool). - Uses
threading.Event+Queuerather than locks because TD's cook cycle is frame-based.
Project Structure
Embody/
+-- AGENTS.md # This file - universal AI instructions
+-- CLAUDE.md # Claude Code specific instructions (if using Claude)
+-- dev/
| +-- embody/
| | +-- externalizations.tsv # Tracking table (NEVER edit directly)
| | \-- Embody/ # Main extension source
| | +-- EmbodyExt.py # Core externalization engine
| | +-- EnvoyExt.py # MCP server extension
| | \-- TDXNExt.py # TDXN network format export/import
\-- release/
\-- Embody-v*.tox # Latest release buildExtension Referencing
Three tiers. TD promotes every capitalized member, so the capital letter is the access modifier:
# Tier 1, public API (UpperCamelCase) - called on the COMP:
op.Embody.Update()
op.Embody.Refresh()
op.Embody.Save('/path/to/op') # opPath is REQUIRED
op.Embody.ExportPortableTox(target=some_comp, save_path='/out.tox')
# Tier 2, wiring (lowerCamelCase) - through ext, from the COMP's own callback DATs:
op.Embody.ext.Embody.getExternalizedOps(COMP)
# Tier 3, private (_lowerCamelCase) - inside the class only..ext.<Name> resolves by the Extension Name parameter, not the class name: the extensions are named Embody/Envoy/TDXN/CatalogManager against classes EmbodyExt/EnvoyExt/TDXNExt/CatalogManagerExt, so op.Embody.ext.Embody.x() works and op.Embody.ext.EmbodyExt.x() raises.
NEVER cache extension references in variables - always call inline.
Third-Party Python Packages
The project shares Embody's uv-managed venv (.venv/ beside the .toe); its
site-packages is importable from any DAT or extension - wired pre-cook via
TD's TDPyEnvManagerContext.yaml (Embody authors it) so even module-level
extension imports work on a cold open, with Embody's init as the fallback.
To add a package, ASK THE USER FIRST (installs execute code and persist across
sessions), then call op.Embody.InstallPackages(['pkg>=1.0']) via
execute_python - it accepts plain name-based requirements only (never URLs,
git refs, or file paths), validates against Embody's core pins and TD's
bundled packages, records the request in the committed .embody/project.json,
and installs wheels-only in the background (watch the Embody log for
completion). Packages declared by OTHER machines via git do not auto-install:
they surface as a warning and need the user's explicit
op.Embody.ApplyDeclaredExtras(). Never INSTALL into .venv by calling
pip/uv yourself - installs go through InstallPackages only (removal is the
one sanctioned direct call: uv pip uninstall <name> --python <VenvPython>,
and only when the user asks). Never install packages TD bundles (numpy,
opencv - crash class), and treat a logged "restart TouchDesigner" notice as
authoritative. External scripts run under op.Embody.VenvPython.
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.

