unreal-plugin
AGENTS.md4 starsChanged 15 days agoMITView on GitHub
Root AGENTS.md is the repository rulebook; .claude/CLAUDE.md links here. README.md describes the plugin for users; the handbook is in docs/. Scenario for Unreal Engine: an Unreal Editor plugin for Unreal 5.6 to 5.8, C++ only, in Plugins/Scenario/. It prices and runs every Scenario model and workflow through Scenario's REST API (https://api.cloud.scenario.com/v1, OAuth or an API key and secret), imports the results as native assets and places them in the open level. People drive it from the Studio tab and the…
- Reads credentials
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 35,117 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 repository4 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- pr-handle-commentsSkill
- pr-squash-messageSkill
- pr-summarySkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 132
Every change keeps them. They are enforced in FScenarioSession and FScenarioRestClient, below every caller.
- Very specific: line 187
No engine build runs on GitHub.
- Very specific: line 192
Every .h, .cpp and .cs file starts with // Copyright (c) 2026 Scenario Inc.
- Distinctive: line 194
No em dashes, in code, docs, commit messages and PR titles.
- Very specific: line 198
No code from scenario-labs/blender-plugin (GPL-3.0).
- Very specific: line 200
All network and file IO is asynchronous.
- Very specific: line 204
Do not edit versions or CHANGELOG.md by hand once release automation is set up.
- Distinctive: line 206
Keep doc edits in a feature PR to the prose the change makes wrong.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
unreal-plugin: agent instructions
Root AGENTS.md is the repository rulebook; .claude/CLAUDE.md links here.
README.md describes the plugin for users; the handbook is in
docs/.
What this repository is
Scenario for Unreal Engine: an Unreal Editor plugin for Unreal 5.6 to 5.8,
C++ only, in Plugins/Scenario/. It prices and runs every Scenario model and
workflow through Scenario's REST API (https://api.cloud.scenario.com/v1,
OAuth or an API key and secret), imports the results as native assets and
places them in the open level. People
drive it from the Studio tab and the viewport composer; agents drive it through
a local MCP server inside the editor.
The repository root is a small host project (ScenarioHost.uproject, module
Source/ScenarioHost) used to build and test the plugin. A release zip holds
Plugins/Scenario/ alone. Every module is Type: Editor except
ScenarioGameplay: three small runtime actors that games made with the kit
use. Nothing else from the plugin is compiled into a packaged game.
Code map
Plugins/Scenario/Source/:
ScenarioCore/(loading phase Default; no editor API, unit-tested):ScenarioRestClient: the backend interface and its REST implementation; what each request can do to spend (read, dry run, paid, cancel), retry policy (reads and dry runs only), workspace scope, token renewal,SCENARIO_NO_SPEND.ScenarioHttp: the HTTP transport on top of Unreal's HTTP module.ScenarioApi: typed calls (models, schemas, prices, jobs, assets, workflows, usage, uploads) and their REST paths; CU values carried as exact decimal strings.ScenarioSession: sign-in state, workspace (team and project), price checks, paid runs, polling, downloads. Every caller goes through it, so the money rules hold for the Studio, the composer, agents, scripts and the commandlet alike.ScenarioQuotes: single-use quotes and their fingerprints.ScenarioLedger: the durable job list in<Project>/Saved/Scenario/, intent rows, Unknown state, reconciliation.ScenarioTransfer: resumable downloads (.partfiles), presigned uploads, host allow-lists.ScenarioOAuth: sign-in as the plugin's registered OAuth application (fixed client id, no registration): browser sign-in with PKCE on a loopback port, device code fallback, token refresh.ScenarioCredentialStore(+Private/Platform/): macOS Keychain, Windows Credential Manager, otherwise an owner-only file in the user's config folder.ScenarioLocalHttpServer: the loopback HTTP listener used by OAuth and by the agent server.ScenarioSchema: model schema to form fields, validation, payloads.ScenarioCatalog,ScenarioLanes: the model picker's catalog (cached 24 hours) and the lanes read fromResources/Lanes.json. The catalog also gives a trained model's form and remembers how it runs.ScenarioTrained: trained models (LoRAs and compositions) run on a base model: kind, base, weight and trigger words from the trained model's record and the schemas of the bases listed inResources/Trained.json; the trained form and the base's request.ScenarioFiles,ScenarioJson,ScenarioHash,ScenarioCU,ScenarioErrors,ScenarioTypes: naming and type sniffing, defensive JSON and canonical JSON, SHA-256, CU formatting, error kinds and messages.ScenarioTelemetry: opt-in usage events, silent while no collection endpoint is set (none in 0.1); fields listed indocs/PRIVACY.md.ScenarioFakes: fake transport and fake Scenario used by the tests.Private/Tests/: automation testsScenario.Core.*.
ScenarioEditor/(loading phase PostEngineInit):ScenarioEditorModule: menus, toolbar button, Studio tab, composer, context menus, toasts.ScenarioSubsystem: editor subsystem that owns the session, imports and placements; returns what each action changed.ScenarioAssets,ScenarioPlacement: import per kind (Interchange for meshes, textures with per-role settings, sounds, media, skies) and placement in the level, one undo transaction each.ScenarioProvenance:Scenario.*metadata on every imported asset and the index behind the "Generated by Scenario" Content Browser filter (ScenarioContentBrowserFilter).ScenarioSettings: Editor Preferences > Plugins > Scenario.Actions/: the action registry shared by agents, Blueprints, Python and the commandlet (ScenarioActions,ScenarioScenarioActions,ScenarioLevelActions,ScenarioOutputLog), andScenarioKitActions, which registers the kit tools declared inResources/Kit.jsonand runs them in the editor's Python.ScenarioScriptLibrary: Blueprint and Python entry points (start and poll, plus the async node "Run Scenario Action").ScenarioCommandlet:-run=ScenarioEditor.Scenariofor scripted generations (module-qualified: the engine looks up commandlets before PostEngineInit modules load).UI/: Slate views: Studio, Create page, model picker, forms, job cards, Jobs, Library, Workflows, Agent and Settings pages, sign-in, viewport composer, style and thumbnails.Private/Tests/: automation testsScenario.Editor.*(action registry, imports, placement undo, provenance, Studio registration).
ScenarioAgent/(loading phase PostEngineInit):ScenarioMcpServer: the local MCP server (Streamable HTTP on127.0.0.1:9877or the next free port, bearer token, Host and Origin checks, sessions, tool annotations).ScenarioAgentClients: Set up buttons for Claude Code, Codex, Cursor and Claude Desktop, with a timestamped backup of every config file they edit.ScenarioAgentModule,SScenarioAgentsSection: server lifecycle, token, activity log, the header's agent dot and the Agents section of the Studio's Agent page.Private/Tests/: automation testsScenario.Agent.*.
ScenarioToolsets/(loading phase PostEngineInit, Unreal 5.8 only; builds empty on older engines throughWITH_SCENARIO_TOOLSETS):ScenarioToolset: the Scenario toolset for Epic's Toolset Registry, oneAICallablefunction per registry action it exposes; paid calls always wait for the person (FScenarioCaller::bSpendWaitsForApproval).ScenarioAgentSkill: the in-engine agent skill, with the live editor state.Private/Tests/: automation testsScenario.Toolsets.*.
ScenarioGameplay/(Runtime, loading phase Default):AScenarioPickup,AScenarioGoalandAScenarioGameRules(timer, music, a Slate HUD) for the kit's games. No network code and no Scenario data.
Also in Plugins/Scenario/: Content/Python/scenario_unreal/ (the kit: worlds,
games and films from Scenario results; recipes.py is the entry point),
Resources/Kit.json (the kit tools' names, descriptions and schemas),
Resources/Lanes.json (lanes, picks, presets), Resources/Trained.json (the
base models read to run trained models),
Resources/AgentSkill/SKILL.md (the agent skill the Agent page installs),
Tests/Fixtures/ (recorded Scenario replies), Config/FilterPlugin.ini.
At the repository root, Install-Windows.bat and Install-macOS.command start
tools/install/: the installers people double-click in the source zip. They
compile the plugin with RunUAT BuildPlugin for the Unreal version a project
uses and install it into <Project>/Plugins/Scenario. Windows PowerShell 5.1
runs the Windows one (keep it ASCII); macOS's bash 3.2 runs the other.
Spending rules
Every change keeps them. They are enforced in FScenarioSession and
FScenarioRestClient, below every caller.
- A price check is a dry run (the model or workflow run with
dryRun=true). It is free and returns the exact CU cost. - Generate needs an unused quote whose fingerprint matches the request now
(SHA-256 of target, workspace and canonical JSON) and consumes it. Quotes
expire after 120 seconds. Agents pass
quote_idandapproved_costequal to the quote's exact CU string. - The intent row is written to the job list before the paid request. If it cannot be written, nothing is sent.
- A paid call is sent once. Any request not marked as a read or a dry run is treated as able to spend and is never retried. A transport failure on it marks the job Unknown, which blocks an identical request until it is reconciled.
SCENARIO_NO_SPEND=1refuses paid calls before any request; cancelling a job still goes out.- Secrets live in the OS credential store only: never in project config,
Saved/, logs, provenance or error messages.
Commands
The engine is found through $UE_ROOT (default
/Users/Shared/Epic Games/UE_5.8). Engine builds and tests run on a Mac with
Unreal installed; GitHub-hosted runners have no engine.
tools/build.sh # RunUAT BuildPlugin into Build/Scenario-<version>-UE<x.y>
tools/build.sh --host # also builds the ScenarioHostEditor target
tools/test.sh [filter] # automation tests headless (default filter: Scenario)
python3 tools/lint.py # headers, em dashes, JSON files, skill frontmatter, secrets
python3 -m unittest discover -s tools/tests # tests of the Python tools
uv run --no-project --with markdown==3.10.3 python tools/build_site.py --output <dir>
python3 tools/contract_check.py # free live check, needs a test key
./Install-macOS.command --project <file.uproject> --yes # the macOS installer, without dialogstools/contract_check.py sends reads and dry runs only and refuses paid tools
itself. It needs SCENARIO_API_KEY and SCENARIO_API_SECRET (or
SCENARIO_KEYCHAIN_SERVICE on macOS). Any paid run needs explicit
authorization for the project and budget first.
CI
| Workflow | When | What |
ci.yml | pull requests, main | lint, tools (Python tests), site (docs build), installer (Install-Windows.bat on Windows against a stand-in engine); ci-ok requires all four |
contract.yml | weekly, PRs changing ScenarioCore/ or the tool | tools/contract_check.py with SCENARIO_NO_SPEND=1, 0 CU (test key secrets; skipped with a warning without them) |
links.yml | weekly, docs PRs | links in Markdown (except the generated CHANGELOG.md) |
pages.yml | main when docs change | builds the docs site and deploys it to GitHub Pages |
pr-name.yml | pull requests | pr-title: the PR title against commitlint.config.mjs |
commitlint.yml | pull requests | commits: every commit the PR adds, same config |
project.yml | non-draft PRs, when opened, reopened or marked ready (not Dependabot's) | adds them to the Plugins project (31) |
scorecard.yml | weekly, main | OpenSSF Scorecard |
No engine build runs on GitHub. Before a release, tools/build.sh and
tools/test.sh run on a Mac with each supported engine version.
Rules
- Every
.h,.cppand.csfile starts with// Copyright (c) 2026 Scenario Inc. Licensed under the MIT License. - No em dashes, in code, docs, commit messages and PR titles.
- This repository is public: no credentials, session IDs, personal paths, team, project, job or asset ids, account records, machine details or spend anecdotes in code, docs, commits or PRs.
- No code from
scenario-labs/blender-plugin(GPL-3.0). Behaviour comes from the shared Scenario specs; the code here is written for this repository. - All network and file IO is asynchronous; Slate views never block the game
thread. Editor-facing errors use the messages in
ScenarioErrors. - Tests write only to ignored folders (
Saved/,Intermediate/,tests/reports/). - Do not edit versions or
CHANGELOG.mdby hand once release automation is set up. - Keep doc edits in a feature PR to the prose the change makes wrong. Test runs, platforms and review notes belong in the PR body, not in docs.
Commits and pull requests
- Branch from
main; pull requests are squash-merged, so the PR title becomes the commit header and the changelog line. Titles follow Conventional Commits with a scope:core,editor,ui,agent,lanes,docs,tools,tests,ci,deps,release,repo. Example:fix(editor): keep the selection after placing a material.commitlint.config.mjsholds these rules; thepr-titleandcommitschecks enforce them on titles and commits. - Fill
.github/pull_request_template.md; tick only what you ran. .agents/skills/holds the PR skills shared by every Scenario repository (skills-lock.json); change them upstream..claude/skills/links to them.- Screenshots of a visible change go in the PR description, never in a commit.
- Name the contributing agent in the PR and keep its co-author trailer on commits and in the squash message. A human reviews the complete diff before merge.
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.

