xiaohongshu
xiaohongshu
moai-domain-adb
Comprehensive ADB (Android Debug Bridge) automation skill for game bot development, device management, computer vision integration, and Tauri-Python orchestration. Provides modular expertise for building intelligent Android automation workflows.
Full skill instructions
Tier 3 Modularized Skill for intelligent Android automation, game bot development, and real-time device orchestration.
| Domain | Capability | Module |
|---|---|---|
| Device Control | ADB connection, shell execution, property inspection | adb-fundamentals |
| Device Management | Multi-device orchestration, state tracking, lifecycle | device-management |
| Game Automation | Bot scripting, action sequences, timing control | game-automation |
| Vision & Detection | Template matching, OCR, region-based detection | computer-vision |
| Tauri Integration | UI-Python bridge, real-time communication, deployment | tauri-integration |
Device Operations
# Check device status
adb devices --list-long
# Execute shell command
adb shell input tap 540 960
# Get device property
adb shell getprop ro.build.version.sdk
# Install APK
adb install -r game.apk
Bot Control
# Start bot
adb shell am start -n com.game/.MainActivity
# Send input sequence
adb shell input tap x y && sleep 1 && adb shell input tap x2 y2
# Capture screenshot
adb shell screencap -p /sdcard/screen.png
Module Selection Guide
Use when you need to...
Understand ADB fundamentals: Load adb-fundamentals module
Manage multiple devices: Load device-management module
Develop game bots: Load game-automation module
Use vision for detection: Load computer-vision module
Integrate with Tauri UI: Load tauri-integration module
moai-domain-adb follows a 5-module progressive disclosure pattern:
moai-domain-adb/
├── SKILL.md # This file (documentation hub)
├── modules/
│ ├── adb-fundamentals.md # Level 1: Core ADB operations
│ ├── device-management.md # Level 2: Multi-device orchestration
│ ├── game-automation.md # Level 3: Bot development patterns
│ ├── computer-vision.md # Level 4: Vision-based detection
│ └── tauri-integration.md # Level 5: UI orchestration
└── scripts/ # IndieDevDan UV scripts
├── adb_device_analyzer.py # Analyze device capabilities
├── adb_bot_generator.py # Generate bot skeletons
├── adb_template_creator.py # Create action templates
├── adb_performance_profiler.py # Profile bot performance
├── adb_config_validator.py # Validate configurations
├── adb_game_tester.py # Test bot on devices
└── adb_deployment_helper.py # Deploy to production
✅ Modularized: 5 independent modules (no cross-module imports) ✅ Production-Ready: 500+ line SKILL.md with comprehensive docs ✅ Scripted: 7 UV scripts following IndieDevDan 13 rules ✅ Delegatable: Works with expert-* and manager-* agents ✅ Reusable: Applicable to any Android automation project
# Pattern 1: Load skill for general ADB knowledge
Skill("moai-domain-adb")
# Pattern 2: Load specific module for targeted expertise
# In agent prompt: "Use moai-domain-adb:adb-fundamentals for device operations"
# Pattern 3: Reference UV script for automated tasks
# Command: uv run .claude/skills/moai-domain-adb/scripts/adb_device_analyzer.py --device emulator-5554
With Agents:
adb-bot-runner: Executes bots using game-automation patternsadb-device-manager: Manages devices using device-management expertiseadb-game-tester: Tests bots using computer-vision and game-automationadb-config-manager: Validates configs using config-validator scriptadb-workflow-orchestrator: Coordinates all agents using tauri-integration patternsWith Commands:
/adb:init → Uses adb-fundamentals + adb_device_analyzer/adb:bot → Uses game-automation + adb_bot_generator/adb:test → Uses computer-vision + adb_game_tester/adb:deploy → Uses tauri-integration + adb_deployment_helperWith UV Scripts: All 7 scripts are self-contained (zero dependencies on each other), follow PEP 723, and implement dual output (human-readable + JSON).
Level 1: Getting Started
adb_device_analyzer.py to list devicesLevel 2: Multi-Device Workflows
Level 3: Game Bot Development
Level 4: Vision-Based Automation
Level 5: Production Orchestration
moai-domain-adb is designed for modular composition:
# Example 1: Simple device check
# Required: adb-fundamentals
agent = Task(
subagent_type="expert-backend",
prompt="Use moai-domain-adb:adb-fundamentals to list ADB devices"
)
# Example 2: Multi-device bot deployment
# Required: device-management + game-automation + tauri-integration
agent = Task(
subagent_type="adb-workflow-orchestrator",
prompt="Deploy game bot to 3 devices"
)
# Example 3: Vision-based testing
# Required: computer-vision + game-automation
agent = Task(
subagent_type="adb-game-tester",
prompt="Test bot with computer vision verification"
)
Device Batching:
adb_performance_profiler.py to identify bottlenecksCaching Strategies:
Concurrency:
Authentication:
Permissions:
su unless necessary)Data Protection:
Common Issues:
| Issue | Diagnosis | Solution |
|---|---|---|
| Device not found | adb_device_analyzer.py --check-connection | Verify USB connection, check ADB daemon |
| Slow bot execution | adb_performance_profiler.py --device <id> | Reduce click delays, batch operations |
| Template matching fails | Check image DPI/resolution | Run adb_template_creator.py --device <id> |
| OCR accuracy poor | Preprocess image (contrast, threshold) | See computer-vision module for tips |
| Tauri communication lag | Check Python process CPU | Reduce log verbosity, optimize render loop |
Debug Mode:
# Enable verbose logging
export ADB_DEBUG=1
uv run .claude/skills/moai-domain-adb/scripts/adb_device_analyzer.py --verbose
# Trace ADB commands
adb logcat | grep "adb_bot_runner"
Test Coverage Target: ≥85%
Test Execution:
# Run all tests
pytest tests/ -v --cov=.claude/skills/moai-domain-adb
# Run specific module tests
pytest tests/test_device_management.py -v
# Profile performance
pytest tests/ --benchmark-only
Each module builds upon previous knowledge but is independently usable:
adb-fundamentals (250 lines)
device-management (280 lines)
game-automation (300 lines)
computer-vision (270 lines)
tauri-integration (240 lines)
All scripts follow IndieDevDan 13 Rules (PEP 723, 9-section structure, dual output):
# Analyze device capabilities
uv run scripts/adb_device_analyzer.py --device emulator-5554 --json
# Generate bot skeleton
uv run scripts/adb_bot_generator.py --game "My Game" --output my_bot.py
# Create action template
uv run scripts/adb_template_creator.py --screenshot screen.png --region "0,0,1080,1920"
# Profile bot performance
uv run scripts/adb_performance_profiler.py --bot bot.py --iterations 100
# Validate configuration
uv run scripts/adb_config_validator.py --config config.yaml --strict
# Test bot on device
uv run scripts/adb_game_tester.py --bot bot.py --device emulator-5554
# Prepare deployment
uv run scripts/adb_deployment_helper.py --bot bot.py --target production
All scripts are located in scripts/ directory and organized by category. Each script supports:
--device/-d - Specify device ID (defaults to first connected)--toon - Output in TOON/YAML format for automation--verbose/-v - Enable verbose logging--help - Show detailed help and usage examplesSee scripts/README.md for comprehensive documentation with 150+ usage examples.
Location: scripts/connection/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_connect.py | Connect to device via IP:port | --device (default: 127.0.0.1:5555) | uv run scripts/connection/adb_connect.py |
adb_disconnect.py | Disconnect device gracefully | --device | uv run scripts/connection/adb_disconnect.py |
adb_restart_server.py | Restart ADB server | --verbose | uv run scripts/connection/adb_restart_server.py |
adb_device_status.py | List all devices and status | --toon | uv run scripts/connection/adb_device_status.py |
Location: scripts/screen/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_screenshot.py | Capture screenshot | --output FILE | uv run scripts/screen/adb_screenshot.py --output capture.png |
adb_tap.py | Tap at coordinates | --x X --y Y --count N | uv run scripts/screen/adb_tap.py --x 500 --y 1000 |
adb_swipe.py | Swipe gesture | --preset {up,down,left,right} or --start X,Y --end X,Y | uv run scripts/screen/adb_swipe.py --preset up |
adb_keyevent.py | Send key event | --key {back,home,menu,power,volume_up} | uv run scripts/screen/adb_keyevent.py --key back |
adb_text_input.py | Type text | --text TEXT | uv run scripts/screen/adb_text_input.py --text "Hello" |
adb_screenrecord.py | Record screen video | --output FILE --duration SECONDS | uv run scripts/screen/adb_screenrecord.py --duration 60 |
Location: scripts/app/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_app_list.py | List installed apps | --filter TEXT, --system, --all | uv run scripts/app/adb_app_list.py --filter afk |
adb_app_start.py | Start app by package | -p PACKAGE, --wait | uv run scripts/app/adb_app_start.py -p com.afk.journey |
adb_app_stop.py | Force stop app | -p PACKAGE | uv run scripts/app/adb_app_stop.py -p com.afk.journey |
adb_app_install.py | Install APK | --apk FILE | uv run scripts/app/adb_app_install.py --apk game.apk |
adb_app_uninstall.py | Uninstall app | -p PACKAGE, --keep-data | uv run scripts/app/adb_app_uninstall.py -p com.example |
Location: scripts/info/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_device_info.py | Device specifications | --toon | uv run scripts/info/adb_device_info.py |
adb_display_info.py | Display resolution/DPI | --toon | uv run scripts/info/adb_display_info.py |
adb_running_app.py | Current foreground app | --toon | uv run scripts/info/adb_running_app.py |
adb_battery_info.py | Battery status | --toon | uv run scripts/info/adb_battery_info.py |
Location: scripts/performance/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_cpu_monitor.py | Real-time CPU monitoring | --duration SECONDS, --package PKG | uv run scripts/performance/adb_cpu_monitor.py --duration 60 |
adb_memory_monitor.py | Memory usage monitoring | --duration SECONDS, --package PKG | uv run scripts/performance/adb_memory_monitor.py --duration 60 |
adb_logcat_filter.py | Filter logcat logs | --tag TAG, --priority {V,D,I,W,E,F}, --follow | uv run scripts/performance/adb_logcat_filter.py --tag MyApp --priority E |
Location: scripts/automation/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_game_loop.py | Execute repeating sequence | -s FILE, -l LOOPS, --infinite | uv run scripts/automation/adb_game_loop.py -s daily.json -l 10 |
adb_wait_for_app.py | Wait for app to start | --package PKG, --timeout SECONDS | uv run scripts/automation/adb_wait_for_app.py -p com.afk.journey |
adb_click_sequence.py | Execute sequence once | -s FILE | uv run scripts/automation/adb_click_sequence.py -s tutorial.json |
adb_screenshot_compare.py | Compare screenshots | -b BEFORE -a AFTER, --threshold FLOAT | uv run scripts/automation/adb_screenshot_compare.py -b ref.png -a test.png |
Location: scripts/utils/
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_shell.py | Execute shell commands | -c COMMAND, --timeout SECONDS | uv run scripts/utils/adb_shell.py -c "ls /sdcard" |
adb_push.py | Push file to device | -l LOCAL -r REMOTE | uv run scripts/utils/adb_push.py -l file.txt -r /sdcard/ |
adb_pull.py | Pull file from device | -r REMOTE -l LOCAL | uv run scripts/utils/adb_pull.py -r /sdcard/screenshot.png -l . |
Location: scripts/ (root level)
| Script | Purpose | Key Options | Example |
|---|---|---|---|
adb_bot_generator.py | Generate bot scripts | --template NAME, --output FILE | uv run scripts/adb_bot_generator.py --template daily_quests |
adb_config_validator.py | Validate configs | --config FILE, --strict | uv run scripts/adb_config_validator.py --config config.json |
adb_deployment_helper.py | Deploy to devices | --apk FILE, --all, --devices IDS | uv run scripts/adb_deployment_helper.py --apk game.apk --all |
adb_device_analyzer.py | Analyze capabilities | --aspects LIST, --output FILE | uv run scripts/adb_device_analyzer.py --aspects performance,battery |
adb_game_tester.py | Test game automation | --test-suite FILE, --screenshots | uv run scripts/adb_game_tester.py --test-suite tests.json |
adb_performance_profiler.py | Profile performance | --package PKG, --duration SECONDS | uv run scripts/adb_performance_profiler.py -p com.afk.journey |
adb_template_creator.py | Create templates | --name NAME, --category CAT | uv run scripts/adb_template_creator.py --name my_automation |
For adb_game_loop.py and adb_click_sequence.py, use JSON format:
{
"name": "Daily Quest Automation",
"steps": [
{"action": "tap", "x": 500, "y": 1000, "delay": 2},
{"action": "swipe", "start": [500, 1500], "end": [500, 500], "duration": 300},
{"action": "wait", "duration": 3},
{"action": "screenshot", "output": "/tmp/check.png"},
{"action": "keyevent", "key": "back"},
{"action": "text_input", "text": "Hello World"}
]
}
Supported Actions: tap, swipe, wait, screenshot, keyevent, text_input
All scripts use shared utilities from scripts/common/:
adb_utils.py - ADB device operations and connection managementcli_utils.py - Click decorators, Rich formatters, output helperserror_handlers.py - Standardized error handling and exit codes (0, 2, 3, 4)path_utils.py - Project root detection and path resolutionAll scripts use standardized exit codes:
Text Output (default): Rich-formatted console output with colors and tables
TOON Output (--toon): YAML/structured format for automation and parsing
Quick Links:
modules/scripts/ with --helptests/Context7 References:
Version: 1.0.0 Status: ✅ Production Ready (Phase 1 Foundation) Last Updated: 2025-12-01 Next Phase: Create 5 core modules + 7 UV scripts
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience