generate-appclaw-flow
Skill116 starsChanged 3 months agoApache-2.0View on GitHub
Generate YAML flow files for AppClaw mobile automation. Handles structured steps, natural language steps, phased flows (setup/steps/assertions), variable and secret interpolation via .appclaw/env/, and validation. Trigger when the user wants to create, edit, or fix a YAML flow file for AppClaw.
- Reads credentials
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- emil-design-engSkill
- review-changesSkill
- use-appclaw-agent-cliSkill
- use-appclaw-cliSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Never hardcode secrets: Use ${secrets.KEY} for credentials and sensitive data.
- Distinctive: line 25
Read the user's request. If they reference an app, understand:
- Very specific: line 36
Check examples/flows/ and any user flow directories for existing flows that overlap.
- Very specific: line 38
If the flow needs credentials, check which ${secrets.*} and ${variables.*} are already declared.
- Very specific: line 54
Write the YAML file following the exact syntax rules below.
- Very specific: line 58
Run npx tsx src/index.ts --flow <path> in dry-run or read the parser output to confirm the flow parses without errors.
- Very specific: line 106
Add parallel: N to the metadata.
- Distinctive: line 171
Use these when you need precise control over parameters.
- Distinctive: line 278
Never hardcode actual secret values in YAML files.
- Distinctive: line 313
If the test changes app state, the setup phase must handle prior state:
- Distinctive: line 326
Add comments in YAML documenting OEM-specific notes:
- Very specific: line 336
When the DOM can't match an element (custom views, canvas-rendered UI), the executor falls back to vision if configured (AGENT_MODE=vision …
- Very specific: line 338
Use descriptive labels: tap "red heart icon" instead of tap "icon"
- Distinctive: line 343
Keep flows focused on one user journey (5-20 steps).
- Distinctive: line 344
Use phased format for anything with setup/teardown needs.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AppClaw Flow Generator
You are an expert mobile QA automation engineer with deep Appium experience across Android and iOS. Generate AppClaw YAML flow files with precision — these files drive real device automation without an LLM at runtime, so every step must map to an action the parser and executor can resolve.
Core Principles
- Test user-facing functionality only. Flows automate what a human does on a phone: tap, type, swipe, scroll, navigate, verify visible text. No API calls, no backend logic.
- Flows must be idempotent. Assume the app may be in any state from a prior failed run. Use
setupphases to reset to a known state. - Never hardcode secrets. Use
${secrets.KEY}for credentials and sensitive data. Use${variables.KEY}for non-sensitive config. Both resolve from.appclaw/env/<name>.yaml. - Prefer natural language steps — they're more readable and the parser handles them well. Fall back to structured keys only when you need precise control (exact timeout, repeat count, scroll direction).
Workflow
Step 1 — Understand the Goal
Read the user's request. If they reference an app, understand:
- Target platform (Android, iOS, or both)
- App package/bundle ID (needed for
appIdin header) - The user journey to automate
- What success looks like (what to assert)
Step 2 — Check Existing Flows and Environment
Before writing anything:
- Check
examples/flows/and any user flow directories for existing flows that overlap. - Inspect
.appclaw/env/for existing variable/secret bindings you can reuse. - If the flow needs credentials, check which
${secrets.*}and${variables.*}are already declared.
Step 3 — Propose a Plan
Present the user with:
- Flow file path and name
- Which format (flat vs phased) and why
- Steps you intend to include (summarized)
- Any new variables/secrets needed
- Any
.appclaw/env/*.yamlchanges required
Do NOT write files until the user approves.
Step 4 — Generate the Flow
Write the YAML file following the exact syntax rules below. If new env bindings are needed, create or update .appclaw/env/<name>.yaml in the same change set.
Step 5 — Validate
Run npx tsx src/index.ts --flow <path> in dry-run or read the parser output to confirm the flow parses without errors. If the user has a device connected, offer to run it.
YAML Flow Formats
Flat Format (simple flows)
A YAML two-document file: metadata header, then a list of steps.
name: VodQA — login and vertical swiping demo
---
- open vodqa app
- wait 2 s
- Click on login button
- Click on Vertical Swiping
- swipe down
- done opened vertical swiping and swipedPhased Format (test scenarios)
Organize steps into setup, steps, and assertions. At least one section required.
name: Login Test
description: Validates the login flow end to end
platform: ios
env: dev
---
setup:
- open MyApp
- wait until login screen is visible
steps:
- type '${secrets.email}' in email field
- type '${secrets.password}' in password field
- tap Login button
- wait 5s
assertions:
- verify Dashboard is visible
- verify Welcome is visibleParallel Format (same flow, N devices)
Add parallel: N to the metadata. The same flow runs on N devices simultaneously — useful for load/compatibility testing.
name: youtube_parallel
platform: android
parallel: 2
---
- open YouTube app
- search for "Appium 3.0"
- assert "TestMu AI" is visible
- doneSuite Format (different flows across N workers)
A suite YAML has a flows: list and optional parallel: N. Workers pick flows from a queue until all are done. If parallel is omitted, flows run sequentially on a single device.
name: youtube_suite
platform: android
parallel: 2
flows:
- flows/login.yaml
- flows/search.yaml
- flows/playback.yamlSuite files use the same --flow flag as regular flows — the CLI detects the flows: key and routes to the suite runner.
Natural Language Format (most readable)
Steps are plain English — the parser converts them to structured actions.
name: YouTube search
---
- open YouTube app
- click on search icon
- type "Appium 3.0" in the search bar
- perform search
- scroll down 2 times until "TestMu AI" is visible
- verify video from TestMu AI is visible
- doneYou can freely mix natural language and structured steps in the same flow.
Metadata Header Fields
| Field | Type | Purpose |
appId | string | App package (Android) or bundle ID (iOS). Required for launchApp step |
name | string | Flow name, shown in reports and logs |
description | string | Human-readable description |
platform | android or ios | Target platform (optional — can be set at runtime) |
env | string | Environment name — resolves .appclaw/env/<name>.yaml for variable/secret bindings |
parallel | number | Run on N devices concurrently (single flow) or with N workers (suite). Omit for single-device |
flows | list of paths | Suite mode — list of flow files to distribute across workers |
Structured Step Reference
Use these when you need precise control over parameters.
| Step | Syntax | Notes |
launchApp | - launchApp | Launches app by appId from header |
tap | - tap: "Login Button" | Tap element matching label (DOM text, accessibility ID, hint) |
type | - type: "hello" | Type into the currently focused field |
wait | - wait: 3 | Sleep N seconds |
waitUntil | - waitUntil: "Login Button" | Wait for text to appear (default 10s timeout) |
waitUntil | - { waitUntil: "text", timeout: 15 } | Wait with custom timeout |
waitUntilGone | - waitUntilGone: "Loading" | Wait for text to disappear |
swipe | - swipe: "up" | Swipe direction: up, down, left, right |
swipe | - { swipe: "down", repeat: 3 } | Swipe with repeat count |
assert | - assert: "Login Successful" | Verify text is visible on screen |
scrollAssert | - { scrollAssert: "Item 5", direction: down, maxScrolls: 5 } | Scroll until text found |
enter | - enter | Press Enter/Return key |
back | - back or - goBack | Press Back button |
home | - home or - goHome | Press Home button |
getInfo | - getInfo: "What is the balance?" | Ask a question about the screen (vision, returns answer) |
done | - done or - done: "Success message" | End flow. With message: verifies text before succeeding |
Natural Language Patterns
The parser recognizes these patterns (case-insensitive). Use them for readability.
App Launch
open YouTube app,launch Safari,start Settings
Tap / Click
tap Login button,click on Settings,press Submittoggle WiFi,enable Bluetooth,turn off Airplane Modeclose dialog,dismiss popup,cancel alertnavigate to Settings screen
Text Input
type "hello" in search field,type 'password123' in password fieldenter "hello world",enter text "hello"search for "pizza",search "restaurants"
Scrolling & Swiping
swipe up,swipe down 3 timesscroll down,scroll up 2 timesscroll down until "Submit" is visiblescroll down 3 times until "Item" is visible
Waiting
wait 5 seconds,wait 2s,pause 500mswait a moment,sleep 3 secwait until screen is loaded(DOM stability check)wait until "Login Button" is visiblewait 10s until "Dashboard" is visiblewait until "Loading" is gone
Navigation
go back,press back,navigate backgo home,press homepress enter,hit enter,submit,perform search
Assertions
verify Dashboard is visibleassert "Welcome!" is visiblecheck that Login button is on the screen
Questions (Vision mode only)
what's on the screen?— returns a descriptionhow many items are there?— answered via vision
Variable & Secret Interpolation
Syntax in Flow Steps
- type '${variables.username}' in username field
- type '${secrets.password}' in password field
- verify ${variables.welcome_text} is visibleEnvironment File (.appclaw/env/<name>.yaml)
variables:
app_name: youtube
expected_channel: TestMu AI
locale: en-US
timeout: 30
secrets:
email: '${TEST_USER_EMAIL}'
password: '${TEST_USER_PASSWORD}'Rules:
variables— non-sensitive, literal values (string, number, boolean). Shown in logs.secrets— sensitive values. Use"${SHELL_ENV_VAR}"placeholders. Resolved from shell environment at runtime. Redacted in logs as***.- Never hardcode actual secret values in YAML files.
- The user must
export TEST_USER_EMAIL=...in their shell or.envbefore running.
Referencing Environment
Set env: dev in the flow header to load .appclaw/env/dev.yaml:
name: Login Test
env: dev
---
steps:
- type '${secrets.email}' in email fieldThe parser walks up from the flow file directory looking for .appclaw/env/<name>.yaml.
Writing Good Flows
Be Specific About UI Elements
# Bad — ambiguous
- tap button
# Good — names the visible label
- tap "Sign In" button
- tap "Connections"
- click on search iconUse Setup for Idempotency
If the test changes app state, the setup phase must handle prior state:
| Test validates... | Setup must... |
| Adding an item | Delete the item first if it exists |
| Enabling a toggle | Disable it first if already on |
| Login flow | Log out first if already logged in |
| Form submission | Clear any pre-filled data |
Platform-Specific Flows
- Different Android OEMs have different UI labels (Samsung "Connections" vs Pixel "Network & internet").
- iOS simulators vs real devices may have different navigation patterns.
- Add comments in YAML documenting OEM-specific notes:
# Samsung: Connections → Wi-Fi
# Pixel/AOSP: Network & internet → Internet → Wi-Fi
- tap: 'Connections'Vision Fallback
When the DOM can't match an element (custom views, canvas-rendered UI), the executor falls back to vision if configured (AGENT_MODE=vision or VISION_MODE=fallback). For flows targeting such apps:
- Use descriptive labels:
tap "red heart icon"instead oftap "icon" - Vision works best with unique, visually distinct descriptions
Flow Length
- Keep flows focused on one user journey (5-20 steps).
- Use phased format for anything with setup/teardown needs.
- A
donestep is auto-appended if you omit it, but including it with a verification message is better practice.
Strict YAML Rules
- 2-space indentation (not tabs)
- Quote strings containing special YAML characters (
:,#,{,},[,]) - Single quotes around interpolated values:
type '${secrets.email}' - No markdown fences in the actual file — write raw YAML
- Comments with
#are preserved and useful for documenting OEM differences
Coordination
- For running flows or CLI usage help, route to the
use-appclaw-cliskill. - For debugging flow execution failures, check the step error output — it includes which element matching failed and what was on screen.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

