Unity-Open-MCP / hub
AGENTS.md15 starsChanged 5 months agoMITView on GitHub
Rules for hub/ — the Tauri + SvelteKit desktop application. Root AGENTS.md also applies. The MCP client auto-config surface (wizard Step 4 writer, Clear AI Setup, detection heuristic, and the bridge window configure panel) is driven by a shared catalog. Adding a client is a manifest + catalog change, not a per-file constant edit. To add a client: 1. Skill target — add the client's project-relative skill path to skills/client-paths.json (clients map) and map it under mcpClientMapping so the skill…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- demo/AGENTS.mdAGENTS.md
- mcp-server/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- animationSkill
- audioSkill
- cinemachineSkill
- constraintsSkill
- input-simulationSkill
- inputsystemSkill
- lightingSkill
- memoryprofilerSkill
- navigationSkill
- particlesystemSkill
- probuilderSkill
- shadergraphSkill
- splinesSkill
- spriteatlasSkill
- terrainSkill
- textureSkill
- tilemapSkill
- timelineSkill
- uiSkill
- vfxSkill
- unity-open-mcpSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Do not add UI framework dependencies (React, Vue, etc.) — Svelte 5 is the only frontend framework.
- Distinctive: line 17
No migrations. The app is pre-release.
- Distinctive: line 70
If hashing, path normalization, range, or fallback behavior changes, update all three implementations and their C#, TypeScript, and Rust …
- Distinctive: line 74
Follow the existing component-per-zone pattern (tabs, popups, drawer).
- Very specific: line 75
No internal references in UI strings — labels, tooltips, and help text must never contain specs/ paths, milestone IDs, or task numbers (see …
- Very specific: line 79
Run npm run check and npm test after changes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Hub rules
Scope
Rules for hub/ — the Tauri + SvelteKit desktop application. Root AGENTS.md also applies.
Package shape
- SvelteKit (Svelte 5, runes mode) frontend in
src/, Tauri (Rust) shell insrc-tauri/. - Frontend:
$stateproxies for reactivity (src/lib/state.svelte.ts), component-per-zone pattern. Backend commands invoked via@tauri-apps/api. - Do not add UI framework dependencies (React, Vue, etc.) — Svelte 5 is the only frontend framework.
- TypeScript strict. Run
npm run check(svelte-check) after changes.
State and data
- Project and settings data lives in
projects.jsonandsettings.jsonat the OS config dir, read/written via Tauri commands. Do not introduce a database. - No migrations. The app is pre-release; prefer simplifying storage/codecs over backward compatibility (see root contributor rules).
- Platform-neutral storage only — no Windows-only config formats.
- New
ProjectEntryfields that are derived from disk (SRP label, default build target, …) must be#[serde(default, skip_serializing_if = "Option::is_none")]so legacyprojects.jsonfiles keep loading and the on-disk shape stays compact until the value is computed. Populate them in every entry-construction pipeline (projects::add_project,projects::refresh_all_projects,walk_up_scan::build_entry,seed::seed_from_unity_hub,new_project::create_new_project) and recompute them inprojects::refresh_all_projectsalongside the other disk-derived fields.
Tauri commands
- New backend commands go in
src-tauri/src/. Commands must be#[tauri::command]and registered in the invoke handler. - Commands that touch the filesystem must validate paths and reject traversal outside expected roots.
MCP client catalog (single source of truth)
The MCP client auto-config surface (wizard Step 4 writer, Clear AI Setup, detection heuristic, and the bridge window configure panel) is driven by a shared catalog. Adding a client is a manifest + catalog change, not a per-file constant edit. To add a client:
- Skill target — add the client's project-relative skill path to
skills/client-paths.json(clientsmap) and map it undermcpClientMappingso the skill copy +generate_skillpick it up. Also update theBUNDLED_MANIFESTinmcp-server/src/skill/client-paths.ts(kept in sync by a unit test). - Rust writer — add a variant to
McpClientId(hub/src-tauri/src/config/mcp_config.rs) and toALL_CLIENTS, and cover it in everymatch:client_format,client_is_global,portable_strategy,resolve_target_path,merge_key_path,build_entry_json,mcp_client_wire_key. TOML clients also need a branch inbuild_codex_toml/read_existing_configskip. - Rust clear + detect — nothing per client.
clear.rsandwizard.rs::read_mcp_heuristicwalkmcp_config::config_locations, and skill detection/clear walkmcp_config::skill_roots; both are derived from the writer (ALL_CLIENTS→resolve_scope→config_root_for→resolve_target_path), so they cover the Unity project and the repository root a commit-safe write uses. A new skill folder goes inmcp_config::SKILL_REL_PATHS(a test keeps it equal to the manifest). A new client reports underother_clientsunless it gets its own heuristic flag. - TS preview — extend
McpClientIdinhub/src/lib/services/ai_toolkit.ts,mcpClientConfigTarget, theMcpClientIdWire/McpClientWireunions inconfig.ts, andclientToWire+MCP_CLIENT_OPTIONSinhub/src/lib/components/wizard/constants.ts(the Step 4 picker catalog consumed by the wizard modules). - Bridge window — add a row to
packages/bridge/Editor/Config/McpClientCatalog.csand (if a new envelope) a branch inBuildEntryFields.
The Rust + TS sides must agree byte-for-byte (the wizard preview is asserted
to match the writer in mcp_config.rs tests). Run cargo test --lib +
npm test + npm run check after a catalog change.
Bridge port mirror
src-tauri/src/config/bridge_port.rsmirrors the bridge and MCP deterministic-port formula. The bridge owns the detailed three-way contract.- If hashing, path normalization, range, or fallback behavior changes, update all three implementations and their C#, TypeScript, and Rust fixtures in the same task.
UI conventions
- Follow the existing component-per-zone pattern (tabs, popups, drawer). Do not create monolithic single-file UI shells.
- No internal references in UI strings — labels, tooltips, and help text must never contain
specs/paths, milestone IDs, or task numbers (see root public-surface rules).
Verification
- Run
npm run checkandnpm testafter changes. - Tauri command changes: update the corresponding frontend service wrapper in
src/lib/services/in the same task.
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.

