Added 16 custom skills: - ralph (RalphLoop autonomous agent) - brainstorming (with Ralph integration) - dispatching-parallel-agents - autonomous-loop - multi-ai-brainstorm - cognitive-context, cognitive-core, cognitive-planner, cognitive-safety - tool-discovery-agent - ui-ux-pro-max (full design system) - wordpress-ai - agent-pipeline-builder - dev-browser - planning-with-files - playwright-skill Also organized remaining skills that were at root level into skills/ folder. Total: 272 skills from skills.sh + 16 custom upgrades Co-Authored-By: Claude <noreply@anthropic.com>
8.0 KiB
8.0 KiB
| 1 | No | Category | Guideline | Description | Do | Don't | Code Good | Code Bad | Severity | Docs URL |
|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | Composable | Pure UI composables | Composable functions should only render UI | Accept state and callbacks | Calling usecase/repo | Pure UI composable | Business logic in UI | High | https://developer.android.com/jetpack/compose/mental-model |
| 3 | 2 | Composable | Small composables | Each composable has single responsibility | Split into components | Huge composable | Reusable UI | Monolithic UI | Medium | |
| 4 | 3 | Composable | Stateless by default | Prefer stateless composables | Hoist state | Local mutable state | Stateless UI | Hidden state | High | https://developer.android.com/jetpack/compose/state#state-hoisting |
| 5 | 4 | State | Single source of truth | UI state comes from one source | StateFlow from VM | Multiple states | Unified UiState | Scattered state | High | https://developer.android.com/topic/architecture/ui-layer |
| 6 | 5 | State | Model UI State | Use sealed interface/data class | UiState.Loading | Boolean flags | Explicit state | Flag hell | High | |
| 7 | 6 | State | remember only UI state | remember for UI-only state | Scroll, animation | Business state | Correct remember | Misuse remember | High | https://developer.android.com/jetpack/compose/state |
| 8 | 7 | State | rememberSaveable | Persist state across config | rememberSaveable | remember | State survives | State lost | High | https://developer.android.com/jetpack/compose/state#restore-ui-state |
| 9 | 8 | State | derivedStateOf | Optimize recomposition | derivedStateOf | Recompute always | Optimized | Jank | Medium | https://developer.android.com/jetpack/compose/performance |
| 10 | 9 | SideEffect | LaunchedEffect keys | Use correct keys | LaunchedEffect(id) | LaunchedEffect(Unit) | Scoped effect | Infinite loop | High | https://developer.android.com/jetpack/compose/side-effects |
| 11 | 10 | SideEffect | rememberUpdatedState | Avoid stale lambdas | rememberUpdatedState | Capture directly | Safe callback | Stale state | Medium | https://developer.android.com/jetpack/compose/side-effects |
| 12 | 11 | SideEffect | DisposableEffect | Clean up resources | onDispose | No cleanup | No leak | Memory leak | High | |
| 13 | 12 | Architecture | Unidirectional data flow | UI → VM → State | onEvent | Two-way binding | Predictable flow | Hard debug | High | https://developer.android.com/topic/architecture |
| 14 | 13 | Architecture | No business logic in UI | Logic belongs to VM | Collect state | Call repo | Clean UI | Fat UI | High | |
| 15 | 14 | Architecture | Expose immutable state | Expose StateFlow | asStateFlow | Mutable exposed | Safe API | State mutation | High | |
| 16 | 15 | Lifecycle | Lifecycle-aware collect | Use collectAsStateWithLifecycle | Lifecycle aware | collectAsState | No leak | Leak | High | https://developer.android.com/jetpack/compose/lifecycle |
| 17 | 16 | Navigation | Event-based navigation | VM emits navigation event | VM: Channel + receiveAsFlow(), V: Collect with Dispatchers.Main.immediate | Nav in UI | Decoupled nav | Using State / SharedFlow for navigation -> event is replayed and navigation fires again (StateFlow) | High | https://developer.android.com/jetpack/compose/navigation |
| 18 | 17 | Navigation | Typed routes | Use sealed routes | sealed class Route | String routes | Type-safe | Runtime crash | Medium | |
| 19 | 18 | Performance | Stable parameters | Prefer immutable/stable params | @Immutable | Mutable params | Stable recomposition | Extra recomposition | High | https://developer.android.com/jetpack/compose/performance |
| 20 | 19 | Performance | Use key in Lazy | Provide stable keys | key=id | No key | Stable list | Item jump | High | |
| 21 | 20 | Performance | Avoid heavy work | No heavy computation in UI | Precompute in VM | Compute in UI | Smooth UI | Jank | High | |
| 22 | 21 | Performance | Remember expensive objects | remember heavy objects | remember | Recreate each recomposition | Efficient | Wasteful | Medium | |
| 23 | 22 | Theming | Design system | Centralized theme | Material3 tokens | Hardcoded values | Consistent UI | Inconsistent | High | https://developer.android.com/jetpack/compose/themes |
| 24 | 23 | Theming | Dark mode support | Theme-based colors | colorScheme | Fixed color | Adaptive UI | Broken dark | Medium | |
| 25 | 24 | Layout | Prefer Modifier over extra layouts | Use Modifier to adjust layout instead of adding wrapper composables | Use Modifier.padding() | Wrap content with extra Box | Padding via modifier | Box just for padding | High | https://developer.android.com/jetpack/compose/modifiers |
| 26 | 25 | Layout | Avoid deep layout nesting | Deep layout trees increase measure & layout cost | Keep layout flat | Box ? Column ? Box ? Row | Flat hierarchy | Deep nested tree | High | |
| 27 | 26 | Layout | Use Row/Column for linear layout | Linear layouts are simpler and more performant | Use Row / Column | Custom layout for simple cases | Row/Column usage | Over-engineered layout | High | |
| 28 | 27 | Layout | Use Box only for overlapping content | Box should be used only when children overlap | Stack elements | Use Box as Column | Proper overlay | Misused Box | Medium | |
| 29 | 28 | Layout | Prefer LazyColumn over Column scroll | Lazy layouts are virtualized and efficient | LazyColumn | Column.verticalScroll() | Lazy list | Scrollable Column | High | https://developer.android.com/jetpack/compose/lists |
| 30 | 29 | Layout | Avoid nested scroll containers | Nested scrolling causes UX & performance issues | Single scroll container | Scroll inside scroll | One scroll per screen | Nested scroll | High | |
| 31 | 30 | Layout | Avoid fillMaxSize by default | fillMaxSize may break parent constraints | Use exact size | Fill max everywhere | Constraint-aware size | Overfilled layout | Medium | |
| 32 | 31 | Layout | Avoid intrinsic size unless necessary | Intrinsic measurement is expensive | Explicit sizing | IntrinsicSize.Min | Predictable layout | Expensive measure | High | https://developer.android.com/jetpack/compose/layout/intrinsics |
| 33 | 32 | Layout | Use Arrangement and Alignment APIs | Declare layout intent explicitly | Use Arrangement / Alignment | Manual spacing hacks | Declarative spacing | Magic spacing | High | |
| 34 | 33 | Layout | Extract reusable layout patterns | Repeated layouts should be shared | Create layout composable | Copy-paste layouts | Reusable scaffold | Duplicated layout | High | |
| 35 | 34 | Theming | No hardcoded text style | Use typography | MaterialTheme.typography | Hardcode sp | Scalable | Inconsistent | Medium | |
| 36 | 35 | Testing | Stateless UI testing | Composable easy to test | Pass state | Hidden state | Testable | Hard test | High | https://developer.android.com/jetpack/compose/testing |
| 37 | 36 | Testing | Use testTag | Stable UI selectors | Modifier.testTag | Find by text | Stable tests | Flaky tests | Medium | |
| 38 | 37 | Preview | Multiple previews | Preview multiple states | @Preview | Single preview | Better dev UX | Misleading | Low | https://developer.android.com/jetpack/compose/tooling/preview |
| 39 | 38 | DI | Inject VM via Hilt | Use hiltViewModel | @HiltViewModel | Manual VM | Clean DI | Coupling | High | https://developer.android.com/training/dependency-injection/hilt-jetpack |
| 40 | 39 | DI | No DI in UI | Inject in VM | Constructor inject | Inject composable | Proper scope | Wrong scope | High | |
| 41 | 40 | Accessibility | Content description | Accessible UI | contentDescription | Ignore a11y | Inclusive | A11y fail | Medium | https://developer.android.com/jetpack/compose/accessibility |
| 42 | 41 | Accessibility | Semantics | Use semantics API | Modifier.semantics | None | Testable a11y | Invisible | Medium | |
| 43 | 42 | Animation | Compose animation APIs | Use animate*AsState | AnimatedVisibility | Manual anim | Smooth | Jank | Medium | https://developer.android.com/jetpack/compose/animation |
| 44 | 43 | Animation | Avoid animation logic in VM | Animation is UI concern | Animate in UI | Animate in VM | Correct layering | Mixed concern | Low | |
| 45 | 44 | Modularization | Feature-based UI modules | UI per feature | :feature:ui | God module | Scalable | Tight coupling | High | https://developer.android.com/topic/modularization |
| 46 | 45 | Modularization | Public UI contracts | Expose minimal UI API | Interface/Route | Expose impl | Encapsulated | Leaky module | Medium | |
| 47 | 46 | State | Snapshot state only | Use Compose state | mutableStateOf | Custom observable | Compose aware | Buggy UI | Medium | |
| 48 | 47 | State | Avoid mutable collections | Immutable list/map | PersistentList | MutableList | Stable UI | Silent bug | High | |
| 49 | 48 | Lifecycle | RememberCoroutineScope usage | Only for UI jobs | UI coroutine | Long jobs | Scoped job | Leak | Medium | https://developer.android.com/jetpack/compose/side-effects#remembercoroutinescope |
| 50 | 49 | Interop | Interop View carefully | Use AndroidView | Isolated usage | Mix everywhere | Safe interop | Messy UI | Low | https://developer.android.com/jetpack/compose/interop |
| 51 | 50 | Interop | Avoid legacy patterns | No LiveData in UI | StateFlow | LiveData | Modern stack | Legacy debt | Medium | |
| 52 | 51 | Debug | Use layout inspector | Inspect recomposition | Tools | Blind debug | Fast debug | Guessing | Low | https://developer.android.com/studio/debug/layout-inspector |
| 53 | 52 | Debug | Enable recomposition counts | Track recomposition | Debug flags | Ignore | Performance aware | Hidden jank | Low |