Skip to content

feat(skills): uno-testing edits the running app through Hot Reload instead of restarting it, with a PostToolUse hook - #186

Merged
kazo0 merged 2 commits into
mainfrom
dev/steve/uno-testing-hot-reload
Oct 12, 2026
Merged

kazo0 merged 2 commits into
mainfrom
dev/steve/uno-testing-hot-reload

Conversation

@kazo0

@kazo0 kazo0 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #185 (base dev/steve/uno-dev-find-elements); the diff is this PR's change only.

What

  • uno-testing skill, both copies: step 2 says Hot Reload is live about 12 s after uno_app_start returns and that the first edit waits at least 15 s, because edits in that window are dropped, never replayed, and not carried by a later edit of another file, and the indicator that would show readiness is hidden by our own UseStudio arguments. A new critical rule says to edit the running app (an existing .xaml or .cs file applies in 2 to 4 s on desktop and Android; a C# edit recreates the page), assert with uno_app_find_elements(waitForMs), and call uno_app_start only for launch arguments, platform, app data, a Release build, or a change Hot Reload does not carry (new file, .csproj, packages, startup code). "Close it before you build" is scoped to when a start is needed.
  • First plugin hook (hooks/hooks.json + hooks/hot-reload-edit.sh, Claude Code only): PostToolUse on Edit|Write|MultiEdit; for a .xaml or .cs path it returns additionalContext that says the running app picks the edit up through Hot Reload, assert instead of restarting. Other paths print nothing. Runs under Git Bash on Windows (Claude Code's default hook shell) and sh elsewhere.
  • README: hooks/ in Contents and Manifests.

Why

Measured through the App MCP host (DevServer 6.7.135, Uno.Sdk 6.7.30, App MCP 1.4 local build, template app, indicator visible), details in unoplatform/uno.app-mcp#187:

Desktop Android
uno_app_start returns after 6 s 40 s
XAML edit 0, 4, 8 s after it returns dropped dropped
XAML edit 12 s after it returns applied within 4 s applied within 4 s
C# edit once live applied in 2 to 4 s, page recreated applied in 3 s

In FieldCheck run fieldcheck-20261009-010927 (unoplatform/private#1189) the two Uno sessions made 29 and 17 uno_app_start calls, most of them "relaunching to pick up the fix" after an edit, at 15 to 40 s each plus the navigation back. Hot Reload was never relied on; the first edit after a start is the one that gets lost, which looks like Hot Reload not working.

Not yet

The hook points at uno_app_find_elements, not at a Hot Reload status tool, because none exists; unoplatform/uno.app-mcp#187 proposes uno_app_hot_reload_status and a readiness wait in uno_app_start. When they ship, the hook and step 2 switch to them and the 15 s clock rule goes away. Not measured, so still a start: new files, .csproj and package changes.

Verification

  • Hook script piped sample PostToolUse JSON: .xaml, .xaml.cs and .cs paths (Windows and POSIX) return valid JSON with additionalContext; .csproj and .md return nothing. The hooks.json command string run through bash -c with CLAUDE_PLUGIN_ROOT set to a Windows path (X:\src\studio\plugins\uno-platform-studio) produces the same output.
  • hooks.json parses; the script is committed 100755 with eol=lf from .gitattributes.
  • .github/scripts/Test-Plugin.ps1 locally: the skill mirror check passes; the one error it reports (uno-dev: Markdown and Codex agent instructions differ) is also present on the base branch locally, untouched here. validate-plugin.yml only runs for PRs against main or release/stable/**, so it does not run on this stacked PR until feat(skills): uno-testing asserts with uno_app_find_elements after an action, screenshot only for the eye #185 merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL

@kazo0
kazo0 added this pull request to stack #187 October 9, 2026 18:30
@kazo0
kazo0 force-pushed the dev/steve/uno-testing-hot-reload branch from c594567 to b6a4162 Compare October 12, 2026 11:20
@kazo0 kazo0 changed the title feat(uno-testing): edit the running app through Hot Reload instead of restarting it, with a PostToolUse hook feat(skills): uno-testing edits the running app through Hot Reload instead of restarting it, with a PostToolUse hook Oct 12, 2026
@kazo0
kazo0 force-pushed the dev/steve/uno-testing-hot-reload branch from b6a4162 to 0e7214a Compare October 12, 2026 11:54
Base automatically changed from dev/steve/uno-dev-find-elements to main October 12, 2026 12:07
kazo0 and others added 2 commits October 12, 2026 08:14
…stead of restarting it, with a PostToolUse hook

The uno-testing skill now says when Hot Reload is live (about 12 s after uno_app_start returns; edits before that are dropped and not replayed), that an edit to an existing .xaml or .cs file reaches the running app in 2 to 4 s on desktop and Android, and that uno_app_start is only for launch arguments, platform, app data, Release, or a change Hot Reload does not carry. The "close before you build" rule is scoped to when a start is needed.

The plugin ships its first Claude Code hook: PostToolUse on Edit|Write|MultiEdit, a POSIX sh script that, for a .xaml or .cs path, adds context telling the agent to assert with uno_app_find_elements instead of restarting.

Measured through the App MCP host (DevServer 6.7.135, Uno.Sdk 6.7.30, App MCP 1.4 local build): unoplatform/uno.app-mcp#187. In FieldCheck run fieldcheck-20261009-010927 the two Uno sessions made 29 and 17 app starts, most after edits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL
…edit of another file; same-file re-edit, then a start

Measured both directions in the Hot Reload probe behind unoplatform/uno.app-mcp#187.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL
@kazo0
kazo0 force-pushed the dev/steve/uno-testing-hot-reload branch from 0e7214a to ac0789a Compare October 12, 2026 12:15
@kazo0
kazo0 merged commit 1e19c50 into main Oct 12, 2026
3 of 4 checks passed
@kazo0
kazo0 deleted the dev/steve/uno-testing-hot-reload branch October 12, 2026 12:18
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