keyhac-action-authoring

Write Keyhac actions that drive application UIs through accessibility trees.

6|Updated Jul 26, 2026
One-click install
npx skills add https://github.com/crftwr/keyhac --skill keyhac-action-authoring-crftwr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: keyhac-action-authoring
Source: https://github.com/crftwr/keyhac/tree/main/keyhac/skills/keyhac-action-authoring
Command: npx skills add https://github.com/crftwr/keyhac --skill keyhac-action-authoring-crftwr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Automating applications that expose no API requires driving their user interface directly, and naive UI automation breaks silently through sleeps, pixel coordinates, unverified writes, and unbounded loops. This Skill guides the authoring of Keyhac actions that read and drive another application's accessibility tree reliably on macOS and Windows. ## Core Features & Use Cases - Accessibility-tree automation: Generate plain-Python Keyhac actions that locate elements by identifier, name, role, or capability, act through verified verbs with explicit preconditions and postconditions, and never rely on sleeps or pixel coordinates. - Structured extraction and form filling: Read tables and paginated results, fill forms from CSV data with verified writes, handle dialogs with appear-act-gone sequencing, and checkpoint progress so interrupted runs resume safely. - Platform quirk guidance: Reference documentation covers measured macOS and Windows behaviors such as Chromium content access, role vocabulary differences, and toggle-state handling. - Use Case: Ask the assistant to extract every row from a paginated results table in Safari into a CSV; it inspects the live screen, writes a ThreadedAction module into ~/.keyhac/extensions/, runs it via the Keyhac MCP tools, reads the result, and hands back a key-binding snippet. ## Quick Start Ask the assistant to write a Keyhac action that extracts the records from the currently open application window and saves them to a CSV on your Desktop.

Frequently Asked Questions about keyhac-action-authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate an application that has no API?

Write a Keyhac action that drives the application's accessibility tree: locate elements by identifier, name, or role, act through verbs like ui.click and ui.fill with explicit postconditions, and read results back. The action is plain Python saved in ~/.keyhac/extensions/.

How do I extract a paginated table from a web page with Keyhac?

Loop over pages by pressing the Next control, waiting on a per-page signal such as the document title rather than a fixed delay, and accumulate rows outside the failing scope. Bound the loop so a Next link pointing to itself cannot run forever.

Does Keyhac UI automation work on both macOS and Windows?

Yes, but role vocabularies differ: macOS AXTextField is a Windows Edit, and Windows has no Cell or Row roles. Write role patterns without the AX prefix for portability, and inspect the live tree on the platform the action will run on.

Why does my UI automation find nothing in Chrome, Slack, or VS Code?

Chromium and Electron applications expose no document content until accessibility is requested. On macOS use the ui.content_access() context manager; on Windows retry the read with wait_for, since renderer accessibility activates after a UIA client attaches.

Why should UI automation avoid sleep and pixel coordinates?

Sleep passes on a fast machine and fails on a slower one, while coordinates break when layouts change. Wait for a named target state such as an element appearing or a value reading correctly, and address elements by identifier, name, or structure instead.

How do I test a Keyhac action after writing it?

Save it with write_extension, confirm it appears in list_actions, run it with start_action, then read the outcome with get_action_result, which returns everything logged plus any traceback. No config.py edit or reload is needed during the test loop.