本文へ移動
cccskills
無料GitHub で公開日本語紹介

compose-ui-architecture

Compose Desktopの画面で状態や副作用をどこに持たせるか整理し、表示と判断の境界、再利用部品やリストの設計を整えます。

原文原文の説明を見る

Write Compose Desktop UI state, effects, and presenter boundaries.

JetBrains/intellij-communityスター 20,664(GitHub 20,664 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 画面とプレゼンターの責務を分けたいとき
  • UI状態の置き場所を整理したいとき
  • Effectやコルーチンの使い方を見直したいとき
  • 再利用部品や遅延リストを設計したいとき

日本語での紹介

できること

Compose Desktopの画面を変更するときに、コンポーザブル、プレゼンターやコーディネーター、状態保持層の役割を整理します。基本方針は「画面は描画し、プレゼンターが判断する」ことです。ホバーやフォーカスなど表示に限る一時状態は画面側に置き、アプリ状態、永続化、通信、ファイル操作、権限や業務判断は状態を持つ層に委ねます。rememberや各種Effectのキー、再利用コンポーネントのModifier、不変データとイベントコールバック、遅延リストの安定キーやcontentType、アニメーション、再コンポーズの負荷も確認項目に含みます。

こんなときに便利

Compose画面に機能を追加するとき、画面内に状態や業務ロジックを持たせすぎていないかを確認できます。Effectの依存関係や再利用コンポーネントのAPIを整えたいとき、リストやアニメーションの実装を見直したいときにも向いています。個別のUI変更を対象とし、コードベース全体の体系的な監査には別スキルが案内されています。

使い方の例

  • 「この画面の状態をコンポーザブルとプレゼンターに適切に分けてください」
  • 「このLaunchedEffectのキーと処理範囲を見直してください」
  • 「再利用可能なリスト項目のAPIと安定キーを整えてください」

注意点

プロジェクトにアーキテクチャ文書がある場合は、内容が異なるときにそちらを優先します。Jewel部品の選択やSwing/AWTとの連携は関連する別スキルの対象です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(8)

  • SKILL.md5.7 KB
  • evals/evals.json6.5 KB
  • references/animation.md11.3 KB
  • references/component-api-lists-performance.md3.7 KB
  • references/desktop-seams-review-output.md1.5 KB
  • references/effects.md1.7 KB
  • references/state-boundaries.md5.1 KB
  • skill-source.json2.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

Compose UI Architecture

Use this skill to keep Compose Desktop UI code architecturally correct while editing IntelliJ-style desktop surfaces. This skill provides authoring and review guardrails for individual changes. When the user asks for a systemic Compose UI architecture assessment across a codebase, use compose-ui-audit instead.

For general post-change review or cleanup, use the review subagents available in the current harness instead of stretching this skill beyond UI architecture. If subagent delegation is unavailable, run those review passes sequentially yourself.

Do not use this skill to replace project docs. If the project has architecture docs, treat them as authoritative when details conflict.

Pair With / Defer To

Pair it with:

  • Pair this skill with jewel-ui when selecting Jewel components, theme wrappers, icons, typography, and IntelliJ-style controls.
  • Pair this skill with jewel-swing-interop when configuring Swing/AWT hosting, ComposePanel, LocalComponent, popups, and bridge theme mechanics.

Defer these adjacent tasks instead of stretching this skill:

  • Use jewel-ui for component choice, label rules, icons, theme wrappers, typography, and Jewel visual style.
  • Use jewel-swing-interop for ComposePanel, AWT popup forwarding, LocalComponent, and host Swing component access.
  • Use configured review or refactoring subagents for general post-change code review or cleanup, or run those passes sequentially yourself if delegation is unavailable.
  • Use compose-ui-audit for a whole-surface systemic Compose UI architecture assessment.

Desktop Compose Terminology

Be precise with names:

  • In Android docs, ViewModel roughly maps to a desktop UI presenter/coordinator layer.
  • In desktop Compose code, a view model may also mean a view-layer data model / screen projection, such as ScreenState, RowModel, or SurfaceModel. Avoid ambiguity by naming whether you mean lifecycle owner or render model.
  • Do not introduce Android ViewModel, Hilt/Koin, Android lifecycle, or Navigation guidance into desktop Compose UI unless the project already uses those concepts.

Core Rule

Compositions render. Presenters decide.

Composables may own ephemeral visual state: hover, focus, animation progress, expansion toggles, tooltip visibility, and layout wiring. They must not own app state, persistence, RPC, file/process/network work, JSON parsing, model selection, permission policy, review workflow decisions, or workspace/config lookup.

Route those through presenters/coordinators or equivalent state-owning layers and expose ready-to-render view models to UI.

Fast Guardrail Pass

Before returning Compose UI code, silently check these questions:

  1. Boundary: does the composable render inputs, or does it decide business/app behavior?
  2. State: is local state truly ephemeral? If state mirrors app/session/project settings, move it up.
  3. Projection: should several values be combined into one presenter-owned screen state before UI sees them?
  4. Effects: does every effect stay minimal and key on the values that should restart it?
  5. Modifier: do reusable composables accept and forward modifier: Modifier = Modifier to the outermost layout?
  6. Lists: do movable and heterogeneous lazy-list items pass a stable key = parameter and a matching contentType = parameter?
  7. Performance: does composition avoid expensive transforms, object churn, and broad state reads?
  8. Animation: does the animation code use declarative APIs where possible, wrap stateful animation objects in remember, and read per-frame values in the layout or draw phase?
  9. API shape: do reusable components accept immutable data and event callbacks instead of presenter instances or mutable state objects?

If an answer is no, fix the shape before writing more code rather than documenting the violation.

Also check for false positives. Local hover state, focus requesters, text-field state, expansion toggles, scroll commands, and one-shot UI labels are usually fine in composition when they do not shadow app/session state.

Progressive Reference Files

Read only the reference files needed for the current task:

  • Read references/state-boundaries.md for rules on presenter/coordinator vs. state-holder vs. composition boundaries, desktop lifecycle, flow collection, CompositionLocal guardrails, and testing ownership.
  • Read references/effects.md for rules on remember, LaunchedEffect, DisposableEffect, snapshotFlow, coroutine scopes, and effect keys.
  • Read references/animation.md when choosing animation APIs, remembering Animatable state, launching target-driven effects, deferring animated reads, or using AnimatedContent, infinite transitions, and gesture-driven motion.
  • Read references/component-api-lists-performance.md for rules on reusable composable API shape, modifier contracts, lazy-list keys and content types, recomposition and performance smells, and healthy patterns to preserve.
  • Read references/desktop-seams-review-output.md for guidance on desktop dialogs, popups, shortcuts, clipboard and URI opening, window state, protocol and runtime seams, and the file-grounded review output format.

Review Output

When reviewing code with this skill, keep output short and file-grounded:

### path/to/File.kt
- Issue: [rule name]
- Why it matters: [one sentence]
- Fix: [specific direction or tiny before/after]

End with the top three fixes, highest impact first. Do not list clean files.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

actions

無料概要あり

IntelliJプラグインのAnActionと登録設定を実装・変更し、表示文言やアイコンの定義、非同期処理の起動方法を整えます。

  • IDEに新しいアクションを追加したいとき
  • アクションの登録やアイコンを変更したいとき
  • 表示名と説明文の定義を整理したいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

bazel-test-migration

無料概要あり

IntelliJのJPSテストモジュールをBazelへ移行し、Bazelだけで起きる失敗を依存関係や実行環境から切り分ける手順を案内します。

  • JPSテストをBazelへ移行したいとき
  • Bazelだけで起きるテスト失敗を調べたいとき
  • テストの依存関係やデータ設定を確認したいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

code-style

無料概要あり

IntelliJのKotlin・Javaコードを新規作成やレビューする際に、言語の選び方、書式、型の扱い、例外処理などのプロジェクト規約に沿って整えるスキルです。

  • IntelliJ規約に沿ってKotlinを書きたいとき
  • Javaコードをレビューしたいとき
  • 例外処理やsealed型の分岐を確認したいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

commits

無料概要あり

IntelliJ向けの変更を適切な単位に分け、チケットの有無に応じた形式で、理由や判断も伝わるコミットメッセージを作成・修正するスキルです。

  • チケット付き変更のメッセージを作りたいとき
  • テストやドキュメントのコミットを整理したいとき
  • 既存のコミットメッセージを修正したいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

compare-python-typecheckers

無料概要あり

Pythonコードの型推論や型エラーを複数の型チェッカーで比較し、各ツールの判定と診断内容をまとめたレポートを作成します。

  • 型推論の違いを比較したいとき
  • 型エラーになるか確かめたいとき
  • 複数チェッカーの診断を見比べたいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

compose-ui-audit

無料概要あり

Compose DesktopのUIコードを読み、状態管理、画面構成、副作用、コルーチン、再描画の性能など、設計と実行時の問題を具体例とともに監査するスキルです。

  • Compose画面の状態管理を監査したいとき
  • 副作用やコルーチンの使い方を点検したいとき
  • 再描画や遅延リストの性能を調べたいとき
JetBrains/intellij-community2.1万2026年10月26日 更新

JetBrains のスキルをすべて見る

このスキルの問題を報告する