migrate-intellij-util

Migrates Java and Kotlin code to IntelliJ com.intellij.util utility classes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

IntelliJ plugin codebases often use standard Java collections and string utilities that waste memory and diverge from platform conventions. This Skill guides incremental, verified migration of standard Java/Kotlin classes to IntelliJ's specialized com.intellij.util implementations.

Core Features & Use Cases

  • API Migration Mapping: Replaces ArrayList with SmartList, HashMap with ContainerUtil maps, string operations with StringUtil, javax.swing.Timer with Alarm, and null checks with ObjectUtils.
  • Safe Incremental Workflow: Limits each change to a single package and a maximum of 50 lines, with baseline and post-migration verification via ./gradlew testClasses, test, and verifyPlugin.
  • Review-Ready Reporting: Produces a migration summary, manual test steps with exact IDE navigation paths, and a suggested Git commit message without committing automatically.
  • Use Case: A Flutter IntelliJ plugin maintainer wants to reduce memory overhead by converting HashMap usages in one package to ContainerUtil maps while confirming no test regressions.

Quick Start

Ask the assistant to migrate one standard Java collection usage in a single package to its com.intellij.util equivalent and verify the build with Gradle tests.

Frequently Asked Questions about migrate-intellij-util

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

FAQPage Schema
How do I migrate Java collections to IntelliJ ContainerUtil?

Replace HashMap or ConcurrentHashMap instantiations with the equivalent ContainerUtil factory methods in a single package. Then run ./gradlew testClasses, test, and verifyPlugin to confirm the migration compiles and passes all tests.

What IntelliJ util classes replace standard Java APIs?

Common replacements include SmartList for ArrayList, ContainerUtil for HashMap, StringUtil for string operations, PathUtil for path handling, Alarm for javax.swing.Timer, ObjectUtils for null checks, and ArrayUtil for array resizing.

Does this migration work with Kotlin code in IntelliJ plugins?

Yes, the migration targets both Java and Kotlin sources in IntelliJ plugin projects. The com.intellij.util classes are interoperable with Kotlin and can replace standard library calls in either language.

Why limit IntelliJ API migrations to 50 lines per change?

Small, single-package changes keep reviews manageable and make regressions easy to isolate. The workflow enforces this constraint alongside Gradle test verification so each migration step is independently verifiable.

When should I use Alarm instead of javax.swing.Timer?

Use Alarm for UI-related callbacks and debouncing in IntelliJ plugins because it integrates with the platform's threading and disposal lifecycle. This prevents leaked timers when IDE components are closed.