agentleFS
GDvegaGDvega/super-android-kotlin-firebase-skill/skills/ui-state-design/SKILL.md

ui-state-design

Skill2 starsChanged 5 months agoMITView on GitHub

Use to design Android and Compose UI states for loading, empty, content, error, offline, permission and sensitive-data flows while preserving ViewModels, data layers and tests.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add or recommend previews and tests for critical states.

    line 32
  2. Distinctive:

    Do not invent states that the ViewModel or data layer cannot produce.

    line 37
  3. Distinctive:

    Do not hide errors behind generic messages when recovery matters.

    line 38
  4. Distinctive:

    Prefer explicit UI models over scattered nullable flags.

    line 42
  5. Distinctive:

    Do not assume these companion skills are installed.

    line 57
  6. Distinctive:

    Use $super-android-kotlin-firebase to design UI states for this Firebase-backed screen.

    line 100
  7. Distinctive:

    Use $super-android-kotlin-firebase to add empty, offline and permission-denied design guidance before Compose implementation.

    line 101
  8. Distinctive:

    Use $super-android-kotlin-firebase to review this ViewModel state model for UX gaps.

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Make every important UI state intentional, testable and accessible.

When to use

  • Designing or reviewing loading, empty, content, error, offline or permission states.
  • Creating a screen state model before implementing Compose UI.
  • Improving AI-generated UI that only handles the happy path.
  • Connecting UI copy, affordances and tests to repository, network, Room, DataStore or Firebase behavior.

Inputs to inspect

  • Gate result from design-test-gate.
  • ViewModel state model and events.
  • Repository/network/local/Firebase result types.
  • Existing previews and tests.
  • Error, permission, offline, auth and sync behavior.
  • Accessibility labels and recovery actions.

Required workflow

  1. Confirm build/tests passed before redesigning states.
  2. Map the real state sources: local data, network, Firebase, permissions and user actions.
  3. Define visible states and transitions without changing data ownership.
  4. Design copy, actions and accessibility semantics for each state.
  5. Add or recommend previews and tests for critical states.
  6. Route implementation details to existing Compose, testing and data skills.

Rules

  • Do not invent states that the ViewModel or data layer cannot produce.
  • Do not hide errors behind generic messages when recovery matters.
  • Preserve ViewModel, repository, Firebase and navigation contracts.
  • Give offline and permission-denied states clear next actions.
  • Include sensitive-data handling in state design when the domain requires it.
  • Prefer explicit UI models over scattered nullable flags.

Related existing skills

Local skills to invoke

  • jetpack-compose
  • testing
  • accessibility
  • room-datastore
  • networking-retrofit-ktor
  • firebase-core

External companion skills to use when installed

Do not assume these companion skills are installed. Prefer the local skills above first, then consult Companion Skills for install and verification commands.

  • aldefy/compose-skill — use for deeper Jetpack Compose, Material 3, design-to-code, theming or Compose architecture guidance.
  • skydoves/android-testing-skills — use for deeper Android or Compose UI testing, semantics, assertions or test workflow guidance.

Files commonly touched

  • *UiState.kt
  • *ViewModel.kt
  • *Screen.kt
  • *Route.kt
  • Repository result models
  • Compose previews
  • Unit and UI tests

Commands to validate

./gradlew assembleDebug
./gradlew test
./gradlew connectedDebugAndroidTest
./gradlew lint

Common mistakes to avoid

  • Designing only content state.
  • Using one generic error for auth, network, validation and permission failures.
  • Changing repository behavior to fit a visual idea.
  • Forgetting loading, empty, offline or stale-data states.
  • Adding state that has no preview or test.

Checklist

  • Build/tests gate passed.
  • State sources identified.
  • State matrix defined.
  • Recovery actions clear.
  • Accessibility semantics considered.
  • Previews and tests planned.
  • Existing data contracts preserved.

Example prompts

  • Use $super-android-kotlin-firebase to design UI states for this Firebase-backed screen.
  • Use $super-android-kotlin-firebase to add empty, offline and permission-denied design guidance before Compose implementation.
  • Use $super-android-kotlin-firebase to review this ViewModel state model for UX gaps.

Expected response style

Respond with: gate status, state-source map, state matrix, UI copy/actions, related skills, validation commands and risks. Do not recommend data-layer changes unless a missing state contract blocks correct UI.

References

  • ../../docs/audits/FUENTES_LOCALES.md
  • references/ui-state-matrix-notes.md
  • templates/ui-state-matrix-template.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.