cleanup-unused-assets

Removes unreferenced icons and resources from the Flutter IntelliJ plugin to reduce plugin size.

2.0k|355|Updated Jul 25, 2016
One-click install
npx skills add https://github.com/flutter/flutter-intellij --skill cleanup-unused-assets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-unused-assets
Source: https://github.com/flutter/flutter-intellij/tree/main/.agents/skills/cleanup-unused-assets
Command: npx skills add https://github.com/flutter/flutter-intellij --skill cleanup-unused-assets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

IntelliJ plugin projects accumulate unused icons, images, and resources over time, bloating the plugin distribution. Manually auditing every asset against code references is tedious and error-prone.

Core Features & Use Cases

  • Asset Scanning: Lists all files in resources/icons and other asset directories of the plugin project.
  • Reference Detection: Searches code and plugin.xml to determine whether each asset is actually referenced.
  • Safe Removal with Verification: Deletes zero-reference assets, then runs ./gradlew buildPlugin, test, and verifyPlugin to confirm no missing-resource regressions.
  • Use Case: Before a plugin release, run this Skill to strip dozens of orphaned icons from resources/icons, verify the build still passes, and receive a summary with a suggested commit message for review.

Quick Start

Ask the assistant to scan the plugin's resources/icons directory, remove any assets not referenced in code or plugin.xml, and verify the build still passes.

Frequently Asked Questions about cleanup-unused-assets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove unused icons from an IntelliJ plugin project?

List all files in resources/icons, search the codebase and plugin.xml for references to each asset, and delete those with zero references. Then run ./gradlew buildPlugin and verifyPlugin to confirm the plugin still loads without missing resource errors.

How to reduce IntelliJ plugin size before release?

Audit asset directories such as resources/icons for unreferenced files and remove them, since orphaned images inflate the plugin distribution. Verify the result with Gradle build and test tasks to catch any broken resource references.

Does deleting unused resources break the IntelliJ plugin build?

It can if an asset is referenced indirectly or loaded dynamically. This workflow mitigates that risk by running ./gradlew buildPlugin, test, and verifyPlugin after deletion and asking the user to review all deletions before committing.

What are the limitations of automated unused asset detection?

Static reference searches can miss assets loaded via reflection, dynamic path construction, or external configuration. That is why the workflow requires manual review of deletions and suggests manual test steps rather than committing automatically.