callstackincubator/agent-skills

repository·main·Indexed 23 days ago

https://github.com/callstackincubator/agent-skills

A collection of AI agent skills for building, optimizing, and upgrading React Native applications. It includes plugins for building (architecture, performance, and version upgrades) and testing (unit/integration tests and device-level QA via agent-device and dogfood). The repository provides integration guides for AI assistants including Cursor, GitHub Copilot, Claude, ChatGPT, OpenAI API, and Windsurf/Codeium, along with conventions for naming and structuring skill files.

Tokens
109.8K
Snippets
234
Records
470
Agent score
81%

What's inside agent-skills

  1. Use the GitHub skill for repository management

    main
    The github skill provides patterns for managing GitHub pull requests, stacked PRs, code reviews, branching strategies, and repository automation. It is designed to be used with the gh CLI. For optimal performance and lower context usage, prefer using the gh CLI over GitHub MCP servers.
  2. End-to-End Testing for React Native TV Apps

    main

    For full behavioral testing of React Native TV applications, Appium is the recommended tool. It supports native platforms (Android TV and Apple TV) via UiAutomator2 and XCUITest respectively, and web-based platforms (Tizen, webOS) via browser automation.

    Key Strategies:

    • Use Appium + WebdriverIO for native TV platforms.
    • Use driver.pressKeyCode to simulate D-pad navigation.
    • Use accessibility labels as selectors (e.g., ~home-button).
    • Utilize device farms (AWS, BrowserStack, Sauce Labs) for testing on real hardware to account for performance and display quirks.
  3. Upgrade React Native apps

    main
    Use this skill to upgrade React Native applications to newer versions. This involves applying template diffs (via rn-diff-purge), updating package.json dependencies, migrating native iOS and Android configurations, resolving CocoaPods and Gradle changes, and handling breaking API updates. This is applicable when bumping React Native versions, migrating from 0.x to 0.y, or upgrading an Expo SDK alongside a React Native upgrade.
  4. Explore React Native implementation and performance skills

    main

    This plugin includes specialized skills for different stages of the React Native lifecycle:

    Best Practices

    • Vercel React Native Skills: Focuses on app structure, development patterns, and technical decision-making during feature implementation.
    • React Native Best Practices: Focuses on production-quality performance work, including profiling, startup time, rendering behavior, memory management, bundle size, and native integration tradeoffs.

    Upgrading

    • Upgrading React Native: Provides guidance for version upgrades, covering template diffs, dependency alignment, iOS/Android project changes, and post-upgrade verification steps.
  5. Review React Native TV best practices by category

    main

    The react-native-tv-best-practices skill organizes guidance into specific topic prefixes. Use these prefixes to locate deep-dive documentation for your specific area of concern:

    • focus-*: focus engines, focus guides, focus event performance
    • nav-*: D-pad navigation, Back/Menu behavior, keyboard/search input
    • design-*: 10-foot typography, layout, color, focus visibility
    • perf-*: startup, memory, lists, animation, and network constraints on TV hardware
    • video-*: playback architecture, DRM/protocol selection, debugging
    • a11y-*: TV accessibility implementation and audit checks
    • setup-*: stack detection, setup, architecture, cross-platform behavior
    • test-* and release-*: test coverage, E2E, and CI/release workflows
  6. Use the assess-react-native-migration skill

    main

    The assess-react-native-migration skill is used to produce a read-only migration decision for a mobile product. It diagnoses the product and delivery system to determine if, and how, a migration to React Native should occur.

    Key constraints:

    • It is a diagnostic tool only; it does not execute the migration.
    • It focuses on gathering evidence (observed, measured, reported, assumed, or unknown) rather than providing an aggregate readiness score.
    • It evaluates the marginal value of React Native over the existing native system.
    • It does not recommend specific implementation details (like Expo vs. bare React Native) until a migration path is accepted.
  7. What is View Flattening and when to use it

    main

    React Native's renderer performs an optimization called View Flattening, where it automatically removes "layout-only" views from the native view hierarchy. These are views that only affect layout and do not require their own native representation for drawing, events, accessibility, measurement, or native-component child semantics.

    Benefits

    • Reduced memory usage
    • Faster rendering
    • Shallower native view tree

    When to use this knowledge

    • When a native component receives an unexpected number of children.
    • When debugging layout issues involving native components.
    • When building native components that rely on receiving specific children.
    • When the JS tree structure does not match the actual native view hierarchy.
  8. Optimize @gorhom/bottom-sheet for 60 FPS

    main

    To prevent jank and dropped frames in @gorhom/bottom-sheet, avoid using React state (useState) for gesture-driven or scroll-driven visual updates. Updating React state during an interaction causes the entire component subtree to re-render on the JS thread. Instead, use react-native-reanimated shared values (useSharedValue) and consume them via useAnimatedStyle to keep animations entirely on the UI thread.

    const animatedIndex = useSharedValue(0);
    
    const overlayStyle = useAnimatedStyle(() => ({
      opacity: interpolate(
        animatedIndex.value,
        [0, 1],
        [0, 0.5],
        Extrapolation.CLAMP
      ),
    }));
    
    <BottomSheet animatedIndex={animatedIndex}>
      <ExpensiveContent />
    </BottomSheet>
    <Animated.View style={[styles.overlay, overlayStyle]} />
  9. Architecting multi-platform TV applications

    main

    When building TV applications, a Monorepo structure is the most common approach because different platforms require bundled applications.

    Key Architectural Principles:

    • Prioritize Logic Reuse: Reuse business logic, state management, custom hooks, and API layers across all platforms.
    • Isolate UI and Focus: Expect TV-specific screen UI, focus behaviors, and platform-specific packaging to require dedicated implementations.
    • Project Structure Example:

    A typical multi-platform shape includes separate native folders for each target (e.g., ios/, tvos/, android/, vega/, web/) while keeping shared application code in a src/ directory.

    my-tv-app/
    ├── ios/              # iOS native files
    ├── tvos/             # tvOS native files
    ├── android/           # Android, Android TV, Fire TV native
    ├── vega/             # Vega OS native files
    ├── web/              # web, webOS, Tizen native files
    ├── src/              # Application code (shared)
    │   ├── index.web.tsx # Web entry point
    │   └── index.js      # Native entry point
    ├── rsbuild.config.ts # Web bundler config
    ├── metro.config.ts   # Native bundler config
    └── package.json
    my-tv-app/
    ├── ios/              # iOS native files
    ├── tvos/             # tvOS native files
    ├── android/           # Android, Android TV, Fire TV native
    ├── vega/             # Vega OS native files
    ├── web/              # web, webOS, Tizen native files
    ├── src/              # Application code (shared)
    │   ├── index.web.tsx # Web entry point
    │   └── index.js      # Native entry point
    ├── rsbuild.config.ts # Web bundler config
    ├── metro.config.ts   # Native bundler config
    └── package.json
  10. Use Quick Section types for rapid reference

    main

    The first section of a skill file should be a 'Quick' section to provide immediate value. Choose the type based on the skill's nature:

    • Quick Pattern: Used for code transformations (e.g., showing Incorrect → Correct code).
    • Quick Command: Used for shell or tool invocations (e.g., npx source-map-explorer).
    • Quick Config: Used for configuration changes (e.g., a metro.config.js snippet).
    • Quick Reference: Used for conceptual overviews (e.g., a summary table).
  11. Select the correct React Native upgrade workflow

    main

    Use this decision map to choose the specific skill/guide required for your current upgrade phase:

    GoalRequired Guide
    Canonical RN diff/merge workflowupgrade-helper-core.md
    Ensure dependency compatibilityupgrading-dependencies.md
    Align React and React 19react.md
    Upgrade Expo SDK dependenciesexpo-sdk-upgrade.md
    Post-upgrade validation (manual/agent)upgrade-verification.md