Skip to content

fix: Improve compile and pause-point skill guidance for AI agents#1836

Merged
hatayama merged 3 commits into
v3-betafrom
docs/compile-skill-force-recompile-guidance
Jul 18, 2026
Merged

fix: Improve compile and pause-point skill guidance for AI agents#1836
hatayama merged 3 commits into
v3-betafrom
docs/compile-skill-force-recompile-guidance

Conversation

@hatayama

@hatayama hatayama commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • The compile skill guide now tells AI agents that --force-recompile is almost never needed and that plain uloop compile is the default.

User Impact

  • Before: agents tended to run --force-recompile "just in case" after editing files externally, freezing Unity with a full rebuild, getting COMPILE_RESULT_UNKNOWN across the domain reload, and leaving the Editor in the unstable just-after-reload state.
  • After: the skill states that incremental change detection is Unity's job, lists why the flag hurts, and names the one legitimate use case (surfacing warnings hidden by other asmdefs), so agents stop paying the full-rebuild cost for no benefit.

Changes

  • Added a "When to use --force-recompile" section to the compile skill source (Packages/src/.../Compile/Skill/SKILL.md) and reworded the parameter description.
  • Regenerated the .claude/ and .agents/ skill copies through uloop skills install --claude --agents.

Verification

  • diff confirms the source and both generated copies are byte-identical.
  • Docs-only change; no code paths affected.

Second commit: condition-triggered pause via dynamic-code watcher

  • The pause-point skill now documents the enable → register watcher → await → inspect → resume pattern: execute-dynamic-code registers an EditorApplication.update watcher that calls UloopPausePoint.Pause(id) on the first frame a runtime condition holds (animation peak, HP reaching zero, spawn), while await-pause-point blocks on the CLI side. No .cs file is written.
  • Added hit-then-Step guidance: pause on the input-consuming line to freeze the frame where simulated input lands, then advance exactly N frames with control-play-mode --action Step. Explicitly warns against race-prone Time.frameCount arithmetic in watchers.
  • The execute-dynamic-code skill cross-references the pattern and repeats the "register and return, never poll or sleep in the snippet" rule.
  • .claude/ and .agents/ copies regenerated through uloop skills install --claude --agents; diff confirms byte-identical.

Review in cubic

AI agents tend to reach for --force-recompile "just in case" after
external file edits, but incremental change detection is Unity's job
and a plain compile already runs every required recompilation. On
large projects the forced full rebuild freezes the Editor for a long
time, usually returns COMPILE_RESULT_UNKNOWN across the domain
reload, and puts the Editor into the unstable just-after-reload
state. Document the few legitimate use cases and make plain
`uloop compile` the default guidance.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates synchronized uloop compile, uloop pause-point, and uloop execute-dynamic-code skill documentation. It clarifies force-recompile usage and documents runtime-condition pause triggers plus deterministic frame stepping after simulated input.

Changes

Force Recompile Documentation

Layer / File(s) Summary
Flag behavior and scope
.agents/skills/uloop-compile/SKILL.md, .claude/skills/uloop-compile/SKILL.md, Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md
The --force-recompile parameter is documented as performing a full recompile plus domain reload and as rarely needed.
Usage guidance and rationale
.agents/skills/uloop-compile/SKILL.md, .claude/skills/uloop-compile/SKILL.md, Packages/src/Editor/FirstPartyTools/Compile/Skill/SKILL.md
A new section explains normal external-file recompilation, drawbacks of forced recompilation, and the use case of surfacing warnings hidden by other asmdefs.

Dynamic Pause-Point Documentation

Layer / File(s) Summary
Runtime condition pause workflow
.agents/skills/uloop-pause-point/SKILL.md, .claude/skills/uloop-pause-point/SKILL.md, Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
The pause-point skills document id-only markers, EditorApplication.update watchers, UloopPausePoint.Pause(id), watcher cleanup, and single-shot or continuous behavior.
Input pause and frame stepping
.agents/skills/uloop-pause-point/SKILL.md, .claude/skills/uloop-pause-point/SKILL.md, Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
New guidance covers pausing on simulated input and advancing exactly N frames with control-play-mode --action Step.
Dynamic-code trigger entry points
.agents/skills/uloop-execute-dynamic-code/SKILL.md, .claude/skills/uloop-execute-dynamic-code/SKILL.md, Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Skill/SKILL.md
The dynamic-code skills describe registering the watcher and using uloop await-pause-point without polling or sleeping inside the snippet.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant DynamicCode
  participant Unity
  CLI->>Unity: Enable id-only pause point
  CLI->>DynamicCode: Register update watcher
  DynamicCode->>Unity: Pause when runtime condition holds
  CLI->>Unity: Await pause point
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main documentation updates to compile and pause-point skills for AI agents.
Description check ✅ Passed The description accurately describes the documented compile guidance and pause-point workflow changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/compile-skill-force-recompile-guidance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Timing-sensitive PlayMode verification (short motions, one-frame
effects, state transitions) cannot be captured reliably by sleeping
and taking a screenshot. Document the enable -> register watcher ->
await -> inspect -> resume pattern: execute-dynamic-code registers an
EditorApplication.update watcher that fires UloopPausePoint.Pause(id)
on the first frame a runtime condition holds, while await-pause-point
does the waiting on the CLI side.

- Add the pattern with a full watcher example to the pause-point skill
- Add hit-then-Step guidance for pausing right after simulated input
  and for frame-offset positioning, and warn against race-prone
  Time.frameCount arithmetic in watchers
- Cross-reference the pattern from the execute-dynamic-code skill
- Regenerate .claude/.agents copies via `uloop skills install`
@hatayama hatayama changed the title chore: Steer agents away from unnecessary --force-recompile in the compile skill chore: Improve compile and pause-point skill guidance for AI agents Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Packages/src/Editor/CliOnlyTools`~/PausePoint/Skill/SKILL.md:
- Around line 131-134: Add an abort/timeout cleanup path to the watcher guidance
so its EditorApplication.update subscription is removed when the condition never
fires, while preserving the existing self-unsubscribe behavior on a hit. Apply
the same documentation update consistently in
Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md lines 131-134,
.agents/skills/uloop-pause-point/SKILL.md lines 131-134, and
.claude/skills/uloop-pause-point/SKILL.md lines 131-134.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c6b6138-1bf9-4306-b6c4-68e18e856f19

📥 Commits

Reviewing files that changed from the base of the PR and between d8e88b5 and df96d09.

📒 Files selected for processing (6)
  • .agents/skills/uloop-execute-dynamic-code/SKILL.md
  • .agents/skills/uloop-pause-point/SKILL.md
  • .claude/skills/uloop-execute-dynamic-code/SKILL.md
  • .claude/skills/uloop-pause-point/SKILL.md
  • Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Skill/SKILL.md

Comment thread Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
The watcher example only unsubscribed from EditorApplication.update on
the hit path, so a condition that never holds would leak the delegate
until the next domain reload. Add a deadline guard matching the marker's
--timeout-seconds and update the rules bullet accordingly. Mirrored
copies under .agents/ and .claude/ are synced byte-identically.

Addresses CodeRabbit review feedback on PR #1836.
@hatayama hatayama changed the title chore: Improve compile and pause-point skill guidance for AI agents fix: Improve compile and pause-point skill guidance for AI agents Jul 18, 2026
@hatayama
hatayama merged commit c7c650e into v3-beta Jul 18, 2026
5 checks passed
@hatayama
hatayama deleted the docs/compile-skill-force-recompile-guidance branch July 18, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant