Workflow Recipes
May 17, 2026 ยท View on GitHub
Read this only when a task needs a named recipe beyond references/ai-workflows.md.
WF-0 Orientation
Use when placement or ownership is unclear.
- Search exact screen text, method names, Unity object names, GUIDs, and runtime/content terms with
rg. - Read likely owners and callsites.
- Read graph output if present.
- Fill the structure map from
references/project-structure-discovery.mdwhen placement matters. - Fill the Routing Card.
- Ask only if two live owners are equally plausible and the choice changes user-visible behavior.
WF-1 Narrow Bug Fix
- Locate exact call path.
- Patch the true owner.
- Avoid architecture migration unless the boundary caused the bug.
- Validate the smallest surface.
WF-2 New Runtime Or Content Feature
- Decide data-first vs code-first.
- Prefer definitions/config for tuning and identity.
- Put code-first feature behavior in the repo's owning feature/module/runtime path.
- Route cross-module facts through contracts/events/bridges.
- Extract a collaborator if a controller would gain a new responsibility group.
- For tutorials, objectives, unlocks, guided selection/action steps, navigation gates, or other state machines, run the Runtime State Step Guard from
references/content-and-systems.md.
WF-3 Cross-Module Communication
- Treat sibling feature imports as blocked.
- Find the repo's existing gateway/event/contract boundary.
- If none exists, create the smallest implementation-free contract.
- Register implementation from the owner.
- Update asmdefs/docs only when dependency structure changes.
WF-4 Hub Deflation
- Name the responsibility group being added or extracted.
- Check line count and graph status when available.
- Extract one focused collaborator with one reason to change.
- Keep MonoBehaviour serialized fields stable if scenes depend on them.
- Prove changed callsites, moved state, or removed coupling.
WF-5 Data, Balance, Or Content
- Search existing definitions/config/assets before editing code.
- Prefer content data over branching inside runtime controllers.
- Add C# only when the data declares behavior not currently handled.
- Validate asset/catalog lookup names and runtime load paths.
- Report exact constants/assets changed.
WF-6 UI Or Screenshot Fix
- Identify visible layer and runtime owner.
- If the task involves any runtime visible output, focus, highlight, selection, click/tap target, visual target, bounds-type choice, marker, blocker, mask, world-to-UI label, HUD marker, modal dimming, duplicate names, hardcoded layout/position, or "do not guess", run the Runtime Visible Output Hard Stop from
references/runtime-owner-proof.mdbefore editing. - Separate layout/anchoring from readability/polish.
- Change only the shown layer unless owner proof requires a direct dependency.
- Preserve camera, background, composition, and runtime layout unless requested.
- For world/local/screen/canvas/camera coordinate mismatch, read
references/coordinate-space-conversion.md. - If an object is found but no marker exists, read
references/runtime-visible-targets.mdand report candidate rects/ambiguity before choosing. - Validate with screenshot, hierarchy, or serialized/runtime proof.
WF-6R Repeated Visible Mismatch
Use when a UI/HUD/focus/highlight/marker/camera/world-to-UI fix already failed, looks unchanged, or lands in the wrong place.
- Stop patching the same coordinate/layout/fallback owner.
- Treat the user's latest screenshot or visible target wording as the current scope.
- Read
references/runtime-visible-targets.md,references/coordinate-space-conversion.md, andreferences/unity-validation.md. - Collect runtime numeric proof: source bounds, destination bounds/root, converted rect, final drawn rect, and runtime writer.
- If values are missing, return a runtime probe plan only.
- Let a checker fail the work if the next patch lacks numeric proof.
WF-12 Multi-Agent Visible Or State Work
Use when a main agent coordinates worker agents for Unity visible-output, tutorial/state, guided selection/action, navigation, or runtime UI work.
- Run the Sub-Agent Decision And Permission Gate from
references/ai-workflows.md; do not spawn until the user approves in the same turn, unless the user already explicitly requested sub-agents. - Main agent owns scope before workers patch: load required references, fill the Routing Card, name the visible target or state flow, and list
Files allowed to touchplusFiles explicitly not touched. - Main agent assigns disjoint ownership: each worker gets a separate file set, owner chain, runtime target, state step, or validation slice. No overlapping writes unless main agent explicitly merges ownership first.
- Workers stay inside the assigned write set. If a worker discovers a new owner, missing reference, or broader dependency, it reports back instead of patching outside scope.
- Visible-output workers must provide runtime numeric proof when required: source bounds, destination bounds/root, converted rect, final drawn rect, and runtime writer.
- State-flow workers must provide state-step proof: shown, clicked, opened, selected, applied, completed, persisted, plus old-save/default/reset paths when relevant.
- Checker fails the run if the Routing Card is missing, write ownership overlaps, runtime numeric proof is missing for visible-output work, or state-step proof treats screen open/click/analytics as domain completion.
- Main agent does final integration, validation, and closeout; workers do not broaden public rules, mirrors, package metadata, or repo instructions unless those files are in the allowed write set.
WF-7 Visual Source Asset
- Stop code editing.
- Define the source asset being created/replaced/redesigned.
- Generate or obtain the approved source asset.
- Inspect transparency, import scale, orientation, 9-slice readiness, and pixel crispness.
- Re-run architecture routing before integration code.
WF-8 Compile Or Validation Repair
- Capture exact error and assembly context.
- Fix the smallest compile/runtime owner.
- Avoid broad refactors unless the error is a boundary violation.
- Re-run the same validation.
WF-9 Architecture Decision
- Keep always-read repo instructions short.
- Put detailed process in a workflow doc or skill.
- Put dependency facts in machine-readable rules when possible.
- Put current runtime maps in architecture docs.
- Create an ADR for significant decisions likely to be revisited.
- Validate docs with
git diff --check.
WF-10 Cleanup Or Deletion
- Prove unused status through code refs, YAML GUID refs, resource paths, asset refs, and runtime reachability.
- Do not treat isolated graph nodes as deletion proof.
- Separate generated/cache cleanup from source refactors.
- Report what was not deleted and why.
WF-11 Session History Or Rule Mining
- Parse session files structurally.
- Filter injected instructions, environment dumps, plugin text, and base64.
- Group repeated patterns before editing rules.
- Patch only the owning artifact.
- Validate the rule/skill/docs change.