dart-best-practices
General best practices for Dart development. Covers code style, effective Dart, and language features.
Diagnoses latent architectural modernization opportunities across Dart and Flutter packages (language idioms, testing hygiene, CLI patterns, doc rot) and prescribes matching specialized skills.
$ npx -y skills add kevmoo/dash_skills --skill dash-discover --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dash-discoverContext preview
The summary Claude sees to decide when to auto-load this skill.
Diagnoses latent architectural modernization opportunities across Dart and Flutter packages (language idioms, testing hygiene, CLI patterns, doc rot) and prescribes matching specialized skills.
name: dash-discover description: |- Diagnoses latent architectural modernization opportunities across Dart and Flutter packages (language idioms, testing hygiene, CLI patterns, doc rot) and prescribes matching specialized skills. key_features: - Architectural Gap Diagnosis - Latent Modernization Discovery - Two-Tier Prescriptions & Evidence
The Meta-Skill Discovery Engine evaluates a Dart or Flutter project's architecture, language idioms, testing patterns, and documentation health to uncover latent modernization opportunities that standard static analysis passes ignore.
---
Use this skill when:
or _"What skills should I use on this repository?"_
focus modernization effort.
still harbor outdated pre-Dart 3 constructs, legacy matcher assertions, unstructured CLI entrypoints, or rotting doc examples.
Do NOT run or prescribe discovery scans when:
`pubspec.yaml` or Dart source files (e.g. pure documentation repositories or external language services).
isolated bug fix or single-file adjustment. Do not derail the turn into a broad repository-wide architectural audit unless specifically solicited.
breaking SDK upgrade or uncommitted refactoring. Allow primary migrations to stabilize before running discovery sweeps.
---
Static analysis (`dart analyze`) verifies syntactic and semantic correctness, not architectural quality or modern idiomatic design. A package can pass `dart analyze --fatal-infos` with zero warnings while simultaneously:
3 switch expressions with pattern destructuring.
fluent, type-safe `package:checks`.
of automated `{@example}` region testing.
`package:args/command_runner.dart`.
Dash Discover systematically identifies these latent gaps and points directly to the specialized skills equipped to remediate them.
---
Run the discovery CLI from anywhere in the workspace:
dart run dash_discover <path-to-target-package>
Or for structured machine ingestion:
dart run dash_discover <path-to-target-package> --json
<!-- DISCOVERY_RULES_START -->
The static scanner performs rapid, zero-network checks across 7 built-in rules:
<!-- prettier-ignore --> 1. **Testing Architecture (`dart-migrate-to-checks-package`)**: Detects test or flutter_test in dependencies when checks is absent. 2. **Dart 3 Language Idioms (`dart-use-pattern-matching`)**: Detects legacy else if (... is ...) type cascades and returning switch statements. 3. **CLI Architecture (`dart-build-cli-app`)**: Detects ad-hoc bin/*.dart CLI entrypoints lacking structured argument parsing. 4. **Cross-Platform Robustness (`dart-use-path-package`)**: Detects manual path string concatenation without package:path. 5. **Testing Architecture (`dart-generate-test-mocks`)**: Detects handwritten fake or mock class definitions without mockito or mocktail. 6. **Testing Architecture (`dart-matcher-best-practices`)**: Detects unidiomatic expect() assertions (e.g. expect(x.length, ...) or expect(x.isEmpty, true)). 7. **Dart 3 Language Idioms (`dart-seal-type-hierarchies`)**: Detects closed type hierarchies that are not sealed, so the compiler cannot check switch exhaustiveness over them.
<!-- DISCOVERY_RULES_END -->
To capture complex cross-cutting architectural patterns beyond regexes:
1. Generate the condensed repository outline (~1k tokens):
dart run dash_discover <path-to-target-package> --outline-only
2. The outline captures:
`sem entities lib/ --signatures`). 3. Pass the generated prompt (`--prompt-only`) and outline to a fast model (such as Gemini Flash) along with the active skills catalog to evaluate semantic architectural fit with concrete file evidence.
---
When `dash-discover` produces recommendations:
1. **Triage by Lifecycle & Confidence**:
testing migrations), prioritized by confidence and affected file count.
as recurring sweeps rather than one-time migrations.
migration at a time). 2. **Follow the Resolved Skill Target**:
`--json` and a clickable link in Markdown.
follow the local `SKILL.md` directly (`file://...`).
`github_url` or install the skill into your agent environment before applying changes. 3. **Verify Empirically**:
General best practices for Dart development. Covers code style, effective Dart, and language features.
Best practices for validating Dart documentation comments. Covers using `dart doc` to catch unresolved references and macros.
Guidelines for handling long lines in Dart code to adhere to the 80-column rule. The `lines_longer_than_80_chars` lint.
Best practices for using `expect` and `package:matcher`. Focuses on readable assertions, proper matcher selection, and avoiding…
Guidelines for using modern Dart features (v3.0 - v3.10) such as Records, Extension Types, Class Modifiers, Wildcards, Digit…
Guidelines and best practices for refactoring consecutive prints, single-line string concatenations, and complex output blocks…