Repository navigation
feat(skills): the agent edits a running app through Hot Reload instead of rebuilding it, with a SessionStart hook - #205
Conversation
…d of rebuilding it, with a SessionStart hook The uno-dev agent ran dotnet build or restarted the app after a .xaml or .cs edit that Hot Reload had already applied. The skill it treats as its rulebook said "build and exercise", the don't-build guidance sat in uno-testing where the agent saw it late, and the hook spoke only after an edit. - uno-build-app gains the running-app rule: a running app is edited and confirmed with uno_app_hot_reload_status, never rebuilt; a start is right only for the listed cases. Rule 4, step 6, the Trivial edit row, new-app.md, verification.md (rule moved under the Build table), the report template, checkpoint and uno-mvux point at it. Every place that said "build and exercise", "then build again", "before any rebuild" or "restart the app" now says the first build before a start, or Hot Reload status. - uno-testing step 1 calls uno_app_get_runtime_info first and builds and starts only when no instance is connected. - New SessionStart hook (startup, resume, clear, compact): in an Uno app project it puts the rule in context before the agent plans, and brings it back after a compaction; elsewhere it prints nothing. - hot-reload-edit.sh reminds instead of staying silent when no solution file is found, points at uno_app_hot_reload_status instead of dotnet build on a compile failure, and its restart list matches the rule. - The rule is cited by alias, never by number; Test-Plugin.ps1 checks the alias is defined. Test-Hooks.ps1 covers the new hook and the two hook fixes. - specs/hot-reload-over-rebuild.md records the analysis and the eval still to run. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JBn6JXofK5yeaG6Ls1KE3S
b0200fc to
c6cbecc
Compare
|
Read the whole diff and the spec. The sweep is thorough and the pieces are consistent: one named rule, cited by alias everywhere, the agent files in parity, a SessionStart hook gated to Uno projects so other sessions pay nothing, and re-injection after a compaction, which is where a rule like this is lost in a long session. The two hook fixes ( Before merge
Context from the catalog runs, for the eval that is still open
Small things
|
GitHub Issue (If applicable): #
PR Type
What is the current behavior?
The
uno-devagent often runsdotnet build,uno_app_closeoruno_app_startafter a.xamlor.csedit that Hot Reload has already applied. Each one costs a build, a relaunch and the app state under test.Root cause, from the sweep in
specs/hot-reload-over-rebuild.md:uno-build-app, the skill the agent treats as its rulebook, says "build and exercise" (rule 4, step 6, the Trivial edit row,new-app.md,verification.md), and the agent files repeat it.uno-testing, loaded only when testing, and inverification.mdunder "Practical traps", after the build table.uno-testingstep 1 builds first and only then says "skip the start if the app is running", so an app that is already up gets a build that is wasted or fails on the lockedbinfolder..sln/.slnxis found above the file, and on a compile failure tells the agent to rundotnet buildagainst the running app.INTERACTION-PATTERNS.md("consider restarting the app"), the MSB3026/3027 remedies ("close, then build again"), the report template's Build row, and "check the generated code" inuno-mvux.What is the new behavior?
Skill text (every host)
uno-build-apphas a new rule, A running app is edited, not rebuilt (the running-app rule): confirm each edit withuno_app_hot_reload_status(file, waitForMs: 10000), neverdotnet build,uno_app_closeoruno_app_start; a start is right only for launch arguments, platform or app data, a Release build, the.csprojor packages, startup code, or a reportedRudeEdit,InternalErroror uncovered edit. The same wording asuno-testing.new-app.md,checkpoint.md, the report template anduno-mvuxpoint at it. Inverification.mdthe rule moved from "Practical traps" to directly under the Build table.uno-testingstep 1 (and theui.mdQuick Start) callsuno_app_get_runtime_infofirst; a connected instance is the app under test, with no build and no start.INTERACTION-PATTERNS.mdchecks the Hot Reload status instead of restarting.agents/uno-dev.agent.mdandcodex/uno-dev.tomlsay "build once, start it and exercise it" and name the new rule.SessionStart hook (Claude Code)
hooks/session-start.shonstartup|resume|clear|compact. In an Uno app project (Uno.Sdkinglobal.json, orSdk="Uno.Sdk…"on a.csprojwithin 3 levels, skippingbin/obj) it adds 371 characters of context: the running-app rule, and "calluno_app_get_runtime_infobefore the first build".compactbrings the rule back after a compaction. Elsewhere it prints nothing, so non-Uno sessions pay no context. About 20 ms.PostToolUse hook fixes
uno_app_hot_reload_statusinstead ofdotnet build.Bashmatcher for shell edits: detecting the write target is neither cheap nor reliable, and the SessionStart hook covers those sessions.Tests
Test-Hooks.ps1: the SessionStart hook on an Unoglobal.jsonfolder, an Uno.Sdk-on-project folder, a non-Uno folder (with an Uno.csprojunderobj/) and a missing folder, plus the 400-character budget; the no-solution path; and that the compile-failure reason no longer saysdotnet build.Test-Plugin.ps1: the rule is cited by alias, never by number, so the rules can be reordered; the check fails if the alias is cited but not defined on a numbered rule.Test-Hooks.ps1,Test-Plugin.ps1andclaude plugin validate --strictpass locally.PR Checklist
Additional Information
specs/hot-reload-over-rebuild.mdholds the analysis, the sweep results and the eval still to run: three successive edits on a running sample app with no build or restart between them, on Claude Code and on Codex (where only the skill text applies), plus a session that starts with the app already running. Open: whether Codex plugins support hooks, and which eval suite hosts these scenarios.🤖 Generated with Claude Code
https://claude.ai/code/session_01JBn6JXofK5yeaG6Ls1KE3S