Skip to content

Skills Overview

The skill system is the formal abstraction layer for Android automation. A Skill packages everything needed to automate a specific app into a reusable, shareable unit.

UI locators defined in elements.yaml. Each element has a fallback chain of locator strategies tried in order:

content_desc -> text -> resource_id -> class_name -> absolute coordinates (x, y)

If the first locator fails (e.g., a resource_id changed after an app update), the system falls back to the next one. This makes skills resilient to minor app updates.

Atomic operations that perform a single ADB interaction. Each action has:

  • precondition() — verify the device is in the expected state before executing
  • execute() — perform the ADB operation (tap, swipe, type, etc.)
  • postcondition() — verify the action succeeded
  • rollback() — undo the action on failure (optional)
  • run() — orchestrates: precondition -> execute (with retry) -> postcondition

Actions retry up to max_retries times (default 2) with retry_delay (default 1.0s) between attempts.

Composed sequences of actions that execute in order. If any action fails, the workflow stops immediately and reports which step failed.

The top-level container. A skill loads from a directory containing skill.yaml (metadata), elements.yaml (UI locators), and Python files for actions and workflows.

Skill (skill.yaml + elements.yaml)
|-- Elements (elements.yaml)
| \-- Element: name -> {content_desc, text, resource_id, class_name, x, y}
| \-- find(device, xml) -> (cx, cy) | None
|
|-- Actions (actions/*.py)
| |-- precondition() -> verify device state
| |-- execute() -> perform ADB operation -> ActionResult
| |-- postcondition() -> verify success
| \-- rollback() -> undo on failure
|
\-- Workflows (workflows/*.py)
\-- steps() -> [Action, Action, ...]
\-- run() -> execute all, stop on first failure
SkillAppActionsWorkflowsElementsStatus
tiktokTikTok (v44.3.3)13941Fully implemented
_baseAny app900Shared utilities
instagramInstagram000Skeleton only
ActionDescription
open_appForce-stop + relaunch TikTok
navigate_to_profileTap Profile tab in bottom nav
tap_searchOpen search screen
type_and_searchType query + press Enter
dismiss_popupDismiss known TikTok popups
like_postDouble-tap center to like
comment_on_postOpen comments, type, send
follow_userTap Follow button
scroll_feedSwipe up to next video
tap_userTap user row in search results
tap_message_buttonTap Message on profile
type_messageType text in DM input
tap_sendSend the DM
WorkflowDescription
upload_video43-step video upload flow
crawl_hashtagSearch hashtag, scrape creators
crawl_usersSearch users tab, scrape profiles
send_dmSearch user, open profile, send DM
engage_fypScroll FYP, like/comment/follow
scan_inboxScan DM inbox for replies
scrape_analyticsScrape post performance metrics
continuous_scrapeLong-running crawl with auto-restart
publish_draftFind and publish a saved draft

The _base skill provides 9 shared actions usable by any app: tap, swipe, type, wait, back, home, launch app, take screenshot, and press enter.

from marketing_system.skills.tiktok import load
from marketing_system.bots.common.adb import Device
dev = Device()
skill = load()
# Inspect
print(skill.name) # 'tiktok'
print(skill.app_package) # 'com.zhiliaoapp.musically'
print(skill.list_actions()) # ['open_app', 'navigate_to_profile', ...]
print(skill.list_workflows()) # ['upload_video', 'crawl_hashtag', ...]
# Run an action
action = skill.get_action("open_app", dev)
result = action.run()
print(result.success, result.duration_ms)
# Run a workflow
wf = skill.get_workflow("engage_fyp", dev, duration=60)
result = wf.run()