dart-tooling
Run Dart tooling workflows for static analysis, dependency conflict resolution, and test migration to package:checks. Use when fixing analyzer errors, resolving pub dependency conflicts, or modernizing test assertions.
What this skill does
# Dart Tooling & Package Workflows ## Contents - [Static Analysis Resolution](#static-analysis-resolution) - [Resolving Package Conflicts](#resolving-package-conflicts) - [Migrating Tests to package:checks](#migrating-tests-to-packagechecks) ## Static Analysis Resolution Use this sequential workflow to identify, fix, and verify static analysis errors in a Dart project. 1. **Run Static Analyzer**: `dart analyze . --fatal-infos` 2. **Apply Automated Fixes**: - `dart fix --dry-run` - `dart fix --apply` 3. **Resolve Manually**: Address Type Mismatches, Null Safety, or Invalid Overrides that `dart fix` couldn't automatically resolve. 4. **Verify**: Ensure both `dart analyze .` and `dart test` pass. ## Resolving Package Conflicts When `pub get` fails due to incompatible package versions, use this systematic approach. ### Understanding `dart pub outdated` | Column | Meaning | |---|---| | **Current** | Version in `pubspec.lock` right now | | **Upgradable** | Latest version allowed by `pubspec.yaml` constraints | | **Resolvable** | Latest version that CAN be resolved with all other deps | | **Latest** | Latest published version (ignoring constraints) | ```bash dart pub outdated ``` ### Version Constraint Best Practices - **Use Caret Syntax**: Always use `^1.2.3` — allows non-breaking updates up to next major version. - **Tighten Dev Dependencies**: Set lower bounds to exact current version for `dev_dependencies`. - **CI Reproducibility**: Use `dart pub get --enforce-lockfile` in CI to ensure exact tested versions. ### Upgrading Dependencies **If updating to "Upgradable" versions:** ```bash dart pub upgrade dart pub upgrade --tighten # Auto-update lower bounds in pubspec.yaml ``` **If updating to "Resolvable" versions (major):** 1. Manually edit `pubspec.yaml` to bump constraints. 2. Run `dart pub upgrade`. 3. Run `dart analyze` → fix breaking API changes. 4. Run `dart test` → fix regressions. ### Surgical Lockfile Removal **NEVER** delete the entire `pubspec.lock`. This causes uncontrolled upgrades across the dependency graph. Instead, remove ONLY the conflicting package's block: 1. Open `pubspec.lock`. 2. Find and delete ONLY the conflicting package's YAML block. 3. Run `dart pub get` — fetches newest compatible version for that package only. 4. Verify: `dart pub deps` → check dependency graph resolves correctly. ### Temporary Overrides (Last Resort) ```yaml dependency_overrides: shared_package: ^x.y.z # Remove once direct deps support newer version ``` ## Migrating Tests to package:checks Transition test assertions from the `package:matcher` syntax to the literate API provided by `package:checks` for more readable output. - **Dependency**: Add `dev_dependency` `checks` via `dart pub add dev:checks`. - **Basic Equality:** Replace `expect(actual, equals(expected))` with `check(actual).equals(expected)`. - **Type Checking:** Replace `expect(actual, isA<Type>())` with `check(actual).isA<Type>()`. - **Asynchronous Expectations:** - `await check(Future.value(10)).completes((it) => it.equals(10));` - **Workflow**: 1. Add `package:checks` and import `package:checks/checks.dart`. 2. Rewrite `expect()` calls to `check()`. 3. Run static analyzer and tests to verify.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.