Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
npx skills add https://github.com/flutter/agent-plugins --skill dart-fix-runtime-errors
Enforce Dart's sound type system to prevent runtime invalid states.
covariant keyword.List<T>, Map<K, V>). Never assign a List<dynamic> to a typed list (e.g., List<Cat>).dynamic. Use explicit casts (e.g., as List<Cat>) when necessary, but ensure the underlying runtime type matches to prevent TypeError exceptions.strict-casts: true in analysis_options.yaml under analyzer: language: to force explicit casting and catch implicit downcast errors at compile time.Eliminate static errors related to null safety by correctly managing variable initialization and nullability.
? for nullable types, ! for null assertions, and required for named parameters that cannot be null.late keyword for non-nullable variables guaranteed to be initialized before use. Apply this specifically to top-level or instance variables where Dart's control flow analysis cannot definitively prove initialization._ wildcard variable (Dart 3.7+) for non-binding local variables or parameters to avoid unused variable warnings.Distinguish between recoverable exceptions and unrecoverable errors.
Exception subtypes for recoverable failures.Error or its subtypes (e.g., TypeError, ArgumentError). Errors indicate programming bugs that must be fixed, not caught. Enforce this by enabling the avoid_catching_errors linter rule.rethrow inside a catch block to propagate an exception while preserving its original stack trace.Use this sequential workflow to identify, fix, and verify static analysis errors in a Dart project. Copy the checklist to track your progress.
Task Progress:
1. Run static analyzer
Execute the Dart analyzer to identify all static errors in the target directory or file.
dart analyze . --fatal-infos
2. Apply automated fixes
Use the dart fix tool to automatically resolve standard linting and analysis issues.
# Preview changes
dart fix --dry-run
# Apply changes
dart fix --apply
3. Resolve remaining errors manually
Review the remaining analyzer output and apply conditional logic based on the error type:
?.) or provide a fallback (??).late.<int>[] instead of []).covariant keyword to the parameter if tightening the type is intentionally required by the domain logic.4. Verify fixes (Feedback Loop)
Run the validator. Review errors. Fix.
dart analyze .
dart test
dart analyze reports errors: Return to Step 3.dart test fails with a TypeError: You have introduced an invalid explicit cast (as T) or accessed an uninitialized late variable. Locate the runtime failure and correct the type hierarchy or initialization order.Input (Fails Static Analysis):
void printInts(List<int> a) => print(a);
void main() {
final list = []; // Inferred as List<dynamic>
list.add(1);
list.add(2);
printInts(list); // Error: List<dynamic> can't be assigned to List<int>
}
Output (Passes Static Analysis):
void printInts(List<int> a) => print(a);
void main() {
final list = <int>[]; // Explicitly typed
list.add(1);
list.add(2);
printInts(list);
}
Input (Fails Static Analysis):
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(Mouse a) {} // Error: Tightening parameter type
}
Output (Passes Static Analysis):
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(covariant Mouse a) {} // Explicitly marked covariant
}
lateInput (Fails Static Analysis):
class Thermometer {
String temperature; // Error: Non-nullable instance field must be initialized
void read() {
temperature = '20C';
}
}
Output (Passes Static Analysis):
class Thermometer {
late String temperature; // Defers initialization check to runtime
void read() {
temperature = '20C';
}
}
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take flutter/dart-fix-runtime-errors from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.