name: flutter-runner description: This skill should be used when executing flutter or dart commands in a Flutter project. It detects available Flutter/Dart executables (FVM project-level or system PATH) and helps select the appropriate one before running commands.
Flutter Runner
Detect and select the appropriate Flutter/Dart executable in a project, then execute commands.
Workflow
Step 1: Detect Available Executables
Check for both FVM and system Flutter/Dart:
- FVM Detection: Check if
.fvmrcfile exists in project root- If exists: FVM is configured, use
fvm flutterorfvm dart
- If exists: FVM is configured, use
- System Detection: Run
which flutterandwhich dart- If found: System Flutter/Dart is available
Step 2: Select Executable
Based on detection results:
| FVM Found | System Found | Action |
|---|---|---|
| Yes | No | Inform user, use fvm flutter/fvm dart |
| No | Yes | Inform user, use flutter/dart from PATH |
| Yes | Yes | Ask user to choose between FVM and system |
| No | No | Inform user no Flutter/Dart found, cannot proceed |
When only one option is available, inform the user which executable will be used before running the command.
When multiple options are available, use AskUserQuestion to let user choose:
- Option 1: FVM (
fvm flutter/fvm dart) - project-specific version from .fvmrc - Option 2: System (
flutter/dart) - global installation from PATH
Step 3: Execute Command
After determining the executable, run the requested command using the selected executable prefix.
Examples:
- User requests "flutter build apk" with FVM selected → Run
fvm flutter build apk - User requests "dart analyze" with system selected → Run
dart analyze
Notes
- Always check for executables before running any flutter/dart command
- The
.fvmrcfile indicates the project uses FVM for version management - FVM ensures consistent Flutter versions across team members
- Cache the user's choice for subsequent commands in the same session