Migrate Intellij Util
Developmentmigrate-intellij-utilMigrate Intellij Util is an Agent Skill for development published in the flutter/flutter-intellij repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Optimize memory usage, consistency, and performance by migrating standard Java/Kotlin classes to IntelliJ's specialized com.intellij.util implementations.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/flutter/flutter-intellij/blob/HEAD/.agents/skills/migrate-intellij-util/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/migrate-intellij-util, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Skill: API Migration to use com.intellij.util.* classes and methods
You are tasked with optimizing memory usage, consistency, and performance by migrating standard Java/Kotlin classes to IntelliJ's specialized com.intellij.util implementations.
Objective
Go read https://javadoc.jetbrains.net/teamcity/openapi/current/com/intellij/util/package-summary.html, and then optimize memory usage, consistency, and performance by migrating standard Java/Kotlin classes to IntelliJ's specialized com.intellij.util implementations.
Candidates for Migration
ArrayList->SmartList(for potentially empty/small lists)HashMap/ConcurrentHashMap->ContainerUtilmapsStringmanipulation ->StringUtil(e.g.,isEmpty,join,notNullize)Path/Filestring manipulation ->PathUtiljavax.swing.Timer->Alarm(for UI-related callbacks/debouncing)- Null checks ->
ObjectUtils(e.g.,doIfNotNull,coalesce) - Array resizing/merging ->
ArrayUtil
Workflow Instructions
1. Baseline
- Run
./gradlew testClasses,./gradlew test, and./gradlew verifyPluginto ensure project is in a good state.
2. Select Target
- Identify a single migration opportunity within a single package.
3. Constraint
- Keep the change extremely small (max 50 lines of code change).
4. Migrate
- Replace standard API with the
com.intellij.utilequivalent.
5. Verify
- Run
./gradlew testClassesto ensure migration didn't break test compilation. - Run
./gradlew testand./gradlew verifyPluginto ensure no regressions. - Suggest manual test steps: Check code changes made and write test steps for a user to execute that will trigger changed code paths. If needed, add logging statements to verify code paths have successfully run.
6. Report & Review
- Summarize the migration.
- Test Location: Explicitly state where in the IDE user should go to test changed functionality (e.g., "Go to Preferences > Languages & Frameworks > Flutter").
- Action: Ask user to review changes closely.
- Do not commit or push.
- Provide a suggested Git commit message (e.g., "Migrate code to use StringUtil in [Class Name]").