Skip to content

Commit 6a91ecb

Browse files
fix: linting
Co-authored-by: Srinivasan Sekar <srinivasan.sekar1990@gmail.com>
1 parent 0a3a222 commit 6a91ecb

5 files changed

Lines changed: 77 additions & 38 deletions

File tree

.agents/skills/use-appclaw-agent-cli/SKILL.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ rather than a YAML flow:
2525

2626
**Always use `scroll`, never `swipe`.** `scroll` and `swipe` are aliases in the parser, but `scroll` reads unambiguously — `scroll down` means scroll down, `scroll up` means scroll up.
2727

28-
| Goal | Command |
29-
|---|---|
30-
| See content **below** (scroll down) | `appclaw-agent --session <name> scroll down --json` |
31-
| See content **above** (scroll up) | `appclaw-agent --session <name> scroll up --json` |
32-
| Scroll down within an element | `appclaw-agent --session <name> scroll @eN down --json` |
33-
| Scroll up within an element | `appclaw-agent --session <name> scroll @eN up --json` |
28+
| Goal | Command |
29+
| ----------------------------------- | ------------------------------------------------------- |
30+
| See content **below** (scroll down) | `appclaw-agent --session <name> scroll down --json` |
31+
| See content **above** (scroll up) | `appclaw-agent --session <name> scroll up --json` |
32+
| Scroll down within an element | `appclaw-agent --session <name> scroll @eN down --json` |
33+
| Scroll up within an element | `appclaw-agent --session <name> scroll @eN up --json` |
3434

3535
**Never use `swipe`**`swipe up` is ambiguous (training data says it scrolls down; AppClaw treats it as scroll up). Using `scroll` eliminates the confusion entirely.
3636

37-
**Never use `swipe @eN direction`** — element-scoped swipe crashes (`swipeElement is not a function`). Use `scroll @eN direction` instead.
38-
7. Close the named session when the task is complete.
37+
**Never use `swipe @eN direction`** — element-scoped swipe crashes (`swipeElement is not a function`). Use `scroll @eN direction` instead. 7. Close the named session when the task is complete.
3938

4039
## Assertions must always be visual
4140

4241
**Never use DOM presence (`is visible`, snapshot element checks) as the sole assertion.** The DOM may contain elements that are off-screen, scrolled out of view, or clipped — DOM presence does not mean the user can see it.
4342

4443
For every assertion or verification step:
44+
4545
1. Take a screenshot: `appclaw-agent --session <name> screenshot /tmp/<name>.png`
4646
2. Read the screenshot image with the Read tool and visually analyze what is actually rendered on screen.
4747
3. Base your pass/fail verdict **only on what you can see in the screenshot**, not on DOM presence.
@@ -50,4 +50,3 @@ For every assertion or verification step:
5050
This applies to any check phrased as "verify X is present", "confirm X appears", "assert X is visible", or similar.
5151

5252
The installed CLI help is the source of truth for supported commands.
53-

landing/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,8 +1853,11 @@ <h1 class="reveal reveal-delay-1">
18531853
<p class="run-surface-text">
18541854
<a href="https://www.npmjs.com/package/appclaw" target="_blank" rel="noopener">CLI</a>
18551855
(<code>npx appclaw</code>) for terminals and CI,
1856-
<a href="https://www.npmjs.com/package/appclaw-agent" target="_blank" rel="noopener">Agent CLI</a>
1857-
(<code>npm i -g appclaw-agent</code>) for AI coding agents like Claude Code and Gemini CLI, or the
1856+
<a href="https://www.npmjs.com/package/appclaw-agent" target="_blank" rel="noopener"
1857+
>Agent CLI</a
1858+
>
1859+
(<code>npm i -g appclaw-agent</code>) for AI coding agents like Claude Code and Gemini
1860+
CLI, or the
18581861
<a
18591862
href="https://marketplace.visualstudio.com/items?itemName=AppClaw.appclaw"
18601863
target="_blank"
@@ -2330,7 +2333,8 @@ <h2 class="reveal reveal-delay-1">Ready to automate your<br />mobile apps?</h2>
23302333
</a>
23312334
</div>
23322335
<div class="cta-meta reveal">
2333-
CLI<span>·</span>Agent CLI<span>·</span>Cursor &amp; VS Code<span>·</span>Apache 2.0<span>·</span>BYO LLM Key
2336+
CLI<span>·</span>Agent CLI<span>·</span>Cursor &amp; VS Code<span>·</span>Apache
2337+
2.0<span>·</span>BYO LLM Key
23342338
</div>
23352339
</div>
23362340
</section>

landing/usage.html

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,7 +3745,9 @@ <h3>Tips for writing good guides</h3>
37453745
<!-- AGENT CLI -->
37463746
<!-- ============================================ -->
37473747
<section id="agent-cli-overview" class="reveal">
3748-
<h2>Agent CLI <code style="font-size:0.7em;vertical-align:middle">appclaw-agent</code></h2>
3748+
<h2>
3749+
Agent CLI <code style="font-size: 0.7em; vertical-align: middle">appclaw-agent</code>
3750+
</h2>
37493751
<p>
37503752
<code>appclaw-agent</code> is a deterministic terminal CLI designed for AI coding agents
37513753
— Claude Code, Gemini CLI, Codex CLI, and any agent with terminal access. It exposes
@@ -3757,8 +3759,8 @@ <h2>Agent CLI <code style="font-size:0.7em;vertical-align:middle">appclaw-agent<
37573759
<div class="callout-title">Who this is for</div>
37583760
<p>
37593761
Use <code>appclaw-agent</code> when an AI coding agent needs to drive a mobile device
3760-
as part of a larger task — writing a test, verifying a UI, or exploring an app.
3761-
The agent issues terminal commands; AppClaw handles the device session.
3762+
as part of a larger task — writing a test, verifying a UI, or exploring an app. The
3763+
agent issues terminal commands; AppClaw handles the device session.
37623764
</p>
37633765
</div>
37643766

@@ -3804,7 +3806,9 @@ <h3>How it compares</h3>
38043806
<section id="agent-cli-install" class="reveal">
38053807
<div class="section-breadcrumb">Agent CLI <span>/</span> Installation</div>
38063808
<h2>Installation</h2>
3807-
<p>Install globally so <code>appclaw-agent</code> is available in any terminal session.</p>
3809+
<p>
3810+
Install globally so <code>appclaw-agent</code> is available in any terminal session.
3811+
</p>
38083812

38093813
<div class="code-block">
38103814
<div class="code-block-header">
@@ -3842,8 +3846,8 @@ <h2>Installation</h2>
38423846
<div class="section-breadcrumb">Agent CLI <span>/</span> Workflow</div>
38433847
<h2>Workflow</h2>
38443848
<p>
3845-
Every session follows the same five-step pattern. Re-snapshot after every
3846-
state-changing action — refs are invalidated when the screen changes.
3849+
Every session follows the same five-step pattern. Re-snapshot after every state-changing
3850+
action — refs are invalidated when the screen changes.
38473851
</p>
38483852

38493853
<div class="code-block">
@@ -3904,7 +3908,10 @@ <h2>Command Reference</h2>
39043908
<h3>Session management</h3>
39053909
<table class="cmd-table">
39063910
<thead>
3907-
<tr><th>Command</th><th>Description</th></tr>
3911+
<tr>
3912+
<th>Command</th>
3913+
<th>Description</th>
3914+
</tr>
39083915
</thead>
39093916
<tbody>
39103917
<tr>
@@ -3925,7 +3932,10 @@ <h3>Session management</h3>
39253932
<h3>Inspection</h3>
39263933
<table class="cmd-table">
39273934
<thead>
3928-
<tr><th>Command</th><th>Description</th></tr>
3935+
<tr>
3936+
<th>Command</th>
3937+
<th>Description</th>
3938+
</tr>
39293939
</thead>
39303940
<tbody>
39313941
<tr>
@@ -3946,7 +3956,10 @@ <h3>Inspection</h3>
39463956
<h3>Interaction</h3>
39473957
<table class="cmd-table">
39483958
<thead>
3949-
<tr><th>Command</th><th>Description</th></tr>
3959+
<tr>
3960+
<th>Command</th>
3961+
<th>Description</th>
3962+
</tr>
39503963
</thead>
39513964
<tbody>
39523965
<tr>
@@ -3971,21 +3984,33 @@ <h3>Interaction</h3>
39713984
<h3>Hardware keys</h3>
39723985
<table class="cmd-table">
39733986
<thead>
3974-
<tr><th>Command</th><th>Description</th></tr>
3987+
<tr>
3988+
<th>Command</th>
3989+
<th>Description</th>
3990+
</tr>
39753991
</thead>
39763992
<tbody>
3977-
<tr><td><code>back --json</code></td><td>Press the hardware Back button</td></tr>
3978-
<tr><td><code>home --json</code></td><td>Press the hardware Home button</td></tr>
3979-
<tr><td><code>enter --json</code></td><td>Press the Enter / Return key</td></tr>
3993+
<tr>
3994+
<td><code>back --json</code></td>
3995+
<td>Press the hardware Back button</td>
3996+
</tr>
3997+
<tr>
3998+
<td><code>home --json</code></td>
3999+
<td>Press the hardware Home button</td>
4000+
</tr>
4001+
<tr>
4002+
<td><code>enter --json</code></td>
4003+
<td>Press the Enter / Return key</td>
4004+
</tr>
39804005
</tbody>
39814006
</table>
39824007

39834008
<div class="callout callout-tip">
39844009
<div class="callout-title">Always re-snapshot after interaction</div>
39854010
<p>
39864011
Any command that changes screen state (<code>press</code>, <code>fill</code>,
3987-
<code>scroll</code>, hardware keys) invalidates all current <code>@eN</code> refs.
3988-
Run <code>snapshot -i --json</code> again before referencing elements.
4012+
<code>scroll</code>, hardware keys) invalidates all current <code>@eN</code> refs. Run
4013+
<code>snapshot -i --json</code> again before referencing elements.
39894014
</p>
39904015
</div>
39914016
</section>
@@ -4020,7 +4045,11 @@ <h3>Stable selectors</h3>
40204045
</p>
40214046
<table class="cmd-table">
40224047
<thead>
4023-
<tr><th>Kind</th><th>Syntax</th><th>Best for</th></tr>
4048+
<tr>
4049+
<th>Kind</th>
4050+
<th>Syntax</th>
4051+
<th>Best for</th>
4052+
</tr>
40244053
</thead>
40254054
<tbody>
40264055
<tr>
@@ -4098,7 +4127,11 @@ <h3>Visual assertions vs DOM checks</h3>
40984127
</p>
40994128
<table class="cmd-table">
41004129
<thead>
4101-
<tr><th>Method</th><th>What it checks</th><th>Use when</th></tr>
4130+
<tr>
4131+
<th>Method</th>
4132+
<th>What it checks</th>
4133+
<th>Use when</th>
4134+
</tr>
41024135
</thead>
41034136
<tbody>
41044137
<tr>

packages/appclaw-agent/src/cli.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { helpText, VERSION, workflowText } from './help.js';
33
import { parseInvocation } from './parser.js';
44

55
const c = {
6-
reset: '\x1b[0m',
7-
bold: '\x1b[1m',
8-
dim: '\x1b[2m',
9-
green: '\x1b[32m',
10-
red: '\x1b[31m',
11-
cyan: '\x1b[36m',
12-
yellow: '\x1b[33m',
6+
reset: '\x1b[0m',
7+
bold: '\x1b[1m',
8+
dim: '\x1b[2m',
9+
green: '\x1b[32m',
10+
red: '\x1b[31m',
11+
cyan: '\x1b[36m',
12+
yellow: '\x1b[33m',
1313
magenta: '\x1b[35m',
1414
};
1515

1616
function colorOutput(session: string | undefined, ok: boolean, message: string, output?: string) {
1717
const icon = ok ? `${c.green}${c.reset}` : `${c.red}${c.reset}`;
18-
const tag = session ? ` ${c.cyan}[${session}]${c.reset}` : '';
18+
const tag = session ? ` ${c.cyan}[${session}]${c.reset}` : '';
1919
if (output) process.stdout.write(`${c.dim}${output}${c.reset}\n`);
2020
process.stdout.write(`${icon}${tag} ${message}\n`);
2121
}

packages/appclaw-agent/src/runtime-contract.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ declare module 'appclaw/agent-runtime' {
5454
fill(target: AgentTarget, text: string): Promise<AgentActionResult>;
5555
longpress(target: AgentTarget, duration?: number): Promise<AgentActionResult>;
5656
swipe(direction: 'up' | 'down' | 'left' | 'right'): Promise<AgentActionResult>;
57-
swipeElement(target: AgentTarget, direction: 'up' | 'down' | 'left' | 'right'): Promise<AgentActionResult>;
57+
swipeElement(
58+
target: AgentTarget,
59+
direction: 'up' | 'down' | 'left' | 'right'
60+
): Promise<AgentActionResult>;
5861
pressKey(key: 'BACK' | 'HOME' | 'ENTER'): Promise<AgentActionResult>;
5962
getText(target: AgentTarget): Promise<AgentActionResult>;
6063
getAttrs(target: AgentTarget): Promise<AgentActionResult>;

0 commit comments

Comments
 (0)