preview-ui
Skill7 starsChanged 12 days agoApache-2.0View on GitHub
Build and visually verify the Claude Code Tray window by launching it and capturing a screenshot. Use whenever a change touches MainWindow, any of its pages (SettingsPage / StatisticsPage / ContextPage) or any windowed UI, before claiming the layout works.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
After editing MainWindow.xaml, SettingsPage.xaml or any page's .xaml.cs.
- Distinctive: line 15
After any change that affects a windowed surface (new settings page, new dialog).
- Distinctive: line 16
Before telling the user a UI change is done.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Preview UI (Claude Code Tray)
The cardinal rule of UI work in this repo: never claim a window looks right without looking at it. WinForms/WPF layout is easy to get wrong on paper; this skill closes the loop by rendering the real window and capturing a PNG you can read back.
When to use
- After editing
MainWindow.xaml,SettingsPage.xamlor any page's.xaml.cs. - After any change that affects a windowed surface (new settings page, new dialog).
- Before telling the user a UI change is done.
How it works
The pictures are cases (cases\preview.cases.json), run by the harness this repository's other
cases use. What draws them is the application itself: it carries Winwright.InApp (WW480), so a case
asks it to render its own visual tree. There is no screen in that, which is what the 451-line screen-copy
script it replaced spent most of its lines guarding against — whose window this is, what is standing over
it, whether a second instance is showing one. Those are readings the engine takes, and a picture it
cannot vouch for is refused rather than written.
One command, and the argument picks a surface:
preview.cmd every preview case
preview.cmd shell the shell on each of its three destinations (statistics, context, settings)
preview.cmd panels every settings panel the sidebar declares (general … about)
preview.cmd context the context load page over its own fixture
preview.cmd note the method note, whose popup no copy of a screen can photographA word that names no tag is refused with the list there is, so a typo costs a corrected word rather than a run of no cases that reads as a pass.
Steps
Draw it (builds Debug first):
preview.cmd panels- Look at the PNGs with the Read tool. They land under git-ignored
docs\_preview\<case name>\, one per surface —general.png,display.png,claude-code.pngand so on — and the command prints the folder. Judge the layout: alignment, spacing, overlap, theme (light/dark follows the Windows setting), accent colour (follows the Windows accent), and that every control rendered. - Iterate: edit the XAML, re-run, re-read — until it is right. Only then report done.
A red is not a picture. The case fails rather than writing something misleading: a page still saying it is computing, a window the application would not draw, a tree that laid out to nothing. Read the failure and fix the cause instead of re-reading a stale PNG.
To see a window by hand rather than in a file, the preview flags are still there — dotnet run --
--main, --settings, --settings-tray ClaudeCode — and the dev-flags skill is their catalogue.
A published shot of System information must use the fixture
--settings System renders this machine's login. Masking hides the holder's name and the local
part of the address, but the organization and its mail domain are the reading — so any screenshot of
that page destined for the README or the site is taken over AccountFixture instead:
ClaudeTray.exe --capture-settings site\public\shots\system.png System --sample [--reveal] [profile=1] --lang en--sample swaps in two synthetic profiles (a personal Max 20x and a Team seat, profile=1), and
--reveal opens with the holder unmasked — safe only together with --sample.
A screenshot cannot see a keyboard bug
--settings runs a WPF Application.Run; the tray runs a WinForms pump and only shows the WPF
window. Those are different input environments, and the difference is not academic: the windows had
no keyboard input at all under the tray (T135) — no typing, no Tab, no Esc — while every preview and
every screenshot looked perfect, because mouse input is WndProc-driven and works either way.
So this loop proves layout, never input. For anything that involves typing, Tab or a shortcut, run
the cases — they host the window under --settings-tray (the tray's own pump) and drive it through
winwright, so the result is a verdict rather than an impression:
dotnet build -c Debug
set CLAUDETRAY_CASES=keyboard && dotnet test tests\ClaudeTray.CasesThat one navigates by clicking the sidebar, types into a TextBox and reads the value back through
ValuePattern, Tabs out of it, and drives a Slider with an arrow key; menu and icon do the same
for the tray's entries and for the click that opens the window. Add a new check to a case file in
cases\, not to a scratch script — the engine owns every wait, retry and read-back, and the UIA
traps behind them (no clickable point on the tray icon, collapsed WPF panes missing from the tree, a
menu that does not always open) are its business rather than something to rediscover. To see the
window by hand instead:
dotnet run -- --settings-tray ClaudeCode # the window hosted the way the tray hosts itNotes
- The picture is a render and not a copy of the screen (WW480), so nothing has to be kept unobscured and the window need not hold the foreground. What is in the file is what this application drew.
- To preview light vs dark, toggle the Windows app theme;
ThemeMode="System"makes the window follow it. There is no in-app theme switch. - The tray icon itself is GDI+, not WPF — preview those with
dotnet run -- --render <dir>instead (dumps PNGs at 16/20/32 px). See AGENTS.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

