# How to Use Flutter Skill
> **One prompt. One shot. Your AI tests the entire app.** ๐ฅ
>
> Inspired by the "AI skills" workflow โ give your AI agent the flutter-skill, and it can see, interact with, and test any running app.
---
## โก 30-Second Setup
```bash
# 1. Install
npm install -g flutter-skill
# 2. Init your project (auto-detects framework & patches your app)
cd your-app/
flutter-skill init
# 3. Add to your AI's MCP config
```
```json
{
"mcpServers": {
"flutter-skill": {
"command": "flutter-skill",
"args": ["server"]
}
}
}
```
**Done.** Your AI can now see and control your app.
---
## ๐ฌ One Prompt, Full Test
Just tell your AI what to test. No test code. No selectors. No boilerplate.
### Example 1: Test Login Flow
**You say:**
> "Launch my app, test the login with test@example.com and password123, verify it reaches the dashboard"
**AI does:**
```
1. launch_app() โ starts your app
2. screenshot() โ sees the login screen
3. inspect() โ finds email field, password field, login button
4. enter_text("email_field", "test@example.com")
5. enter_text("password_field", "password123")
6. tap("login_button")
7. wait_for_element("dashboard_title")
8. screenshot() โ captures the dashboard
โ
"Login flow works โ dashboard loaded successfully"
```
### Example 2: Full Form Validation
**You say:**
> "Submit the registration form empty and check that all validation errors appear"
**AI does:**
```
1. screenshot() โ sees the registration form
2. tap("submit_button") โ submits empty form
3. inspect() โ finds error messages
4. assert_text("Email is required")
5. assert_text("Password is required")
6. screenshot() โ captures the error state
โ
"All 3 validation errors displayed correctly"
```
### Example 3: Visual Regression
**You say:**
> "Navigate through all 5 tabs and screenshot each one"
**AI does:**
```
1. tap("home_tab") โ screenshot("home.png")
2. tap("search_tab") โ screenshot("search.png")
3. tap("profile_tab") โ screenshot("profile.png")
4. tap("settings_tab") โ screenshot("settings.png")
5. tap("inbox_tab") โ screenshot("inbox.png")
โ
"All 5 tab screenshots captured"
```
### Example 4: Complete E2E Flow
**You say:**
> "Test the complete checkout flow โ add an item to cart, go to checkout, fill shipping, confirm order"
**AI does:**
```
1. tap("product_1") โ opens product detail
2. tap("add_to_cart") โ adds to cart
3. tap("cart_icon") โ opens cart
4. tap("checkout_button") โ opens checkout
5. enter_text("address", "123 Main St")
6. enter_text("city", "San Francisco")
7. tap("confirm_order")
8. wait_for_element("order_confirmed")
9. screenshot()
โ
"Order #12345 confirmed โ full checkout flow verified"
```
---
## ๐ง Two Modes
### Mode 1: CLI (Claude Code / Terminal)
Use flutter-skill directly from the command line:
```bash
# Launch your app
flutter-skill launch /path/to/your/app
# Inspect the screen
flutter-skill inspect
# Interact
flutter-skill act tap "login_button"
flutter-skill act enter_text "email" "hello@example.com"
flutter-skill act scroll_to "bottom_item"
# Screenshot
flutter-skill screenshot ./screen.png
```
### Mode 2: MCP Server (Cursor / Windsurf / Claude Desktop)
Add to your MCP settings and just talk to the AI. It calls the tools automatically.
```json
{
"mcpServers": {
"flutter-skill": {
"command": "flutter-skill",
"args": ["server"]
}
}
}
```
**Works with:** Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Continue, or any MCP client.
---
## ๐ฑ 8 Platforms, One Skill
flutter-skill works the same way across all platforms:
| Platform | Add to your app | AI can test it |
|----------|----------------|----------------|
| **Flutter** (iOS/Android/Web) | `FlutterSkillBinding.ensureInitialized()` | โ
|
| **React Native** | `import FlutterSkill; FlutterSkill.start()` | โ
|
| **Electron** | `require('flutter-skill-bridge').start()` | โ
|
| **iOS** (Swift/SwiftUI) | `FlutterSkillBridge.shared.start()` | โ
|
| **Android** (Kotlin) | `FlutterSkillBridge.start(this)` | โ
|
| **Tauri** (Rust) | `flutter_skill::init()` | โ
|
| **KMP** (Kotlin Multiplatform) | `FlutterSkillBridge().start()` | โ
|
| **.NET MAUI** | `FlutterSkillBridge.Start()` | โ
|
**Same AI prompts. Same tools. Any framework.**
---
## ๐ ๏ธ All 40+ Tools
๐ See the Screen
| Tool | What it does |
|------|-------------|
| `screenshot` | Full app screenshot (base64 PNG) |
| `screenshot_element` | Screenshot a specific element |
| `inspect` | List all interactive elements (buttons, fields, etc.) |
| `get_widget_tree` | Full widget hierarchy |
| `find_by_type` | Find widgets by type (e.g., "ElevatedButton") |
| `get_text_content` | Extract all visible text |
๐ Interact Like a User
| Tool | What it does |
|------|-------------|
| `tap` | Tap an element by key or text |
| `double_tap` | Double tap |
| `long_press` | Long press |
| `enter_text` | Type into a text field |
| `swipe` | Swipe up/down/left/right |
| `scroll_to` | Scroll an element into view |
| `drag` | Drag from one element to another |
| `go_back` | Navigate back |
| `native_tap` | Tap via native OS (for system dialogs) |
| `native_input_text` | Type via native OS |
| `native_swipe` | Swipe via native OS |
โ
Verify & Assert
| Tool | What it does |
|------|-------------|
| `assert_text` | Verify text is visible |
| `assert_visible` | Verify element exists |
| `assert_not_visible` | Verify element is gone |
| `assert_element_count` | Verify number of elements |
| `wait_for_element` | Wait for element to appear (with timeout) |
| `wait_for_gone` | Wait for element to disappear |
| `get_checkbox_state` | Get checkbox checked/unchecked |
| `get_slider_value` | Get slider position |
| `get_text_value` | Get text field value |
๐ Launch & Control
| Tool | What it does |
|------|-------------|
| `launch_app` | Launch app with flavors/defines |
| `scan_and_connect` | Auto-find running apps |
| `connect_app` | Connect via URI |
| `hot_reload` | Trigger hot reload |
| `hot_restart` | Trigger hot restart |
| `list_sessions` | List connected sessions |
| `switch_session` | Switch between sessions |
๐ Debug & Logs
| Tool | What it does |
|------|-------------|
| `get_logs` | Application logs |
| `get_errors` | Error messages |
| `get_performance` | Performance metrics |
| `get_memory_stats` | Memory usage |
| `clear_logs` | Clear log buffer |
Give your AI the skill to test your app โ github.com/ai-dashboad/flutter-skill