跳到正文
cccskills
免费在 GitHub 公开中文介绍

compose-ui-audit

审查 Compose Desktop 界面代码的架构和运行时问题,检查状态管理、副作用、协程、延迟列表、动画与重组,并按优先级列出发现。

原文查看原文说明

Audit Compose Desktop UI state and effects.

JetBrains/intellij-community星标 20,684(GitHub 20,684 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 审查 Compose 界面的状态管理
  • 检查副作用和协程用法
  • 调查延迟列表或重组性能

中文介绍

功能

本技能审查 Compose Desktop 界面代码中的架构边界和 Compose 运行时用法,并根据代码证据报告问题。它会检查应用状态或业务逻辑是否进入可组合函数、状态归属是否合适,以及 remember 的键和局部状态是否合理。审查范围还包括 LaunchedEffect、DisposableEffect、snapshotFlow、协程用法、流的收集方式和资源生命周期。

此外,技能会检查延迟列表的键和 contentType、重组期间执行的工作、动画 API、Modifier 的传递与顺序、可组合函数的规模及公开 API 形态。桌面端接点包括焦点、快捷键、对话框、文件选择器和剪贴板。每项发现会标出优先级、代码位置和修复建议,并说明审查范围与置信度;必要时还会参考测量或跟踪资料。

适用场景

需要检查 Compose Desktop 页面或工具窗口中的状态管理和副作用设计时,可以使用本技能。排查重组缓慢或动画异常时,也可以根据具体代码位置整理可能原因。

使用示例

  • “请审查这个页面的 Compose 架构。”
  • “请检查这个工具窗口的状态管理和副作用。”
  • “请调查延迟列表和动画相关的性能隐患。”

注意事项

审查范围是 Compose Desktop 的架构和运行时,不包括视觉设计评价、Jewel 组件选择或 Android 专属设计。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好明确说明只读收集证据,未描述修改或对外发送。
安装难易度所需工具和 API 密钥是否少且有说明
A良好未指定 API 密钥或额外工具前提。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(39)

  • SKILL.md14.1 KB
  • evals/evals.json18.1 KB
  • references/api-hygiene.md8.8 KB
  • references/audit-search-patterns.md3.9 KB
  • references/boundary-violations.md3.3 KB
  • references/effects/derived-state-of-guide.md2.2 KB
  • references/effects/effect-selection-guide.md2.7 KB
  • references/effects/infinite-loop-patterns.md2.6 KB
  • references/effects/overview.md7.7 KB
  • references/lazy-layouts/animate-item.md2.0 KB
  • references/lazy-layouts/cache-window-and-prefetch.md3.2 KB
  • references/lazy-layouts/desktop-scroll-measurement.md2.0 KB
  • references/lazy-layouts/keys-and-content-type.md2.2 KB
  • references/lazy-layouts/nested-lazy-layouts.md1.6 KB
  • references/lazy-layouts/overview.md7.5 KB
  • references/measurement/benchmarking-methodology.md1.9 KB
  • references/measurement/overview.md5.5 KB
  • references/measurement/profiler-setup.md2.5 KB
  • references/modifiers/custom-modifier-node.md3.4 KB
  • references/modifiers/modifier-order.md2.1 KB
  • references/modifiers/overview.md7.4 KB
  • references/modifiers/phase-deferral.md2.6 KB
  • references/reporting-guidance.md2.3 KB
  • references/stability/ci-stability-gate.md2.0 KB
  • references/stability/desktop-measurement.md2.2 KB
  • references/stability/overview.md7.6 KB
  • references/stability/reading-classes-txt.md2.1 KB
  • references/stability/reading-composables-txt.md1.9 KB
  • references/stability/stabilising-types.md3.1 KB
  • references/stability/stability-config-syntax.md1.6 KB
  • references/stability/stability-inference-algorithm.md3.4 KB
  • references/stability/strong-skipping-escape-hatches.md2.6 KB
  • references/subcomposition/desktop-subcomposition-measurement.md1.7 KB
  • references/subcomposition/overview.md7.2 KB
  • references/subcomposition/subcomposition-decision-tree.md1.8 KB
  • references/subcomposition/swing-panel-subcomposition.md1.8 KB
  • references/tracing-setup.md5.3 KB
  • references/tracing-usage.md6.3 KB
  • skill-source.json2.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

Compose UI Audit

Audit Compose Desktop UI code for architectural correctness and Compose runtime hygiene. This workflow gathers read-only evidence rather than reviewing visual design. Use compose-ui-architecture for day-to-day authoring guardrails and jewel-ui for Jewel component and theming guidance.

If the user asks for a general review, cleanup pass, or broad investigation rather than a Compose UI architecture audit, use the review subagents available in the current harness. If subagent delegation is unavailable, run those review passes sequentially yourself.

Keep the audit proportional. A focused request on one file should get a focused file review; a broad request like "audit this tool window" should map the surface, sample representative files, and report systemic patterns.

Relationship To Agent Review Capabilities

  • For a quick second opinion on current changes, use an available read-only review subagent.
  • For cleanup or consolidation after implementation, use an available cleanup or refactoring subagent, then review the diff.
  • For a slow investigative review, use available deeper review subagents or specialist reviewers.
  • For a Compose UI architecture and runtime review specifically, use this skill directly.

Scope

In scope:

  • composition-vs-presenter boundary violations
  • app/state/workflow logic inside composables
  • remember, derivedStateOf, and local state misuse
  • LaunchedEffect, DisposableEffect, snapshotFlow, and coroutine-scope misuse
  • lazy-list keys and contentType
  • The audit covers modifier forwarding and order, composable size, file organization, KDoc, and reusable composable API shape.
  • Review Detekt and Compose-rules signals that affect UI API contracts, state ownership, effects, or hot-path performance.
  • recomposition/performance smells in Compose Desktop code
  • The audit checks animation API choice, remembered animation state, target-driven effects, and phase-correct animated reads.
  • desktop flow collection and coherent screen projections
  • state-holder shape and testability
  • The audit covers desktop seams including focus, keyboard shortcuts, dialogs and file pickers, clipboard and open URI handling, popups, window-local state, and protocol or runtime-backed UI boundaries.

Out of scope unless the user explicitly asks:

  • Defer Jewel component choice, theme wrappers, icon APIs, and typography details to jewel-ui.
  • low-level Swing/AWT interop mechanics; defer to jewel-swing-interop
  • Android-specific topics include Android lifecycle, collectAsStateWithLifecycle, Navigation, Material, Accompanist, baseline profiles, and R8.
  • numeric Android-style 0-100 scoring
  • broad Detekt cleanup unrelated to Compose UI architecture

Output Shape

## Summary
[overall posture: healthy / targeted cleanup needed / risky]

## Top findings
1. [severity] [finding] — `path:line`
2. ...

## Category notes
### Boundary and state ownership
### Desktop lifecycle and flow collection
### Effects and coroutine usage
### Lazy lists, animation, and recomposition
### Modifier/API shape
### Desktop interop seams

## Top 3 fixes
1. ...

## Confidence and limits
[what was sampled, what was not checked]

Do not assign numeric scores by default. If the user explicitly requests scoring, read reporting-guidance.md, label scoring as a project-specific heuristic, and avoid importing Android release metrics.

Audit Process

1. Confirm target

If the user gives paths, audit those. Otherwise locate the UI source root from the project's architecture docs or by searching for @Composable. Skip generated/build directories and tests unless the user asks.

2. Map the surface

Find representative files before judging:

  • screens and full layouts
  • reusable components
  • timeline / lazy-list surfaces
  • settings panels
  • permission/review workflow UI
  • state-holder classes
  • presenter projection classes consumed by UI

For broad audits, name the sampled surface in the report.

3. Gather evidence

Treat search hits as candidate locations and read the surrounding code before reporting a finding. For the full pattern list, read audit-search-patterns.md.

4. Judge by desktop Compose categories

Use the category checklist below, but avoid re-reading every reference file. Open only the reference files needed for actual evidence you find.

CategoryWhat to checkRead when deeper diagnosis is needed
Boundary and state ownershipBusiness/app logic in composition, broad app-state reads, local state shadowing app state, presenter objects passed into leaf components, direct IJPL API/Project parameter leaks in @Composable (use abstract state or explicit provider boundaries, no lazy CompositionLocal minting like LocalProject)boundary-violations.md
Desktop lifecycle and flow collectionMultiple raw flows that must be coherent, resource-producing flows started from leaves, composition-owned file watchers/subprocesses/loopseffects/overview.md
Effects and coroutine usageWork launched from bodies, bad effect keys, stale callbacks, missing cleanup, noisy snapshotFlow, business workflows in effectseffects/overview.md
Lazy lists and recompositionMissing stable keys/content types, per-row lookups, row/model churn, hot-path transforms, stale remember caches for theme/environment-derived UI valueslazy-layouts/overview.md, stability/overview.md
AnimationWrong animation API, unremembered Animatable, target-driven animation launched from composition, per-frame values read during composition, broad AnimatedContent targets, offscreen infinite transitionscompose-ui-architecture animation, modifiers/overview.md, lazy-layouts/animate-item.md
Modifier/API shapeSwallowed modifiers, missing/misordered modifier, MutableState<T>/State<T> component APIs, unstable or mutable parameters, event/content-slot parameter shape, action/presenter CompositionLocals, unnecessary Modifier.composed {}, huge/deeply nested composables, poor file ordering, missing/stale KDoc on reusable composablesapi-hygiene.md, modifiers/overview.md
Desktop interop seamsAWT/Swing details in leaves, shortcut paths bypassing presenter checks, persisted window/session policy in remember, protocol/runtime work in UIsubcomposition/overview.md

Composable Size, Nesting, And API Hygiene

When the target includes reusable component APIs, public/cross-file composables, Detekt findings, or lint-like Compose smells, read api-hygiene.md. It distils Detekt's comments/naming/complexity/coroutines/ performance guidance and Nacho López' Compose Rules into Compose Desktop/Jewel audit heuristics.

Review composables as production code, not as throwaway markup. Flag composables that are so large, deeply nested, or mixed-purpose that they obscure state ownership, make recomposition behavior hard to reason about, or prevent focused testing/reuse.

Prefer findings that point to a specific extraction boundary: a toolbar, row, empty state, footer, popup, repeated section, or distinct branch. Do not ask for arbitrary fragmentation; extraction should make the UI easier to read, name, test, or reuse.

Also check file organization and API polish:

  1. public screen/entry-point composables should appear near the top of the file;
  2. private sub-composables should generally follow in top-down usage order;
  3. helpers/constants should stay close to the code that uses them unless project conventions say otherwise;
  4. public or cross-file reusable composables should have KDoc explaining purpose, important parameters, slot expectations, and non-obvious behavior.

For private helpers, KDoc often means the helper needs a clearer name or smaller scope instead.

For reusable component API design, use the AndroidX Compose API guidelines as high-level reference material, adapted for Compose Desktop/Jewel and without importing Android-only assumptions:

Theme And Environment-Sensitive remember Keys

Check remember(...) calls that cache UI values derived from theme, density, locale, font scale, window state, Swing LaF defaults, or similar environment-provided state.

Coarse keys such as a theme name, LaF name, dark-mode boolean, or no key can leave stale UI. Underlying colours, typography, metrics, strings, shortcut text, or defaults can change without that coarse label changing.

Report this only when stale output is plausible and user-visible. Good fixes are, in order:

  1. remove remember if the calculation is cheap;
  2. pass the concrete inputs used by the calculation as remember keys;
  3. key by a framework-provided theme/environment change token when the dependency is broad or not practical to enumerate, such as JewelTheme.instanceUuid in Jewel code.

Do not mechanically demand more keys for every remember; the finding needs a concrete stale-cache risk.

5. Optional: performance diagnosis

If the task involves jank, slow UI, or recomposition issues, measure before diagnosing and again after any proposed fix. Use the relevant existing reference instead of duplicating the procedure here:

6. Optional: Perfetto tracing

Use these guides when investigating jank, recomposition, or rendering performance with trace evidence:

Reporting Rules

Read reporting-guidance.md before producing the final report. In short:

  • Cite concrete file paths and line numbers where possible.
  • Prefer 2-4 representative examples for systemic findings.
  • Do not infer runtime problems from a grep hit alone.
  • Do not double-count one root cause across categories.
  • Separate Compose runtime/architecture findings from Jewel component-choice findings.
  • When no serious issues are found, say so with confidence/limits and low-priority polish only.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 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日 更新

使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。

  • 比较不同检查器的类型推断
  • 确认代码是否会被判为类型错误
  • 查看多个工具的诊断差异
JetBrains/intellij-community2.1万2026年10月29日 更新

整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。

  • 分离界面绘制与展示器决策
  • 整理界面状态的归属
  • 检查 Effect 键和协程用法
JetBrains/intellij-community2.1万2026年10月29日 更新

查看 JetBrains 的全部技能

报告此技能的问题