Agent skill · Audited from source
dart-fix-runtime-errors
skill · dart-lang/skillsBSD-3-Clause licenceAudited 23 Oct 2026 · source db37821a6b02
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit db37821a6b02 and found no filesystem, network or shell access and no hard-coded secrets. What it does: 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.
Cite
Cite this page
ModelsAtlas. “dart-fix-runtime-errors (dart-lang/skills)”. Retrieved 23 Oct 2026. https://modelsatlas.com/skills/dart-lang/dart-fix-runtime-errors
2 skills are called “dart-fix-runtime-errors”. You are viewing dart-lang/skills.
- dart-lang/skills★ 529✓SAFE
- flutter/agent-plugins★ 3.1k✓SAFE
Trust audit
Audit 0.4.1 · source read 23 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 16,667 of 17,602 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha db37821a6b02 · 23 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherdart-lang GitHub organizationOwner of the repository this skill is read from
- Source folderdart-lang/skills/skills/dart-fix-runtime-errorsThe exact folder we audited
- LicenceBSD-3-ClauseAs the repository states it
- Commit pinned for this verdictdb37821a6b02A new audit runs when the source changes
- Repository statusNot archivedLast push 6 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: 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.
---
name: dart-fix-runtime-errors
description: 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.
metadata:
model: models/gemini-3.1-pro-preview
last_modified: Fri, 24 Apr 2026 15:13:22 GMT
---
# Resolving Dart Static Analysis Errors
## Contents
- [Core Concepts & Guidelines](#core-concepts--guidelines)
- [Type System & Soundness](#type-system--soundness)
- [Null Safety](#null-safety)
- [Error Handling](#error-handling)
- [Workflows](#workflows)
- [Workflow: Static Analysis Resolution](#workflow-static-analysis-resolution)
- [Examples](#examples)
## Core Concepts & Guidelines
### Type System & Soundness
Enforce Dart's sound type system to prevent runtime invalid states.
* **Method Overrides:** Maintain sound return types (covariant) and parameter types (contravariant). Never tighten a parameter type in a subclass unless explicitly marked with the `covariant` keyword.
* **Generics & Collections:** Add explicit type annotations to generic classes (e.g., `List<T>`, `Map<K, V>`). Never assign a `List<dynamic>` to a typed list (e.g., `List<Cat>`).
* **Downcasting:** Avoid implicit downcasts from `dynamic`. Use explicit casts (e.g., `as List<Cat>`) when necessary, but ensure the underlying runtime type matches to prevent `TypeError` exceptions.
* **Strict Casts:** Enable `strict-casts: true` in `analysis_options.yaml` under `analyzer: language:` to force explicit casting and catch implicit downcast errors at compile time.
### Null Safety
Eliminate static errors related to null safety by correctly managing variable initialization and nullability.
* **Modifiers:** Apply `?` for nullable types, `!` for null assertions, and `required` for named parameters that cannot be null.
* **Late Initialization:** Use the `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.
* **Wildcards:** Use the `_` wildcard variable (Dart 3.7+) for non-binding local variables or parameters to avoid unused variable warnings.
### Error Handling
Distinguish between recoverable exceptions and unrecoverable errors.
* **Catching:** Catch `Exception` subtypes for recoverable failures.
* **Errors:** Never explicitly catch `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.
* **Rethrowing:** Use `rethrow` inside a `catch` block to propagate an exception while preserving its original stack trace.
## Workflows
### Workflow: Static Analysis Resolution
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.
- [ ] 2. Apply automated fixes.
- [ ] 3. Resolve remaining errors manually.
- [ ] 4. Verify fixes (Feedback Loop).
**1. Run static analyzer**
Execute the Dart analyzer to identify all static errors in the target directory or file.
```bash
dart analyze . --fatal-infos
```
**2. Apply automated fixes**
Use the `dart fix` tool to automatically resolve standard linting and analysis issues.
```bash
# 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:
* **If the error is a Null Safety issue (e.g., "Property cannot be accessed on a nullable receiver"):**
* Verify if the variable can logically be null.
* If yes, use optional chaining (`?.`) or provide a fallback (`??`).
* If no, and initialization is guaranteed elsewhere, mark the declaration with `late`.
* **If the error is a Type Mismatch (e.g., "The argument type 'List<dynamic>' can't be assigned..."):**
* Trace the variable's initialization.
* Add explicit generic type annotations to the instantiation (e.g., `<int>[]` instead of `[]`).
* **If the error is an Invalid Override (e.g., "The parameter type doesn't match the overridden method"):**
* Widen the parameter type to match the superclass, OR
* Add the `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.
```bash
dart analyze .
dart test
```
* **If `dart analyze` reports errors:** Return to Step 3.
* **If `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.
## Examples
### Example: Fixing Dynamic List Assignments
**Input (Fails Static Analysis):**
```dart
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):**
```dart
void printInts(List<int> a) => print(a);
void main() {
final list = <int>[]; // Explicitly typed
list.add(1);
list.add(2);
printInts(list);
}
```
### Example: Fixing Method Overrides (Contravariance)
**Input (Fails Static Analysis):**
```dart
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(Mouse a) {} // Error: Tightening parameter type
}
```
**Output (Passes Static Analysis):**
```dart
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(covariant Mouse a) {} // Explicitly marked covariant
}
```
### Example: Fixing Null Safety with `late`
**Input (Fails Static Analysis):**
```dart
class Thermometer {
String temperature; // Error: Non-nullable instance field muExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit db37821
git clone https://github.com/dart-lang/skills git -C skills checkout db37821a6b02
The author documents no install command, so this uses the repository directly. Our verdict covers commit db37821a6b02 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
db37821a6b02
Similar skills
obra/superpowers
Use when creating new skills, editing existing skills, or verifying skills work before deployment
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Questions about dart-fix-runtime-errors
Is dart-fix-runtime-errors safe to install?
What can dart-fix-runtime-errors access on my machine?
How current is this page?
Sources
- github.com/dart-lang/skills/tree/main/skills/dart-fix-runtime-er — the audited source at commit db37821a6b02 and every finding aboveObserved · 23 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- Is dart-fix-runtime-errors safe to install?
- What can dart-fix-runtime-errors access on my machine?
- How current is this page?