dart-fix-runtime-errors: a Dart team skill for fixing Dart type and null errors
A Dart team skill with a fix workflow for analyzer errors: run dart analyze, apply dart fix, then fix type and null errors by hand.
- Installs
- 19.2K
- on skills.sh
- Stars
- 537
- on GitHub
- Updated
- Oct 2026
- last repo commit
The frontmatter says this skill fetches an active stack trace with get_runtime_errors and verifies with hot_reload. The steps in the file do not mention those tools. They are headed "Resolving Dart Static Analysis Errors" and run dart analyze . --fatal-infos, dart fix --dry-run, dart fix --apply, then dart analyze . and dart test.
For the errors that remain, Claude follows rules for null safety, type mismatches and invalid method overrides. The skill is one file with no scripts. It edits your Dart code.
Good for
- Dart developers facing null-safety or type mismatch errors
- Teams moving code to strict casts and sound types
- Anyone who wants a repeatable fix and verify loop
Install dart-fix-runtime-errors
Claude Code
- 1
Copy this prompt.
Install the dart-fix-runtime-errors skill in Claude Code. Run this command: npx skills add https://github.com/dart-lang/skills --skill dart-fix-runtime-errors Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- Contents
- Core Concepts & Guidelines
- Type System & Soundness
- Null Safety
- Error Handling
- Workflows
- Workflow: Static Analysis Resolution
- Examples
- Example: Fixing Dynamic List Assignments
- Example: Fixing Method Overrides (Contravariance)
- Example: Fixing Null Safety with late
Key facts
- License
- BSD-3-Clause
- Installs on skills.sh
- 19,237 as of 2026-11-02
- Last repo commit
- 2026-10-16
- skills.sh audits
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
What it includes
dart analyze . --fatal-infos
Finds all static errors in the target directory or file.
Try: “Fix the null-safety errors in lib/ and verify with the tests.”
Runs code ·
1. Run static analyzerdart fix --dry-run, then dart fix --apply
Previews the changes and then applies the standard linting and analysis fixes.
Runs code ·
2. Apply automated fixesBranches for null safety, type mismatch and invalid override
Uses ?. or ?? or late for null errors, explicit generic types for List<dynamic> mismatches, and a wider parameter or covariant for override errors.
Write ·
3. Resolve remaining errors manuallydart analyze . and dart test
Loops back to step 3 on analyzer errors. A TypeError in tests means a bad explicit cast or an uninitialized late variable.
Runs code ·
4. Verify fixesOverrides, generics, downcasting and strict-casts
Covers covariant return types, explicit type arguments, avoiding implicit downcasts and enabling strict-casts.
Read ·
Type system and soundness guidelinesNullable types, late, wildcards, Exception versus Error
Never catch Error subtypes, use rethrow to keep the stack trace, and use _ for unused variables on Dart 3.7+.
Read ·
Null safety and error handling guidelinesThree input and output code pairs
Dynamic list assignment, covariant method override and late initialization.
Read ·
Examples
From the official docs
Permissions
Low risk
Claude runs dart commands and edits your Dart files. Work in a git repository and review the diff.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It applies fixes and runs your tests
dart fix --apply edits files and dart test runs your test code. Review the diff and test output. github.com
Technical details
| Scopes |
|
|---|
Questions
What does dart-fix-runtime-errors do?
It gives Claude a four-step loop for Dart analyzer errors: run dart analyze, apply dart fix, fix what remains by hand, then re-run dart analyze and dart test.
How do I install it?
Use the install box at the top of this page. The dart-lang/skills README also gives one command that installs every skill in the repo into the standard .agents/skills folder, if you want the whole set.
Does it read live runtime stack traces?
The frontmatter description says it uses get_runtime_errors and lsp to fetch a stack trace and verifies with hot_reload. The steps in the file itself do not use those tools. They run dart analyze, dart fix and dart test.
Is it safe to use?
It edits your Dart source with dart fix --apply and manual changes, and runs dart test. Work in a git repository and review the diff. The skill warns that a bad explicit cast or an uninitialized late variable can make tests fail with a TypeError.
How is it different from dart-run-static-analysis?
dart-run-static-analysis focuses on running the analyzer, applying dart fix, formatting and configuring analysis_options.yaml. This skill adds rules and branches for fixing null-safety, type and override errors by hand and ends with dart test. The other skill's file is in the same repo.
Information
updated Nov 2, 2026
- Repository
- dart-lang/skills
- Folder
skills/dart-fix-runtime-errors
Sources
Docs, issue trackers and discussions this page is built from.