Agent skill

Hsvmtest

by cmsj in cmsj/Hammerspoon2

Run Hammerspoon 2 tests, or install and drive a build, inside a headless Tart macOS VM via scripts/vm/hs2vm, instead of on the developer's own Mac — use this by default whenever running tests or…

MITAuto-check passedMobile

Install Hsvmtest

skills CLI
$ npx skills add cmsj/Hammerspoon2 --skill hsvmtest -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cmsj/Hammerspoon2 hsvmtest --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cmsj/Hammerspoon2.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/HSVMTest .claude/skills/hsvmtest && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hsvmtest
GitHub stars
118
Token cost
~1.8k tokens
SKILL.md length
704 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Run Hammerspoon 2 tests, or install and drive a build, inside a headless Tart macOS VM via scripts/vm/hs2vm, instead of on the developer's own Mac — use this by default whenever running tests or…

  • Mobile work in your project
  • SKILL.md covers Prerequisites, Running tests, Installing and driving the app and Other commands, plus 1 more section
  • Calls xcodebuild, brew and xcrun

What it does

Hsvmtest is an agent skill from cmsj/Hammerspoon2. Run Hammerspoon 2 tests, or install and drive a build, inside a headless Tart macOS VM via scripts/vm/hs2vm, instead of on the developer's own Mac — use this by default whenever running tests or poking at the running app

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with macOS and Xcode. The licence is MIT.

When your agent uses it

  • Mobile work in your project

Example prompts

  • “/hsvmtest”

What it can do on your machine

Read from SKILL.md and the folder at commit 1029407. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • xcodebuild
    • brew
    • xcrun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hsvmtest loads about 1.8k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 704 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cmsj/Hammerspoon2 at commit 1029407, republished under its MIT licence (© cmsj). 704 words, ~1,803 tokens.

Download SKILL.mdSave it as .claude/skills/hsvmtest/SKILL.md (or your agent's skills folder).
name
hsvmtest
description
Run Hammerspoon 2 tests, or install and drive a build, inside a headless Tart macOS VM via scripts/vm/hs2vm, instead of on the developer's own Mac — use this by default whenever running tests or poking at the running app

Testing in a VM with hs2vm

Running xcodebuild test on the host takes over the developer's screen, keyboard and mouse (windows open, the pointer moves, keystrokes are synthesized). Run tests in a VM by default with scripts/vm/hs2vm; only fall back to a host xcodebuild test if the user asks for it or the VM can't be used (say why).

Everything runs headless: VMs have no window on the host. Screenshots (screencapture) and mouse/keyboard input (the hs2vm-guest tool posting CGEvents) happen inside the guest.

Prerequisites

  • tart installed (the user installs it: brew install openai/tools/tart — never run brew yourself).
  • The golden image hs2-golden exists (scripts/vm/hs2vm status). If not, build it with scripts/vm/hs2vm provision (~4 minutes; needs the ~41 GB Cirrus Labs base image, pulled automatically on first use). Re-provision after an Xcode update so the guest matches the host.

Running tests

bash
scripts/vm/hs2vm test                                                       # full suite (~12 min)
scripts/vm/hs2vm test "-only-testing:Hammerspoon 2Tests/HSHashIntegrationTests"
scripts/vm/hs2vm test "-only-testing:Hammerspoon 2Tests/HSHashIntegrationTests/testMD5FromJS()"
scripts/vm/hs2vm test --keep …                                              # keep the VM to investigate

Arguments after test go straight to xcodebuild test-without-building, so the -only-testing: rules in CLAUDE.md apply (target Hammerspoon 2Tests with a space, top-level suite struct name, trailing () for a single test).

test builds on the host (into build/vm/DerivedData, separate from Xcode's), clones hs2-golden, runs the tests, collects results, and deletes the clone. Run the full suite with run_in_background and watch build/vm/runs/<timestamp>/xcodebuild.log. Results land in build/vm/runs/<timestamp>/:

FileContents
summary.mdMarkdown pass/fail/skip summary from scripts/xcresult-report.js — read this first
xcodebuild.logFull test output
TestResults.xcresultResult bundle (xcrun xcresulttool get test-results tests --path …)
crash-reports/Hammerspoon 2*.ips from the guest, if the test host crashed
build.log, final.pngHost build log; screenshot of the guest when the tests finished

The exit status is xcodebuild's.

What differs from the host
  • Tests can detect the VM: ProcessInfo.processInfo.environment["HS2_VM"] != nil (set via TEST_RUNNER_HS2_VM=1).
  • Expected skips: battery, camera, Wi-Fi, Stream Deck, physical MIDI (no such hardware), and hs.ocr recognizeText (Vision can't load its accurate-recognizer models in a VM).
  • TCC is pre-granted to net.tenshu.Hammerspoon-2 by bundle ID (Accessibility, Screen Recording, Input Monitoring, PostEvent, Camera, Microphone, AppleEvents → Finder/System Events), so permission-gated tests run rather than skip. Any build is covered; no signing needed.
  • One display, 1024x768 points (2048x1536 pixels).

Installing and driving the app

bash
scripts/vm/hs2vm up hs2-dev                      # clone hs2-golden as hs2-dev and boot it
scripts/vm/hs2vm build                           # host build (skip if `test` just built)
scripts/vm/hs2vm install hs2-dev [--config my-init.js] [--app path/to/Hammerspoon 2.app]
scripts/vm/hs2vm hs hs2-dev 'hs.application.frontmost().title'
scripts/vm/hs2vm hs hs2-dev < script.js          # multi-line; the last expression's value is printed;
                                                 # Promises are awaited; exit status is hs2's:
                                                 # 65 = the JavaScript threw (or its Promise
                                                 # rejected), 1 = couldn't reach the app
scripts/vm/hs2vm screenshot hs2-dev /tmp/shot.png   # then Read the PNG
scripts/vm/hs2vm down hs2-dev                    # stop and delete it when done

install writes ~/.config/Hammerspoon2/init.js as hs.ipc.start(); followed by --config, skips the first-launch Welcome window, launches the app and waits until it answers.

hs runs the app's own hs2 CLI in the guest, so it exercises the real hs.ipc path (hs2 → HammerspoonIPCBroker launch agent → app). The broker is registered with SMAppService, which refuses bundles without a sealed signature, so hs2vm build ad-hoc signs the app after building; Debug builds skip hs.ipc's same-team checks. A JavaScript error is printed to stderr as err.toString() (no stack).

Show full SKILL.md (283 more words)Show less
Mouse and keyboard
bash
scripts/vm/hs2vm click hs2-dev 1341 984          # also doubleclick, rightclick, move
scripts/vm/hs2vm drag hs2-dev 100 100 600 400
scripts/vm/hs2vm key hs2-dev cmd+n               # chords; several per call: key hs2-dev cmd+a delete
scripts/vm/hs2vm type hs2-dev 'Hello, world!'
  • Coordinates are screenshot pixels (2048x1536). When the Read tool shows a downscaled image, multiply by the scale factor it reports.
  • Modifiers: cmd, shift, ctrl, alt/opt/option, fn. Keys: letters, digits and US-layout punctuation, return, tab, esc, space, delete (backspace), forwarddelete, arrows, home/end/pageup/pagedown, f1–f12.
  • type sends Unicode text directly, so it's independent of keyboard layout.
  • Input is real HID-level CGEvents, so Hammerspoon's own event taps and hotkeys see it.

Other commands

hs2vm start|stop <vm>, hs2vm exec <vm> <cmd…> (runs as the auto-logged-in admin user in the GUI session; sudo needs no password), hs2vm status. VM names must start with hs2- (the user's permission rule allows tart exec hs2-*).

Gotchas

  • At most two macOS VMs can run at once (Apple's licence, enforced by Virtualization.framework).
  • build, test and install share one DerivedData (build/vm/DerivedData) and take turns on a lock (build/vm/products-lock) while building and copying products into a guest, so simultaneous runs are safe; a second one logs that it's waiting. A lock left by a dead process is reclaimed automatically.
  • Call tart exec (and hs2vm) as standalone commands, not chained with &&/;, so the user's Bash(tart exec hs2-*) permission rule matches.
  • Don't call tart list while a VM is booting (it makes the boot fail with "Internal Virtualization error"); hs2vm start already avoids this.
  • Don't run VMs with tart run --vnc / --vnc-experimental: Virtualization.framework's VNC server asserts while setting up some client connections (and on clients that don't advertise the DesktopSize/ExtendedDesktopSize encodings), killing the whole VM. hs2vm never enables it.
  • The Cirrus Labs base image posts persistent "App Background Activity" / "Extensions Added" banners at boot; hs2vm start closes them (hs2vm-guest dismiss-notifications). If one shows up in a screenshot later, run scripts/vm/hs2vm exec <vm> /usr/local/bin/hs2vm-guest dismiss-notifications 5.

© cmsj, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/HSVMTest of cmsj/Hammerspoon2.

Open the folder on GitHubat commit 1029407

Compare with similar skills

Hsvmtest next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hsvmtest compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hsvmtest this skillcmsj/Hammerspoon2118—~1.8kAutomated safety check: PassMIT
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca89k1 repos~584Automated safety check: PassApache-2.0
Apple Crash Log .NET Symbolicationdotnet/skills5.6k1 repos~2.4kAutomated safety check: PassMIT
App Store Preflight Skillstruongduy2611/app-store-preflight-skills1.4k—~1.4kAutomated safety check: PassMIT
Build And Run Screendropfayazara/Screendrop2.2k—~1.1kAutomated safety check: PassCC0-1.0

Similar skills

  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    89k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    MobileAuto-check passed
  • App Store Preflight Skills

    truongduy2611/app-store-preflight-skills

    Scan an iOS/macOS Xcode project for common App Store rejection patterns before submission.

    1.4k GitHub stars~1.4k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Build And Run Screendrop

    fayazara/Screendrop

    Build the Screendrop macOS app with xcodebuild, kill any running instance (of any scheme), and launch the fresh build.

    2.2k GitHub stars~1.1k tokensUpdated 9 days ago
    MobileAuto-check passed
  • Official

    Update dotnet/macios to a new Xcode beta and validate it end-to-end.

    2.9k GitHub stars~1.8k tokensUpdated 2 days ago
    MobileAuto-check passed

More from cmsj/Hammerspoon2

  • Hs2type

    cmsj/Hammerspoon2

    Guide for creating custom types in Hammerspoon 2 — both shared engine types and module-specific types

    118 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Hs2module

    cmsj/Hammerspoon2

    Ensure all Hammerspoon v2 modules follow established patterns

    118 GitHub stars~8.6k tokensUpdated yesterday
    Auto-check passed
  • Hs2tests

    cmsj/Hammerspoon2

    Guide for writing tests in Hammerspoon 2 — framework, structure, JSTestHarness patterns, async, environment guards, and what not to test

    118 GitHub stars~5.4k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Hsvmtest

What does Hsvmtest do?

Run Hammerspoon 2 tests, or install and drive a build, inside a headless Tart macOS VM via scripts/vm/hs2vm, instead of on the developer's own Mac — use this by default whenever running tests or…. Hsvmtest is an agent skill from cmsj/Hammerspoon2.

When should I use Hsvmtest?

Hsvmtest fits situations like: mobile work in your project.

How do I install Hsvmtest in Claude Code?

Run `npx skills add cmsj/Hammerspoon2 --skill hsvmtest -a claude-code`. Or copy the skill folder (.claude/skills/HSVMTest in cmsj/Hammerspoon2) into .claude/skills/hsvmtest in your project. Claude Code loads it when a task matches its description.

How do I install Hsvmtest in Codex?

Run `npx skills add cmsj/Hammerspoon2 --skill hsvmtest -a codex`. Or copy the skill folder (.claude/skills/HSVMTest in cmsj/Hammerspoon2) into .agents/skills/hsvmtest in your project. Codex loads it when a task matches its description.

Can I use Hsvmtest in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cmsj/Hammerspoon2 --skill hsvmtest -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hsvmtest, .gemini/skills/hsvmtest, .github/skills/hsvmtest and .opencode/skills/hsvmtest in your project.

What does Hsvmtest need to run?

Going by SKILL.md and its folder, Hsvmtest needs the command-line tools its instructions call (xcodebuild, brew and xcrun).

Does Hsvmtest access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Hsvmtest safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hsvmtest use?

Hsvmtest is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hsvmtest use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hsvmtest?

Skills that share tags, products or a category with Hsvmtest: macOS Spm App Packaging (Dimillian/Skills, 4k stars), Orca iOS Simulator Control (stablyai/orca, 89k stars), Apple Crash Log .NET Symbolication (dotnet/skills, 5.6k stars) and App Store Preflight Skills (truongduy2611/app-store-preflight-skills, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hsvmtest?

cmsj (a GitHub user) maintains it in cmsj/Hammerspoon2, which has 118 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 9, 2026.

Source: cmsj/Hammerspoon2 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.