Skip to content

docs(sdk): the hotkeys skill answers what agents read the bundle for - #1182

Merged
allisonmahmood merged 1 commit into
mainfrom
hotkeys/skill-answers-1161
Nov 4, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
hotkeys/skill-answers-1161

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

Agents moving patches onto patchy/hotkeys read the compiled bundle to answer questions the skill should answer: what counts as a text field, whether an extra modifier still matches, where propagation stops, why Ctrl+K reaches the address bar with a dialog open, why a native <dialog> stops closing on Escape, and how to type a table of bindings. The patchy-hotkeys skill now answers each of these, the package README mirrors the parts it covers, and the Preact skill's imports name patchy/hotkeys.

Closes #1161

Stacked on #1177 (#1160), which also edits the skill's "Showing hotkeys" section.

Look at

Each item in the issue, and where it now lives. Every claim was checked against the pinned TanStack 0.19.0 code (_event-target.js, _match.js, hotkey-manager.js, _registration.js):

Issue item Skill README
Fields When it fires: a text <input> or <textarea> that isn't read-only, <select>, contenteditable, role="textbox" / role="searchbox" points to the skill
Strict modifiers Writing a hotkey: an extra modifier stops a match; a symbol's own Shift ("?") isn't extra "match exactly, so "J" doesn't fire on Shift+J"
Propagation When it fires: bubble-phase listener on the document; window never sees a fired key; earlier listeners and other document listeners do; a field that stops propagation hides the key from every hotkey points to the skill
Held keys reach the browser Dialogs and scopes: a held hotkey doesn't block its keys (Ctrl+K reaches the address bar); one registered inside the scope does "A held hotkey doesn't block its keys"
Native <dialog> Dialogs and scopes › Native <dialog>: a live Escape hotkey prevents cancel; wrap the dialog in a HotkeyScope and close one way, from onCancel with no Escape inside, as HotkeySheet does, or from an Escape hotkey's run; worked example points to the skill
Tables of bindings Writing a hotkey: HotkeyBinding<Chord>[], and HotkeyBinding<Chord | "G H" | "G T">[] for sequences same
enabled and the sheet When it fires, beside enabled: tying it to a button's state makes the row come and go; check in run to keep it listed —
Preact skill imports patchy-preact › Imports and rendering names patchy/hotkeys and its skill —

The table types are the one claim a compiler can hold the skill to, so the typecheck test now declares a HotkeyBinding<Chord | "G H">[] table and passes it to useHotkeys. A table typed HotkeyBinding<Chord>[] with "G H" in it is refused with Type '"G H"' is not assignable to type 'Chord', as the skill says.

How it was verified

Locally, with CI on this PR as the judge for the full suite:

  • pnpm check: format, lint, typecheck and synth pass. Its offline tests failed only in suites this change doesn't touch: stray GET / requests to the CLI's local stub servers and timeouts on a heavily loaded shared machine.
  • Re-run on their own: SdkApi.test.ts, which packs and serves the project skills, initProject.test.ts, which reads the Preact skill's lint block, and hotkeys.test.ts, with the new table line. 42 of 42 pass.
  • Not run locally: pnpm verify, which the machine's load ruled out.
  • Not run: a pnpm dev trial asking a fresh agent these questions. One trial run is a smell test, and acceptance is run separately.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

Docs and one typecheck line. Patches receive the skill text through a release and patchy refresh.

  • What does a revert leave behind? Nothing.
  • Does the release before it still work with that? Yes.

Built by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, through T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:cli Touches the cli area area:docs Touches the docs area size:s Under 100 changed lines labels Nov 1, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review (GPT 6.1 Sol, xhigh) on 4cd30fc: PASS with one P3, fixed in 27292fd.

  • P3: "window listeners never see it" overstated the propagation rule. A window capture listener runs before the document's bubble listener, so it still sees the key. The skill now says bubble-phase window listeners.
  • Fields: text-entry inputs and textareas, including number and date, honour readOnly. Selects, contenteditable and the textbox and searchbox roles are protected.
  • Strict modifiers match the pinned matcher, including the symbol's implicit-Shift exception.
  • Propagation: a field's stopPropagation hides the key from Patchy.
  • The native <dialog> example closes through cancel and restores focus.
  • Binding tables: the types accept sequences and reject them in HotkeyBinding<Chord>[].
  • enabled guidance and the Preact import are correct.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 27292fd858afe71fa03e2e7f13a1a80f9d658483 (base ec6593d, #1177's head) on team, by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, through T3 Code.

How: pnpm dev up team at the head, then patchy init a tier 1 repo with the environment's CLI. I wrote a page that exercises each new statement, published it as Ada and drove it with real key presses in headless Chromium through the published frame. The repo's served patchy-hotkeys and patchy-preact skills were byte-identical to the head's packages/sdk/skills.

Done means

  • Each answer is in the skill, mirrored in the README where it covers it: passed. I read the skill and README at the head. Strict modifiers, tables and held keys are in both. Fields, propagation and the native <dialog> are in the skill, and the README points to it. I spot-checked every new statement in a published patch, and each one matched:
    • Fields: a single key (L) waits in a <select>, a text, number and contenteditable field, and on role="textbox" and role="searchbox". Mod+Enter and Escape fire in each. L fires in a read-only <input>, a read-only <textarea> and a read-only number input.
    • Strict modifiers: "ArrowLeft" fires alone but not with Shift or Alt held, and "J" doesn't fire on Shift+J. "?" fires on Shift+/.
    • Propagation: for a fired key, a window capture listener and a later document listener see it, already prevented. A bubble-phase window listener doesn't. A field's own onKeyDown runs and the hotkey still fires. A field that calls stopPropagation() keeps L from firing.
    • Held keys: with a HotkeyScope open, Ctrl+K doesn't fire the page's Mod+K and reaches window with defaultPrevented false. A Mod+K registered inside the scope fires and prevents.
    • Native <dialog>, using the skill's example verbatim, with the page's own Escape hotkey live: the dialog opens modal and the page's L is held. Escape closes it through onCancel without the page's Escape firing, the dialog leaves the DOM, and focus returns to the opener. The Close button closes it the same way. With no scope, Escape fires the page's hotkey and the dialog stays open with no cancel. With Escape registered inside the scope, its run closes the dialog with no cancel, and focus returns. The same dialog opened in a passive useEffect closes, but focus lands on body, as the skill's last paragraph says.
    • Tables: in the patch repo, pnpm typecheck accepts HotkeyBinding<Chord>[] and HotkeyBinding<Chord | "G H" | "G T">[]. It refuses "G H" in a HotkeyBinding<Chord>[] with Type '"G H"' is not assignable to type 'Chord'.
    • enabled and the sheet: with <HotkeySheet hotkey="Mod+/" />, a row tied to a checkbox through enabled leaves the sheet when it's unchecked. A row that checks the same condition in run stays listed.
  • The Preact skill's imports name patchy/hotkeys: passed. Imports and rendering now says shortcuts come from patchy/hotkeys and points to ../patchy-hotkeys/SKILL.md, which resolves in an initialized repo's .agents/skills.
Key-press results in the published frame (trimmed)
PASS  #select: L waits  []
PASS  #select: Mod+Enter fires  ["fired Mod+Enter"]
PASS  #select: Escape fires  ["fired page Escape"]
PASS  #number: L waits  []
PASS  #editable / #textbox / #searchbox: L waits, Mod+Enter and Escape fire
PASS  #readonly: L fires  ["fired L"]
PASS  #readonly-area: L fires  ["fired L"]
PASS  #number-ro: L fires  ["fired L"]
PASS  ArrowLeft: "ArrowLeft" fires  ["fired ArrowLeft"]
PASS  Shift+ArrowLeft: "ArrowLeft" doesn't fire  []
PASS  Alt+ArrowLeft: "ArrowLeft" doesn't fire  []
PASS  Shift+J: "J" doesn't fire  []
PASS  Shift+Slash: "?" fires  ["fired ?"]
PASS  fired L  ["window-capture l","fired L","document-later l prevented"]
PASS  unbound K  ["window-capture k","document-later k untouched","window-bubble k untouched"]
PASS  #own: field's onKeyDown runs and L fires  ["window-capture l","own-onKeyDown l","fired L","document-later l prevented"]
PASS  #stopper: a field stopping propagation hides L  ["window-capture l"]
PASS  scope open: page Mod+K held, Ctrl+K not prevented  [..., "window-capture Ctrl+k","document-later Ctrl+k untouched","window-bubble Ctrl+k untouched"]
PASS  scope with inner Mod+K: it fires and prevents  [..., "fired inner Mod+K","document-later Ctrl+k prevented"]
PASS  skill example: Escape closes via onCancel, page Escape held  ["window-capture Escape","document-later Escape untouched","window-bubble Escape untouched","closed dialog"]
PASS  skill example: focus returns to opener  "open-dialog"
PASS  no scope + live page Escape: dialog stays open, no cancel  ["window-capture Escape","fired page Escape","document-later Escape prevented"]
PASS  Escape inside the scope: its run closes, no cancel  ["window-capture Escape","fired inner Escape","closed esc","document-later Escape prevented"]
PASS  passive effect variant: closes, focus does NOT return  [[..., "closed passive"],"body"]
PASS  enabled-tied Save comes and goes; run-checked Print stays
      {"armed":["Show shortcuts","Save","Print"],"disarmed":["Show shortcuts","Print"]}

Tests: vitest run src/hotkeys.test.ts src/hotkeyRules.test.ts at the head, 8 of 8, including the new table line. CI on the head is green, browser included, except test (22) and test (24), which were still running when I posted this.

Golden journeys

  • Publish a page: passed in part. The environment's CLI published the check patch twice as Ada, and it opened at its address with its frame. Ben's view wasn't checked: the change doesn't touch serving.
  • The others aren't touched: the diff is skill text, README text and one typecheck line.

Rollback answers: they match the diff. A revert leaves nothing: no schema, data or contract. Repos that refreshed keep the newer skill text, which describes the same SDK.

Not run

  • Ctrl+K reaching the address bar itself: headless Chromium has no address bar. I checked the mechanism instead: the key isn't prevented while held, and is prevented when a hotkey inside the scope takes it.
  • A pnpm dev trial asking a fresh agent these questions: outside what I was asked to check. I checked the statements against behaviour instead.
  • macOS (⌘) and non-Chromium browsers.

Notes

  • A read-only field keeps its own caret keys. In a read-only <input>, L fires but "ArrowLeft" doesn't. TanStack gives inputs ArrowLeft, ArrowRight, Home and End, and gives a read-only <textarea> the arrows, Home, End, PageUp and PageDown. The skill says read-only fields aren't text fields, which holds. Unlike its sentence on checkboxes, radios and ranges, it doesn't say which keys a read-only field keeps. Likewise, "a text <input>" includes number, date and the other text-entry types (number checked above). Spelling that out would save a reader a guess. Nit; not blocking.
  • Stacked on feat(sdk): hotkey labels say Enter, not ↵, off a Mac, and refuse misspelt keys #1177, which needs to land first.

@allisonmahmood
allisonmahmood force-pushed the hotkeys/skill-answers-1161 branch from 5bda230 to c5d9d0c Compare November 1, 2026 17:37
@allisonmahmood
allisonmahmood force-pushed the hotkeys/format-words-1160 branch from f5b9c73 to e896b12 Compare November 4, 2026 02:31
Base automatically changed from hotkeys/format-words-1160 to main November 4, 2026 02:43
@allisonmahmood
allisonmahmood force-pushed the hotkeys/skill-answers-1161 branch from c5d9d0c to 5c5df42 Compare November 4, 2026 02:43
@allisonmahmood
allisonmahmood merged commit 82c1e83 into main Nov 4, 2026
24 checks passed
@allisonmahmood
allisonmahmood deleted the hotkeys/skill-answers-1161 branch November 4, 2026 02:53
allisonmahmood added a commit that referenced this pull request Nov 4, 2026
…ges publish (#1241)

## What changed

This adds release 36's What's new entry, written from `1acc968`. It
covers everything merged since release 35's `through` (`dd0e2ec`), and
sets the `patchy` release to `0.36.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| Improved: shortcuts work where you use them (keys for one part of a
patch, the closest wins, text boxes keep their typing keys) | #1231 |
| Improved: the shortcuts sheet shows what works where you are (Ctrl+/
and ⌘/ open it, its commands run, it opens from a patch's menu and in
view on a narrow screen, keeps the look, spells keys out away from a
Mac) | #1231, #1181, #1178, #1180, #1177 |
| Fixed: keys pressed while a patch opens reach it | #1183 |
| Fixed: pages styled with Tailwind 4 publish, and a look with the same
rule saves | #1191 |
| Fixed: an old copy of a patch no longer replaces newer work
(**Breaking** for such a copy: it needs `patchy pull` or one
`--allow-behind` publish) | #1179 |
| Improved: your agent can check a publish before sending it | #1188 |
| Improved: your agent hears what changed when it updates a patch |
#1186, #1185 |
| Fixed: your agent stops chasing false alarms (`pnpm install` exit
codes, `manifest.json` bytes, the description notice, a copied dev
record) | #1176, #1174, #1175 |
| Behind the scenes: fuller hotkeys instructions for agents; fewer
redraw costs for patches with many shortcuts | #1182, #1187 |

`patchChanges` has three sentences for the agent refreshing a patch
across this release:
- #1231's, from its PR: text fields keep their keys, `preventDefault()`,
and the sheet's Mod+/ and `.hotkey-row` buttons.
- The sheet's dialog renders in `document.body`, and element-only page
rules don't reach it (#1178, #1180). Its own row lists last (#1181). The
hotkey label helpers take only valid literals (#1177).
- Publish's `unknown_base_version` (#1179).

It also rewords release 33's "Press ? to see every shortcut a patch
has". That was true only for a patch that mounts the shortcuts sheet, so
it now says a patch *can* list its shortcuts.

The rest get no line:
- #1206, #1207, #1209 and #1220 are `pnpm dev eval` tooling.
- #1222 is release 35's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`, and release 33's reworded line.
- **Rollback safety, from the live commit `d28fdd0` (release 35) to
`1acc968`:**
- #1191 is labelled `one-way`. Its Release impact: a company look
published after this release with a nested `@supports` condition stays
stored after a revert. Release 35 refuses any bundle carrying it, so
repo publishes in that company would fail until an admin runs `patchy
look restore` to an earlier revision. Pages and Tailwind 4 repos already
published stay published.
- #1183 is the only change to what the server serves browsers: the
shell's script, under a digest-named URL. Its revert leaves nothing
behind.
- The hotkeys PRs change `patchy/hotkeys`, which patches bundle when
they are built. Published patches keep their copy.
- The CLI PRs change what a CLI writes and refuses. Release 35 reads
everything they leave behind: #1176's `allowBuilds` entry, #1174's
indented `manifest.json`, and the `version` recorded by an
`--allow-behind` publish.

**Rollback line:** If this release misbehaves, roll back to `d28fdd0`
(release 35). First check that no company's look has a nested
`@supports` condition, and `patchy look restore` an earlier revision
where one does (#1191).

## How it was verified

- **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and
`schemas.test.ts` pass (22 tests), and `bun fmt` passes on the changed
files.
- **Facts.** The sheet's new `document.body` home and its element-rule
reset were checked against `hotkeys.ts` and `hotkeySheet.ts` on main.
- **Deploy state.** I pinned the live commit from `/healthz/deep`:
`d28fdd0` (release 35). The Deploy run updated last succeeded, and none
is unfinished.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Text and version numbers only. Like every release, the `0.36.0` bump
tells CLIs and patch repos installed before this deploy to upgrade.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3
Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

patchy-hotkeys skill: facts agents had to read the bundle for

1 participant