agentleFS
appclawhqappclawhq/AppClaw/.agents/skills/generate-appclaw-flow/SKILL.md

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

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
  1. Very specific:

    Never hardcode secrets: Use ${secrets.KEY} for credentials and sensitive data.

    line 18
  2. Distinctive:

    Read the user's request. If they reference an app, understand:

    line 25
  3. Very specific:

    Check examples/flows/ and any user flow directories for existing flows that overlap.

    line 36
  4. Very specific:

    If the flow needs credentials, check which ${secrets.*} and ${variables.*} are already declared.

    line 38
  5. Very specific:

    Write the YAML file following the exact syntax rules below.

    line 54
  6. Very specific:

    Run npx tsx src/index.ts --flow <path> in dry-run or read the parser output to confirm the flow parses without errors.

    line 58
  7. Very specific:

    Add parallel: N to the metadata.

    line 106
  8. Distinctive:

    Use these when you need precise control over parameters.

    line 171
  9. Distinctive:

    Never hardcode actual secret values in YAML files.

    line 278
  10. Distinctive:

    If the test changes app state, the setup phase must handle prior state:

    line 313
  11. Distinctive:

    Add comments in YAML documenting OEM-specific notes:

    line 326
  12. Very specific:

    When the DOM can't match an element (custom views, canvas-rendered UI), the executor falls back to vision if configured (AGENT_MODE=vision …

    line 336
  13. Very specific:

    Use descriptive labels: tap "red heart icon" instead of tap "icon"

    line 338
  14. Distinctive:

    Keep flows focused on one user journey (5-20 steps).

    line 343
  15. Distinctive:

    Use phased format for anything with setup/teardown needs.

    line 344

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 setup phases 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 appId in header)
  • The user journey to automate
  • What success looks like (what to assert)

Step 2 — Check Existing Flows and Environment

Before writing anything:

  1. Check examples/flows/ and any user flow directories for existing flows that overlap.
  2. Inspect .appclaw/env/ for existing variable/secret bindings you can reuse.
  3. 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/*.yaml changes 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 swiped

Phased 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 visible

Parallel 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
- done

Suite 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.yaml

Suite 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
- done

You can freely mix natural language and structured steps in the same flow.


Metadata Header Fields

FieldTypePurpose
appIdstringApp package (Android) or bundle ID (iOS). Required for launchApp step
namestringFlow name, shown in reports and logs
descriptionstringHuman-readable description
platformandroid or iosTarget platform (optional — can be set at runtime)
envstringEnvironment name — resolves .appclaw/env/<name>.yaml for variable/secret bindings
parallelnumberRun on N devices concurrently (single flow) or with N workers (suite). Omit for single-device
flowslist of pathsSuite mode — list of flow files to distribute across workers

Structured Step Reference

Use these when you need precise control over parameters.

StepSyntaxNotes
launchApp- launchAppLaunches 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: 3Sleep 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- enterPress Enter/Return key
back- back or - goBackPress Back button
home- home or - goHomePress 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 Submit
  • toggle WiFi, enable Bluetooth, turn off Airplane Mode
  • close dialog, dismiss popup, cancel alert
  • navigate to Settings screen

Text Input

  • type "hello" in search field, type 'password123' in password field
  • enter "hello world", enter text "hello"
  • search for "pizza", search "restaurants"

Scrolling & Swiping

  • swipe up, swipe down 3 times
  • scroll down, scroll up 2 times
  • scroll down until "Submit" is visible
  • scroll down 3 times until "Item" is visible

Waiting

  • wait 5 seconds, wait 2s, pause 500ms
  • wait a moment, sleep 3 sec
  • wait until screen is loaded (DOM stability check)
  • wait until "Login Button" is visible
  • wait 10s until "Dashboard" is visible
  • wait until "Loading" is gone

Navigation

  • go back, press back, navigate back
  • go home, press home
  • press enter, hit enter, submit, perform search

Assertions

  • verify Dashboard is visible
  • assert "Welcome!" is visible
  • check that Login button is on the screen

Questions (Vision mode only)

  • what's on the screen? — returns a description
  • how 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 visible

Environment 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 .env before 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 field

The 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 icon

Use Setup for Idempotency

If the test changes app state, the setup phase must handle prior state:

Test validates...Setup must...
Adding an itemDelete the item first if it exists
Enabling a toggleDisable it first if already on
Login flowLog out first if already logged in
Form submissionClear 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 of tap "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 done step 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-cli skill.
  • For debugging flow execution failures, check the step error output — it includes which element matching failed and what was on screen.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.