b2b-android-import-cleaner

Remove unused imports from Kotlin and Java source files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/herren-official/product-agents --skill b2b-android-import-cleaner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: b2b-android-import-cleaner
Source: https://github.com/herren-official/product-agents/tree/main/skills/b2b-Android/import-cleaner
Command: npx skills add https://github.com/herren-official/product-agents --skill b2b-android-import-cleaner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unused imports in Kotlin/Java files create noise and can slow code reviews and minorly impact builds. This skill detects and removes dead imports to keep code clean and efficient.

Core Features & Use Cases

  • Detect unused imports in Kotlin and Java source files, including staged and unstaged changes.
  • Remove unused imports automatically or generate a report for manual review.
  • Integrate with commit workflows (pre-commit hooks) and manual runs for Android/Kotlin projects.

Quick Start

Automatically run the Import Cleaner on staged Kotlin/Java files to remove unused imports before committing.

Frequently Asked Questions about b2b-android-import-cleaner

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

FAQPage Schema
How do I remove unused imports from Kotlin and Java files before a git commit?

To remove unused imports before a commit, you can run an import cleaner that scans staged and unstaged Kotlin and Java source files to detect and delete dead import statements automatically.

What is the best way to detect dead imports in Android projects?

The best way to detect dead imports in Android projects is to use a static analysis import cleaner that scans source files to identify unused statements, offering either safe auto-fix or reporting options for manual review.

Can I automatically clean unused imports in staged files without affecting wildcard imports?

Yes, automated import cleaning can target staged files while specifically excluding wildcard imports and annotations, safely removing only the confirmed unused import statements without breaking your code.

Does the import cleaner work with both staged and unstaged Kotlin source files?

Yes, the import cleaner works with both staged and unstaged Kotlin source files, scanning your working directory as needed to ensure all unused import statements are detected and removed.

What are the limitations of using automated import cleanup for Kotlin and Java?

Limitations of automated import cleanup include the need to carefully exclude wildcard imports and annotations during scanning, as automatic removal might otherwise alter code behavior if not configured for safe auto-fixing.