stacks-mobile

Build native iOS and Android applications from Stacks and STX codebases with Craft.

625|19|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-mobile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-mobile
Source: https://github.com/stacksjs/stacks/tree/main/storage/framework/defaults/ai/skills/stacks-mobile
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-mobile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It removes the boilerplate of turning a Stacks web application into native iOS and Android apps by orchestrating Craft project generation, mobile configuration, and native capability wiring from a single config file.

Core Features & Use Cases

  • Native Build Orchestration: Run buddy build:ios and buddy build:android to validate config/mobile.ts, generate the Xcode project via xcodegen, and record build provenance.
  • Native Runtime APIs: Access haptics, geolocation, push notifications, sharing, keep-awake, and health services through the browser-safe @stacksjs/mobile runtime with web fallbacks.
  • STX Native Components: Use <NativeAppShell>, <NativeTabBar>, <NativeShareButton>, and related components for safe areas, tab navigation, permissions, and offline banners.
  • Use Case: A team with an existing Stacks web app configures config/mobile.ts with a bundle ID and capabilities, then generates a shippable Xcode project with HealthKit and watchOS companion support without writing Swift.

Quick Start

Configure config/mobile.ts with your app name, bundle ID, and content URL, then ask the assistant to build the iOS project with buddy build:ios.

Frequently Asked Questions about stacks-mobile

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an iOS app from a Stacks project?

Run buddy build:ios after configuring config/mobile.ts with your app name, bundle ID, and content source. The build validates the config, initializes a Craft iOS project, and generates the Xcode project with xcodegen.

How do I add native capabilities like haptics and sharing to a Stacks mobile app?

Enable the capabilities in config/mobile.ts under ios or android, then call the runtime APIs from @stacksjs/mobile such as haptics.selection() or share.share(). Craft translates enabled capabilities into native bridge availability and iOS privacy descriptions.

Does the Stacks mobile runtime work in a regular browser?

Yes, the @stacksjs/mobile runtime is browser-safe. Craft-backed operations use the native bridge inside a native host, while supported web APIs provide fallback behavior outside one.

Can I use a local Craft checkout for iOS builds?

Yes, set CRAFT_IOS_SRC to the absolute path of Craft's iOS builder source before running buddy build:ios. The equivalent CRAFT_ANDROID_SRC variable exists for Android builds.

Why would I skip xcodegen or Gradle during mobile builds?

STACKS_IOS_SKIP_XCODEGEN=1 and STACKS_ANDROID_SKIP_GRADLE=1 exist only for source-level CI and tests. Shippable projects must be generated and compiled with Xcode or Gradle respectively.