Ui components

From championswimmer/TwoFac · View interactive version

Ui components is an AI agent skill from the GitHub repository championswimmer/TwoFac. Structure and routing guide for composeApp screens, components, and their relationships.

How to use this skill

Skill file

Skill: Compose UI Components and Screens

Use this skill when working on UI in composeApp, especially to decide where to place new screens/components and how they connect.

composeApp UI structure

Current component domains:

Screens and responsibilities

`HomeScreen`

`AccountsScreen`

`AddAccountScreen`

`AccountDetailScreen`

`SettingsScreen`

`PlatformSettingsContent` (expect/actual)

Screen → component relationships

Component nesting relationships

Where to add new components

  1. Prefer reusable components in components/<domain>/ComponentName.kt.
  2. Choose domain by feature ownership:
  1. Keep route-specific glue/state logic in screen files; extract only reusable/presentational parts into components/*.
  2. If you create a new domain, keep naming consistent: tech.arnav.twofac.components.<domain>.ComponentName.

Where to add new screens

  1. Add route-level composable in screens/ (e.g. NewFeatureScreen.kt).
  2. Add a typed route to navigation/NavigationRoutes.kt using @Serializable object/data class.
  3. Wire the screen into App.kt NavHost with a composable<...> entry.
  4. If it is top-level navigation, update:
  1. Keep platform-specific variants as expect/actual only when platform API differences are required.

Quick checklist before finishing UI changes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.