test-driven-development
OBobra/superpowers299k2,675 new stars in the last 7 days
Launch, see and drive a real game so an agent can test its own mods. Covers launching via Steam or the exe, windowed mode at a fixed size, screenshots of the game window (GPU-safe capture), clicking and typing into menus, holding keys, relative mouse, crash-reporter cleanup, killing by PID, reading logs, scripted test scenes, and an in-game JSON bridge that lets an agent observe and act. Windows-first (also from WSL), with notes for Linux and macOS. Use when a mod must be verified in game, when navigating menus automatically, or when building a repeatable test or demo scene.
The real game is the oracle. The loop is launch → navigate → set up the scene → act → screenshot and read logs → decide. Build it once per game, then every change you make can be checked in a minute.
um winum win setup # once: PowerShell tools + an ffmpeg with gfxcapture, picks NVENC/AMF/QSV/x264
um win ps # windowed processes: pid, name, title
um win launch --steam 105600 # or: um win launch "C:\Games\Foo\Foo.exe" -- -windowed
um win shot --exe Terraria.exe shot.png --scale 0.33 # full frame + a 1/3 copy that's cheap to look at
um win drive --proc Terraria "focus" "click 640 360" "key 0x1B" "type hello" "hold 0x44 1500"
um win drive --proc Terraria "hold 0x20 150" "sleep 200" "hold 0x20 150" # sleep <ms> pauses between steps
um win drive --proc Terraria idle # seconds since the user last touched mouse/keyboard (does not wait)
um win kill <pid> # exact PID only
um win reg get "HKCU\Software\..." # registry (reg set backs the key up first)
From Python (for longer scripts), from um.win import Drive, shot, Recorder, then d = Drive("AoE2DE_s"),
d.focus(), d.click(x, y), d.key("0x0D").
WinDrive commands (um/ps1/WinDrive.ps1; stdin protocol, one reply per line). Coordinates are in
the game window's client area.
move x y, click x y [right], mdown/mup, drag x0 y0 x1 y1, rel dx dy (FPS cameras /
raw input), wheel 120.key <vk> [tap|down|up], hold <vk> <ms>, type <text>, scanmode on (DirectInput /
raw-input games that ignore virtual-key events).focus, rect, size <w> <h> (sets the client size), title, fg, idle, untop.sleep <ms> waits between steps in one call. Each um win drive call starts PowerShell (1-2 s),
so put timed combos in one call.Rules of the road
idle, ask the human to click, and launch with the anti-cheat off so online can't start. See
knowledge/techniques/driving-real-games-safely.md.idle is under a minute, ask before driving, and keep sessions short.
Unattended runs are fine once the user says so.--scale 0.33 copies. Multiply coordinates back ×3 for clicks, and
keep a table of menu click points in MODLOG.md, measured once.um win shot/record warn when it's on; turn it off for the game
while capturing (Settings > System > Display > Graphics > the game > Auto HDR), and back on after if the user wants.[/Script/Engine.GameUserSettings] in UE GameUserSettings.ini, Unity's
Screenmanager Fullscreen mode / Resolution registry values under HKCU\Software\<company>\<product>);-windowed -w 1920 -h 1080, Unity -screen-fullscreen 0 -screen-width 1920 -screen-height 1080,
Source -sw -w 1920 -h 1080);Mode Display 0 + Windowed Width/Height).um win drive --proc X "size 1920 1080" also resizes most windowed games.-skipintro, -nosplash, Unity -popupwindow), or delete/rename intro
videos in a copy of the game.-skipselect Player:World), a save made for testing,
scenario auto-load, a dev console command.Main.instance.InactiveSleepTime = TimeSpan.Zero; Unity: Application.runInBackground = true; UE:
t.IdleWhenNotForeground 0)./arsenal, /mothership).127.0.0.1 (see
examples/terraria-tmodloader/reference/AgentBridge.cs).
observe (menu options or world state as text), click <id>, controls, step.BsSndRpt64.exe, CrashReportClient.exe, UnityCrashHandler64.exe) can
linger and make Steam say "already running". um win ps to spot them, um win kill <pid> to clear
them.pkill -f or wildcard taskkill /IM. The pattern can match your own shell or other apps.xdotool search --name "Game" windowactivate --sync key Escape, xdotool mousemove --window $W 640 360 click 1. Screenshots: import -window $(xdotool search --name Game) shot.png, or
ffmpeg x11grab.grim. Proton games are Windows games under Wine: launch options
(WINEDLLOVERRIDES, PROTON_LOG=1) go in Steam.screencapture -l <windowid> shot.png (window id via GetWindowID or AppleScript),
osascript / cliclick for input. Input and screen recording need Accessibility and Screen Recording
permission for the terminal.OBobra/superpowers299k2,675 new stars in the last 7 days
MAmattpocock/skills290k10,235 new stars in the last 7 days
AFaffaan-m/ECC279k4,056 new stars in the last 7 days
Audit accessibility on Web, iOS, and Android to meet WCAG 2.2, with keyboard navigation and screen-reader support.
AFaffaan-m/ECC279k4,056 new stars in the last 7 days
AFaffaan-m/ECC279k4,056 new stars in the last 7 days
FIfirecrawl/firecrawl191k2,014 new stars in the last 7 days