react-components-and-hooks
Writes React components and hooks - props, model hooks, effects, React Compiler (no useMemo), selectors, Pressable, lists, safe areas, window size, error boundaries. Use when writing a hook, an effect or a component's logic. Not for Toybox looks (toybox-components) or screens (toybox-screens).
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- react-components-and-hooks
- description
- Writes React components and hooks - props, model hooks, effects, React Compiler (no useMemo), selectors, Pressable, lists, safe areas, window size, error boundaries. Use when writing a hook, an effect or a component's logic. Not for Toybox looks (toybox-components) or screens (toybox-screens).
02 资源文件 373
- 资产文件assets/shared.json1.3 KB
- 其他examples/hide-for-premium.test.tsx1.8 KB
- 其他examples/hide-for-premium.tsx737 B
- 其他examples/labelled-value.test.tsx1.0 KB
- 其他examples/labelled-value.tsx1.5 KB
- 脚本examples/use-step-pager.test.ts1.6 KB
- 脚本examples/use-step-pager.ts1.3 KB
- 参考文档references/patterns-and-recipes.md17.5 KB
- 参考文档references/rules-explained.md14.8 KB
- 脚本scripts/check-lib.mjs44.4 KB
- 脚本scripts/check-react-rules.mjs15.3 KB
- 脚本scripts/lib/object-literal.mjs3.1 KB
- 脚本scripts/selftest.mjs351 B
- 其他templates/motion-config.test.tsx1.1 KB
- 其他templates/motion-config.tsx491 B
- 其他templates/screen-frame.test.tsx1.9 KB
- 其他templates/screen-frame.tsx2.0 KB
- 其他templates/shell-error-boundary.test.tsx1.8 KB
- 其他templates/shell-error-boundary.tsx1.1 KB
- 其他templates/shell-providers.android.test.tsx1.3 KB
- 其他templates/shell-providers.test.tsx2.7 KB
- 其他templates/shell-providers.tsx1.9 KB
- 脚本templates/system-a11y-store.test.ts2.3 KB
- 脚本templates/system-a11y-store.ts1.2 KB
- 其他templates/themed-status-bar.android.test.tsx1.7 KB
- 其他templates/themed-status-bar.test.tsx646 B
- 其他templates/themed-status-bar.tsx1.0 KB
- 脚本templates/use-hold-to-confirm.test.ts2.3 KB
- 脚本templates/use-hold-to-confirm.ts2.0 KB
- 脚本templates/use-reduce-motion-setting.test.ts1.8 KB
- 脚本templates/use-reduce-motion-setting.ts1.4 KB
- 脚本templates/use-reduce-motion.test.ts1.6 KB
- 脚本templates/use-reduce-motion.ts1.8 KB
- 其他templates/use-window-class.test.tsx1.1 KB
- 脚本templates/use-window-class.ts462 B
- 脚本templates/window-class.test.ts951 B
- 脚本templates/window-class.ts694 B
- 参考文档tests/fixtures/bad-canvas/EXPECT.txt30 B
- 其他tests/fixtures/bad-canvas/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-canvas/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-canvas/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-canvas/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-canvas/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-canvas/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-canvas/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-canvas/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-canvas/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-canvas/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-canvas/packages/shell/src/ui/stickers.tsx672 B
- 其他tests/fixtures/bad-canvas/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-canvas/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-canvas/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-canvas/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-class/EXPECT.txt32 B
- 其他tests/fixtures/bad-class/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-class/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-class/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-class/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-class/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-class/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-class/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-class/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-class/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-class/packages/shell/src/ui/legacy-card.tsx177 B
- 其他tests/fixtures/bad-class/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-class/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-class/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-class/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-class/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-effect-no-cleanup/EXPECT.txt33 B
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/use-app-active.ts279 B
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-effect-no-cleanup/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-flatlist/EXPECT.txt31 B
- 其他tests/fixtures/bad-flatlist/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-flatlist/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-flatlist/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-flatlist/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 其他tests/fixtures/bad-flatlist/packages/shell/src/screens/home/pack-list.tsx253 B
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-flatlist/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-flatlist/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-flatlist/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-flatlist/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-flatlist/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-hitslop/EXPECT.txt27 B
- 其他tests/fixtures/bad-hitslop/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-hitslop/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-hitslop/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-hitslop/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-hitslop/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-hitslop/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-hitslop/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-hitslop/packages/shell/src/ui/tile-button.tsx1.5 KB
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-hitslop/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-hook-file/EXPECT.txt53 B
- 其他tests/fixtures/bad-hook-file/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-hook-file/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-hook-file/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-hook-file/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/screens/home/home-helpers.ts56 B
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-hook-file/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-hook-file/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-hook-file/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-hook-file/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-hook-file/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-hook-name/EXPECT.txt46 B
- 其他tests/fixtures/bad-hook-name/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-hook-name/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-hook-name/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-hook-name/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-hook-name/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-hook-name/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-hook-name/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-hook-name/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/ui/use-hold.ts1.3 KB
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-hook-name/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-isrtl/EXPECT.txt21 B
- 其他tests/fixtures/bad-isrtl/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-isrtl/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-isrtl/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-isrtl/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-isrtl/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-isrtl/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/ui/row-direction.ts108 B
- 其他tests/fixtures/bad-isrtl/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-isrtl/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-isrtl/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-key-index-template/EXPECT.txt29 B
- 其他tests/fixtures/bad-key-index-template/packages/shell/src/ui/pack-list.tsx403 B
- 参考文档tests/fixtures/bad-key-index/EXPECT.txt28 B
- 其他tests/fixtures/bad-key-index/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-key-index/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-key-index/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-key-index/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-key-index/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-key-index/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-key-index/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-key-index/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-key-index/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-key-index/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-key-index/packages/shell/src/ui/star-row.tsx314 B
- 其他tests/fixtures/bad-key-index/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-key-index/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-key-index/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-key-index/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-no-selector/EXPECT.txt53 B
- 其他tests/fixtures/bad-no-selector/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-no-selector/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-no-selector/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-no-selector/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/screens/home/use-home-theme.ts160 B
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-no-selector/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-no-selector/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-no-selector/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-no-selector/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-no-selector/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-object-selector/EXPECT.txt35 B
- 其他tests/fixtures/bad-object-selector/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-object-selector/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-object-selector/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-object-selector/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/screens/home/use-audio-flags.ts298 B
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-object-selector/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-object-selector/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-object-selector/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-object-selector/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-object-selector/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-pressed-destructure/EXPECT.txt36 B
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-pressed-destructure/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-props-mutable/EXPECT.txt56 B
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/ui/labelled-value.tsx1.4 KB
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-props-mutable/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-props-mutable/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-reduced-motion/EXPECT.txt40 B
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/ui/pulse.ts150 B
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-reduced-motion/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-reduced-motion/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-render-date/EXPECT.txt45 B
- 其他tests/fixtures/bad-render-date/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-render-date/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-render-date/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-render-date/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-render-date/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-render-date/packages/shell/src/screens/home/greeting.tsx130 B
- 其他tests/fixtures/bad-render-date/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-render-date/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-render-date/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-render-date/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-render-date/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-render-date/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-render-date/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-render-date/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-render-date/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-shared-value/EXPECT.txt48 B
- 其他tests/fixtures/bad-shared-value/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-shared-value/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-shared-value/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-shared-value/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-shared-value/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-shared-value/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-shared-value/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-shared-value/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/ui/use-fill.ts185 B
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-shared-value/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-testid-optional/EXPECT.txt55 B
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-testid-optional/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-testid-optional/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-ui-store/EXPECT.txt60 B
- 其他tests/fixtures/bad-ui-store/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-ui-store/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-ui-store/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-ui-store/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-ui-store/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-ui-store/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-ui-store/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-ui-store/packages/shell/src/ui/sound-badge.tsx260 B
- 其他tests/fixtures/bad-ui-store/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-ui-store/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-use-memo/EXPECT.txt43 B
- 其他tests/fixtures/bad-use-memo/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-use-memo/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-use-memo/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-use-memo/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 其他tests/fixtures/bad-use-memo/packages/shell/src/screens/home/home-list.tsx249 B
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-use-memo/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-use-memo/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-use-memo/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-use-memo/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-use-memo/packages/shell/src/ui/window-class.ts694 B
- 参考文档tests/fixtures/bad-use-no-memo/EXPECT.txt37 B
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/screens/home/home-probe.tsx116 B
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/bad-use-no-memo/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/bad-use-no-memo/packages/shell/src/ui/window-class.ts694 B
- 脚本tests/fixtures/good/.claude/skills/demo/use-planted.ts138 B
- 脚本tests/fixtures/good/apps/demo/ios/Generated/use-planted.ts153 B
- 脚本tests/fixtures/good/apps/demo/src/demo-count.ts95 B
- 其他tests/fixtures/good/packages/shell/src/app/motion-config.tsx491 B
- 其他tests/fixtures/good/packages/shell/src/app/shell-error-boundary.tsx1.1 KB
- 其他tests/fixtures/good/packages/shell/src/app/shell-providers.tsx1.8 KB
- 脚本tests/fixtures/good/packages/shell/src/app/system-a11y-store.ts1.2 KB
- 脚本tests/fixtures/good/packages/shell/src/app/use-reduce-motion.ts918 B
- 其他tests/fixtures/good/packages/shell/src/screens/home/hide-for-premium.tsx701 B
- 脚本tests/fixtures/good/packages/shell/src/screens/how-to-play/use-step-pager.ts1.3 KB
- 其他tests/fixtures/good/packages/shell/src/ui/hop-dots.tsx346 B
- 其他tests/fixtures/good/packages/shell/src/ui/labelled-value.test.tsx1012 B
- 其他tests/fixtures/good/packages/shell/src/ui/labelled-value.tsx1.5 KB
- 其他tests/fixtures/good/packages/shell/src/ui/screen-frame.tsx1.5 KB
- 其他tests/fixtures/good/packages/shell/src/ui/tile-button.tsx1.4 KB
- 脚本tests/fixtures/good/packages/shell/src/ui/use-hold-to-confirm.ts1.3 KB
- 脚本tests/fixtures/good/packages/shell/src/ui/use-window-class.ts462 B
- 脚本tests/fixtures/good/packages/shell/src/ui/window-class.ts694 B
- 脚本tests/fixtures/good/skills/demo-skill/tests/fixtures/bad-use-memo/packages/shell/src/ui/use-planted.ts179 B
03 SKILL.md 正文
React components and hooks
Every component and hook in the Shell and the game apps follows one set of React rules (function components with read-only props, effects only for outside systems, compiler memoization, narrow store selectors, accessible 44 pt pressables, safe any-size layout, one error boundary), and a script proves the ones lint cannot see.
Rules that must hold
- Function components, one per file, named export, explicit
: ReactNode. React Compiler optimises only functions; the one class isShellErrorBoundary. - Props are
type XProps = { readonly … }, strings arrive translated, interactive components take a requiredtestID, and a reusable component derives its parts from that one testID (${testID}.label). Lint does not catch prop mutation; Maestro and the screen contract select by testID. - No logic in components. Pure functions hold rules and derived values, ports hold side effects, a
use-<screen>-model.tshook wires them;ui/never imports stores, screens or services. - Effects only synchronise with systems outside React (OS subscriptions with cleanup, pushing state into a native API, focused-screen work, measurements); everything else is computed during render or done in the handler. No state setter runs synchronously in an effect.
- No
useMemo,useCallback,memo;.get()/.set()on shared values;'use no memo'only with its failing test. The compiler memoizes, and silently skips any function that breaks a Rule of React. - Store hooks always get a selector returning a primitive or an existing reference; objects go through
useShallow. A new object per call loops forever in Zustand 5; a missing selector re-renders on every change. - Render is pure: no clock, no random, no ref reads, no components declared inside components.
- Pressables live in
ui/, carry a role, a translated name, their state, and a 44 × 44 pt box of their own (neverhitSlop); holds have a screen-reader alternative. - Layout survives any window: never
Dimensions; size fromuseWindowClass()(oronLayout), pure layout maths tested at the listed sizes and at 200 % text,ScreenFramefor safe areas, logical style keys only, noisRTL. - Reduce motion comes only from
useReduceMotion();<MotionConfig/>applies it to every Reanimated animation, and a parity capture freezes every loop through the same hook. Only the saved choice itself readsuseReduceMotionSetting(): the Settings row, and the S12 success confetti's hide switch (isHiddenBySetting: the pieces vanish for the player's setting, while a capture freeze only holds them at their first still frame). - Lists render every item in a
ScrollViewwith stable keys (no FlatList, FlashList or index keys in v1); at most 8 Skia canvases per screen outside the board. The one exception is S15's test-only font page (spec 7.6). It holds about 570 texts, and drawn at once they timed out XCUITest's hierarchy query (E17), so its ScrollView mounts its rows a step at a time as it scrolls and never unmounts one (toybox-screens'use-font-test-window.ts). ShellErrorBoundarywraps the app root and the board host; its fallback has one way out and never retries; errors boundaries cannot see are caught where they happen and logged.
Workflow
- Read references/rules-explained.md once per session before writing React code; each rule has its reason and its enforcer.
- Writing a
ui/component: imitate examples/labelled-value.tsx (+ its test); it is a shape to follow, never a file to copy into the app. For the press, compose the ToyboxRaisedSurface; check the Pressable table in references/patterns-and-recipes.md. - Writing a screen: the route file is only
const model = use<Screen>Model(); return <<Screen>View model={model} />; the view is pure and the model hook is the only code that reads stores, services, the game host and navigation (toybox-screens ships every Shell screen's hook with its test). Keep every function at 40 lines or fewer by splitting a hook intouse-<screen>-actions.tsand similar parts. Wrap Premium-only parts the way examples/hide-for-premium.tsx reads one store value. - Writing a hook: follow examples/use-step-pager.ts (state + derived values, no effect) or templates/use-hold-to-confirm.ts (Reanimated timer); an effect only for the four allowed kinds.
- Setting up the app root once: copy
system-a11y-store.ts,use-reduce-motion-setting.ts,use-reduce-motion.ts,motion-config.tsx,shell-error-boundary.tsx,themed-status-bar.tsx(Android: the status bar follows the in-app theme; Expo's prebuild writes one light-content bar, white on the light theme),shell-providers.tsxtopackages/shell/src/app/andscreen-frame.tsx,window-class.ts,use-window-class.tstopackages/shell/src/ui/, each with its test (or its// device-only:marker). Every template's first line names its app path; files inexamples/have none and are never copied. - Write the test first (RNTL through
renderWithShell; recipes in references/patterns-and-recipes.md); give hot store-reading components a<Profiler>test likehide-for-premium.test.tsx. - Run
npx tsc --noEmit -p packages/shell,npx eslint <changed paths> --max-warnings 0, the Jest tests, thennode ${CLAUDE_SKILL_DIR}/scripts/check-react-rules.mjs .from the repo root (it scanspackages/shell/srcandapps/, skippingskills/,.claude/and generated native output). Fix everyFAILline and rerun until it printsRESULT: PASS.
Definition of done
- [ ] Every new component has a named export, read-only props, a required
testIDif interactive, translated strings only, and a test that queries it by role and name. - [ ] Every new hook sits in
use-<name>.ts, has a test, and uses an effect only for an outside system (with cleanup). - [ ] No
useMemo,useCallback,memo,.value,hitSlop,Dimensions, index keys or unselected store reads were added. - [ ] Layout functions are tested at the listed window sizes and at
fontScale2; screens sit inScreenFrame. - [ ] Hot store-reading components have a
<Profiler>re-render test. - [ ]
tsc, ESLint--max-warnings 0and Jest pass for the touched workspaces. - [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-react-rules.mjs .printsRESULT: PASS
Anti-patterns
- Copying a prop into state with an effect. Compute it during render; the lint rule
set-state-in-effectis right. useCallback"to be safe". The compiler already memoizes; the import is banned and the checker fails it.useSettingsStore((state) => ({ a, b })). A fresh object each call: wrap inuseShallowor select two primitives.- A
Pressablein a screen or anonPresson aView. Use the ui primitives so role, label, state and size are right once. hitSlopto reach 44 pt. Make the box itself 44 pt; slop is invisible and overlaps neighbours.FlatListfor the levels grid. Measured slower at 90 tiles; aScrollViewwith stable keys wins.- Reading
DimensionsorI18nManager.isRTL. Windows resize and direction has one source. - An error fallback that retries by itself. It becomes a crash loop; offer one way out.
Files in this skill
| File | What it is | Read/run when |
|---|---|---|
| references/rules-explained.md | All 53 rules with reasons and enforcers | Workflow step 1 |
| references/patterns-and-recipes.md | File map, ui component, screen + model hook, hooks, effects, stores, styles, pressables, lists, window sizes, motion, errors, test recipes, versions | Workflow steps 2-6 |
| examples/labelled-value.tsx | Example (shape only, not copied): presentational ui component with derived part testIDs | Workflow step 2 |
| examples/labelled-value.test.tsx | Example: its test | Workflow step 2 |
| examples/hide-for-premium.tsx | Example (shape only, not copied): store-reading component with a primitive selector | Workflow step 3 |
| examples/hide-for-premium.test.tsx | Example: Profiler re-render guard and store-driven tests | Workflow steps 3 and 6 |
| examples/use-step-pager.ts | Example (shape only, not copied): hook with state and derived values, no effect | Workflow step 4 |
| examples/use-step-pager.test.ts | Example: renderHook tests | Workflow step 4 |
| templates/use-hold-to-confirm.ts | Reanimated safety timer hook (the same file toybox-components ships in ui/; copy once) |
Workflow step 4 |
| templates/use-hold-to-confirm.test.ts | Fake-timer tests: the 2 s hold, an early release, the frozen fill for a parity capture, the clamp (the same file toybox-components ships; copy once) | Workflow step 4 |
| templates/system-a11y-store.ts | OS accessibility switches mirrored in a store (synced from the library; board-gestures-and-input and accessibility ship the same file; do not edit here) | Workflow step 5 |
| templates/system-a11y-store.test.ts | Its test (synced from the library) | Workflow step 5 |
| templates/use-reduce-motion.ts | useReduceMotion(): every animation's answer (the setting, and true during a parity capture); the same file settings-and-preferences and accessibility ship, copy once |
Workflow step 5 |
| templates/use-reduce-motion.test.ts | Its test (a capture freezes motion, the row stays as saved) | Workflow step 5 |
| templates/use-reduce-motion-setting.ts | useReduceMotionSetting() and resolveReduceMotion(): the saved choice or the phone's switch, never frozen; it imports no test-only code, so the S15 debug model (reached from the test-only entry) reads it without an import loop |
Workflow step 5 |
| templates/use-reduce-motion-setting.test.ts | Its test | Workflow step 5 |
| templates/motion-config.tsx | Reanimated global reduce-motion flag | Workflow step 5 |
| templates/motion-config.test.tsx | Its test: the flag follows the Shell setting | Workflow step 5 |
| templates/shell-error-boundary.tsx | The one class component | Workflow step 5 |
| templates/shell-error-boundary.test.tsx | Fallback, logging and reset tests | Workflow step 5 |
| templates/shell-providers.tsx | Root provider stack | Workflow step 5 |
| templates/shell-providers.test.tsx | Its test: children render, crash fallback, OS accessibility switches | Workflow step 5 |
| templates/shell-providers.android.test.tsx | Its Android test (unit-android): the stack draws the status bar for the chosen theme |
Workflow step 5 |
| templates/themed-status-bar.tsx | ThemedStatusBar: on Android, dark status bar text and icons on the light theme, light ones on the dark theme (an allowed native-sync effect); nothing on iOS |
Workflow step 5 |
| templates/themed-status-bar.test.tsx | Its iOS test: the system appearance keeps the bar | Workflow step 5 |
| templates/themed-status-bar.android.test.tsx | Its Android test (unit-android): light, dark and a change made in Settings |
Workflow step 5 |
| templates/screen-frame.tsx | Safe areas, ground, centred column; UNDER_HOME_INDICATOR_EDGES for tall bodies without a banner |
Workflow step 5 |
| templates/screen-frame.test.tsx | Its test (with safe-area metrics, both edge sets) | Workflow step 5 |
| templates/window-class.ts | Pure window classification | Workflow step 5 |
| templates/window-class.test.ts | Tests at the listed sizes | Workflow step 5 |
| templates/use-window-class.ts | Hook over useWindowDimensions | Workflow step 5 |
| templates/use-window-class.test.tsx | Its test: follows a window change | Workflow step 5 |
scripts/check-react-rules.mjs |
Checker for the rules lint does not fully cover | Workflow step 7, and at the end |
scripts/lib/object-literal.mjs |
Bracket-matching helper for the checker | Never by hand |
scripts/selftest.mjs |
Proves the checker passes the good fixture and catches each planted bug | After changing the checker |
scripts/check-lib.mjs |
Shared script helper, synced from the library (do not edit here) | Never by hand |
assets/shared.json |
Declares the shared files this skill copies in | When adding a shared file |
tests/fixtures/ |
Good and planted-bad source trees for the self-test | When adding a rule to the checker |
Related skills
toybox-components- the Toybox look of buttons, rows, toggles and every other component.toybox-design-system- tokens,makeStyles,AppText,RaisedSurface.toybox-screens- screen layouts and the exact testIDs.state-stores- store factories, reducers and selectors.typescript-and-lint-rules- the full ESLint and TypeScript configuration.unit-and-component-tests- Jest projects,renderWithShell, RNTL conventions.accessibilityandperformance-budgets- VoiceOver, contrast and the measured budgets.
04 同仓库更多 Skills
unit-and-component-tests
Sets up Jest and writes Pocket Arcade test code - three projects, RNTL 14 async via renderWithShell, root SDK mocks, fakes, fast-check, coverage, Stryker. Use when a test needs the Shell wrapper, a mock or a fake, or Jest fails. Not for the red-green loop (tdd-workflow) or goldens (golden-tests).
typescript-and-lint-rules
Enforces Pocket Arcade's strict TypeScript 6 tsconfigs, ESLint 9 flat config, Prettier and size limits. Use when writing or splitting .ts/.tsx or fixing a tsc or lint error. Not for gate wiring (quality-gates), names (naming-conventions) or import zones (architecture-and-boundaries).
demo-skill
Builds a demo. Use when testing the pitfall checker.
demo-skill
Builds a demo. Use when testing the pitfall checker.
troubleshooting-playbook
Diagnoses and fixes Pocket Arcade failures with a catalogue of 300+ known ones (symptom, cause, fix). Use when something errors, crashes, hangs or renders wrong, or an error or log needs explaining. Not for gate setup (quality-gates) or running builds (ios-simulator-build, ios-release-testflight).
toybox-visual-parity
Proves a built Pocket Arcade screen matches its Toybox design screenshot (light/dark, en/fa) and drives the fixes: capture, element gates, sheets, sign-off. Use when any screen is built or changed, or for visual parity, design match, screenshot compare. Not for building screens (toybox-screens).