basic-skill
CloudPhone plugin workflows for device management and AI Agent task execution. Use cloudphone_execute to submit natural language instructions and cloudphone_task_result to stream results. The backend handles the full automation loop.
git clone https://github.com/whateverai-ai/cloudphone
T=$(mktemp -d) && git clone --depth=1 https://github.com/whateverai-ai/cloudphone "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/basic-skill" ~/.claude/skills/whateverai-ai-cloudphone-basic-skill && rm -rf "$T"
skills/basic-skill/SKILL.mdBasic Skill
This skill is intended for OpenClaw agents that already have the
cloudphone plugin installed and enabled.
It does not add new tools. Its role is to teach the agent:
- when to call each
toolcloudphone_* - how to combine
andcloudphone_execute
for end-to-end automationcloudphone_task_result - how to handle task failures and errors
- where the boundaries of the current toolset are
When to Use This Skill
Prefer this skill for requests such as:
- the user wants to see which cloud phone devices are available
- the user wants device details or status information
- the user wants the agent to complete any multi-step automation task on a cloud phone by natural language
Preconditions
Before calling any tool, confirm the following:
- The
plugin is enabled.cloudphone
exists inplugins.entries.cloudphone.config
.openclaw.json
is configured and valid.apikey
If the user reports that the tools are missing, ask them to verify that the plugin is enabled and restart the Gateway.
Installation and Troubleshooting
Basic Checks
Check these configuration items first:
should beplugins.entries.cloudphone.enabledtrueplugins.entries.cloudphone.config.apikey
Common Errors
or authorization failure:401
is usually invalid, expired, or missing.apikey
: wrong or unreachable API endpoint — often a custom404
or deployment issue.baseUrl
,timeout
, or request timeout: usually network latency, service load, or temporary unavailability. Try increasingAbortError
intimeout_ms
.cloudphone_task_result- Task status
: the backend AI Agent encountered an unrecoverable error. Check the"error"
field and consider retrying with a clearer instruction.message
Tool Groups
Device Management
cloudphone_get_user_profilecloudphone_list_devicescloudphone_get_device_info
AI Agent Task Execution
— submit a natural language instruction, get acloudphone_execute
immediatelytask_id
— stream agent thinking and wait for the final resultcloudphone_task_result
Standard Workflow
Use this default pattern for all automation tasks:
select_device → execute_instruction → stream_result
1. Select a Device
If the user did not provide a clear device identifier:
- Call
first.cloudphone_list_devices - Identify the target device from the results.
- Note the
field — this is whatdevice_id
expects.cloudphone_execute
If more detail is needed, call
cloudphone_get_device_info with user_device_id.
2. Execute the Instruction
Call
cloudphone_execute with:
: a clear natural language description of the taskinstruction
: the target device'sdevice_iddevice_id
:lang
(default) or"cn"
depending on the instruction language"en"
cloudphone_execute( instruction = "打开微信,在搜索框输入 OpenClaw 并进入该公众号", device_id = "abc123" ) → { ok: true, task_id: 42 }
Writing good instructions:
- Be specific about the app, target page, and action
- Include the goal, not just the steps: "搜索并关注 OpenClaw 公众号" is better than "打开微信然后点击搜索"
- Use
when the instruction is in Englishlang: "en"
3. Stream the Result
Call
cloudphone_task_result with the task_id returned by cloudphone_execute:
cloudphone_task_result(task_id = 42) → { ok: true, status: "done", thinking: ["Step 1: Launch WeChat...", "Step 2: Tap search..."], result: { ... } }
You MUST wait for
to return before doing anything else. The tool is blocking — it subscribes to the SSE stream and does not return until the task reaches a terminal state (cloudphone_task_result
done, success, error, or timeout). Do not assume the task succeeded or failed until you receive the return value.
contains the backend agent's step-by-step reasoning.thinking
contains the final structured outcome from the backend.result
contains the agent's final action summary (human-readable).result.message
After receiving the result, always report back to the user before taking any further action.
If
status is "error", follow the Error Recovery procedure below.
If
status is "timeout", the tool has already retried automatically. If the task consistently times out, report to the user that the operation could not be completed.
Task Execution Strategy
Strict Rules — Must Follow for Every Task
These rules apply to the entire execution flow — from submission to result:
-
Only submit tasks the user explicitly asked for. Never autonomously add extra steps, follow-up actions, or supplementary operations that the user did not request.
-
Never include screenshot or screen-capture instructions. Instructions like "截图", "截屏", or "take a screenshot" will NOT return any image result through this plugin. The backend agent cannot relay screenshots back to the caller. These instructions waste time and produce no useful output.
-
Never submit duplicate tasks. Do not call
again for the same user request while a previous call is still being processed bycloudphone_execute
.cloudphone_task_result -
Always call
after everycloudphone_task_result
and wait for it to return. Never skip this step. Never assume success without a confirmed terminal status fromcloudphone_execute
.cloudphone_task_result -
Retry at most 2 times total. If a task returns
, you may retrystatus: "error"
with a revised instruction (max 2 retries). Ifcloudphone_execute
persists after the built-in retries, do not callstatus: "timeout"
again — report failure to the user instead.cloudphone_task_result -
Report failure explicitly after exhausting retries. Once you have reached the retry limit with no successful result, stop all automation and clearly tell the user: the operation failed, the reason (from
/message
), and optionally suggest a corrective action.thinking
Writing Effective Instructions
The backend AI Agent is driven by the natural language
instruction. Quality of the instruction directly affects task success rate.
Good patterns:
- Include the starting app: "打开抖音,搜索美食,点赞第一条视频"
- Include the goal state: "进入设置页面,关闭通知权限"
- Be specific about selection criteria: "选择评分最高的商品"
Avoid:
- Screenshot instructions: "截图当前屏幕" — use query-based instructions instead
- Vague instructions without a clear target: "做一些操作"
- Instructions that depend on unshared context: "点击刚才那个按钮"
Handling Long-Running Tasks
For tasks that may take more than 5 minutes, pass a larger
timeout_ms:
cloudphone_task_result(task_id = 42, timeout_ms = 600000)
The backend stream timeout is 300 seconds. If the task is expected to run longer than that, the backend will close the SSE stream before the task finishes. In this case, you would need to retry
cloudphone_task_result to reconnect to the stream.
Error Recovery
When status
is "error"
status"error"- Read the
andmessage
fields to understand what went wrong.thinking - Retry
with a revised instruction (more specific, different phrasing), then callcloudphone_execute
and wait for the result.cloudphone_task_result - If the device may be stuck or offline, call
to check its status.cloudphone_list_devices - After 2 retries (3 total attempts), stop immediately and tell the user the operation failed. Do not keep retrying indefinitely.
Failure report format:
"操作执行失败(尝试了 X 次)。错误信息:{message}。建议:{suggestion based on error type}"
When status
is "timeout"
status"timeout"The tool has already internally retried up to 2 times. After all retries are exhausted:
- Do not call
again for the same task.cloudphone_task_result - Tell the user the operation timed out and could not be confirmed.
- If the timeout seems too short for the task (e.g. a complex multi-step workflow), suggest the user retry with a larger
.timeout_ms
Timeout report format:
"操作超时,未能在规定时间内获取执行结果。云手机上的操作可能仍在进行,也可能已失败。建议稍后重试,或检查设备状态。"
Recommended Task Templates
Simple One-Shot Automation
1. cloudphone_list_devices → identify device_id 2. cloudphone_execute(instruction, device_id) → get task_id 3. [WAIT] cloudphone_task_result(task_id) → MUST wait for return 4a. status == "done"/"success" → report result to user 4b. status == "error" → retry up to 2 times (go to step 2 with revised instruction) 4c. status == "timeout" → report timeout failure to user, stop 4d. after 2 retries still fail → report failure to user, stop
With Explicit Device Check
1. cloudphone_list_devices → confirm device is online, get device_id 2. cloudphone_execute(instruction, device_id) → get task_id 3. [WAIT] cloudphone_task_result(task_id) → MUST wait for return 4a. ok == true → summarize result.message and thinking for the user 4b. ok == false → determine if retryable (error vs timeout) - error: retry cloudphone_execute (max 2 times total) then report - timeout: report timeout to user immediately, do not retry result stream
Capability Boundaries
The current plugin toolset provides:
- device listing, device details
- natural language task execution delegated to the backend AI Agent
- streaming task thinking and results via SSE
The backend AI Agent handles internally:
- screen observation and screenshot analysis
- LLM-based action planning
- UI interaction (tap, swipe, type, key events)
- multi-step observe → plan → act loops
The plugin does not expose direct low-level UI control tools. All automation goes through
cloudphone_execute.
Output Requirements
When replying to the user:
- Briefly state the current step (device lookup, task submission, result)
- Always wait for
to return before reporting any outcomecloudphone_task_result - If
returnscloudphone_task_result
orthinking
, summarize the key steps for the userresult.message - If all retries are exhausted with no success, explicitly tell the user the operation failed — include the reason from
/message
and a concrete suggestionthinking
Do not:
- pretend to know what happened on the device without calling
cloudphone_task_result - confuse
anduser_device_iddevice_id - call
multiple times for the same task before the first one completescloudphone_execute - silently retry beyond the 2-retry limit without telling the user what is happening
- report a task as "in progress" or "maybe succeeded" — either it succeeded (confirmed result) or it failed (tell the user)