🎯 Dart Cleanup & Refactoring Router
[!NOTE]
Personal Environment Router: This skill is optimized for @kevmoo's local development environment and assumes specialized skills are checked out under ~/github/kevmoo/ and ~/github/dart-lang/. Other users should clone the required repositories or adapt the catalog paths in Skill Catalog to match their local layout.
Orchestrates specialized Dart workflows from local GitHub checkouts without pre-loading heavy individual skills into static prompt memory.
🛠️ Operating Protocol
1. Intent Evaluation & Confidence Matching (Strict Single-Skill Target)
When invoked with text (e.g. /dart-cleanup convert expect matchers to checks), evaluate the input against the Skill Catalog using this 3-tier confidence decision tree:
- Tier 1: Unambiguous Clear Match (High Confidence / 90%+ sure)
- Exactly 1 skill in the catalog clearly maps to the requested transformation.
- Action:
- Check for the target
SKILL.md at its candidate path in ~/github/.
- If missing, output the Missing Checkout Safety Net.
- If present, call
view_file on the target SKILL.md, hydrate its untruncated instructions into active context, and execute the refactoring immediately.
- Tier 2: Uncertain / Close Match (Medium Confidence)
- A skill seems close or relevant, but there is ambiguity.
- Action: Stop and ask the user for confirmation before hydrating:
"I think you might mean <skill-name> (SKILL.md). Would you like me to load and run this workflow?"
- Tier 3: No Clear Match or Bare Invocation (Low Confidence / Empty Input)
- No skill matches the prompt, or
/dart-cleanup was invoked with no arguments.
- Action: Output:
"I couldn't find an unambiguous skill match for your request. Here is the catalog of available specialized Dart skills:"
Render the categorized Skill Catalog with clickable file:// links so the user can choose.
2. Missing Checkout Safety Net
If a target SKILL.md is selected but missing from the local filesystem, output:
⚠️ Missing local checkout: Target skill <skill-name> was not found at ~/github/.... Please ensure https://github.com/<org>/<repo> is cloned into ~/github/.
📋 Skill Catalog & Path Priority
A. Refactoring & Code Quality
dart-cognitive-complexity: Reduces cognitive complexity, nested loops, and deep conditionals via pattern matching & guard clauses. Includes a gated Tier 3 method-object reference for extreme cases.
dart-undead: Audits, triages, and safely remediates unreachable and dead declarations in Dart and Flutter codebases using deterministic reachability analysis (pkg:undead).
dart-dedupe: Detects, audits, and safely remediates structural code duplication across Dart and Flutter repositories using the standalone Dedupe engine (pkg:dedupe) and empirical test gating.
dart-build-cli-app: CLI entrypoint structure, argument parsing, cross-platform scripts, exit codes.
B. Language Modernization & Formatting
dart-best-practices: Effective Dart guidelines, class design, null safety, and general style.
dart-modern-features: Records, pattern matching, switch expressions, extension types, class modifiers.
dart-multiline-strings: Converts consecutive print statements & string concatenations into triple-quoted strings.
dart-long-lines: Formats code to adhere to the 80-column line limit (lines_longer_than_80_chars).
C. Testing & Assertions
dart-migrate-to-checks-package: Converts legacy expect(a, equals(b)) matchers to modern package:checks syntax (check(a).equals(b)).
dart-use-pattern-matching: Refactors complex conditionals and destructuring to idiomatic Dart 3 pattern matching.
dart-test-fundamentals: Core package:test practices, grouping, setUp/tearDown lifecycles, and dart_test.yaml.
dart-matcher-best-practices: Best practices for legacy package:matcher assertions.
dart-collect-coverage: Collecting coverage using package:coverage and creating LCOV reports.
1---2name: dart-cleanup3description: Orchestrates specialized Dart refactoring, code quality, testing, and modern language features on demand. Use when cleaning up, modernizing, refactoring, or optimizing Dart code. Don't use for non-Dart projects or general codebase search.4---56# 🎯 Dart Cleanup & Refactoring Router78> [!NOTE]9> **Personal Environment Router**: This skill is optimized for `@kevmoo`'s local development environment and assumes specialized skills are checked out under `~/github/kevmoo/` and `~/github/dart-lang/`. Other users should clone the required repositories or adapt the catalog paths in [Skill Catalog](#-skill-catalog) to match their local layout.1011Orchestrates specialized Dart workflows from local GitHub checkouts without pre-loading heavy individual skills into static prompt memory.1213---1415## 🛠️ Operating Protocol1617### 1. Intent Evaluation & Confidence Matching (Strict Single-Skill Target)1819When invoked with text (e.g. `/dart-cleanup convert expect matchers to checks`), evaluate the input against the [Skill Catalog](#-skill-catalog) using this 3-tier confidence decision tree:2021* **Tier 1: Unambiguous Clear Match (High Confidence / 90%+ sure)**22 * Exactly 1 skill in the catalog clearly maps to the requested transformation.23 * *Action*:24 1. Check for the target `SKILL.md` at its candidate path in `~/github/`.25 2. If missing, output the [Missing Checkout Safety Net](#missing-checkout-safety-net).26 3. If present, call `view_file` on the target `SKILL.md`, hydrate its untruncated instructions into active context, and execute the refactoring immediately.27* **Tier 2: Uncertain / Close Match (Medium Confidence)**28 * A skill seems close or relevant, but there is ambiguity.29 * *Action*: Stop and ask the user for confirmation before hydrating:30 > *"I think you might mean **`<skill-name>`** ([SKILL.md](file:///path/to/SKILL.md)). Would you like me to load and run this workflow?"*31* **Tier 3: No Clear Match or Bare Invocation (Low Confidence / Empty Input)**32 * No skill matches the prompt, or `/dart-cleanup` was invoked with no arguments.33 * *Action*: Output:34 > *"I couldn't find an unambiguous skill match for your request. Here is the catalog of available specialized Dart skills:"*35 Render the categorized [Skill Catalog](#-skill-catalog) with clickable `file://` links so the user can choose.3637### 2. Missing Checkout Safety Net38If a target `SKILL.md` is selected but missing from the local filesystem, output:39> ⚠️ **Missing local checkout**: Target skill `<skill-name>` was not found at `~/github/...`. Please ensure `https://github.com/<org>/<repo>` is cloned into `~/github/`.4041---4243## 📋 Skill Catalog & Path Priority4445### A. Refactoring & Code Quality46* **`dart-cognitive-complexity`**: Reduces cognitive complexity, nested loops, and deep conditionals via pattern matching & guard clauses. Includes a gated Tier 3 method-object reference for extreme cases.47 * *Path*: [SKILL.md](file://~/github/kevmoo/analytica.dart/skills/dart-cognitive-complexity/SKILL.md)48* **`dart-undead`**: Audits, triages, and safely remediates unreachable and dead declarations in Dart and Flutter codebases using deterministic reachability analysis (`pkg:undead`).49 * *Path*: [SKILL.md](file://~/github/kevmoo/analytica.dart/skills/dart-undead/SKILL.md)50* **`dart-dedupe`**: Detects, audits, and safely remediates structural code duplication across Dart and Flutter repositories using the standalone Dedupe engine (`pkg:dedupe`) and empirical test gating.51 * *Path*: [SKILL.md](file://~/github/kevmoo/analytica.dart/skills/dart-dedupe/SKILL.md)52* **`dart-build-cli-app`**: CLI entrypoint structure, argument parsing, cross-platform scripts, exit codes.53 * *Path*: [SKILL.md](file://~/github/dart-lang/skills/skills/dart-build-cli-app/SKILL.md)5455### B. Language Modernization & Formatting56* **`dart-best-practices`**: Effective Dart guidelines, class design, null safety, and general style.57 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-best-practices/SKILL.md)58* **`dart-modern-features`**: Records, pattern matching, switch expressions, extension types, class modifiers.59 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-modern-features/SKILL.md)60* **`dart-multiline-strings`**: Converts consecutive print statements & string concatenations into triple-quoted strings.61 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-multiline-strings/SKILL.md)62* **`dart-long-lines`**: Formats code to adhere to the 80-column line limit (`lines_longer_than_80_chars`).63 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-long-lines/SKILL.md)6465### C. Testing & Assertions66* **`dart-migrate-to-checks-package`**: Converts legacy `expect(a, equals(b))` matchers to modern `package:checks` syntax (`check(a).equals(b)`).67 * *Path*: [SKILL.md](file://~/github/dart-lang/skills/skills/dart-migrate-to-checks-package/SKILL.md)68* **`dart-use-pattern-matching`**: Refactors complex conditionals and destructuring to idiomatic Dart 3 pattern matching.69 * *Path*: [SKILL.md](file://~/github/dart-lang/skills/skills/dart-use-pattern-matching/SKILL.md)70* **`dart-test-fundamentals`**: Core `package:test` practices, grouping, `setUp`/`tearDown` lifecycles, and `dart_test.yaml`.71 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-test-fundamentals/SKILL.md)72* **`dart-matcher-best-practices`**: Best practices for legacy `package:matcher` assertions.73 * *Path*: [SKILL.md](file://~/github/kevmoo/dash_skills/skills/dart-matcher-best-practices/SKILL.md)74* **`dart-collect-coverage`**: Collecting coverage using `package:coverage` and creating LCOV reports.75 * *Path*: [SKILL.md](file://~/github/dart-lang/skills/skills/dart-collect-coverage/SKILL.md)76