cleanup-code-inspections

Reduce technical debt and improve code quality by systematically resolving static analysis warnings.

npx skills add https://github.com/flutter/flutter-intellij --skill cleanup-code-inspections

Skill: Code Inspection & Cleanup

You are tasked with reducing technical debt and improving code quality by systematically resolving static analysis warnings.

Objective

Reduce technical debt and improve code quality by systematically resolving static analysis warnings.

Workflow Instructions

1. Baseline

  • Run ./gradlew test and ./gradlew verifyPlugin to ensure the project is stable.

2. Run Inspection

  • Execute Analyze > Inspect Code... on the project (or a specific module) using the "Default" profile.

3. Prioritize

  • Focus first on "Probable bugs", "Performance", and "Memory" categories.

4. Refactor

  • Apply quick-fixes for obvious issues (e.g., "Result of method call ignored", "String concatenation in loop").

5. Suppress

  • Explicitly suppress false positives with a comment and reason (e.g., //noinspection [ID] - [Reason]).

6. Verify

  • Run ./gradlew testClasses to ensure safe refactoring.
  • Run ./gradlew test and ./gradlew verifyPlugin to ensure no regressions.
  • Re-run analysis to ensure the "Yellow code" count has decreased and no regressions were introduced.

7. Report & Review

  • Summarize the inspections resolved.
  • Test Location: Explicitly state where in the IDE the user should go to test the changed functionality (e.g., "Go to Preferences > Languages & Frameworks > Flutter").
  • Action: Ask the user to review the changes closely.
  • Do not commit or push.
  • Provide a suggested Git commit message (e.g., "Cleanup: Resolve static analysis warnings in [Module]").

More skills from flutter

dart-modern-features
flutter
To find candidates for modernization:
flutter-fix-layout-issues
flutter
Fixes Flutter layout errors (overflows, unbounded constraints) using Dart and Flutter MCP tools. Use when addressing "RenderFlex overflowed", "Vertical…
adding-release-notes
flutter
Adds user-facing change descriptions to DevTools release notes. Use when documenting improvements, fixes, or new features in the NEXT_RELEASE_NOTES.md file.
reviewing-devtools-prs
flutter
DevTools repository-specific PR review workflow enforcing DevTools style guidelines and common review patterns. Use when reviewing pull requests in the…
dart-use-primary-constructors
flutter
Help users write syntactically and semantically correct primary constructors in Dart, and migrate/use the new constructor syntax, empty-body semicolon syntax,…
code-documentation
flutter
Guide for writing effective code documentation, including docstrings, JSDoc, dartdoc, and implementation comments. Use this skill when writing new code, adding…
api-review
flutter
Reviews the specified code against the canonical API Design guidelines. Use this skill when the user asks for an API review or to check code against API design…
flutter-accessibility
flutter
Implement WCAG 2 and EN 301 549 accessibility standards and adaptive layouts in Flutter apps. Enforces semantic annotations, tap target sizes (48x48 dp minimum), and text contrast ratios (4.5:1 for small text, 3:1 for large) across mobile, web, and desktop platforms Provides decision logic for web semantics initialization, interactive widget wrapping, screen-size-based layout switching, and keyboard/mouse input handling Includes focus traversal management via FocusTraversalGroup and...