audit-ui-thread-safety

Audits IntelliJ plugin code for EDT blocking calls and migrates heavy work to background threads.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI freezes in IntelliJ-based IDEs occur when I/O operations or heavy computations run on the Event Dispatch Thread (EDT). This Skill audits plugin code for threading violations and guides the migration of blocking calls to background threads, keeping the IDE responsive.

Core Features & Use Cases

  • EDT Usage Audit: Searches the codebase for runInEdt, invokeLater, and invokeAndWait usages and checks whether they contain file access, network calls, or heavy computation.
  • Background Migration: Refactors blocking work to Task.Backgroundable or ReadAction.nonBlocking and verifies modal dialogs do not block the UI thread.
  • Verification Workflow: Runs ./gradlew test, ./gradlew verifyPlugin, and a sandbox IDE session (./gradlew runIde) to confirm no regressions or deadlocks.
  • Use Case: A Flutter plugin developer notices the IDE freezes when opening a project. Use this Skill to locate the blocking call on the EDT, move it to a background task, and verify the fix with tests and manual steps.

Quick Start

Audit the current project for UI thread safety violations and move any blocking calls off the EDT, then verify with the Gradle test suite.

Frequently Asked Questions about audit-ui-thread-safety

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

FAQPage Schema
How do I fix UI freezes in an IntelliJ plugin?

UI freezes are fixed by moving blocking work off the Event Dispatch Thread. Audit usages of runInEdt, invokeLater, and invokeAndWait, then migrate I/O or heavy computation to Task.Backgroundable or ReadAction.nonBlocking and verify with Gradle tests.

How to audit IntelliJ plugin code for EDT violations?

Search the codebase for runInEdt, invokeLater, and invokeAndWait calls, then inspect each block for file access, network calls, or heavy computation. Any blocking work found inside these UI blocks must be moved to a background thread.

What is the difference between Task.Backgroundable and ReadAction.nonBlocking?

Task.Backgroundable runs a task on a background thread with optional progress display, while ReadAction.nonBlocking schedules a non-blocking read action that can be cancelled when write actions occur. Both keep long work off the EDT.

How do I verify threading changes did not break the plugin?

Run ./gradlew testClasses and ./gradlew test to confirm safe refactoring, then ./gradlew verifyPlugin for compatibility checks. Finally launch a sandbox IDE with ./gradlew runIde and exercise the changed code paths while watching for freezes.

Why do modal dialogs cause UI freezes in IntelliJ?

Modal dialogs block the UI thread when they perform long-running work while holding the EDT. Verify dialogs do not execute I/O or heavy computation during display, and move such work to background tasks before showing the dialog.