[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69B8FE826QNJ8NZFZJP3XFQ":3,"skill-same:01M69B8FE826QNJ8NZFZJP3XFQ":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":17,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M69B8FE826QNJ8NZFZJP3XFQ","reactor-devtools","Reactor 应用可视化调试","Driving a running Reactor app via `mur devtools` — screenshot, inspect visual tree, click\u002Ftype\u002Fscroll, read hook state. Use when diagnosing visible bugs (layout, contrast) or verifying a UI change landed.","通过 `mur devtools` 驱动运行中的 Reactor 应用——截图、检查可视化树、点击\u002F输入\u002F滚动、读取 hook 状态。在诊断可见的 bug（布局、对比度）或验证 UI 变更是否生效时使用。","microsoft\u002Fmicrosoft-ui-reactor","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69B6EF21X2GHARCXN2BH1K1",896,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-devtools\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRSRYQ3M8N5063NNQPF2B1","调试与故障排查","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"reactor devtools","devtools","layout","running","when","bugs","inspect","tree","contrast","hook","click","type","app","change","visual","use","read","ui","screenshot","state","reactor app","2026-11-10 10:12:30",false,"---\nname: reactor-devtools\ndescription: \"Driving a running Reactor app via `mur devtools` — screenshot, inspect visual tree, click\u002Ftype\u002Fscroll, read hook state. Use when diagnosing visible bugs (layout, contrast) or verifying a UI change landed.\"\n---\n\n# Reactor Devtools — CLI-driven UI automation\n\nThe Reactor devtools let you look at a running debug-build app the way a\nuser does (screenshots, rendered text, layout bounds) and drive it the way\na user does (click, type, toggle, scroll). **Always prefer the `mur devtools`\nCLI** — every action composes with shell pipes and `jq`, each invocation is\na complete audit record, and no MCP client setup is needed.\n\nUnder the hood the CLI talks JSON-RPC to a loopback HTTP endpoint the app\nexposes. The MCP endpoint is still available at `http:\u002F\u002F127.0.0.1:PORT\u002Fmcp`\nas a parity escape hatch, but reach for it only when the CLI can't express\nwhat you need (structured args the CLI flattens, or another MCP client\nthat's already wired up).\n\nLoopback-only — **DEBUG builds only**, never ship it. Auth is a per-launch\nbearer token written into the lockfile; the CLI applies it transparently\nduring lockfile discovery, so you don't see it. **Don't pass `--endpoint`\nfor tool calls** — without the token the server returns 401. `--endpoint`\nis only useful when you're crafting the `Authorization: Bearer …` header\nyourself (curl, custom client).\n\n## Getting `mur` on your PATH\n\n`mur` resolves from PATH in both modes:\n- **Skill kit (deployed):** `install-skill-kit.ps1` (shipped with the kit zip)\n  prepends `\u003Cinstall>\u002Fbin\u002F\u003Carch>` to your user PATH.\n- **Cloned repo (selfhost):** `dotnet build` of `src\u002FReactor.Cli` automatically\n  mirrors the output to `\u003Crepo>\u002Fbin\u002F\u003Carch>\u002F` (architecture is determined from\n  `RuntimeIdentifier`). Add that directory to your PATH once.\n\nIf `mur --version` doesn't resolve, neither path was set up; commands below assume it does.\n\n## Attaching to a running app\n\nThe app author enables devtools capability in the app project, usually only for Debug builds:\n\n```xml\n\u003CItemGroup Condition=\"'$(Configuration)' == 'Debug'\">\n  \u003CRuntimeHostConfigurationOption Include=\"Reactor.DevtoolsSupport\"\n                                  Value=\"true\" Trim=\"true\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n`ReactorApp.Run` takes no `devtools:` or `preview:` argument.\n\n**Prefer attaching to an app that's already running.** Any devtools-enabled\napp writes a lockfile to `%TEMP%\u002Freactor-devtools\u002F` on first render, and\n`mur devtools \u003Cverb>` discovers it automatically — **no port, no config,\nno parsing stdout.**\n\n```bash\nmur devtools session list --pretty   # confirm a session is up\n```\n\nExit 0 with a row means you're good to go; every other verb will find it.\nExit 4 means no live session — you need to launch one yourself (next\nsection).\n\n## Launching an app yourself\n\nTwo launch modes, from simplest to most featured:\n\n### Plain `dotnet run` (the default)\n\n```bash\ndotnet run --project path\u002Fto\u002FApp.csproj -- --devtools run \\\n  > \u002Ftmp\u002Fapp-stdout.log 2>&1 &\n```\n\nThis is what you want in almost every AI session: spawn the app, drive it\nwith `mur devtools \u003Cverb>`, call `mur devtools shutdown` when you're done.\nNo supervisor machinery, no pinned port — the CLI finds the session via\nthe lockfile regardless.\n\n### `mur devtools \u003Cproject>` — the supervisor\n\nReach for this **only** when you need a stable MCP endpoint across\n`reload` cycles:\n\n```bash\nmur devtools path\u002Fto\u002FApp.csproj --mcp-port 54931\n```\n\nThe supervisor pins the port (reload-proof) and catches the child's exit\ncode 42 to rebuild and relaunch. Useful if you've wired an external MCP\nclient to `http:\u002F\u002F127.0.0.1:54931\u002Fmcp` and want it to survive code\nedits. Overkill for one-shot automation.\n\nIf another process already holds the port when the app starts, the app\nexits with code 43. A port you pinned with `--mcp-port` is never moved:\nthe supervisor reports the conflict and exits 43, so free the port or\npick another. Without `--mcp-port`, the supervisor picks a new free port,\nprints `using MCP port N across reloads instead`, and relaunches. Take\nthe endpoint from that line or the lockfile, not from the first one.\n\n## Discovering the tool surface\n\n```bash\nmur devtools call tools\u002Flist --pretty    # names + input schemas\nmur devtools call tools\u002Flist | jq '.tools[].name'\n```\n\n`mur devtools --help` lists every named verb with one-line descriptions.\n\n## CLI verb catalog\n\nEach verb attaches to the running session via lockfile discovery; no flags\nneeded when only one session is active. Pass `--pretty` to any verb for\nindented JSON.\n\n| Verb | What it does |\n|---|---|\n| `version` | Build tag + pid + port — confirm the app is the one you expect. |\n| `components` | Class names of every `Component` subclass; marks which is mounted. |\n| `switch \u003Cname>` | Swap the root component by class name. **Invalidates all node ids.** |\n| `reload [--component N]` | Rebuild + relaunch via the supervisor sentinel. Old ids dead. |\n| `shutdown` | Close the app cleanly (supervisor exits 0). Releases the build output file lock. |\n| `windows` | Active window ids, titles, bounds, currently-mounted component. |\n| `windows.list` | Spec 036 §10. Per-window id, key, title, DIP size, DPI, state, isMain. Use this when you care about DPI \u002F DIP size or the `key` column for `UseOpenWindow`-keyed lookups. |\n| `windows.activate \u003Cid>` | Activate (focus) a window. Returns `{ ok, id }`. |\n| `windows.close \u003Cid>` | Close a window. Honors `UseClosingGuard` \u002F `Closing` subscribers — returns `{ ok: false, cancelled: true, id }` when a guard vetoed the close. |\n| `windows.open \u003CComponent> [--title T] [--width W] [--height H] [--key K]` | Open a new top-level window mounting an allowlisted Component. The component name is gated by the same allowlist as `switchComponent`; rejected names return `unknown-component` with the available list. |\n| `tree [--selector S] [--window W] [--view summary\\|full]` | Dump the visual tree as JSON. `full` adds layout\u002Fautomation\u002Fvisual fields. |\n| `screenshot [--selector S] [--out path]` | PNG of the window (or selector-cropped region). `--out path.png` writes to file; `--out -` streams bytes to stdout. |\n| `click \u003Cselector>` | UIA click. Prefers Invoke → Toggle → SelectionItem; returns `via`. |\n| `invoke` \u002F `toggle` \u002F `select` | Direct UIA pattern access. `select \u003Ccontainer> \u003Citem>` auto-expands ComboBoxes. |\n| `type \u003Cselector> \u003Ctext> [--clear]` | Set text on a value-bearing control. |\n| `focus \u003Cselector>` | Programmatic focus on a Control. |\n| `scroll \u003Cselector> [--by H%,V%] [--to \u003Citem-selector>]` | Scroll by **percentage deltas** 0–100 (not pixels), or scroll an item into view. |\n| `expand \u003Cselector>` \u002F `collapse \u003Cselector>` | ExpandCollapse pattern (ComboBox popup, TreeViewItem, Expander). |\n| `wait \u003Cselector> [--text X \\| --text-matches RE \\| --visible \\| --count N] [--timeout MS]` | Poll a predicate until satisfied or timeout. |\n| `state [--selector S]` | Dump every hook value (useState\u002FuseReducer\u002Fetc.) across mounted components. |\n| `logs [--tail N] [--since SEQ] [--filter RE] [--source stdout\\|stderr\\|debug\\|trace] [--follow]` | Drain captured `Debug.WriteLine` \u002F `Trace.WriteLine` \u002F `Console.Out` \u002F `Console.Error`. Ring buffer installed at `--devtools run` startup — late-attaching agents still see startup output. `--follow` long-polls until Ctrl+C. |\n| `fire \u003CComponent>.\u003Cevent> [--args JSON]` | Call a NAMED METHOD on a live component by reflection. **Inline lambdas aren't reachable**. |\n| `properties \u003Cselector> [--name PropName]` | Read dependency properties on an element. Omit `--name` to enumerate all DPs with values, types, and local-vs-default status. Supports attached properties via `Grid.Row` syntax. |\n| `set-property \u003Cselector> \u003Cname> \u003Cvalue>` | Set a dependency property. Value is parsed from string (Thickness, CornerRadius, Brush hex `#RRGGBB`, enums, bool, double, int). |\n| `resources [--selector S] [--scope element\\|window\\|app] [--filter RE]` | Browse ResourceDictionary entries. Walks element → ancestor elements → window → app (including MergedDictionaries and ThemeDictionaries). |\n| `set-resource \u003Ckey> \u003Cvalue> [--scope app\\|window\\|element] [--selector S]` | Set or add a XAML resource. Reports whether the write replaced an existing entry or created a new shadowing entry. |\n| `styles \u003Cselector>` | Inspect the explicitly-assigned Style: TargetType, Setters (property + value), BasedOn chain. Returns `hasStyle: false` when only a default\u002Ftheme style is active. |\n| `ancestors \u003Cselector>` | Walk the visual tree upward — returns type, name, and automationId for each ancestor up to the root. |\n| `call \u003Ctool\\|method> [--args JSON]` | Generic JSON-RPC passthrough — parity escape hatch. |\n\n### Reference-graph overlay\n\nThe `references` tool (Spec 057) returns the app's reactive reference\ngraph — `descriptor.Reference`\u002F`.ReferenceList`, the `binding.Reference`\nbridge, and modifier edges like `.LabeledBy`\u002F`.DescribedBy`\u002F`.FlowsTo`\u002F\n`.XYFocus*` — as `{from, to, label, slot, kind, resolved}` edges keyed to\nthe same node ids `tree` uses, plus diagnostics for **cycles** and\n**unresolved** (perpetually-null) references. Reach it through the\ngeneric passthrough:\n\n```bash\nmur devtools call references --pretty\nmur devtools call references --args '{\"selector\":\"#login-form\"}'   # scope to a subtree\n```\n\nUse it to confirm an accessibility relationship (`LabeledBy`\u002F`DescribedBy`)\nor an `XYFocus*` ring actually resolved to the control you expect, or to\nspot a reference that never resolved. Cycles are a supported topology and\nare reported informationally, not as errors. The same overlay also backs\nthe **References** toggle in the VS Code live-preview panel.\n\n### Session management\n\n```bash\nmur devtools session list             # JSONL, one live session per line\nmur devtools session list --pretty    # human table\nmur devtools session clean            # GC stale lockfiles\nmur devtools session clean --dry-run  # show what would be removed\n```\n\n### Shared flags (before any verb)\n\n- `--endpoint \u003Curl>` — skip lockfile discovery and talk to this endpoint.\n  **Drops the bearer token** — the CLI has no `--token` flag, so verbs hit\n  the endpoint unauthenticated and get 401. Only useful with `curl` plus a\n  hand-built `Authorization` header, not for `mur devtools \u003Cverb>` calls.\n- `--pretty` — indent JSON output.\n- `--auto` — loopback port scan (slow; use only when lockfile discovery fails).\n\n### Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | Success. |\n| 1 | Usage error (unknown flag, missing argument). |\n| 2 | Transport error (endpoint unreachable, timeout). |\n| 3 | Another devtools session is already active for this project. |\n| 4 | No live devtools session found. |\n| 5 | Tool returned a JSON-RPC error. stdout has the error envelope. |\n\n## Selector grammar (5 forms)\n\n1. **Node id** — `r:main\u002FCounterDemo.SubmitButton` — copy from `tree`. Stable within a window's lifetime; invalidated by `switch` \u002F `reload`.\n2. **AutomationId** — `#btn-inc`. Matches `AutomationProperties.AutomationId` exactly.\n3. **AutomationName** — `[name='Increment']` or `[name=\"+ 1\"]`. Matches `AutomationProperties.Name` OR the visible caption of Buttons \u002F TextBlocks \u002F TextBoxes \u002F ContentControls.\n4. **TypePath** — `Button`, `Button[2]`, `StackPanel > Button`. Type name is `GetType().Name`. Index disambiguates.\n5. **Reactor source** — `{component:'CounterDemo',line:42}`. Reserved (Phase 3).\n\n`[name=…]` cannot be indexed — if it matches multiple, error is `ambiguous-selector` with all candidate ids listed; pick one by node id or prefix with a TypePath step.\n\n## Typical workflows\n\n### \"Does the app look right?\" — visual diagnosis\n\n```bash\nmur devtools screenshot --out \u002Ftmp\u002Fshot.png\nmur devtools screenshot --selector \"[name='Submit']\" --out \u002Ftmp\u002Fbtn.png\nmur devtools tree --selector \"#login-form\" --view full --pretty\n```\n\nFull-view `tree` nodes carry `bounds`, `actualSize`, `desiredSize`,\n`layout.margin`, `layout.padding`, `isVisible`, `isEnabled`,\n`automationControlType`. That's usually enough to spot a margin collapse\nor a zero-size child without running the app in a debugger.\n\n### Diagnosing a layout issue\n\n1. `mur devtools screenshot --out \u002Ftmp\u002Fshot.png` — confirm what's actually on screen.\n2. `mur devtools tree --selector \"\u003Ccontainer>\" --view full | jq '.nodes[] | select(.actualSize.width == 0)'` — find zero-sized children. A child with `actualSize:{width:0,height:0}` under a parent that's sized means the child isn't getting space (missing `Flex(grow:1)` on a ScrollView inside a FlexColumn is a classic).\n3. Edit the Reactor code, then `mur devtools reload` (rebuild + relaunch) and re-screenshot.\n4. `mur devtools wait \"\u003Cselector>\" --visible --timeout 2000` if the state is async — don't screenshot before mount.\n\n### Diagnosing a contrast \u002F color issue\n\n1. `mur devtools screenshot --selector \"\u003Celement>\" --out \u002Ftmp\u002Fel.png` — pull the cropped PNG.\n2. Decode the PNG and sample foreground\u002Fbackground pixels. Compute WCAG 2.1 ratio = `(L1 + 0.05) \u002F (L2 + 0.05)` where L is relative luminance. Target ≥ 4.5:1 for body text, ≥ 3:1 for large text \u002F UI chrome.\n3. If low, check whether the color came from a Theme token (correct — rebind to the right token for the surface) or a hardcoded hex (wrong — replace with a `Theme.*` token; see `skills\u002Fdesign.md`).\n4. Edit, `mur devtools reload`, re-screenshot, re-measure.\n\n### Verifying a state-driven change\n\n```bash\nmur devtools click \"[name='+ 1']\"\nmur devtools wait \"[name='Current count: 1']\" --timeout 1000\nmur devtools state                    # confirm the underlying UseState value\n```\n\n`state` is particularly useful when the UI text doesn't obviously encode\nthe value (e.g. a slider position or a theme toggle).\n\n### Reading debug output while the app runs\n\n```bash\nmur devtools logs --tail 50                     # last 50 lines, most recent first\nmur devtools logs --source debug --pretty       # only Debug.WriteLine \u002F Trace\nmur devtools logs --filter \"Nav.*cache\" --tail 20\nmur devtools logs --follow                      # stream until Ctrl+C\nmur devtools logs --since 42                    # everything after seq 42\n```\n\nPair with `state` and `tree` to diagnose state-driven bugs: paste a\n`Debug.WriteLine` in the render path, reload, reproduce, then drain logs.\nThe buffer (4 MB default) is installed **before** component reflection so\nit catches startup output too — attach late and you still see what booted.\n`dropped` in the response reports ring overflow; bump via\n`--devtools-logs-capacity \u003CMB>` on the app's launch if you're losing\nentries. Set `--devtools-logs off` on launch to disable capture entirely.\n\n### Inspecting properties and styles\n\n```bash\n# Enumerate all dependency properties on an element\nmur devtools properties \"#my-button\" --pretty\n\n# Read a specific property (supports attached properties)\nmur devtools properties \"#my-button\" --name Margin\nmur devtools properties \"#my-button\" --name Grid.Row\n\n# Mutate a property at runtime\nmur devtools set-property \"#my-button\" Background \"#FF0000\"\nmur devtools set-property \"#my-button\" Margin \"10,5,10,5\"\nmur devtools set-property \"#my-button\" Visibility Collapsed\n\n# Inspect the applied style (explicit only — theme\u002Fdefault styles return hasStyle:false)\nmur devtools styles \"#my-button\" --pretty\n```\n\n`properties` reports `isLocal: true` when a value was set directly (via\ncode or XAML attribute) vs inherited from style\u002Ftemplate\u002Fdefault. Use\n`set-property` to hot-patch layout or color at runtime without a rebuild.\n\n### Browsing resources and themes\n\n```bash\n# List all app-level resources\nmur devtools resources --pretty\n\n# Filter to color-related resources\nmur devtools resources --filter \"Color|Brush\" --pretty\n\n# Scope to a specific element's ResourceDictionary chain\nmur devtools resources --selector \"#my-panel\" --scope element\n\n# Override a resource at runtime\nmur devtools set-resource ButtonBackground \"#00FF00\"\n```\n\nResources are listed with their scope (`element`, `ancestor:Grid`, `app`,\n`app\u002Fmerged`, `app\u002Ftheme:Light`, etc.) so you can trace where a value\ncame from. `set-resource` at a higher scope may **shadow** a value\ndefined in a merged\u002Ftheme dictionary — check the `replaced` flag in the\nresponse.\n\n### Understanding the visual tree hierarchy\n\n```bash\n# Walk ancestors from an element to the root\nmur devtools ancestors \"#my-button\" --pretty\n```\n\nUseful for understanding layout containers, resource scoping, and which\nparent element is providing inherited property values.\n\n### Driving the app from a script\n\nFor launch → drive → shutdown loops (stress tests, batch automation, CI):\n\n1. Start the app yourself (`dotnet run … -- --devtools run &` or the built exe).\n2. **Poll `mur devtools session list` until exit 0** — that's the only signal\n   that lockfile discovery + the auth probe both succeed. Don't grep stdout\n   for `MCP_ENDPOINT=`; that banner fires before the lockfile is written and\n   before the server can authorize you.\n3. Issue verbs without `--endpoint` so lockfile discovery applies the bearer\n   token.\n4. `mur devtools shutdown` — the child exits with code 0 within a second.\n   Wait for the OS process to exit before relaunching against the same\n   project, or the single-instance check (exit 3) will trip on the next iteration.\n5. If a previous iteration was killed without `shutdown`, run\n   `mur devtools session clean` to GC the stale lockfile.\n\n### Cleaning up when done\n\n```bash\nmur devtools shutdown     # close the app; release build-output file locks\n```\n\nA running Reactor app holds open handles on its own build output, which\nblocks `dotnet build` from overwriting the DLLs. Use `shutdown` between\nrebuilds when you're iterating on the app's source. If the app was started\nunder `mur devtools \u003Cproject>` (supervisor mode), `shutdown` also makes the\nsupervisor return 0 so the `mur.exe` binary frees up.\n\n## Gotchas\n\n1. **Both the build-time switch and a devtools launch are required.** The MCP server only starts if the app was compiled with `\u003CRuntimeHostConfigurationOption Include=\"Reactor.DevtoolsSupport\" Value=\"true\" Trim=\"true\" \u002F>` (samples use a Debug-conditional shared props convention so Release\u002FAOT stays trimmed) **and** launched with either `mur devtools …` or `dotnet run -- --devtools run` directly. Either launch mode works — the supervisor is optional. Miss both legs (switch + launch flag) and the app boots normally with no MCP port, no lockfile, no banner. If `mur devtools session list` reports exit 4 indefinitely, check the csproj\u002Fprops switch first, then the launch command.\n2. **`switch` and `reload` invalidate every node id.** Re-walk the tree after them; do not cache `r:…` ids across swaps.\n3. **Popups aren't in the main visual tree.** `tree` walks `window.Content` — ComboBox dropdown items, flyouts, and context menus live in separate popup roots and won't show up. `select` auto-expands the container but item resolution through the main tree will still miss them. Prefer `ISelectionItemProvider` via a node-id that `tree` emitted while the popup was open, or switch to a selector that targets the SelectorItem ancestor directly.\n4. **`fire` only sees declared methods.** Inline lambdas (`Button(\"+1\", () => setCount(...))`) are unreachable. Hoist the handler to a method on the Component class when you need `fire` access.\n5. **Scroll percent read-back can lag one call.** Right after `mur devtools scroll … --by 0,50`, the next verb may report `scrollPercent.vertical:0` before the engine settles. If the offset matters, call `scroll … --by 0,0` once more to read the settled value, or use `--to \u003Citem-selector>` (ScrollIntoView) which is deterministic.\n6. **Use `wait` before asserting on async UI.** Many demos render on a dispatcher hop; a `screenshot` immediately after `click` may capture the pre-state.\n7. **Devtools log is authoritative.** Every call lands in `%LOCALAPPDATA%\\Reactor\\devtools\\{pid}.log` (tab-separated: ts, tool, selector, latency, ok\u002Ferr, rpc code). Tail it to reconstruct a failed run.\n8. **Single-instance per project.** Two `mur devtools` against the same `.csproj` is a hard error (exit 3). Use `mur devtools shutdown` or close the window to release the lockfile before starting another.\n9. **Log capture starts inside `ReactorApp.Run()`.** Anything the app's `Program.cs` writes via `Console.WriteLine` \u002F `Debug.WriteLine` **before** the `Run()` call is not captured — install happens as the first side-effect of the devtools bring-up, not at process start. Move diagnostic writes inside your root `Component.Render()`, an effect, or any code reached from `Run()` and they'll show up in `mur devtools logs`. The buffer is in-memory only in v1 — a crash takes it with it; attach early or run `--follow` if you need the final moments.\n10. **`styles` only returns explicitly-assigned styles.** WinUI 3 `FrameworkElement.Style` is null when the element uses a theme\u002Fdefault style (implicit style). A null result does **not** mean the element is unstyled — it means the style was applied by the theme system, not by explicit assignment in XAML or code. There is no WinUI 3 API to inspect the resolved implicit style at runtime.\n11. **`properties` isLocal semantics.** The `isLocal` flag uses `ReadLocalValue` which only distinguishes locally-set values from everything else — it cannot tell you whether a non-local value came from a style, animation, template, or default. A value with `isLocal: false` may still differ from the DP's default if it was set via a style or template binding.\n12. **`set-resource` shadows, it doesn't merge.** Writing a resource at element scope creates a new entry in that element's ResourceDictionary — it does not modify the app-level or theme dictionary. The response includes `replaced: true` when overwriting an existing key at the same scope, or `replaced: false` when creating a new shadowing entry. Downstream elements that already resolved the old value won't update until they re-query.\n\n## Raw MCP (escape hatch)\n\nIf you have to talk MCP directly — another MCP client, an existing script,\nor a structured argument shape the CLI flattens — the endpoint is\ndiscoverable from the lockfile:\n\n```bash\nENDPOINT=$(mur devtools session list | jq -r '.endpoint')\ncurl -s $ENDPOINT -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools\u002Fcall\",\n       \"params\":{\"name\":\"click\",\"arguments\":{\"selector\":\"[name=\\\"Save\\\"]\"}}}'\n```\n\n`GET $ENDPOINT` returns the self-describing schema document (protocol\nversion, selector grammar, tool inventory). Prefer the CLI for everything\nelse.\n\n## Spec + source pointers\n\n- Specs: `docs\u002Fspecs\u002F024-ai-agent-devtools.md`, `docs\u002Fspecs\u002F025-devtools-cli-parity.md`, `docs\u002Fspecs\u002F036-window-design.md` (multi-window MCP surface §10)\n- Server: `src\u002FReactor\u002FHosting\u002FDevtools\u002FDevtoolsMcpServer.cs`\n- Tool registration: `DevtoolsTools.cs`, `DevtoolsUiaTools.cs`, `DevtoolsFireTool.cs`, `DevtoolsStateTool.cs`, `DevtoolsLogsTool.cs`, `DevtoolsPropertyTools.cs`\n- Log capture: `LogCaptureBuffer.cs`, `LogCaptureInstall.cs`\n- CLI verbs: `src\u002FReactor.Cli\u002FDevtools\u002FDevtoolsVerbs.cs`\n- Selector grammar \u002F parser: `SelectorParser.cs`\n","# Reactor Devtools — CLI-driven UI automation\n\nThe Reactor devtools let you look at a running debug-build app the way a\nuser does (screenshots, rendered text, layout bounds) and drive it the way\na user does (click, type, toggle, scroll). **Always prefer the `mur devtools`\nCLI** — every action composes with shell pipes and `jq`, each invocation is\na complete audit record, and no MCP client setup is needed.\n\nUnder the hood the CLI talks JSON-RPC to a loopback HTTP endpoint the app\nexposes. The MCP endpoint is still available at `http:\u002F\u002F127.0.0.1:PORT\u002Fmcp`\nas a parity escape hatch, but reach for it only when the CLI can't express\nwhat you need (structured args the CLI flattens, or another MCP client\nthat's already wired up).\n\nLoopback-only — **DEBUG builds only**, never ship it. Auth is a per-launch\nbearer token written into the lockfile; the CLI applies it transparently\nduring lockfile discovery, so you don't see it. **Don't pass `--endpoint`\nfor tool calls** — without the token the server returns 401. `--endpoint`\nis only useful when you're crafting the `Authorization: Bearer …` header\nyourself (curl, custom client).\n\n## Getting `mur` on your PATH\n\n`mur` resolves from PATH in both modes:\n- **Skill kit (deployed):** `install-skill-kit.ps1` (shipped with the kit zip)\n  prepends `\u003Cinstall>\u002Fbin\u002F\u003Carch>` to your user PATH.\n- **Cloned repo (selfhost):** `dotnet build` of `src\u002FReactor.Cli` automatically\n  mirrors the output to `\u003Crepo>\u002Fbin\u002F\u003Carch>\u002F` (architecture is determined from\n  `RuntimeIdentifier`). Add that directory to your PATH once.\n\nIf `mur --version` doesn't resolve, neither path was set up; commands below assume it does.\n\n## Attaching to a running app\n\nThe app author enables devtools capability in the app project, usually only for Debug builds:\n\n```xml\n\u003CItemGroup Condition=\"'$(Configuration)' == 'Debug'\">\n  \u003CRuntimeHostConfigurationOption Include=\"Reactor.DevtoolsSupport\"\n                                  Value=\"true\" Trim=\"true\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n`ReactorApp.Run` takes no `devtools:` or `preview:` argument.\n\n**Prefer attaching to an app that's already running.** Any devtools-enabled\napp writes a lockfile to `%TEMP%\u002Freactor-devtools\u002F` on first render, and\n`mur devtools \u003Cverb>` discovers it automatically — **no port, no config,\nno parsing stdout.**\n\n```bash\nmur devtools session list --pretty   # confirm a session is up\n```\n\nExit 0 with a row means you're good to go; every other verb will find it.\nExit 4 means no live session — you need to launch one yourself (next\nsection).\n\n## Launching an app yourself\n\nTwo launch modes, from simplest to most featured:\n\n### Plain `dotnet run` (the default)\n\n```bash\ndotnet run --project path\u002Fto\u002FApp.csproj -- --devtools run \\\n  > \u002Ftmp\u002Fapp-stdout.log 2>&1 &\n```\n\nThis is what you want in almost every AI session: spawn the app, drive it\nwith `mur devtools \u003Cverb>`, call `mur devtools shutdown` when you're done.\nNo supervisor machinery, no pinned port — the CLI finds the session via\nthe lockfile regardless.\n\n### `mur devtools \u003Cproject>` — the supervisor\n\nReach for this **only** when you need a stable MCP endpoint across\n`reload` cycles:\n\n```bash\nmur devtools path\u002Fto\u002FApp.csproj --mcp-port 54931\n```\n\nThe supervisor pins the port (reload-proof) and catches the child's exit\ncode 42 to rebuild and relaunch. Useful if you've wired an external MCP\nclient to `http:\u002F\u002F127.0.0.1:54931\u002Fmcp` and want it to survive code\nedits. Overkill for one-shot automation.\n\nIf another process already holds the port when the app starts, the app\nexits with code 43. A port you pinned with `--mcp-port` is never moved:\nthe supervisor reports the conflict and exits 43, so free the port or\npick another. Without `--mcp-port`, the supervisor picks a new free port,\nprints `using MCP port N across reloads instead`, and relaunches. Take\nthe endpoint from that line or the lockfile, not from the first one.\n\n## Discovering the tool surface\n\n```bash\nmur devtools call tools\u002Flist --pretty    # names + input schemas\nmur devtools call tools\u002Flist | jq '.tools[].name'\n```\n\n`mur devtools --help` lists every named verb with one-line descriptions.\n\n## CLI verb catalog\n\nEach verb attaches to the running session via lockfile discovery; no flags\nneeded when only one session is active. Pass `--pretty` to any verb for\nindented JSON.\n\n| Verb | What it does |\n|---|---|\n| `version` | Build tag + pid + port — confirm the app is the one you expect. |\n| `components` | Class names of every `Component` subclass; marks which is mounted. |\n| `switch \u003Cname>` | Swap the root component by class name. **Invalidates all node ids.** |\n| `reload [--component N]` | Rebuild + relaunch via the supervisor sentinel. Old ids dead. |\n| `shutdown` | Close the app cleanly (supervisor exits 0). Releases the build output file lock. |\n| `windows` | Active window ids, titles, bounds, currently-mounted component. |\n| `windows.list` | Spec 036 §10. Per-window id, key, title, DIP size, DPI, state, isMain. Use this when you care about DPI \u002F DIP size or the `key` column for `UseOpenWindow`-keyed lookups. |\n| `windows.activate \u003Cid>` | Activate (focus) a window. Returns `{ ok, id }`. |\n| `windows.close \u003Cid>` | Close a window. Honors `UseClosingGuard` \u002F `Closing` subscribers — returns `{ ok: false, cancelled: true, id }` when a guard vetoed the close. |\n| `windows.open \u003CComponent> [--title T] [--width W] [--height H] [--key K]` | Open a new top-level window mounting an allowlisted Component. The component name is gated by the same allowlist as `switchComponent`; rejected names return `unknown-component` with the available list. |\n| `tree [--selector S] [--window W] [--view summary\\|full]` | Dump the visual tree as JSON. `full` adds layout\u002Fautomation\u002Fvisual fields. |\n| `screenshot [--selector S] [--out path]` | PNG of the window (or selector-cropped region). `--out path.png` writes to file; `--out -` streams bytes to stdout. |\n| `click \u003Cselector>` | UIA click. Prefers Invoke → Toggle → SelectionItem; returns `via`. |\n| `invoke` \u002F `toggle` \u002F `select` | Direct UIA pattern access. `select \u003Ccontainer> \u003Citem>` auto-expands ComboBoxes. |\n| `type \u003Cselector> \u003Ctext> [--clear]` | Set text on a value-bearing control. |\n| `focus \u003Cselector>` | Programmatic focus on a Control. |\n| `scroll \u003Cselector> [--by H%,V%] [--to \u003Citem-selector>]` | Scroll by **percentage deltas** 0–100 (not pixels), or scroll an item into view. |\n| `expand \u003Cselector>` \u002F `collapse \u003Cselector>` | ExpandCollapse pattern (ComboBox popup, TreeViewItem, Expander). |\n| `wait \u003Cselector> [--text X \\| --text-matches RE \\| --visible \\| --count N] [--timeout MS]` | Poll a predicate until satisfied or timeout. |\n| `state [--selector S]` | Dump every hook value (useState\u002FuseReducer\u002Fetc.) across mounted components. |\n| `logs [--tail N] [--since SEQ] [--filter RE] [--source stdout\\|stderr\\|debug\\|trace] [--follow]` | Drain captured `Debug.WriteLine` \u002F `Trace.WriteLine` \u002F `Console.Out` \u002F `Console.Error`. Ring buffer installed at `--devtools run` startup — late-attaching agents still see startup output. `--follow` long-polls until Ctrl+C. |\n| `fire \u003CComponent>.\u003Cevent> [--args JSON]` | Call a NAMED METHOD on a live component by reflection. **Inline lambdas aren't reachable**. |\n| `properties \u003Cselector> [--name PropName]` | Read dependency properties on an element. Omit `--name` to enumerate all DPs with values, types, and local-vs-default status. Supports attached properties via `Grid.Row` syntax. |\n| `set-property \u003Cselector> \u003Cname> \u003Cvalue>` | Set a dependency property. Value is parsed from string (Thickness, CornerRadius, Brush hex `#RRGGBB`, enums, bool, double, int). |\n| `resources [--selector S] [--scope element\\|window\\|app] [--filter RE]` | Browse ResourceDictionary entries. Walks element → ancestor elements → window → app (including MergedDictionaries and ThemeDictionaries). |\n| `set-resource \u003Ckey> \u003Cvalue> [--scope app\\|window\\|element] [--selector S]` | Set or add a XAML resource. Reports whether the write replaced an existing entry or created a new shadowing entry. |\n| `styles \u003Cselector>` | Inspect the explicitly-assigned Style: TargetType, Setters (property + value), BasedOn chain. Returns `hasStyle: false` when only a default\u002Ftheme style is active. |\n| `ancestors \u003Cselector>` | Walk the visual tree upward — returns type, name, and automationId for each ancestor up to the root. |\n| `call \u003Ctool\\|method> [--args JSON]` | Generic JSON-RPC passthrough — parity escape hatch. |\n\n### Reference-graph overlay\n\nThe `references` tool (Spec 057) returns the app's reactive reference\ngraph — `descriptor.Reference`\u002F`.ReferenceList`, the `binding.Reference`\nbridge, and modifier edges like `.LabeledBy`\u002F`.DescribedBy`\u002F`.FlowsTo`\u002F\n`.XYFocus*` — as `{from, to, label, slot, kind, resolved}` edges keyed to\nthe same node ids `tree` uses, plus diagnostics for **cycles** and\n**unresolved** (perpetually-null) references. Reach it through the\ngeneric passthrough:\n\n```bash\nmur devtools call references --pretty\nmur devtools call references --args '{\"selector\":\"#login-form\"}'   # scope to a subtree\n```\n\nUse it to confirm an accessibility relationship (`LabeledBy`\u002F`DescribedBy`)\nor an `XYFocus*` ring actually resolved to the control you expect, or to\nspot a reference that never resolved. Cycles are a supported topology and\nare reported informationally, not as errors. The same overlay also backs\nthe **References** toggle in the VS Code live-preview panel.\n\n### Session management\n\n```bash\nmur devtools session list             # JSONL, one live session per line\nmur devtools session list --pretty    # human table\nmur devtools session clean            # GC stale lockfiles\nmur devtools session clean --dry-run  # show what would be removed\n```\n\n### Shared flags (before any verb)\n\n- `--endpoint \u003Curl>` — skip lockfile discovery and talk to this endpoint.\n  **Drops the bearer token** — the CLI has no `--token` flag, so verbs hit\n  the endpoint unauthenticated and get 401. Only useful with `curl` plus a\n  hand-built `Authorization` header, not for `mur devtools \u003Cverb>` calls.\n- `--pretty` — indent JSON output.\n- `--auto` — loopback port scan (slow; use only when lockfile discovery fails).\n\n### Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | Success. |\n| 1 | Usage error (unknown flag, missing argument). |\n| 2 | Transport error (endpoint unreachable, timeout). |\n| 3 | Another devtools session is already active for this project. |\n| 4 | No live devtools session found. |\n| 5 | Tool returned a JSON-RPC error. stdout has the error envelope. |\n\n## Selector grammar (5 forms)\n\n1. **Node id** — `r:main\u002FCounterDemo.SubmitButton` — copy from `tree`. Stable within a window's lifetime; invalidated by `switch` \u002F `reload`.\n2. **AutomationId** — `#btn-inc`. Matches `AutomationProperties.AutomationId` exactly.\n3. **AutomationName** — `[name='Increment']` or `[name=\"+ 1\"]`. Matches `AutomationProperties.Name` OR the visible caption of Buttons \u002F TextBlocks \u002F TextBoxes \u002F ContentControls.\n4. **TypePath** — `Button`, `Button[2]`, `StackPanel > Button`. Type name is `GetType().Name`. Index disambiguates.\n5. **Reactor source** — `{component:'CounterDemo',line:42}`. Reserved (Phase 3).\n\n`[name=…]` cannot be indexed — if it matches multiple, error is `ambiguous-selector` with all candidate ids listed; pick one by node id or prefix with a TypePath step.\n\n## Typical workflows\n\n### \"Does the app look right?\" — visual diagnosis\n\n```bash\nmur devtools screenshot --out \u002Ftmp\u002Fshot.png\nmur devtools screenshot --selector \"[name='Submit']\" --out \u002Ftmp\u002Fbtn.png\nmur devtools tree --selector \"#login-form\" --view full --pretty\n```\n\nFull-view `tree` nodes carry `bounds`, `actualSize`, `desiredSize`,\n`layout.margin`, `layout.padding`, `isVisible`, `isEnabled`,\n`automationControlType`. That's usually enough to spot a margin collapse\nor a zero-size child without running the app in a debugger.\n\n### Diagnosing a layout issue\n\n1. `mur devtools screenshot --out \u002Ftmp\u002Fshot.png` — confirm what's actually on screen.\n2. `mur devtools tree --selector \"\u003Ccontainer>\" --view full | jq '.nodes[] | select(.actualSize.width == 0)'` — find zero-sized children. A child with `actualSize:{width:0,height:0}` under a parent that's sized means the child isn't getting space (missing `Flex(grow:1)` on a ScrollView inside a FlexColumn is a classic).\n3. Edit the Reactor code, then `mur devtools reload` (rebuild + relaunch) and re-screenshot.\n4. `mur devtools wait \"\u003Cselector>\" --visible --timeout 2000` if the state is async — don't screenshot before mount.\n\n### Diagnosing a contrast \u002F color issue\n\n1. `mur devtools screenshot --selector \"\u003Celement>\" --out \u002Ftmp\u002Fel.png` — pull the cropped PNG.\n2. Decode the PNG and sample foreground\u002Fbackground pixels. Compute WCAG 2.1 ratio = `(L1 + 0.05) \u002F (L2 + 0.05)` where L is relative luminance. Target ≥ 4.5:1 for body text, ≥ 3:1 for large text \u002F UI chrome.\n3. If low, check whether the color came from a Theme token (correct — rebind to the right token for the surface) or a hardcoded hex (wrong — replace with a `Theme.*` token; see `skills\u002Fdesign.md`).\n4. Edit, `mur devtools reload`, re-screenshot, re-measure.\n\n### Verifying a state-driven change\n\n```bash\nmur devtools click \"[name='+ 1']\"\nmur devtools wait \"[name='Current count: 1']\" --timeout 1000\nmur devtools state                    # confirm the underlying UseState value\n```\n\n`state` is particularly useful when the UI text doesn't obviously encode\nthe value (e.g. a slider position or a theme toggle).\n\n### Reading debug output while the app runs\n\n```bash\nmur devtools logs --tail 50                     # last 50 lines, most recent first\nmur devtools logs --source debug --pretty       # only Debug.WriteLine \u002F Trace\nmur devtools logs --filter \"Nav.*cache\" --tail 20\nmur devtools logs --follow                      # stream until Ctrl+C\nmur devtools logs --since 42                    # everything after seq 42\n```\n\nPair with `state` and `tree` to diagnose state-driven bugs: paste a\n`Debug.WriteLine` in the render path, reload, reproduce, then drain logs.\nThe buffer (4 MB default) is installed **before** component reflection so\nit catches startup output too — attach late and you still see what booted.\n`dropped` in the response reports ring overflow; bump via\n`--devtools-logs-capacity \u003CMB>` on the app's launch if you're losing\nentries. Set `--devtools-logs off` on launch to disable capture entirely.\n\n### Inspecting properties and styles\n\n```bash\n# Enumerate all dependency properties on an element\nmur devtools properties \"#my-button\" --pretty\n\n# Read a specific property (supports attached properties)\nmur devtools properties \"#my-button\" --name Margin\nmur devtools properties \"#my-button\" --name Grid.Row\n\n# Mutate a property at runtime\nmur devtools set-property \"#my-button\" Background \"#FF0000\"\nmur devtools set-property \"#my-button\" Margin \"10,5,10,5\"\nmur devtools set-property \"#my-button\" Visibility Collapsed\n\n# Inspect the applied style (explicit only — theme\u002Fdefault styles return hasStyle:false)\nmur devtools styles \"#my-button\" --pretty\n```\n\n`properties` reports `isLocal: true` when a value was set directly (via\ncode or XAML attribute) vs inherited from style\u002Ftemplate\u002Fdefault. Use\n`set-property` to hot-patch layout or color at runtime without a rebuild.\n\n### Browsing resources and themes\n\n```bash\n# List all app-level resources\nmur devtools resources --pretty\n\n# Filter to color-related resources\nmur devtools resources --filter \"Color|Brush\" --pretty\n\n# Scope to a specific element's ResourceDictionary chain\nmur devtools resources --selector \"#my-panel\" --scope element\n\n# Override a resource at runtime\nmur devtools set-resource ButtonBackground \"#00FF00\"\n```\n\nResources are listed with their scope (`element`, `ancestor:Grid`, `app`,\n`app\u002Fmerged`, `app\u002Ftheme:Light`, etc.) so you can trace where a value\ncame from. `set-resource` at a higher scope may **shadow** a value\ndefined in a merged\u002Ftheme dictionary — check the `replaced` flag in the\nresponse.\n\n### Understanding the visual tree hierarchy\n\n```bash\n# Walk ancestors from an element to the root\nmur devtools ancestors \"#my-button\" --pretty\n```\n\nUseful for understanding layout containers, resource scoping, and which\nparent element is providing inherited property values.\n\n### Driving the app from a script\n\nFor launch → drive → shutdown loops (stress tests, batch automation, CI):\n\n1. Start the app yourself (`dotnet run … -- --devtools run &` or the built exe).\n2. **Poll `mur devtools session list` until exit 0** — that's the only signal\n   that lockfile discovery + the auth probe both succeed. Don't grep stdout\n   for `MCP_ENDPOINT=`; that banner fires before the lockfile is written and\n   before the server can authorize you.\n3. Issue verbs without `--endpoint` so lockfile discovery applies the bearer\n   token.\n4. `mur devtools shutdown` — the child exits with code 0 within a second.\n   Wait for the OS process to exit before relaunching against the same\n   project, or the single-instance check (exit 3) will trip on the next iteration.\n5. If a previous iteration was killed without `shutdown`, run\n   `mur devtools session clean` to GC the stale lockfile.\n\n### Cleaning up when done\n\n```bash\nmur devtools shutdown     # close the app; release build-output file locks\n```\n\nA running Reactor app holds open handles on its own build output, which\nblocks `dotnet build` from overwriting the DLLs. Use `shutdown` between\nrebuilds when you're iterating on the app's source. If the app was started\nunder `mur devtools \u003Cproject>` (supervisor mode), `shutdown` also makes the\nsupervisor return 0 so the `mur.exe` binary frees up.\n\n## Gotchas\n\n1. **Both the build-time switch and a devtools launch are required.** The MCP server only starts if the app was compiled with `\u003CRuntimeHostConfigurationOption Include=\"Reactor.DevtoolsSupport\" Value=\"true\" Trim=\"true\" \u002F>` (samples use a Debug-conditional shared props convention so Release\u002FAOT stays trimmed) **and** launched with either `mur devtools …` or `dotnet run -- --devtools run` directly. Either launch mode works — the supervisor is optional. Miss both legs (switch + launch flag) and the app boots normally with no MCP port, no lockfile, no banner. If `mur devtools session list` reports exit 4 indefinitely, check the csproj\u002Fprops switch first, then the launch command.\n2. **`switch` and `reload` invalidate every node id.** Re-walk the tree after them; do not cache `r:…` ids across swaps.\n3. **Popups aren't in the main visual tree.** `tree` walks `window.Content` — ComboBox dropdown items, flyouts, and context menus live in separate popup roots and won't show up. `select` auto-expands the container but item resolution through the main tree will still miss them. Prefer `ISelectionItemProvider` via a node-id that `tree` emitted while the popup was open, or switch to a selector that targets the SelectorItem ancestor directly.\n4. **`fire` only sees declared methods.** Inline lambdas (`Button(\"+1\", () => setCount(...))`) are unreachable. Hoist the handler to a method on the Component class when you need `fire` access.\n5. **Scroll percent read-back can lag one call.** Right after `mur devtools scroll … --by 0,50`, the next verb may report `scrollPercent.vertical:0` before the engine settles. If the offset matters, call `scroll … --by 0,0` once more to read the settled value, or use `--to \u003Citem-selector>` (ScrollIntoView) which is deterministic.\n6. **Use `wait` before asserting on async UI.** Many demos render on a dispatcher hop; a `screenshot` immediately after `click` may capture the pre-state.\n7. **Devtools log is authoritative.** Every call lands in `%LOCALAPPDATA%\\Reactor\\devtools\\{pid}.log` (tab-separated: ts, tool, selector, latency, ok\u002Ferr, rpc code). Tail it to reconstruct a failed run.\n8. **Single-instance per project.** Two `mur devtools` against the same `.csproj` is a hard error (exit 3). Use `mur devtools shutdown` or close the window to release the lockfile before starting another.\n9. **Log capture starts inside `ReactorApp.Run()`.** Anything the app's `Program.cs` writes via `Console.WriteLine` \u002F `Debug.WriteLine` **before** the `Run()` call is not captured — install happens as the first side-effect of the devtools bring-up, not at process start. Move diagnostic writes inside your root `Component.Render()`, an effect, or any code reached from `Run()` and they'll show up in `mur devtools logs`. The buffer is in-memory only in v1 — a crash takes it with it; attach early or run `--follow` if you need the final moments.\n10. **`styles` only returns explicitly-assigned styles.** WinUI 3 `FrameworkElement.Style` is null when the element uses a theme\u002Fdefault style (implicit style). A null result does **not** mean the element is unstyled — it means the style was applied by the theme system, not by explicit assignment in XAML or code. There is no WinUI 3 API to inspect the resolved implicit style at runtime.\n11. **`properties` isLocal semantics.** The `isLocal` flag uses `ReadLocalValue` which only distinguishes locally-set values from everything else — it cannot tell you whether a non-local value came from a style, animation, template, or default. A value with `isLocal: false` may still differ from the DP's default if it was set via a style or template binding.\n12. **`set-resource` shadows, it doesn't merge.** Writing a resource at element scope creates a new entry in that element's ResourceDictionary — it does not modify the app-level or theme dictionary. The response includes `replaced: true` when overwriting an existing key at the same scope, or `replaced: false` when creating a new shadowing entry. Downstream elements that already resolved the old value won't update until they re-query.\n\n## Raw MCP (escape hatch)\n\nIf you have to talk MCP directly — another MCP client, an existing script,\nor a structured argument shape the CLI flattens — the endpoint is\ndiscoverable from the lockfile:\n\n```bash\nENDPOINT=$(mur devtools session list | jq -r '.endpoint')\ncurl -s $ENDPOINT -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools\u002Fcall\",\n       \"params\":{\"name\":\"click\",\"arguments\":{\"selector\":\"[name=\\\"Save\\\"]\"}}}'\n```\n\n`GET $ENDPOINT` returns the self-describing schema document (protocol\nversion, selector grammar, tool inventory). Prefer the CLI for everything\nelse.\n\n## Spec + source pointers\n\n- Specs: `docs\u002Fspecs\u002F024-ai-agent-devtools.md`, `docs\u002Fspecs\u002F025-devtools-cli-parity.md`, `docs\u002Fspecs\u002F036-window-design.md` (multi-window MCP surface §10)\n- Server: `src\u002FReactor\u002FHosting\u002FDevtools\u002FDevtoolsMcpServer.cs`\n- Tool registration: `DevtoolsTools.cs`, `DevtoolsUiaTools.cs`, `DevtoolsFireTool.cs`, `DevtoolsStateTool.cs`, `DevtoolsLogsTool.cs`, `DevtoolsPropertyTools.cs`\n- Log capture: `LogCaptureBuffer.cs`, `LogCaptureInstall.cs`\n- CLI verbs: `src\u002FReactor.Cli\u002FDevtools\u002FDevtoolsVerbs.cs`\n- Selector grammar \u002F parser: `SelectorParser.cs`\n",{"name":5,"description":7},"main","74791562c11792f7c0e2dd875f1e82b94d70b397","plugins\u002Freactor\u002Fskills\u002Freactor-devtools",67,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 01:08:04",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add microsoft\u002Fmicrosoft-ui-reactor --skill reactor-devtools",{"tool":72,"command":73},"bunx","bunx skills add microsoft\u002Fmicrosoft-ui-reactor --skill reactor-devtools",{"tool":75,"command":76},"pnpm","pnpm dlx skills add microsoft\u002Fmicrosoft-ui-reactor --skill reactor-devtools","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-devtools\u002FSKILL.md",true,[],[81,95,129,158,186,212],{"skillNo":82,"name":83,"nameZh":84,"description":17,"descriptionZh":85,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":94,"publishedAt":52},"01M69B94E15PYYWXAGFV832MRK","Charting","图表制作","","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fsrc\u002FReactor.Advanced\u002FCharting\u002Fskill.md",[88,91],{"categoryNo":89,"categoryName":90,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD4CMBM6B4PWSM1NXGT9","数据分析与报告",{"categoryNo":92,"categoryName":93,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5CX980XNXCJKQF70BY","数据分析师",[83],{"skillNo":96,"name":97,"nameZh":98,"description":99,"descriptionZh":100,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":101,"categories":102,"keywords":107,"publishedAt":52},"01M69B92C846XMSNJ4PZGVYY3C","reactor-wrapping","Reactor 控件包装生成","Turn ANY WinUI control — a vendor\u002Fthird-party control, your own custom Control, or a Windows Community Toolkit one — into a first-class declarative Reactor element with the [GenerateReactorWrapper] source generator, zero hand-written wrapper code. Covers auto-inference (props, content, two-way pairs, panel\u002Fitems children, events), the [Wrap*] annotation cheat-sheet, imperative-lifecycle controls, diagnostics, and when to fall back to a hand-written ControlDescriptor.","借助 `[GenerateReactorWrapper]` 源生成器，将任意 WinUI 控件——供应商\u002F第三方控件、自定义 `Control` 或 Windows Community Toolkit 控件——转换为一等公民的声明式 Reactor 元素，无需手写任何包装代码。涵盖自动推断（属性、内容、双向绑定对、面板\u002F条目子元素、事件）、`[Wrap*]` 注解速查表、命令式生命周期控件、诊断，以及何时回退到手写 `ControlDescriptor`。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-wrapping\u002FSKILL.md",[103,104],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[108,109,110,111,112,113,114,35,115,116,117,118,119,120,121,122,123,124,125,126,127,128],"reactor wrapping","declarative","with","hand","code","cheat","generator","auto","controls","custom","element","lifecycle","winui","ZeRO","panel","community","back","inference","diagnostics","toolkit","windows",{"skillNo":130,"name":131,"nameZh":132,"description":133,"descriptionZh":134,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":135,"categories":136,"keywords":139,"publishedAt":52},"01M69B90PW92BQ4YNZYTP4SERB","reactor-windowing","Reactor 顶层窗口管理","Reactor top-level windowing cookbook: WindowSpec, OpenWindow, draggable windows, borderless\u002Ftool windows, placement persistence, taskbar visibility, z-order, aspect ratio, SizeToContent, displays, taskbar integration, and owner-window file\u002Ffolder pickers.","Reactor 顶层窗口开发指南：`WindowSpec`、`OpenWindow`、可拖动窗口、无边框\u002F工具窗口、窗口位置持久化、任务栏可见性、z-order 层级、宽高比、`SizeToContent`、多显示器、任务栏集成，以及基于所有者窗口的文件\u002F文件夹选择器。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-windowing\u002FSKILL.md",[137,138],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},[140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,128,155,156,157],"reactor windowing","progress","persistence","cookbook","integration","folder","command","command palette","top","window","palette","file","restore","open","tool","remember","position","make",{"skillNo":159,"name":160,"nameZh":161,"description":162,"descriptionZh":163,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":164,"categories":165,"keywords":168,"publishedAt":52},"01M69B8Y5Y0VKXADXCN3W1NK89","reactor-recipes","Reactor 即用型代码配方","Paste-ready single-file Reactor recipes indexed by intent — list with add\u002Fdelete\u002Ftoggle, sidebar navigation between pages, form with validation + submit gating, async fetch with loading\u002Ferror\u002Fdata states, themed Win11 card surface. Use a recipe instead of synthesizing from prose: copy, adjust, ship.","按意图索引、可直接粘贴使用的单文件 Reactor 配方——支持增删与切换的列表、页面间侧边栏导航、带校验与提交门控的表单、带加载\u002F错误\u002F数据状态的异步获取、Win11 主题卡片界面。使用现成配方而非根据文字描述自行拼凑：复制、调整、即可交付。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-recipes\u002FSKILL.md",[166,167],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},[169,170,151,171,110,172,46,173,174,175,176,177,178,179,180,181,182,183,184,185],"reactor recipes","recipes","recipe","form","adjust","single","pages","async","card","submit","loading","states","fetch","gating","single-file","ready","error",{"skillNo":187,"name":188,"nameZh":189,"description":190,"descriptionZh":191,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":192,"categories":193,"keywords":196,"publishedAt":52},"01M69B8WNYS31M4P012P2QTX6R","reactor-navigation","Reactor 页面导航与路由","Reactor navigation — `UseNavigation` hook, `NavigationHost` renderer, `NavigationView` sidebar, `TabView` tabs, route params, stack operations, page lifecycle, deep linking, transitions, caching. Use when building multi-page apps or wiring sidebar\u002Ftab navigation.","Reactor 导航——`UseNavigation` 钩子、`NavigationHost` 渲染器、`NavigationView` 侧边栏、`TabView` 标签页、路由参数、栈操作、页面生命周期、深链接、转场动画、缓存。适用于构建多页面应用或接入侧边栏\u002F标签页导航时。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-navigation\u002FSKILL.md",[194,195],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},[197,198,199,35,200,46,119,201,202,203,204,205,40,206,207,208,209,210,211],"navigation","reactor navigation","caching","apps","renderer","multi-page","page","deep","wiring","operations","transitions","linking","stack","route","multi",{"skillNo":213,"name":214,"nameZh":215,"description":216,"descriptionZh":217,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":218,"categories":219,"keywords":222,"publishedAt":52},"01M69B8TGJA43N8X6BFVWTXC1H","reactor-input","Reactor 输入交互处理","Reactor input — gestures (`OnPan`, `OnPinch`, `OnRotate`), pointer events, drag-and-drop (`OnDragStarting`), focus management (`UseElementFocus`, `UseFocus`, `UseFocusTrap`). Use when implementing direct manipulation or custom focus behavior.","Reactor 输入处理——手势（`OnPan`、`OnPinch`、`OnRotate`）、指针事件、拖放（`OnDragStarting`）、焦点管理（`UseElementFocus`、`UseFocus`、`UseFocusTrap`）。在实现直接操作交互或自定义焦点行为时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmicrosoft-ui-reactor\u002Fblob\u002Fmain\u002Fplugins\u002Freactor\u002Fskills\u002Freactor-input\u002FSKILL.md",[220,221],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},[223,224,225,226,227,228,229,230,35,46,117,231,232,233],"input","reactor input","direct","events","management","behavior","focus","drop","implementing","drag","gestures"]