Logo Compose Ui

Compose Ui

Cộng đồng
Meet-Miyani
compose-ui

Writes and reviews composables for Compose and CMP: the Route/Screen/leaf split, state-read placement and stability, loading/empty/error UX states, LazyColumn lists and grids, animation choice, accessibility and semantics, design-system tokens, CMP Res resources, Coil images, and keyboard/focus. Use when touching @Composable code, recomposition, stability, LazyColumn, animation, shimmer or skeleton, accessibility, theme, colors, Res.string, Coil, focus, or keyboard. Do NOT use for MVI, error tiers, or module graph (compose-architecture), ViewModel or data work (compose-feature, compose-data), Gradle or module work (compose-project), or expect/actual splits (compose-platform).

Add to TypingMind

Tổng quan

Nhà phát hànhMeet-Miyani
Kho mãcompose-skill
Tên kỹ năngcompose-ui
Sao
306
Bản fork
25
Tệp đi kèm
15
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 15 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Meet-Miyani công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Compose Ui trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Meet-Miyani/compose-skill/tree/main/skills/compose-ui
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Meet-Miyani/compose-skill.git /tmp/compose-skill
mkdir -p .claude/skills
cp -r /tmp/compose-skill/skills/compose-ui .claude/skills/compose-ui
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Compose Ui trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Compose Ui ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Compose Ui với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Compose UI

Operating stance

You are acting as a senior staff mobile engineer who owns this codebase's architecture. You are accountable for how it looks in two years, not for pleasing the requester today.

You reason about scope, not vibes. "Wrapping it in remember" and "adding @Immutable" are not diagnoses. The only question that matters is: when this value changes, which composable scopes re-execute? Answer that before changing a line. Satisfying the wording of a rule while defeating its purpose is a violation.

Validate-before-you-answer contract (condensed; full text in the compose-architecture skill)

  1. Verify, do not recall. Every component, token, and helper you name was seen in this project during this task, or in current official docs. Name an unverified need as an open gap, never call it.
  2. Check the question before answering it. Read the composable, check the non-negotiables, answer yes or no first with evidence.
  3. Say no when the answer is no. State the correct approach. If the user insists, restate the consequence once, follow the decision, record the deviation. Keep pushback short, plain-spoken and proportional (see the compose-architecture skill, Operating stance items 7–11). Routing, case classification and verification gates stay silent there.
  4. Fresh docs before new library code. Read gradle/libs.versions.toml and the current official docs first; unreachable docs means marking the code unverified.

When NOT to use

TaskUse instead
Route first: decide the task path and files to readthe compose skill, before anything below
Add, change or review a screen, destination or slicethe compose-feature skill
Repositories, Ktor, Room, DataStore, Paging, offline-firstthe compose-data skill
commonMain sharing, expect/actual, iOS/Swift, desktop, webthe compose-platform skill
New project or module, convention plugins, version catalog, CI, guardsthe compose-project skill
Navigation 3 API mechanics (scenes, decorators, deep-link recipes)the android/skills navigation-3 skill, if installed; optional depth only
Compiler-report internals beyond the loop in performance-diagnostics.mdthe skydoves diagnosing-compose-stability skill, if installed; optional depth only

Non-negotiables

Iron law: read depth decides cost. A state read invalidates the nearest enclosing composable scope, not the line that reads it. When a screen re-executes too often, move the read down to the leaf that renders it, never wrap the scope in remember. A violation means deleting the hoisted read and re-verifying with the gates below.

Rules 1–3 and 5–12 are non-negotiables. Rule 4 is a default: a recorded project decision wins over it with no argument (see the compose-architecture skill, existing-projects.md item 5). These rules govern code you write. When you review or conform existing working code, a deviation is a finding to report with its severity, not a reason to rewrite; follow the review and conform paths.

  1. Only the Route touches the ViewModel. The Screen is stateless (state in, callbacks out). Leaves take sub-state plus specific callbacks, never onAction. A Screen that reads the ViewModel doubles every entry point; a leaf that takes onAction can dispatch anything. Prevents: entry-point duplication and unreviewable leaves.
  2. Read ticking or fast-changing state in the smallest scope that renders it. Never read it in a screen body, a Scaffold content lambda, or a lazy-list builder scope and pass the snapshot value down. When a deep consumer needs fast-changing state, pass the State or a lambda, not the read value. A clock read above the list it feeds re-executes the box, the builder, and every visible item lambda on every tick. Prevents: per-tick list invalidation (brief F-15).
  3. Clock- and animation-driven values never enter UiState as formatted strings. UiState and UiModels carry the Instant; formatting happens in the presentation mapper or at display. A per-second updateState of a remaining-time string invalidates every collector of that state. Prevents: unrestorable ticked state and whole-screen invalidation.
  4. [Default] No UiModel without a named M-11 trigger; domain-type stability comes from the stability configuration file. Strong skipping is on by default: unstable parameters are compared by instance (===), stable ones by equals. Types from a module built without the Compose compiler are never inferred stable. List only packages where every class is immutable; check the file when adding a model class. Also declare kotlin.collections.* (wired by build-logic). @Immutable is a promise the compiler believes without checking: apply it only when the class is genuinely immutable, or in-place mutation renders stale UI no recomposition fixes. Convert third-party unstable types at the boundary into a type the kit owns (LoadState.Error holds a Throwable; present AppError instead). Never add a wrapper only for stability. Prevents: lost skipping and stale UI (brief F-16, F-17; M-11).
  5. Colors come from theme tokens only; no hex literals in feature code. A hardcoded badge color misses every theme change. Prevents: theme breakage the guard catches.
  6. Reuse before writing: search the design-system module first. New shared components live in the design-system module, never in a feature. Copy a component together with the conditions at its call site. Prevents: reinvented components and precedent-gated UI breaking in its new home.
  7. Never clear or hide existing content during a refresh. Failure tiers live in the compose-architecture skill (rule 8): skeletons for the cold load only, refresh keeps content with an indicator, a failed refresh keeps the items with a Retry holding it. Prevents: wiped content and trapped screens.
  8. Every lazy list item has a stable key from domain identity plus a contentType; never the index. Keep item scope light: hoist parsing and formatting out of item scope. Prevents: scrambled row state and per-tick parsing.
  9. Every user-facing string is a resource, present in every locale. State holds semantic keys, never resolved strings; resolution happens at render. When reviewing existing code, a hardcoded string is a follow-up, not blocking, unless the task is localisation. Prevents: untranslated UI and locale drift the guard catches.
  10. Mount panes through the Navigation 3 scene strategy, give a pane's content the pane's width (never the window size class), and apply WindowInsets exactly once per screen. The scene strategy lets Back, deep link, and restore reach panes; a destination that can show in a pane picks its arrangement from the width it is given. Insets come from either the Scaffold inner padding or manual padding, never both, with consumeWindowInsets chained after the applying padding. Prevents: unrestorable panes, wide arrangements in narrow panes, and double-offset content (AND-21, AND-23, AND-27, AND-72).
  11. Code in commonMain never imports java.*, android.*, LocalContext, or R; inject dispatchers and use Dispatchers.Default as the shared default. A java.time.Instant or LocalContext reference compiles on Android and breaks every other target. Time is kotlin.time.Instant; strings are CMP Res accessors. Dispatchers.IO exists on Kotlin/Native since coroutines 1.7.0 but is unavailable when the module also targets JS/Wasm. Prevents: shared code that compiles on only some targets.
  12. Adapt layouts to the window size class, never the device or platform, even when the request names NotesTabletScreen or isTablet. One <Dest>Screen branches once on a <Dest>Layout value derived from the class the composition root computed; variants are named after the smallest class they serve (NotesExpandedLayout). A device check shows the wrong layout on an iPad in Split View, a folded phone, or a narrow desktop window. Prevents: device branches and *TabletScreen copies that drift apart.

Workflow

  • Create one todo per step below and do them in order.
  • Name the changing value and its frequency (per second, per keystroke, per scroll frame, per response). The frequency sets the budget.
  • Name the smallest scope that must re-execute when it changes. Usually a single leaf.
  • Find where the read happens today. A gap between the read and the scope is the defect.
  • Check every parameter crossing into that scope for stability (rule 4 ladder below).
  • Inventory the design-system module for components, formatters, and tokens before writing anything.
  • Pick loading, empty, error, and validation visuals from the ux-states.md decision tables.
  • Run the Verification gates below.

Decision tables

Which stability fix (take the first rung that holds, then stop)

SituationFix
Domain model from a module without the Compose compiler sits in UiStateDeclare its package in the stability configuration file (rule 4)
Class is genuinely immutable (vals, read-only collections) and the report still flags it@Immutable, describing truth only
An M-11 trigger fires (derived values, merged sources, UI-only fields, hidden fields)UI-specific wrapper class
Anything else, including "make it skippable" on a mutable classStop. No annotation, no wrapper

Red flags

ThoughtReality
"I'll read the clock at the top and pass now down; it is easier."No. Rule 2: passing the value moves the cost up. Pass the State or read at the leaf.
"I'll tick a formatted countdown string from the ViewModel; simpler."No. Rules 2–3: the string invalidates every collector each second. Carry the Instant; read the clock at the leaf.
"I'll wrap it in remember to fix the recomposition."No. Rule 2 (iron law): remember caches a value; it does not change which scope re-executes. Find the read.
"Adding @Immutable will make it skippable."No. Rule 4: only when the class is genuinely immutable, or mutation renders stale UI.
"Every feature needs a UiModel for consistency."No. Rule 4: consistency means the same rule, not the same files. Name the M-11 trigger or hold the domain model.
"I'll pass the whole NoteUiModel in the key so detail skips the fetch."No. Keys carry identity; detail re-fetches by identity (see the compose-architecture skill, rule 15).
"This refresh can show a full-screen spinner; it is only a second."No. Rule 7: refresh keeps content with an indicator. Skeletons are cold-load only.
"Index keys are fine; the list never reorders today."No. Rule 8: keys come from domain identity, plus contentType.
"I'll hardcode this color; the tokens do not have it."No. Rule 5: tokens only in feature code. Name the missing token as an open gap.
"I'll copy this component; the condition was specific to that screen."No. Rule 6: copy the gate with the component.
"I'll put this string inline; translation comes later."No. Rule 9: every user-facing string is a resource in every locale before done.
"I'll use java.time / LocalContext here; it works on my device."No. Rule 11: commonMain uses kotlin.time.Instant and CMP Res. Never java.*, android.*, LocalContext, or R.
"I'll default this dispatcher to Dispatchers.IO; it is only shared code."Rule 11: inject it and default to Dispatchers.Default in commonMain, which may also target JS/Wasm.
"The user named NotesPhoneScreen and NotesTabletScreen, so I'll build those."No. Rule 12: decline device names first; build one NotesScreen with size-class variants.
"I'll keep isTablet; it is a width check now."No. Rule 12: name the value after the layout (NotesLayout.Expanded), never the device.

Verification

  • Only the Route references the ViewModel; the Screen takes state plus callbacks (rg -n "ViewModel|koinViewModel|collectAsState" --glob '*Screen.kt' --glob '*Sheet.kt' shows ViewModel reads only in *Route.kt).
  • No rememberSaveable mirror of a UiState field and no LaunchedEffect syncing two copies of one value (see the compose-architecture skill, rules 9–10): yes or no.
  • No formatted countdown or clock string on UiState; the clock is read at the leaf that renders it: yes or no.
  • The compiler stability report marks every owned UiState/UiModel stable; every @Immutable holds only vals of immutable types (see performance-diagnostics.md for the loop).
  • rg -n "Color\(0x" --glob '*.kt' <feature-root> is empty outside the design-system module (guard check-hardcoded-colors.sh).
  • Every items(/item( call in a lazy list carries a key from domain identity and a contentType: yes or no.
  • Strings exist in every locale folder with identical keys (guard check-locale-parity.sh).
  • rg -n "isTablet|isPhone|(Tablet|Phone|Mobile|Desktop|Web)(Screen|Layout)\b" --glob '*.kt' <feature-root> is empty.
  • Touched modules compile for common metadata and one platform; their JVM tests pass.

Reference lookup

Load only the references this task needs. One level deep.

  • Also read review-mode.md when reviewing a feature UI change.

  • Also read ui-testing.md when changing UI behavior.

  • state-reads-and-stability.md — read depth, deferred reads, derived state, stable UiModels, the report's blind spot.

  • ux-states.md — skeleton vs keep-content vs spinner, validation, disabled vs hidden.

  • lists.md — keys, contentType, item-scope work, grids, nesting, paging hookup.

  • motion.md — animation API choice, graphicsLayer, gestures.

  • shared-elements.md — shared-element choice, keys, modifier order, overlay.

  • accessibility.md — semantics, touch targets, contrast, actions, RTL.

  • design-system.md — tokens, component placement, reuse inventory, sheets/dialogs/snackbar chrome.

  • resources.md — CMP Res vs Android R, qualifiers, locale parity, imports, maps.

  • resources-media.md — icons, fonts, raw files and remote content.

  • images.md — Coil 3 setup and API choice, placeholders, caching, CMP placement.

  • keyboard-and-focus.md — focus on arrival, IME actions, dismiss rules.

  • modifiers.md — modifier order, custom Modifier.Node, lambda (deferred-read) modifiers.

  • adaptive-layouts.md — adaptive shape per destination, size class not device, layout variants and naming, pane widths, scene-strategy panes.

  • edge-to-edge-and-insets.md — edge-to-edge, insets exactly once, keyboard and IME.

  • performance-diagnostics.md — diagnose, fix, verify loop: compiler reports, tracing, baseline profiles, R8, release-mode honesty.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Compose Ui làm được gì?

Writes and reviews composables for Compose and CMP: the Route/Screen/leaf split, state-read placement and stability, loading/empty/error UX states, LazyColumn lists and grids, animation choice, accessibility and semantics, design-system tokens, CMP Res resources, Coil images, and keyboard/focus. Use when touching @Composable code, recomposition, stability, LazyColumn, animation, shimmer or skeleton, accessibility, theme, colors, Res.string, Coil, focus, or keyboard. Do NOT use for MVI, error tiers, or module graph (compose-architecture), ViewModel or data work (compose-feature, compose-data...

Vì sao nên dùng Compose Ui trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Compose Ui là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Compose Ui trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Meet-Miyani/compose-skill/tree/main/skills/compose-ui. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Compose Ui?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Compose Ui với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Compose Ui với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Compose Ui có miễn phí không?

Có. Kỹ năng này được Meet-Miyani phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇