Skip to content

docs(commands): generate the keyboard, scroll, and clipboard API blocks - #4809

Merged
thymikee merged 4 commits into
mainfrom
t3/commands-doc-generated-blocks
Nov 20, 2026
Merged

thymikee merged 4 commits into
mainfrom
t3/commands-doc-generated-blocks

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

commands.md changed in 54 of the last 200 commits because it restates facts the command registry owns. This pilot makes Keyboard, Scroll, and Clipboard hybrid.

  • scripts/command-docs/generate.ts (pnpm generate:command-docs) rewrites only the regions between <!-- generated:command <name> --> and <!-- /generated -->. A block holds the summary, synopsis, aliases, options table, and capabilities link, all read from existing registry data.
  • The hand-written text is now a short "Things to know" list for a person who drives an agent.
  • The command-docs gate also runs the new drift guard. No new gate id, no waiver.

The shipped tool is unchanged. 6 files touched. All other sections are byte-identical (3 diff hunks).

Before (Keyboard, 1 of 3 bullets):

keyboard status (alias keyboard get) reports whether the software keyboard is visible. When it can identify a visible Return control, it reports its action as returnKey and can include … (6 more sentences)

After:

Inspect, press, or dismiss the device keyboard.
agent-device keyboard [status|get|dismiss|enter|return]
Supported targets: Keyboard dismiss, enter, and status
Exact behavior: `agent-device help keyboard`.

plus four short "Things to know" bullets.

Validation

At 32b5a05, local:

  • pnpm check:command-docs: 17 passed (coverage guard and drift guard).
  • runner-refusal-reason-docs.test.ts: 3 passed.
  • pnpm check:doc-prose, pnpm check:doc-links, pnpm check:gate-manifest, pnpm check:quick: pass.
  • Built site: the markers are HTML comments and do not render.

No check:affected --run receipt; CI validates. Docs and tooling only: no device run applies.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.46 MB 6.46 MB +133 B
Package (unpacked) 6.46 MB 6.46 MB +133 B
Package (download) 1.97 MB 1.97 MB +147 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.2 ms 32.8 ms +5.6 ms
CLI --help 49.7 ms 70.9 ms +21.2 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at 32b5a05. The generator and the schema text were read; the generator and help scroll were not run locally. All 26 checks pass, including the command-docs gate that runs the new drift guard, and there are no conflicts. Not blocking, and you can take or leave these: generate.ts:37 re-derives the option list instead of sharing one function with help <command> in cli-help.ts, so a flag with an override but no base description shows in the docs table and not in help; generate.ts:129 copies the drift reporter from scripts/capability-matrix/generate.ts, which one shared module could serve; the --no-post-gesture-stabilization bullet in commands.md:647 now says the config key applies to every command and drops the Node client and batch postGestureStabilization: false route, while client-api.md and configuration.md still link to it for that; the trimmed Scroll section at commands.md:641 drops the --max-passes range, the scroll refresh default and the keyboardAvoided fields, which no other page or help scroll carries; and commands.md:1042 says Android keyboard dismiss closes the keyboard, but it returns keyboard_dismiss_unavailable when the keyboard stays up. Also not verified here: a site build to check that the HTML-comment markers stay hidden, the sessionless clipboard path, and Appium iOS keyboard dismiss against the unqualified 'On iOS' sentence.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 20, 2026
thymikee and others added 3 commits November 20, 2026 16:11
The command reference restated registry facts by hand. A marked block per
command now carries the summary, synopsis, options, and capabilities link,
rendered by scripts/command-docs/generate.ts from the existing registry data.
The hand-written text of the three pilot sections keeps only what a person
who drives an agent needs to know.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The command-docs gate now also runs the drift guard, so a stale block fails
on the unit lane and on the docs lane. The docs workflow reruns when the
generator changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…re the help-flag and drift helpers

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the t3/commands-doc-generated-blocks branch from 32b5a05 to a78e1ec Compare November 20, 2026 15:13
@thymikee

Copy link
Copy Markdown
Member Author

Follow-up on the optional notes at a78e1ec19e (rebased onto current main):

Doc content, all applied

  • Scroll: the --max-passes range (1–200), the scroll refresh default (scroll up 0.4 --duration-ms 1200) and the keyboardAvoided / keyboardMinY result fields are back.
  • --no-post-gesture-stabilization: the Node client and batch-step route (postGestureStabilization: false) is back.
  • Keyboard: the Android bullet now says dismiss asks the platform to close the keyboard and returns keyboard_dismiss_unavailable when it stays up.

Code, both applied

  • The option list is no longer re-derived: commandHelpFlags(schema) lives in src/commands/schema/usage.ts and both cli-help.ts and the generator call it. Help output is unchanged (the 114 schema tests pass).
  • The drift reporter reuses firstDifference from the capability-matrix generator.

Local: build, lint and typecheck, check:command-docs (17), schema tests, capability-matrix and reason-docs guards, eager-closure budgets, fallow, production-exports, doc-prose.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on a78e1ec. The verdict and the full list are in the summary comment.

name,
summary: schema.text.summary,
usage: buildCommandUsage(name, schema),
aliases: cliAliasesForCommand(name).map((entry) => entry.alias),

@apex-sentinel-staging apex-sentinel-staging Bot Nov 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer raised on 7352d81: marked fixed in 7352d81 by thymikee in this comment.

🆕 🟡 Minor · Keyboard aliases no longer appear anywhere in commands.md

The generated block for keyboard renders no Aliases: line, so commands.md no longer documents that keyboard get and keyboard return are accepted spellings, and the scroll refresh description lost the note that Android aims the pull inside the scroll container (only the iOS middle-of-screen half survived). collectCommandFacts fills aliases from cliAliasesForCommand(name), which has no keyboard entries — those spellings are positional values of usageOverride: 'keyboard [status|get|dismiss|enter|return]', so the Aliases: branch never fires and nothing replaces the old hand-written bullets.

Suggested change

Re-add the facts the generator cannot derive to the hand-written lists: that keyboard get and keyboard return are accepted spellings, and that scroll refresh aims inside the scroll container on Android.

Details

Also raised here

Also raised at this location by persona senior-developer: keyboard status field returnKeyLabel dropped from user docs — website/docs/docs/commands.md no longer mentions returnKeyLabel anywhere after this PR, so a reader of the keyboard reference cannot learn that keyboard status can return a localized Return-key label — the removed bullet carried "can include its localized accessibility label as returnKeyLabel", "A label alone leaves the action unknown and the label field absent", and "Only Android can report none", none of which the generated block or the new bullets restore. The generated block only emits registry facts (summary, synopsis, aliases, options, capabilities link), so response fields documented by hand have no owner in the hybrid.

Also raised at this location by persona senior-developer: iOS keyboard dismiss no-op on hidden keyboard no longer documented — The keyboard section now states only that keyboard dismiss does not close a visible keyboard on iOS and returns keyboard_dismiss_unavailable, while the removed bullet also documented that on the native iOS runner the command succeeds as a no-op when the software keyboard is already hidden. A caller that dismisses defensively and checks for failure reads a keyboard_dismiss_unavailable-shaped mental model and will treat the real no-op success as something else; the Android bullet documents its equivalent ("If the keyboard stays up, it returns keyboard_dismiss_unavailable"), so the asymmetry is a silent omission, not a deliberate simplification.

persona: senior-developer, javascript

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at 7352d8166f: the bullets name keyboard get and keyboard return as aliases again. The registry holds only command-level aliases, so the generated block cannot print action aliases; they stay in the hand-written text.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 7352d81

Since the review of a78e1ec: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (ae9f203ade9f).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee
thymikee merged commit c9cce06 into main Nov 20, 2026
24 of 25 checks passed
@thymikee
thymikee deleted the t3/commands-doc-generated-blocks branch November 20, 2026 15:31
thymikee added a commit that referenced this pull request Nov 20, 2026
…nts-main

* origin/main:
  docs(commands): generate the keyboard, scroll, and clipboard API blocks (#4809)
  refactor(host-kit): move settleWithin to a dependency-free leaf module (#4816)
  fix(android): share the boot error shape and pin the offline boot-probe retry (#4812)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant