plugins/development/skills/flutter-workflow/SKILL.md
Docs-first development workflow for Flutter/Dart projects covering widgets, state management, navigation, and platform integration (iOS/Android/Web). Fetches current documentation via MCP before any implementation. Use when building or modifying Flutter apps. Trigger phrases - "flutter", "dart", "flutter widget", "flutter app", "flutter navigation", "flutter state management". NOT for React Native/Expo (use expo-workflow) or web-only frontends (use frontend-app/frontend-lp).
npx skillsauth add petrogurcak/skills flutter-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
DOCS FIRST, CODE SECOND
You MUST NEVER generate Flutter code without first fetching relevant documentation via MCP tools.
This is NON-NEGOTIABLE. Every workflow below has MANDATORY MCP fetch steps that MUST be completed before implementation.
Use this skill for ALL Flutter development tasks:
Use for: Creating any new Flutter widget
MANDATORY CHECKLIST:
☐ 1. Determine widget type
- Stateless (no internal state)
- Stateful (internal state with setState)
- Inherited (providing data down tree)
☐ 2. ⚠️ MANDATORY: Fetch widget documentation
Call MCP tool: fetch_widget_docs(widget_type)
Wait for response before continuing
☐ 3. ⚠️ MANDATORY: Fetch Material/Cupertino guidelines (if UI component)
Call MCP tool: get_material_design_guidelines(component_type)
Wait for response before continuing
☐ 4. Plan widget structure based on fetched docs
- Constructor parameters (required vs optional)
- Build method structure
- Internal state if Stateful
☐ 5. Implement widget following current API:
- const constructor where possible
- Proper null safety (no ! abuse)
- Immutable properties
- Key parameter if needed
☐ 6. Implement build() method:
- Follow fetched Material/Cupertino patterns
- Use const widgets where possible
- Proper composition over inheritance
☐ 7. VERIFY against quality checklist:
✓ Uses Flutter 3.x+ APIs (no deprecated)
✓ Dart 3.x+ null safety
✓ const constructors used
✓ Proper accessibility (Semantics)
✓ Follows fetched guidelines
Example Execution:
// WRONG: Generating code without fetching docs
class ProfileWidget extends StatefulWidget { ... }
// CORRECT: Workflow followed
// 1. Determined: Stateful widget needed
// 2. Called: fetch_widget_docs("StatefulWidget")
// 3. Reviewed current StatefulWidget API from docs
// 4. Called: get_material_design_guidelines("card")
// 5. Now implementing with current API:
class ProfileWidget extends StatefulWidget {
const ProfileWidget({
super.key,
required this.userId,
});
final String userId;
@override
State<ProfileWidget> createState() => _ProfileWidgetState();
}
class _ProfileWidgetState extends State<ProfileWidget> {
// Implementation following fetched docs...
}
Use for: Any state management implementation
MANDATORY CHECKLIST:
☐ 1. Identify state scope:
- Local (single widget) → setState
- Subtree (section of app) → InheritedWidget/Provider
- Feature (module-wide) → Riverpod/BLoC
- App-wide (global) → Riverpod/BLoC with repositories
☐ 2. Choose state management solution:
- Provider (simple, lightweight)
- Riverpod (modern, compile-safe)
- BLoC (predictable, testable)
- GetX (batteries-included)
☐ 3. ⚠️ MANDATORY: Fetch state management patterns
Call MCP tool: fetch_state_management_pattern(solution, use_case)
Wait for response before continuing
☐ 4. ⚠️ MANDATORY: Fetch package docs (if using package)
Call MCP tool: get_package_docs(package_name)
Example: get_package_docs("flutter_riverpod")
Wait for response before continuing
☐ 5. Set up state classes following fetched patterns:
- Use sealed classes for state variants (Dart 3)
- Immutable state with records or freezed
- Clear state naming (loading, success, error)
☐ 6. Implement state update logic:
- Pure functions (no side effects in reducers)
- Immutability (copyWith patterns)
- Async handling with proper error catching
☐ 7. Connect state to UI:
- Use Consumer/Watch patterns from docs
- Proper widget rebuild optimization
- Loading/error UI states
☐ 8. VERIFY disposal and cleanup:
✓ Controllers/notifiers properly disposed
✓ Stream subscriptions cancelled
✓ No memory leaks
✓ Proper provider scope
Decision Tree: Which State Solution?
State complexity?
├─ Simple (1-2 properties) → setState or Provider
├─ Medium (3-10 properties) → Riverpod or Provider
└─ Complex (>10, async, business logic) → Riverpod or BLoC
Testability requirement?
├─ High → BLoC (well-defined streams)
└─ Medium → Riverpod (easy to mock)
Team familiarity?
├─ New to Flutter → Provider (simple)
├─ Modern Flutter → Riverpod (recommended)
└─ Large apps → BLoC (architecture)
Use for: Setting up navigation, routes, deep linking
MANDATORY CHECKLIST:
☐ 1. Choose routing solution:
- Named routes (simple, legacy)
- Navigator 2.0 (declarative, complex)
- GoRouter (recommended, type-safe)
☐ 2. ⚠️ MANDATORY: Fetch navigation documentation
Call MCP tool: fetch_navigation_docs(solution)
If GoRouter: also call get_package_docs("go_router")
Wait for responses before continuing
☐ 3. Define route structure:
- List all app routes
- Identify route parameters
- Plan nested navigation if needed
☐ 4. Implement routing configuration:
- Follow fetched patterns exactly
- Type-safe route definitions
- Route parameters with proper types
☐ 5. Set up deep linking (if needed):
⚠️ MANDATORY: fetch_navigation_docs(solution, "deep-linking")
- URL patterns
- Route parsing
- Platform setup (iOS/Android)
☐ 6. Implement route guards/middleware (if needed):
- Authentication checks
- Authorization logic
- Redirect logic
☐ 7. VERIFY navigation:
✓ Type-safe navigation (no string errors)
✓ Proper back button handling
✓ Deep links work
✓ Route transitions smooth
✓ Parameters passed correctly
Use for: Platform channels, native code, platform-specific features
MANDATORY CHECKLIST:
☐ 1. Identify platform feature:
- Camera/Photos
- Biometrics
- Native APIs
- File system
- Sensors
☐ 2. ⚠️ MANDATORY: Fetch platform integration docs
Call MCP tool: fetch_platform_integration(feature, platform)
Call for each platform (iOS, Android, Web if needed)
Wait for responses before continuing
☐ 3. Decide implementation approach:
- Use existing package (check pub.dev)
- Create platform channel
- Use FFI (for C/C++)
☐ 4. If using package:
⚠️ MANDATORY: get_package_docs(package_name)
Follow package integration guide
☐ 5. If creating platform channel:
- Define method channel interface
- Implement Flutter side (Dart)
- Implement native side (Kotlin/Swift)
- Handle errors and edge cases
☐ 6. Handle platform-specific code:
- Use Platform.isIOS/isAndroid checks
- Provide fallbacks for unsupported platforms
- Test on all target platforms
☐ 7. VERIFY platform integration:
✓ Works on all target platforms
✓ Proper error handling
✓ Fallbacks for unsupported features
✓ No platform-specific crashes
Use for: Creating complex layouts, custom UI
MANDATORY CHECKLIST:
☐ 1. Plan layout structure:
- Identify layout widgets needed (Column, Row, Stack, etc.)
- Determine responsive requirements
- Plan animation needs
☐ 2. ⚠️ MANDATORY: Fetch layout widget docs
For each main layout widget:
Call MCP tool: fetch_widget_docs(widget_name)
Example: fetch_widget_docs("CustomScrollView")
Wait for responses
☐ 3. ⚠️ MANDATORY: Fetch Material guidelines (if applicable)
Call MCP tool: get_material_design_guidelines(component)
Wait for response
☐ 4. Implement layout:
- Use const widgets aggressively
- Proper constraints (don't over-constrain)
- Keys where needed (for lists)
☐ 5. Add responsive behavior:
- MediaQuery for screen dimensions
- LayoutBuilder for adaptive layouts
- Breakpoints for tablet/desktop
☐ 6. Optimize performance:
⚠️ If complex: fetch_performance_guidelines("rendering")
- Const constructors
- RepaintBoundary where needed
- Avoid expensive builds
☐ 7. VERIFY layout:
✓ Responsive on different screen sizes
✓ No overflow errors
✓ Smooth scrolling
✓ Proper accessibility
Use for: Adding any pub.dev package
MANDATORY CHECKLIST:
☐ 1. Identify package need:
- Search pub.dev for solution
- Check package popularity and maintenance
- Verify Flutter 3.x+ compatibility
☐ 2. ⚠️ MANDATORY: Fetch package documentation
Call MCP tool: get_package_docs(package_name)
Wait for response before continuing
☐ 3. Review package docs:
- Installation instructions
- Platform-specific setup
- Breaking changes in recent versions
☐ 4. Add to pubspec.yaml:
- Use latest stable version
- Check version constraints
☐ 5. Platform-specific setup (if required):
- iOS: Podfile, Info.plist changes
- Android: build.gradle, AndroidManifest changes
- Follow package instructions exactly
☐ 6. Import and use package:
- Follow examples from fetched docs
- Use current API (check for deprecations)
☐ 7. VERIFY package integration:
✓ Builds successfully on all platforms
✓ No conflicts with other packages
✓ Features work as expected
Language Features:
// ✓ CORRECT: Records for simple data
final user = (name: 'John', age: 30);
// ✓ CORRECT: Sealed classes for state
sealed class LoadingState {}
class Loading extends LoadingState {}
class Success extends LoadingState {
final Data data;
Success(this.data);
}
class Error extends LoadingState {
final String message;
Error(this.message);
}
// ✓ CORRECT: Pattern matching
switch (state) {
case Loading(): return CircularProgressIndicator();
case Success(:final data): return DataView(data);
case Error(:final message): return ErrorView(message);
}
// ✗ WRONG: Using old patterns
// Don't use unions via inheritance without sealed
// Don't ignore pattern matching for state
Null Safety:
// ✓ CORRECT: Proper null safety
String? getName() => user?.name;
final name = getName() ?? 'Unknown';
// ✓ CORRECT: Late with initialization guarantee
late final String userId = fetchUserId();
// ✗ WRONG: Null check operator abuse
final name = user!.name!; // Don't do this
// ✗ WRONG: Ignoring nullability
String name = possiblyNullValue; // Error
Lints & Analysis:
# Must have in analysis_options.yaml
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
linter:
rules:
- prefer_const_constructors
- prefer_const_declarations
- use_key_in_widget_constructors
- prefer_final_fields
- avoid_print
Material Design 3:
// ✓ CORRECT: Material 3 theme
MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
),
);
// ✗ WRONG: Material 2
// Don't use old ThemeData without useMaterial3
Widget Construction:
// ✓ CORRECT: Const constructors
const Text('Hello');
const SizedBox(height: 16);
const Padding(padding: EdgeInsets.all(8), child: ...);
// ✓ CORRECT: Keys for lists
ListView.builder(
itemBuilder: (context, index) => ListTile(
key: Key('item_$index'), // Important for animations
...
),
);
// ✗ WRONG: No const where possible
Text('Hello'); // Should be const
Accessibility:
// ✓ CORRECT: Semantic labels
Semantics(
label: 'Profile photo of ${user.name}',
child: Image.network(user.photoUrl),
)
// ✓ CORRECT: Exclude decorative
Semantics(
excludeSemantics: true,
child: DecorativeImage(),
)
// ✗ WRONG: No semantics for interactive elements
IconButton(icon: Icon(Icons.delete), onPressed: ...); // Missing label
Do you need internal state that changes over time?
├─ NO → Can parent pass all data?
│ ├─ YES → StatelessWidget
│ └─ NO → Inherited or State Management
│
└─ YES → Is state simple (1-3 properties)?
├─ YES → StatefulWidget with setState
└─ NO → State Management (Provider/Riverpod/BLoC)
What's your layout pattern?
├─ Vertical stack → Column (or ListView if scrollable)
├─ Horizontal row → Row (or ListView horizontal)
├─ Layered/overlapping → Stack
├─ Scrollable → ListView/GridView/CustomScrollView
├─ Flexible sizes → Expanded/Flexible in Row/Column
└─ Custom layout → CustomMultiChildLayout or LayoutBuilder
What's your app complexity?
├─ Simple (few screens, little state) → Provider or setState
├─ Medium (multiple features) → Riverpod or Provider
└─ Complex (many features, large team) → Riverpod or BLoC
What's your team experience?
├─ New to Flutter → Provider (easy)
├─ Experienced → Riverpod (modern, recommended)
└─ From Redux/MobX → BLoC (familiar patterns)
Before implementing any widget, consider:
☐ Can this widget be const?
☐ Do I need to rebuild the whole widget or just part?
(Use const for unchanged parts)
☐ Is this list/grid long?
(Use .builder constructors)
☐ Am I rebuilding expensive widgets unnecessarily?
(Use RepaintBoundary or split into smaller widgets)
☐ Do I have keys on list items?
(Needed for correct animations and state)
DON'T:
DO:
This skill works in tandem with the Flutter MCP server. The MCP provides the WHAT (current APIs, patterns, docs), this skill provides the WHEN and HOW (workflows, process).
Available MCP Tools (call as needed per workflows):
fetch_widget_docs(widget_name) - Widget API and lifecyclefetch_state_management_pattern(solution, use_case) - State patternsfetch_navigation_docs(solution) - Navigation setupsearch_flutter_api(query) - API referenceget_material_design_guidelines(component) - Material 3 patternsfetch_platform_integration(feature, platform) - Platform-specific codesearch_dart_docs(topic) - Dart language featuresget_package_docs(package_name) - pub.dev packagesfetch_performance_guidelines(topic) - Performance optimizationget_testing_patterns(test_type) - Testing approachesYou MUST call these tools at the workflow steps marked with ⚠️ MANDATORY
Before considering any Flutter implementation complete:
FINAL VERIFICATION CHECKLIST:
☐ All MANDATORY MCP tool calls were made
☐ Implementation follows fetched documentation
☐ Uses Flutter 3.x+ APIs (no deprecations)
☐ Uses Dart 3.x+ features appropriately
☐ Null safety is correct
☐ Const constructors used where possible
☐ Accessibility considered (Semantics)
☐ Error handling implemented
☐ Resources properly disposed
☐ No performance anti-patterns
☐ Code follows current best practices from docs
This skill enforces a DOCS-FIRST development process:
NEVER skip step 2. The MCP server provides current, accurate documentation. Use it.
Your workflows are your process. Follow them rigorously for consistent, high-quality Flutter code that uses current APIs and best practices.
development
Builds a pre-launch social proof strategy through structured beta programs using D'Souza Brain Audit interviews. Use when launching new products/services and need compelling testimonials, planning a beta cohort, designing interview questions to harvest objection-busting social proof, improving video testimonials for landing pages, or designing case studies with metrics. Trigger phrases include "beta tester program for testimonials", "pre-launch social proof", "Brain Audit testimonial framework", "case study harvest", "reverse testimonial", "video testimonial mechanics", "social proof landing page", "sběr referencí", "beta tester program", "testimonial pro landing page", "social proof před launchem", "rozhovor s klientem", "case study sběr", "reference před spuštěním". NOT for ongoing case study production (use growth-hacking case-study approach), offer design (use offer-creation), or conversion optimization (use ux-optimization).
development
Use when planning a product launch and the product type is unclear or could be either generic (SaaS/app/physical) or info-product. Routes between marketing:launch-strategy (generic launches) and marketing:info-product-launch (courses, memberships, ebooks, cohorts, communities). Trigger phrases - "launch", "spuštění", "go-to-market", "product launch", "release strategy", "uvedení na trh", "launch plan", "spuštění produktu", "launch sequence", "launch strategy". Do NOT trigger when product type is already clear (use specific skill directly).
testing
Specialized 8-week launch cadence for info-products — online courses, cohort programs, memberships, communities, ebooks, masterminds. Combines Jeff Walker's Product Launch Formula (Seed/Internal/JV variants, PLC sequence, open-cart day-by-day) with Stu McLaren's membership mechanics (closed cart, Success Path) and Hormozi Grand Slam Offer stacking. Use when planning "launch online kurzu", "info-product launch", "PLF launch", "course launch", "membership launch", "cohort launch", "ebook launch", "open cart close cart", "8-week launch of online course", "beta cohort to launch sequence", "spuštění kurzu", "launch členské sekce", "open cart strategie". Differentiates from marketing:launch-strategy (generic SaaS/app launches) — info-product-specific. NOT for SaaS launches, physical products, or services.
development
Use when releasing an Expo/React Native mobile app to App Store and Google Play - covers eas submit, ASC "Submit for Review", Play promote Internal→Production, OTA update, and decoding common silent failures (Apple agreement expiry, missing English locale, Background Location declaration, web bundle failure on react-native-maps).