Agent skill
building-mobile-game
Build mobile games and game-like interactive experiences in React Native and Expo. Use when Codex is creating or refactoring arcade, puzzle, casual, action, physics-based, or animation-heavy gameplay, including Expo game setup with the with-reanimated template, sprite-sheet generation and extraction, frame-based animation, touch controls, simple collision and physics loops, score and game-state systems, and cross-platform verification on web plus iOS and Android.
Install this agent skill to your Project
npx add-skill https://github.com/Intelligent-Internet/ii-agent/tree/main/src/ii_agent/settings/skills/builtin/building-mobile-game
SKILL.md
Mobile Game Workflow
References
./references/setup-and-loop.md-- Expo bootstrap, worklets setup, engine selection, game loop order, physics rules, packages, and performance checks./references/assets-and-animation.md-- sprite-sheet prompt templates, extraction workflow, naming, animation state mapping, and validation checklist./scripts/extract_sprites.py-- connected-component sprite extractor with background removal and optional frame normalization./scripts/normalize_animation_frames.py-- shared-scale frame normalizer with optional anchor frame locking for existing characters
Mandatory Reading Order
For any new mobile game task, read both reference files before planning implementation or calling project tools:
- Read
./references/setup-and-loop.mdfirst. - Read
./references/assets-and-animation.mdsecond. - Only after both references have been read should you choose libraries, plan gameplay, generate assets, or start coding.
Do not stop after reading only setup-and-loop.md. The asset reference is also mandatory for almost every real game because it covers sprite-sheet prompting, extraction, and normalization.
The only acceptable exception is a deliberately art-free prototype that uses simple geometric placeholder shapes and no image generation. When in doubt, read both references anyway.
Quick Start
- Read
./references/setup-and-loop.md, then read./references/assets-and-animation.md. - Start from
mobile_app_init(..., example="with-reanimated", with_tailwind=False)for animation-heavy or gesture-heavy game projects. - Install
react-native-worklets@0.5.1and put"react-native-worklets/plugin"last inbabel.config.js. Never add"react-native-reanimated/plugin". - Choose the lightest rendering stack that can support the mechanic:
react-native-game-enginefor most 2D arcade or puzzle loops@shopify/react-native-skiafor custom 2D drawing and effectsexpo-glplusthreefor 3D or GL scenesmatter-jsonly when the game truly needs richer physics
- Build gameplay in this order: input, movement, collisions, scoring or lives, pause or restart, then polish.
- Ask
generate_imagefor one whole animation strip at once, not one frame at a time, so character identity and proportions stay consistent. - Split raw strips with
./scripts/extract_sprites.py, then standardize them with./scripts/normalize_animation_frames.pywhen the game needs fixed frame sizes or an exact existing idle anchor. - Verify the game on Expo web and on mobile before calling the feature done.
Core Rules
- Keep physics simple first. Use manual velocity, gravity, and AABB collisions before reaching for a full physics engine.
- Build one mechanic at a time and re-test immediately after each layer.
- Keep gameplay rendering separate from overlays such as score, pause, settings, and game-over UI.
- Use only cross-platform APIs for rendering, animation, input, storage, audio, and haptics.
- Do not pull game art from random URLs. Generate assets locally and keep them under
assets/images/. - Use
generate_imagefor sprite sheets and explicitly ask for multiple states, transparent background, and large spacing between poses or items. Do not accept a single hero illustration when the game needs animation frames. - Ask for a full strip with explicit slot count, slot size, and canvas layout. Do not ask the model to patch one tiny frame at a time unless you are prepared for character drift.
- Normalize with one global scale for the whole strip. Do not rescale each frame independently or tall poses will make the character shrink.
- Normalize animation frame sizes for each entity so characters do not jitter between states.
Decision Guide
- Need route structure, navigation polish, or general Expo UI? Load
building-uias well. - Need async APIs, leaderboards, or cloud save? Load
data-fetchingfor the network layer. - Need to port browser game code or use a web-only library inside Expo? Load
use-dom.
Delivery Checklist
- The project boots from the reanimated example and uses
react-native-worklets/plugincorrectly. - The core loop is playable end to end with real input, collision, scoring, and failure or success states.
- Sprite sheets were generated with
generate_image, split cleanly, backgrounds are transparent, and per-entity frames share one canvas size with one global scale. - If the animation extends an existing shipped character, frame 01 can be locked to the exact in-game idle anchor instead of a regenerated approximation.
- Audio, haptics, pause or resume, and persistence are implemented when the design calls for them.
- Web preview and at least one mobile target have been checked for controls, frame pacing, and collision bugs.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
data-fetching
Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, axios, React Query, SWR, error handling, caching strategies, offline support.
docx
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
pptx
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
use-dom
Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.
Didn't find tool you were looking for?