agentleFS
vchelaruvchelaru/Gum/.claude/skills/gum-tool-screenshots/SKILL.md

gum-tool-screenshots

Skill659 starsChanged 2 months agoMITView on GitHub

Screenshots of the Gum tool (Avalonia head) to check or show a UI change. Triggers: screenshot, --screenshot, --exit-after, PrScreenshot, before/after images, "show me the Variables tab", shader parameter rows.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before/after: build GumPreview in each worktree and run each exe on its own project copy.

    line 34

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Screenshots of the Gum tool

Pick the route by what has to be on screen. Load this before the first attempt.

A PrScreenshot shows the real window, or the real panel inside the real theme and background, never a bare control in an isolated window: the colors then differ from the tool and read as a regression. Screenshots/StandardsPaletteScreenshotTests.cs is the pattern (the real MainWindow, canvas hidden, both themes).

To seeUse
A tab, row, dialog or controlThe headless harness and PrScreenshot (Tests/Gum.Avalonia.Tests/Harness/README.md, "PR screenshots"). Screenshots/ShaderDropdownScreenshotTests.cs types into the filter box. Run with GUM_SCREENSHOT_DIR=<folder>.
The real canvas, a graphics device or a compiled Effect (shader parameter rows)The real head: build Gum.slnx, then Tool/Gum.Avalonia/bin/Debug/net10.0/Gum --exit-after 90 --screenshot out.png --user-data <temp folder> --select "Element#Instance" <project.gumx>. Flags are in Tools/ParityShots/README.md. The canvas harness scenarios skip on macOS, so there this is the only route.

Landmines in the real-head route

  • The capture fires on the first drawn canvas frame, so the Variables and States panels can be empty, and the Variables grid is scrolled to the top. No flag waits for the panels. A temporary Task.Delay before capture?.Invoke() in UnattendedRun.RunAsync, plus setting the grid's ScrollViewer.Offset from the window's visual tree, gets the frame. Revert both before committing.
  • Open a project at the current .gumx version: copy Tools/Gum.ProjectServices/Templates/Default, add Components/X.gucx, and add <ComponentReference Name="X" /> to the .gumx. Version 1 projects (most of Samples/ and the CodeGen fixtures) lack newer standard variables such as ShaderParameters, so those rows never appear.
  • GUM_ECHO_OUTPUT=1 writes the Output tab to stderr. "Compiled render-target shader" there means the container has an effect.
  • Open the PNG and read it before saying anything worked, then send it with SendUserFile.

Runtime Forms controls and theme components: GumPreview

The editor canvas does not show how a Forms control looks at runtime (templates, focus, scroll bars, text selection). Tool/GumPreview (the host the Preview button launches) loads a .gumj through the runtime with real Forms controls and saves the first drawn frame; use it for any change to a theme component, a Forms visual or runtime layout. Use the Avalonia head only for editor UI.

  • Build only it: dotnet build Tool/GumPreview/GumPreview.csproj (about 1.5 min cold; it builds MonoGameGum and friends). Output: Tool/GumPreview/bin/Debug/net10.0/GumPreview.exe.
  • Run: GumPreview.exe --project <copy>/X.gumj --element <Screen or Component name> --exit-after 60 --screenshot <abs path>.png. A run takes about 4 s and writes a 1024x768 PNG. --element includes its folder (Meadow/DemoScreenGum). It is a WinExe, so no console window opens, and --exit-after keeps it unattended: the window is placed off-screen (about -32000,-32000) and takes no focus, so nobody should look at the screen. MonoGame re-centers the window after construction, so the placement is re-applied in Initialize and every Update; the same position is requested on macOS/Linux, but only Windows is verified there (a window manager may clamp it).
  • Diagnostic log: a Debug build ALWAYS writes {temp}/GumPreview/preview.log (Windows %TEMP%\GumPreview\preview.log; the previous run is preview.previous.log), no flag needed; the tool's own log is {temp}/Gum/tool.log. Release is off. --log <abs path>.log overrides the path (--log-default is accepted, redundant in Debug). Flushed per line: tool-selection/tool-var (what the tool sent), reload, focus, key, mouse, selection, selection-instances and error lines you can read while Preview runs; the header comment of PreviewDebugLog explains how to read it. From the tool, set env var GUM_PREVIEW_LOG=<abs path> before starting gum and the launcher passes --log to every Preview. Source: Tool/GumPreview/PreviewDebugLog.cs.
  • Runtime-only states: --focus <TextBox instance name> [--type <text>] [--select-all]. --type and --select-all need --focus.
  • Project: copy a .gumj project that has the theme (for example a Meadow project; the ListBox lives in Components/Meadow/Controls/ListBox.gucj) to the scratchpad and edit the copy, never the original. A project carries its own component files, so to test a template change edit the copy's .gucj, not Tools/Gum.ProjectServices/Templates (.gucx XML).
  • To get a scroll bar, add more ListBoxItem instances (with .Parent = <ListBox>.InnerPanelInstance) to the copy's screen, or shrink the list.
  • Before/after: build GumPreview in each worktree and run each exe on its own project copy. The theme files are data, so the same exe works for both if only a template changed.
  • A thumb with no visible track makes a one-pixel change invisible by eye; size the list so the thumb nearly fills it, or diff the two PNGs.
  • Exit 1 with "was not ready within --exit-after ... No screenshot was taken" means the project did not load or no frame drew; read the stderr text. Open the PNG and confirm the controls are drawn before reporting.
  • A component alone (--element Meadow/Controls/TextBox) draws at the top-left of the 1024x768 canvas; --focus names an instance inside a screen, so use a screen for the focused/typed/selected look.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.