본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

kotlin-ui-swing-component-architecture

IntelliJ 기반 제품의 Swing 기능 구조를 설계하거나 검토하는 스킬입니다. View, Controller, 상태, 비동기 작업, 생명주기의 책임을 정리하고 EDT에서 안전하게 화면을 갱신하면서 불필요한 추상화를 줄이도록 돕습니다.

원문원문 설명 보기

Design IntelliJ Swing UI components, state flow, and EDT work.

JetBrains/intellij-community스타 20,685(GitHub 20,685 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Swing 화면의 책임 정리하기
  • EDT와 비동기 작업 검토하기
  • 화면 상태와 폐기 책임 설계하기
  • IntelliJ 플러그인 UI 검토하기

한국어 소개

할 수 있는 일

이 스킬은 IntelliJ 기반 제품의 Swing UI에서 기능 경계와 책임을 정리하고, 기능 규모에 맞는 구성을 제안합니다. View는 위젯을 만들고 화면에 그리며, Controller는 입력을 검증하고 서비스를 호출하고, 서비스는 UI에 의존하지 않는 애플리케이션 처리를 담당하도록 나눕니다. 상태가 복잡하면 불변 상태와 단방향 데이터 흐름을 도입하도록 안내합니다. 비동기 작업 취소와 오래된 결과 처리, 이벤트 디스패치 스레드(EDT)에서의 안전한 화면 갱신, 폐기 시 정리 작업도 다룹니다. 기존 구성 요소의 조합을 우선하며 불필요한 추상화나 대규모 재작성을 피하는 방향입니다.

이럴 때 유용합니다

IntelliJ 플러그인 등의 Swing 화면을 새로 만들거나 변경하고 검토할 때 사용할 수 있습니다. 화면 클래스가 서비스 호출이나 비동기 작업까지 맡고 있거나 상태 관리, 스레드, 폐기 처리의 책임자가 불분명할 때 필요한 만큼만 분리하는 데 도움이 됩니다.

사용 예시

  • “이 Swing 화면에서 View와 Controller의 책임을 정리해 주세요.”
  • “EDT를 막는 작업이나 폐기 정리 누락이 있는지 검토해 주세요.”
  • “비동기 검색을 위한 최소한의 상태 관리를 설계해 주세요.”

주의 사항

재사용 가능한 Swing 위젯이나 사용자 지정 그리기를 새로 도입하려면, 필요한 이유와 표준 구성 요소로 대체할 수 없는 이유를 설명하고 사용자의 명시적 승인을 받아야 합니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호새 재사용 위젯과 사용자 지정 그리기는 이유 설명과 명시적 승인을 요구합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
A양호설계와 검토 절차 중심이며 추가 도구나 인증 정보를 요구하지 않습니다.

점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md16.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/kotlin-ui-swing-component-architecture/SKILL.md -->

Swing feature component architecture

Design Swing UI as isolated feature components with unidirectional data flow, explicit state, and clear EDT and lifecycle ownership. Introduce the smallest architecture that cleanly separates responsibilities; do not enforce MVC, MVP, MVVM, or MVI by name.

Workflow

  1. Read the local module instructions and inspect the whole feature boundary, including callers, services, listeners, asynchronous work, and disposal.

  2. Map ownership of rendering, user intent, UI state, application logic, asynchronous work, navigation, and lifecycle.

  3. Choose the lowest architecture level that makes those responsibilities clear.

  4. Keep Swing in the View, coordinate behavior in the Controller when one is needed, and keep application services independent of Swing.

  5. Make data flow one-way where state or workflows are non-trivial:

    user -> View --Intent--> Controller --calls--> Services
              ^                  |
              '--- render(State)-'
    
  6. Verify EDT safety, cancellation, disposal, state transitions, and the minimal public API.

  7. Apply the UI accessibility skill when creating, changing, or reviewing the UI itself.

Choose the architecture level

Treat line counts as prompts to inspect complexity, not hard thresholds.

  • Level 1 — one View or component class: Start here for a small feature, roughly under 200 LOC, containing only layout and local presentation behavior. Extract a Controller if it invokes services, owns workflows, or becomes hard to test or reason about.
  • Level 2 — View + Controller: Start here around 200-600 LOC when validation, services, navigation, or non-trivial interactions are present. Add immutable State when several visual modes or concurrent operations make implicit state ambiguous.
  • Level 3 — State + explicit Intent, optionally Reducer and Effects: Consider this for several asynchronous operations or a complex multi-step workflow, and only when the added types reduce branching and clarify transitions.

Never add an interface, presenter, reducer, effect layer, event bus, global UI store, or framework merely to satisfy a pattern. Require every abstraction to remove concrete duplication, isolate a dependency, make ownership clear, or make important behavior testable.

Prefer composition and platform components

Prefer existing IntelliJ Platform, JB UI, Kotlin UI DSL, or standard Swing components. Configure and compose them into a feature View instead of subclassing JComponent, JPanel, or another widget merely to provide layout, defaults, borders, or event wiring. A feature wrapper can own a root JComponent without being a Swing component itself. Subclass a Swing component only when the subtype has a genuine reusable widget contract or a platform integration point requires it.

Before implementing a new reusable Swing widget or any custom painting, stop and ask the user for explicit approval. This gate covers reusable JComponent subclasses, overrides of paint, paintComponent, or paintChildren, Painter implementations, and direct Graphics2D rendering. Explain why existing platform or standard components, composition, icons, borders, renderers, or UI DSL are insufficient, propose the closest standard alternative, and wait for approval. Existing custom components may be reviewed or refactored without retrospective approval; ask when the change introduces a new custom widget or new custom painting.

When a reusable custom widget is approved, give it a proper ComponentUI delegate. Keep reusable rendering, look-and-feel defaults, scaling and theme behavior, and UI-installed listeners in the delegate with symmetric installUI and uninstallUI lifecycle. Keep the widget's semantic state and public behavior in the JComponent subclass; do not put ad hoc painting into a feature View.

Define the feature boundary

Keep Swing types out of public or external APIs wherever possible. Exchange immutable state, domain values, stable IDs, and semantic callbacks. When Swing embedding is unavoidable, expose only the root JComponent at that integration seam and keep child widgets, models, renderers, painters, and raw Swing events private.

Prefer a concrete feature wrapper over a Swing subclass or an interface that consumers do not need:

internal class SearchComponent {
  private val searchField = JBTextField()

  val component: JComponent = JPanel(BorderLayout()).apply {
    add(searchField)
  }

  fun focusSearch() = searchField.requestFocusInWindow()

  fun clear() {
    searchField.text = ""
  }
}

If an API must be public, keep UI construction behind an internal integration point and expose domain-oriented operations. Do not expose buttons, lists, trees, text fields, models, or other internal widgets for outside manipulation.

Use the component or a nearby composition root to construct the View, Controller, services, and navigator. Prefer constructor injection. Restrict ApplicationManager.getApplication().getService(...) and similar lookups to composition roots or established platform integration points, never arbitrary View code.

Assign responsibilities

View

Make the View own Swing:

  • Construct widgets and layouts.
  • Render labels, icons, selection, visibility, enabled state, validation presentation, and animations.
  • Emit semantic user intents such as onSaveRequested, onRetryRequested, onSearchRequested(query), or onItemActivated(id).
  • Keep widgets private and provide render(state) when the feature has meaningful state.
  • Keep purely presentational transient details, such as focus, hover, caret position, or an uncommitted editor interaction, local when no application decision depends on them.

Do not let the View call repositories or services, start network or filesystem work, decide navigation, mutate domain objects, contain business rules, or block the EDT. Do not attach listeners to View widgets from outside the View.

Controller

Introduce a Controller when behavior no longer remains simple and local. Make it:

  • Subscribe to semantic View intents.
  • Validate and normalize user input.
  • Invoke services and navigation.
  • Own explicit UI state and state transitions.
  • Coordinate asynchronous work, stale-result protection, cancellation, errors, and retries.
  • Render the resulting state.
  • Own and release subscriptions and tasks.

Do not construct Swing layouts or reach into View widgets from the Controller.

Services

Keep application services independent of Swing, JComponent, widget models, and EDT assumptions. Pass domain values or dedicated data objects across the boundary. Inject navigation separately when it is a UI concern.

Model and render state

Introduce immutable state when the feature has multiple visual modes, asynchronous work, or decisions that would otherwise be inferred from widgets:

data class SearchState(
  val query: String,
  val loading: Boolean,
  val results: List<SearchResult>,
  val error: String?,
)

Use a sealed state hierarchy instead of combinations of booleans when modes are mutually exclusive. Do not mirror every widget property into state; model values that drive behavior or rendering.

Make render(state) deterministic, idempotent, and complete for the modeled state. Keep listener installation, service calls, navigation, and other effects out of rendering. Prefer one render operation over a sequence such as showSpinner(), hideRetry(), setItems(), and enableButton() that can leave the UI partially updated.

Never use widget properties as application state:

// Wrong: application decisions depend on the current rendering.
if (progressBar.isVisible) return
if (statusLabel.text == "Loading") return

Keep a single source of truth. Update it through one controller path, then render it:

private fun updateState(transform: (SearchState) -> SearchState) {
  state = transform(state)
  view.render(state)
}

Treat intents as semantic events

Translate raw Swing events inside the View. Emit domain-relevant values or stable IDs rather than widgets, indices whose meaning can change, or ActionEvent unless the Swing event itself is genuinely required.

Prefer:

view.onSearchRequested { query -> controller.search(query) }

over exposing searchButton, searchField, or resultList. Avoid a new event abstraction when a callback is enough.

Enforce EDT ownership

Treat the View and its widgets as EDT-confined unless a Swing API explicitly documents otherwise. Construct, read, and mutate Swing state on the EDT.

Inspect every listener and callback for blocking operations, including:

  • Future.get() or equivalent waits
  • Thread.sleep() and runBlocking
  • Network requests and process execution
  • Filesystem scans
  • Database queries
  • Expensive parsing or computation

Capture required input on the EDT, run expensive work away from it, then return to the EDT before updating state or rendering. Follow the surrounding module's platform coroutine, modality, read/write-action, and dispatcher conventions. Prefer a coroutine scope tied to the feature lifecycle; never use GlobalScope. If using SwingUtilities.invokeLater, verify that platform modality and disposal semantics do not require an IntelliJ scheduling API instead.

Modality rides in the coroutine context and defers on the EDT: capture a ModalityState per operation on the submitting thread (ModalityState.defaultModalityState()) and pass it to the work — launch(modality.asContextElement()) or invokeLater(runnable, modality) — rather than freezing one modality onto a long-lived scope. Work submitted with a modality lower than the currently open modal dialog is deferred until that dialog closes, which reads as a hang; completing with the modality captured at submit time dispatches it inside the originating modal state. ModalityState.any() is the opposite trap — it never defers, so a non-trivial callback can run inside an unrelated modal dialog while your model is mid-transition (reentrancy / inconsistent state); reserve any() for trivial, state-independent bookkeeping.

For concurrent requests, cancel obsolete work or tag requests and ignore stale completion. Preserve coroutine cancellation rather than converting it into a user-visible failure. Re-check lifecycle before applying results.

Own lifecycle

Prefer a CoroutineScope tied to the feature lifetime as the primary lifecycle mechanism: take a child scope of the enclosing project or service scope, or the scope the platform hands in, rather than constructing a standalone one. Launch asynchronous work, flow subscriptions, and retries in that scope so cancelling it tears everything down in one place.

For event, message-bus, RPC, or Flow subscriptions, use the shortest lifecycle that consumes the updates. Prefer a caller/client scope owned by the UI content, dialog, popup, tool-window panel, or explicit operation over an application- or project-level service scope. Use an app/project service scope only when the collected state is intentionally app/project-owned for that full lifecycle and retaining everything reachable from the stream for that lifetime is acceptable.

Avoid API methods that both start a subscription and expose a synchronous snapshot without an explicit owner. Split them into an owner-taking subscription method, for example one accepting CoroutineScope, and a snapshot accessor that only reads already-collected state. Action update paths and menu builders should read snapshots and must not implicitly start long-lived subscriptions. If a service caches per-project mirrors keyed by ProjectId, remove entries when the owning client scope completes.

Implement Disposable, AutoCloseable, or the lifecycle type already used by the module when a platform integration point requires it, and bridge it to the scope by cancelling the scope on disposal. Ensure teardown:

  • Removes listeners and subscriptions.
  • Stops timers and animations.
  • Cancels background work and pending retries.
  • Clears callbacks that could retain the View or Controller.
  • Prevents late results from rendering into a disposed UI.

Register child lifetimes with the IntelliJ Disposer where appropriate. Make repeated disposal safe.

Use IntelliJ Platform facilities deliberately

  • Prefer Kotlin UI DSL and JB UI components for new IntelliJ UI when they improve consistency or maintenance.
  • Prefer Kotlin UI DSL's listCellRenderer or textListCellRenderer over renderers based on SimpleColoredComponent when the DSL supports the required presentation.
  • Do not rewrite working Swing into Kotlin UI DSL unless requested or the migration materially improves the change.
  • Use the Action System for IDE actions and MessageBus for appropriate platform-wide communication, not for private button-to-controller events.
  • Use localized message bundles for user-visible text.
  • Follow platform coroutine, threading, and lifecycle conventions already established in the owning module.

Refactor incrementally

  1. Identify one feature boundary and preserve its current external behavior.
  2. Encapsulate widgets behind the View or component API.
  3. Translate raw listeners into semantic intents.
  4. Move validation, service calls, navigation, and workflows into the Controller.
  5. Introduce immutable state only when it replaces ambiguous or duplicated widget-derived state.
  6. Consolidate rendering into render(state) when several methods can diverge.
  7. Move expensive work off the EDT and guard against stale or late results.
  8. Add lifecycle cleanup.
  9. Split further only when a remaining class still owns unrelated responsibilities.

Do not perform a large architectural rewrite when a small extraction resolves the ownership problem.

Test at the right boundary

  • Test controller state transitions, validation, service interactions, errors, cancellation, and stale-result handling without requiring real network or filesystem work.
  • Test View rendering and semantic event translation on the EDT.
  • Test disposal when listeners, timers, or background tasks exist.
  • Prefer observable behavior over tests that reach into private widgets.
  • Do not introduce a View interface solely to satisfy a mocking framework; add a narrow test seam only when it has a concrete design benefit.

Classify architecture findings

Treat these as severity defaults and adjust for actual impact.

  • Critical: Blocking the EDT; accessing Swing from background threads; network, filesystem, database, or domain mutations in the View; domain layers depending on Swing.
  • Major: Exposed internal widgets or unnecessary Swing types in public APIs; avoidable Swing inheritance; unnecessary custom widgets or painting; a reusable custom widget without a proper ComponentUI; application state inferred from widgets; Controller-built layouts; uncancelled or stale async results; missing lifecycle cleanup; a god panel mixing UI, services, and workflows.
  • Minor: Large anonymous listeners; unnecessary widget getters or interfaces; mixed construction and behavior that remains understandable; small duplication in imperative rendering.

A panel over roughly 500 lines is a review signal, not an automatic defect. Judge responsibility count, coupling, asynchronous behavior, and change risk.

Produce architecture reviews

When reviewing code, use these exact headings. Cite concrete symbols or file locations, distinguish observed facts from recommendations, and write None when a section has no findings.

Architecture Assessment

State the feature boundary, current complexity, selected architecture level, and whether a refactor is justified.

Current Responsibilities

Map rendering, intents, state, application logic, asynchronous work, navigation, and lifecycle to their current owners.

Architecture Problems

List Critical, Major, and Minor findings with evidence and impact.

Critical Issues

Call out EDT violations, blocking, domain/Swing dependency inversion, unsafe late results, or other correctness risks that require priority.

Suggested Component Structure

Show the smallest useful target structure and its public boundary.

Minimal Refactoring Plan

Give ordered, behavior-preserving steps. Separate necessary work from optional cleanup.

Example Code

Provide a focused example or patch shape for the highest-value change; do not rewrite the whole feature unless requested.

Trade-offs

Explain added types or state, rejected heavier patterns, testing impact, migration risk, and any manual verification still needed.

Guiding principle

Make Views know how the UI looks, Controllers know what the user wants, services know how the application works, and state describe what should be visible. Never let Swing widgets become the application's state or business layer.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

actions

무료요약 있음

IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.

  • IDE 메뉴에 새 동작 추가
  • 동작 등록이나 아이콘 변경
  • 동작 이름과 설명 정리
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

bazel-test-migration

무료요약 있음

IntelliJ JPS 테스트 모듈을 Bazel로 옮기고 Bazel에서만 발생하는 실패를 조사하는 안내서입니다. 의존성, 플러그인, 테스트 데이터와 runfiles 문제를 확인하고 생성된 대상과 이전된 테스트를 검증합니다.

  • 기존 JPS 테스트 모듈을 Bazel로 이전할 때
  • Bazel에서만 실패하는 테스트를 조사할 때
  • 테스트 의존성과 데이터 설정을 확인할 때
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

code-style

무료요약 있음

IntelliJ 프로젝트 규칙에 맞춰 Kotlin과 Java 코드를 작성하거나 검토합니다. 언어 선택, 서식, 봉인 타입, 스레드 주석, 제어 흐름 예외 처리를 확인합니다.

  • IntelliJ 규칙에 맞는 Kotlin 작성
  • Java 코드 검토
  • 예외 처리와 봉인 타입 분기 확인
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

commits

무료요약 있음

이 가이드는 IntelliJ 프로젝트의 변경 사항을 목적별로 나누고 프로젝트 형식에 맞는 커밋 메시지를 작성하도록 돕습니다. 티켓이 있으면 번호와 변경 설명을, 없으면 레이블과 하위 시스템명을 사용하며 필요에 따라 이유와 판단을 본문에 담습니다.

  • 티켓이 있는 변경의 프로젝트 형식 메시지 작성
  • 테스트나 문서 커밋에 적절한 레이블 적용
  • 기존 커밋 메시지를 규칙에 맞게 수정
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compare-python-typecheckers

무료요약 있음

여러 Python 타입 검사기로 코드 조각이나 파일의 타입 추론과 오류 판정을 비교합니다. 도구별 결과, 실행 시간, 진단 내용을 Markdown 보고서로 모아 저장할 수 있습니다.

  • 검사기별 타입 추론 비교
  • 코드가 타입 오류로 판정되는지 확인
  • 여러 도구의 진단 결과 비교
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compose-ui-architecture

무료요약 있음

Compose Desktop 화면을 구성할 때 컴포저블은 렌더링을 맡고 프레젠터나 코디네이터는 앱 결정을 맡도록 구조를 정리합니다. 상태 소유권, Effect, 재사용 컴포넌트 API, 지연 목록 키, 애니메이션과 성능을 개별 UI 변경에 맞춰 살펴봅니다.

  • 화면 렌더링과 프레젠터 판단 분리
  • UI 상태를 둘 위치 정리
  • Effect 키와 코루틴 사용 검토
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

JetBrains의 스킬 모두 보기

이 스킬의 문제 신고