$npx -y skills add sendaifun/solana-new --skill build-mobileGuide a developer through building a Solana mobile app. Use when a user says "build a mobile app", "React Native Solana", "Solana mobile", "mobile wallet", "mobile dApp", "Android Solana", or "iOS Solana". Reads build-context.md from a prior scaffold phase if available.
| 1 | ## Preamble (run first) |
| 2 | |
| 3 | ```bash |
| 4 | _TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous") |
| 5 | _TEL_TIER="${_TEL_TIER:-anonymous}" |
| 6 | _TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no") |
| 7 | _TEL_START=$(date +%s) |
| 8 | _SESSION_ID="$$-$(date +%s)" |
| 9 | mkdir -p ~/.superstack |
| 10 | echo "TELEMETRY: $_TEL_TIER" |
| 11 | echo "TEL_PROMPTED: $_TEL_PROMPTED" |
| 12 | if [ "$_TEL_TIER" != "off" ]; then |
| 13 | _TEL_EVENT='{"skill":"build-mobile","phase":"build","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' |
| 14 | echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true |
| 15 | _CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "") |
| 16 | [ -n "$_CONVEX_URL" ] && curl -s -X POST "$_CONVEX_URL/api/mutation" -H "Content-Type: application/json" -d '{"path":"telemetry:track","args":{"skill":"build-mobile","phase":"build","status":"success","version":"0.2.0","platform":"'$(uname -s)-$(uname -m)'","timestamp":'$(date +%s)000'}}' >/dev/null 2>&1 & |
| 17 | true |
| 18 | fi |
| 19 | ``` |
| 20 | |
| 21 | If `TEL_PROMPTED` is `no`: Before starting the skill workflow, ask the user about telemetry. |
| 22 | Use AskUserQuestion: |
| 23 | |
| 24 | > Help superstack get better! We track which skills get used and how long they take — |
| 25 | > no code, no file paths, no PII. Change anytime in `~/.superstack/config.json`. |
| 26 | |
| 27 | Options: |
| 28 | - A) Sure, help superstack improve (anonymous) |
| 29 | - B) No thanks |
| 30 | |
| 31 | If A: run this bash: |
| 32 | ```bash |
| 33 | echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json |
| 34 | _TEL_TIER="anonymous" |
| 35 | touch ~/.superstack/.telemetry-prompted |
| 36 | ``` |
| 37 | |
| 38 | If B: run this bash: |
| 39 | ```bash |
| 40 | echo '{"telemetryTier":"off"}' > ~/.superstack/config.json |
| 41 | _TEL_TIER="off" |
| 42 | touch ~/.superstack/.telemetry-prompted |
| 43 | ``` |
| 44 | |
| 45 | This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely and proceed to the skill workflow. |
| 46 | |
| 47 | > **Wrong skill?** See [SKILL_ROUTER.md](../../SKILL_ROUTER.md) for all available skills. |
| 48 | |
| 49 | # Build Mobile |
| 50 | |
| 51 | ## Overview |
| 52 | |
| 53 | Guide the user through building a Solana mobile application using React Native or native Android (Kotlin). Covers wallet connection via Mobile Wallet Adapter (MWA), transaction signing, deep linking, and the unique UX challenges of mobile crypto apps. Leverages the Solana Mobile stack and Phantom Connect SDK. |
| 54 | |
| 55 | ## Workflow |
| 56 | |
| 57 | 1. Check for `.superstack/build-context.md`. If found, use stack decisions. If not, ask: what platform (React Native cross-platform, or native Android)? What wallet connection method (MWA, Phantom deep links, embedded wallet)? Write `.superstack/build-context.md` with the context gathered so future skills can use it. |
| 58 | 2. Read [references/mobile-architecture.md](references/mobile-architecture.md) to select the right scaffold and SDK approach. |
| 59 | 3. Read [references/mobile-wallet-patterns.md](references/mobile-wallet-patterns.md) for wallet connection and transaction signing patterns. |
| 60 | 4. Implement in milestones: |
| 61 | a. Scaffold the project from the appropriate mobile template |
| 62 | b. Integrate wallet connection (MWA, Phantom mobile flow, or embedded wallet) |
| 63 | c. Build the first transaction flow (send SOL, swap, mint — whatever the app does) |
| 64 | d. Handle mobile-specific edge cases (network drops, backgrounding, timeout) |
| 65 | e. Test on Android emulator or device during development; use Mock MWA Wallet for development wallet flows |
| 66 | 5. Verify the full flow before signoff: install app, connect wallet, sign transaction, confirm on-chain, then repeat on a physical device with a real wallet installed. |
| 67 | |
| 68 | ## Non-Negotiables |
| 69 | |
| 70 | - Do development testing on any Android device or emulator; use Mock MWA Wallet when testing MWA flows during development. |
| 71 | - Always do final end-to-end verification on a physical device with a real wallet installed before calling the mobile flow production-ready. |
| 72 | - Handle network interruptions gracefully — mobile networks drop constantly. |
| 73 | - Never store private keys on device. Use Mobile Wallet Adapter, secure embedded wallet SDKs, or wallet-provider flows designed for mobile apps. |
| 74 | - Add loading states for every transaction — mobile users expect visual feedback. |
| 75 | - Test transaction signing timeout and app-switching behavior — wallets may not respond if the user backgrounds the app or switches apps. |
| 76 | - For React Native, follow the current Solana Mobile installation flow: use a custom Expo development build, import crypto polyfills before Solana libraries, and prefer current Solana Mobile sample patterns over older manual Buffer/url polyfill recipes. |
| 77 | |
| 78 | ## Phase Handoff |
| 79 | |
| 80 | This skill is **Phase 2 (Build)** in the Idea → Build → Launch journey. |
| 81 | |
| 82 | **Reads**: `.superstack/build-context.md` |
| 83 | **Writes/Updates**: `.super |