xiaohongshu
xiaohongshu
dart-flutter-mcp
Provides Flutter and Dart development workflows using dart-mcp tools. Triggers when working with .dart files, pubspec.yaml, or when user mentions Flutter, widget, Riverpod, Freezed, or Dart development. MUST BE USED for Flutter project work involving dart_analyzer, dart_run_tests, hot_reload, or ...
Full skill instructions
<quick_start> <common_workflows> Validate code quality:
dart_analyzer → Check for errors/warnings
dart_format → Ensure consistent style
Run tests:
dart_analyzer → Catch compile errors first
dart_run_tests → Execute tests
Debug running app:
get_runtime_errors → Capture current errors
get_widget_tree → Inspect UI hierarchy
[make fix]
hot_reload → Apply changes
get_runtime_errors → Verify fix
Understand an API:
dart_resolve_symbol → Get signature and documentation
</common_workflows> </quick_start>
<tool_categories> <dart_tools> Static Analysis and Code Quality:
| Tool | Purpose | When to Use |
|---|---|---|
dart_analyzer | Static analysis for errors, warnings, hints | After writing code, before running tests |
dart_format | Apply consistent code formatting | After all code changes |
dart_fix | Apply automated fixes for analyzer issues | When analyzer reports fixable issues |
Testing:
| Tool | Purpose | When to Use |
|---|---|---|
dart_run_tests | Execute Dart/Flutter tests | After writing tests, in TDD cycles |
Symbol Resolution:
| Tool | Purpose | When to Use |
|---|---|---|
dart_resolve_symbol | Get symbol documentation and signatures | Understanding APIs, checking method signatures |
Package Discovery:
| Tool | Purpose | When to Use |
|---|---|---|
pub_dev_search | Search pub.dev for packages | Finding packages for specific functionality |
| </dart_tools> |
<flutter_runtime_tools> Runtime Debugging (requires running app):
| Tool | Purpose | When to Use |
|---|---|---|
get_runtime_errors | Fetch current runtime errors and stack traces | First step in debugging, verify fixes |
get_widget_tree | Inspect widget hierarchy at runtime | Layout debugging, finding widget issues |
hot_reload | Apply code changes without losing state | After making fixes, during development |
hot_restart | Full restart preserving debug session | When hot reload fails or state is corrupted |
Prerequisites: App must be running in debug mode with Dart tooling daemon connected. </flutter_runtime_tools>
<ide_tools> IDE Integration (mcp__ide__*):
| Tool | Purpose | When to Use |
|---|---|---|
mcp__ide__getDiagnostics | Get IDE diagnostics for a file | Check for issues in specific file |
mcp__ide__readFile | Read file contents | Understanding existing code |
mcp__ide__writeFile | Write/create files | Creating new files |
mcp__ide__getCurrentEditor | Get active editor content | Context-aware operations |
mcp__ide__getOpenEditors | Get currently open files | Understanding user context |
mcp__ide__searchInProject | Search across project files | Finding patterns, usages |
mcp__ide__getProjectStructure | Get project file tree | Understanding project layout |
| </ide_tools> | ||
| </tool_categories> |
1. Write failing test
2. dart_run_tests → Verify RED (test fails)
3. Write minimal implementation
4. dart_run_tests → Verify GREEN (test passes)
5. Refactor code
6. dart_run_tests → Verify still GREEN
7. dart_analyzer → Check for issues
8. dart_format → Apply consistent style
This cycle ensures tests drive implementation and code quality stays high. </tdd_workflow>
<debug_workflow> Runtime Debugging Workflow:
1. Verify app is connected:
get_runtime_errors → If fails, app not connected
2. Gather evidence:
get_runtime_errors → Capture current errors
get_widget_tree → Inspect UI structure
3. Analyze error patterns:
- RenderFlex overflow → Layout constraints issue
- Null check operator → Null safety issue
- setState after dispose → Lifecycle issue
4. Make targeted fix (use mcp__ide__readFile/writeFile)
5. Apply and verify:
hot_reload → Apply changes
get_runtime_errors → Should be empty or reduced
6. If hot_reload fails:
dart_analyzer → Check for syntax errors
hot_restart → Try full restart
</debug_workflow>
<code_quality_workflow> Pre-Commit Quality Check:
1. dart_analyzer → Must show 0 errors, 0 warnings
2. dart_run_tests → All tests must pass
3. dart_format → Apply consistent formatting
4. dart_fix → Apply any remaining automated fixes
</code_quality_workflow> </workflows>
<tool_details> <dart_analyzer_detail> dart_analyzer
Performs static analysis on Dart/Flutter code.
Returns:
Best Practices:
Example Output:
lib/src/auth/repository.dart:45:12
ERROR: The argument type 'String' can't be assigned to parameter type 'int'
lib/src/widgets/profile.dart:23:5
WARNING: Unused import 'package:flutter/foundation.dart'
Analysis complete. 1 error, 1 warning.
</dart_analyzer_detail>
<dart_run_tests_detail> dart_run_tests
Executes Dart/Flutter tests with filtering and coverage.
Options:
path/to/test_file.dart--name "test description"--coverage--reporter expandedBest Practices:
dart_analyzer first to catch compile errorsInterpreting Results:
✓ should return user when authenticated
✓ should throw when token expired
✗ should handle network timeout
Expected: Left<NetworkFailure>
Actual: Right<User>
2 passed, 1 failed
</dart_run_tests_detail>
<dart_resolve_symbol_detail> dart_resolve_symbol
Resolves symbols to their documentation and type signatures.
Use Cases:
Example:
Query: "TaskEither.tryCatch"
Result:
TaskEither<L, R>.tryCatch(
Future<R> Function() run,
L Function(Object error, StackTrace stackTrace) onError,
)
Creates a TaskEither that runs the given function and catches any errors.
Best Practices:
<runtime_tools_detail> get_runtime_errors
Fetches current runtime errors from a running Flutter app.
Requires: App running in debug mode with daemon connected.
Returns:
Best Practices:
Common Error Patterns:
RenderFlex overflowed → Layout constraintsNull check operator used on null value → Null safetysetState() called after dispose() → Lifecycle bugtype 'Null' is not a subtype → Type mismatchget_widget_tree
Inspects the widget hierarchy of a running Flutter app.
Returns:
Use For:
Look For:
hot_reload
Applies code changes to a running app without losing state.
When It Works:
When It Fails:
If Hot Reload Fails:
dart_analyzer to check for errorshot_restart for full restart
</runtime_tools_detail>
</tool_details><anti_patterns> Common Mistakes:
Correct Order:
dart_analyzer → dart_run_tests → dart_format
get_runtime_errors → [fix] → hot_reload → get_runtime_errors
</anti_patterns>
<success_criteria> MCP tool usage is correct when:
dart_analyzer shows 0 errors before running testsdart_run_tests executes without compile failuresget_runtime_errors returns empty after fix verificationhot_reload succeeds (no syntax errors in code)Uncertainty Handling:
<reference_guides> For advanced patterns and detailed examples:
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