UI Contract Guard
Use this skill before changing shared UI.
What to protect
- Shared component APIs should remain stable and predictable.
libs/ui/components/src/index.tsandlibs/ui/theme/src/index.tsmust expose platform-safe surfaces.- Design tokens and contracts should be centralized, not redefined in apps.
- Do not let domain logic or network code leak into shared UI components.
Review Sequence
- Inspect current exports and consumers.
- Separate visual primitives from app-specific compositions.
- Confirm whether a change is web-only, native-only, or shared.
- Prefer prop/API refinement over duplicating similar components.
- Call out breaking API changes explicitly.
Heuristics
- Shared if semantics and lifecycle match across apps/platforms.
- App-local if wording, layout, or data dependencies are product-specific.
- Native/web split if implementation differs but the conceptual contract is the same.
Load only when needed:
- Shared UI notes: platform rules