diff --git a/README.md b/README.md index c5d46442d5..ebbedc5048 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,15 @@ Install the CLI: ```bash npm install -g agent-device@latest +agent-device doctor agent-device --version agent-device help workflow ``` -The installed CLI help is the source of truth for agents. Start with `agent-device help workflow`, then follow the topic-specific help when a task needs dogfooding, debugging, replay, or React Native profiling. +Run `agent-device doctor` yourself after installation to check local setup before +handing the CLI to an agent. The installed CLI help is the source of truth for +agents. Start with `agent-device help workflow`, then follow the topic-specific +help when a task needs dogfooding, debugging, replay, or React Native profiling. Prerequisites depend on the target platform: Node.js 22+, Xcode for iOS/tvOS/macOS targets, Android SDK + ADB for Android, and macOS Accessibility permission for desktop automation. Web automation requires Node 24+. See [Installation](https://oss.callstack.com/agent-device/docs/installation) for platform setup. diff --git a/skills/agent-device/SKILL.md b/skills/agent-device/SKILL.md index 6e0e1279a3..2be1b4a30d 100644 --- a/skills/agent-device/SKILL.md +++ b/skills/agent-device/SKILL.md @@ -38,8 +38,6 @@ agent-device help dogfood Default loop: `open -> snapshot/-i -> get/is/find or press/fill/scroll/wait -> verify -> close`. -On a fresh machine (first iOS run), start with `agent-device doctor --platform ios`: it preflights the environment and warms the iOS runner build cache in the background so the first `open` is fast. - Use this skill only to route into version-matched CLI help. Let the selected help topic provide exact command shapes, platform limits, and current workflow guidance; use `help workflow` as the full reference when a task-specific topic is too narrow. For precise location workflows, read the installed `settings` help before planning so coordinate support and platform limits come from the active CLI version. diff --git a/src/cli/parser/__tests__/cli-help-topics.test.ts b/src/cli/parser/__tests__/cli-help-topics.test.ts index 51d29fd273..ea356e2121 100644 --- a/src/cli/parser/__tests__/cli-help-topics.test.ts +++ b/src/cli/parser/__tests__/cli-help-topics.test.ts @@ -107,7 +107,8 @@ test('usage includes agent workflows, config, environment, and examples footers' assert.match(usageText, /open "Expo Go" --platform ios/); assert.match(usageText, /Do not use plain snapshot or snapshot --diff for this recovery check/); assert.match(usageText, /Install flows: install\/install-from-source first/); - assert.match(usageText, /fill 'id="field-email"' "qa@example\.com" replaces/); + assert.match(usageText, /use fill --settle to replace a field value/); + assert.match(usageText, /Use type only to append after focusing a field with press/); assert.match(usageText, /do not use fill ""/); assert.match(usageText, /Android IME capture: if fill says input was captured/); assert.match(usageText, /Implicit default sessions are scoped to the current worktree/); @@ -116,6 +117,8 @@ test('usage includes agent workflows, config, environment, and examples footers' assert.match(usageText, /After mutation: refs are stale/); assert.match(usageText, /use its selector directly; otherwise refresh with snapshot -i/); assert.match(usageText, /verify the action with diff snapshot -i or snapshot --diff/); + assert.match(usageText, /fill \[text\]\s+Replace text in/); + assert.match(usageText, /type \s+Append text to the focused field/); assert.match(usageText, /Sparse or AX-unavailable snapshot/); assert.match(usageText, /macOS context menus use click --button secondary/); assert.match( @@ -456,6 +459,8 @@ test('usageForCommand resolves manual QA help topic', async () => { assert.match(help, /Run snapshot -i to get current refs/); assert.match(help, /press\/fill\/click\/longpress --settle/); assert.match(help, /A bare screenshot\/snapshot is not verification/); + assert.match(help, /use fill --settle to replace/); + assert.match(help, /use type only to append to an already-focused field/); assert.match(help, /Do not use placeholders such as @ref/); }); @@ -556,10 +561,8 @@ test('usageForCommand resolves react-native help topic', async () => { assert.match(help, /help react-devtools/); assert.match(help, /Help workflow owns the full Expo URL command shapes/); assert.match(help, /For app\/package launches, run metro prepare/); - assert.match(help, /agent-device doctor --platform android/); - assert.match(help, /agent-device doctor --platform android --app com\.example\.app/); - assert.match(help, /agent-device doctor --platform ios/); - assert.match(help, /agent-device doctor --remote --remote-config \.\/remote\.json/); + assert.match(help, /Do not run doctor as routine QA\/dogfood prep/); + assert.match(help, /Use doctor only when the user asks for setup diagnostics/); assert.match(help, /same host context that owns the dev server/); assert.match(help, /sandbox probe is not authoritative/); assert.match(help, /adb reverse only affects Android device-to-host traffic/); diff --git a/src/cli/parser/cli-help.ts b/src/cli/parser/cli-help.ts index 8562621a25..c4d0a313b4 100644 --- a/src/cli/parser/cli-help.ts +++ b/src/cli/parser/cli-help.ts @@ -93,7 +93,7 @@ const AGENT_QUICKSTART_LINES = [ 'Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability.', 'Expo Go/dev clients: use the provided URL when given; on iOS use open "Expo Go" --platform ios, then snapshot -i --platform ios to verify project UI. Do not use plain snapshot or snapshot --diff for this recovery check. Android URL opens infer the foreground package for logs/perf when possible.', 'Install flows: install/install-from-source first, then open the installed id with --relaunch.', - 'Text: fill \'id="field-email"\' "qa@example.com" replaces; type appends after press.', + 'Text fields: use fill --settle to replace a field value. Use type only to append after focusing a field with press.', 'Clearing text: do not use fill ""; use a visible clear/reset control or report that clearing is unsupported.', 'Android IME capture: if fill says input was captured by the keyboard/IME, inspect keyboard state and switch/disable handwriting before retrying; do not loop fill/type.', 'Implicit default sessions are scoped to the current worktree; if a prompt names a Session, include --session on every command in that flow.', @@ -168,6 +168,7 @@ Loop: Targets: Prefer refs from the latest snapshot -i or settled diff. Use durable selectors when the label/id is known: label="Search", id="submit", role=button label="Follow". + For text fields, use fill --settle to replace the field value; use type only to append to an already-focused field. Do not use placeholders such as @ref, @eN,