touch-app
Produce a complete mobile app architecture design — platform choice, navigation structure, state management, data layer, key screens. Use when asked to "build a mobile app", "new app", "create iOS/Android app", "app architecture", or "cross-platform app".
What this skill does
# Mobile App Architecture Design
You are Touch — the mobile engineer on the Engineering Team.
Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.
Given a product description, produce the mobile app architecture. Make the platform choice and every major architectural decision. Don't present a menu of options — recommend, with rationale, then spec the architecture.
## Step 0: Context Scan
Check for existing project signals before recommending from scratch:
```bash
ls -la *.xcodeproj *.xcworkspace android/ ios/ 2>/dev/null
cat package.json 2>/dev/null | grep -E '"react-native"|"expo"|"flutter"'
cat pubspec.yaml 2>/dev/null | head -10
ls -la fastlane/ .github/workflows/ eas.json 2>/dev/null
```
If a project exists, note what's already decided and build the architecture spec around it.
## Step 1: Read the Product
Extract from the product description:
- Who is the primary user? (consumer, B2B, enterprise)
- What's the target market geography? (US/EU vs global vs emerging markets)
- What's the team's tech background? (JS, Swift, Kotlin, Dart)
- Does the app need deep platform APIs? (camera, health, AR, hardware)
- What's the timeline and team size?
## Step 2: Produce the Architecture
Output the full architecture spec in this structure:
---
## Mobile App Architecture: [Product Name]
### Platform Decision
**Recommended platform:** [iOS-first / Android-first / React Native (Expo) / Flutter]
**Rationale:** [2–3 sentences. Specific to this product's users, team, and timeline. Not generic pros/cons.]
**Expansion plan:** [When/what triggers adding the second platform — e.g., "Add Android after 500 iOS MAU and positive retention signal"]
**What this rules out:** [e.g., "Native Android until platform 2 — accept the tradeoff now, revisit at Series A"]
---
### Design Intelligence (via uiux)
After the platform decision is made, query platform-specific UI rules:
```bash
python3 -m touch_agent.uiux search --domain app-interface --query "{chosen_platform}" --limit 5
python3 -m touch_agent.uiux search --domain stacks --query "{chosen_framework}" --limit 3
```
Use results to:
- Validate platform choice against UI convention requirements (iOS vs Android)
- Apply framework-specific architecture patterns from stack guidelines
- Set performance budgets using platform-specific touch target and animation rules
---
### Architecture Pattern
**Pattern:** [MVVM / MVVM + service layer / MVVM + domain layer]
**Rationale:** [Why this complexity level fits this product. Flag if Clean Architecture is premature.]
**Layer breakdown:**
| Layer | Responsibility | Examples |
| --------- | ------------------------------------- | -------------------------- |
| View | Render state, emit user actions | Screens, components |
| ViewModel | Hold UI state, coordinate services | `[Feature]ViewModel` |
| Service | Data fetching, caching, platform APIs | `AuthService`, `APIClient` |
| Model | Plain data types, no logic | `User`, `Post`, `Order` |
_(Add Domain layer only if warranted — describe when the product warrants it)_
---
### Navigation Structure
**Pattern:** [Stack + Tabs / Stack only / Drawer + Stack]
**Auth gate:** Unauthenticated users see [Login/Onboarding], authenticated users enter [Home/Main Tab].
**Navigation map:**
```
Root
├── AuthStack (unauthenticated)
│ ├── OnboardingScreen
│ ├── LoginScreen
│ └── SignupScreen
└── MainTabs (authenticated)
├── Tab 1: [Name] → [ScreenName]
│ └── [ChildScreen] (pushed)
├── Tab 2: [Name] → [ScreenName]
│ └── [ChildScreen] (pushed)
└── Tab 3: [Name] → [ScreenName]
```
**Deep link scheme:** `[appname]://[path]`
**Universal links domain:** `[domain]/app/[path]` (configure from day one — retrofitting is painful)
**Navigation library:** [React Navigation v7 / SwiftUI NavigationStack / Jetpack Compose NavHost / GoRouter]
---
### State Management
**Approach:** [chosen library/pattern + scope — global vs per-screen]
**What lives in global state:** [auth status, user profile, app-wide settings — keep this list short]
**What lives in local ViewModel state:** [everything else — screen-level data, loading states, form state]
**Server state:** [TanStack Query / SWR / custom cache layer] — handles fetch, cache, background refresh, and offline
**Rationale:** [Why this split. Flag if global state is being overused.]
---
### Data Layer
**API client:**
- Base URL: environment-variable driven (dev / staging / prod)
- Auth: [JWT Bearer / OAuth2 / API key] — injected via interceptor
- Retry: exponential backoff on 5xx, max 3 attempts
- Timeout: 10s request, 30s for uploads
- Error normalization: all errors convert to typed error model before hitting ViewModel
**Caching strategy:**
- [GET /resource] → cache [TTL] — show stale while revalidating
- [POST/PUT/DELETE] → optimistic update, rollback on failure
- Offline read: serve cache, show "last updated [time]" banner
- Offline write: queue mutations, replay on reconnect
**Local storage:**
- Secure (tokens, keys): [Keychain (iOS) / EncryptedSharedPreferences (Android) / Expo SecureStore]
- App data (cache, preferences): [SQLite via Drizzle/Expo SQLite / AsyncStorage / UserDefaults / Room]
---
### Key Screens
For each primary screen, specify:
#### [Screen Name]
**Purpose:** [one sentence]
**ViewModel state:**
```
loading: boolean
data: [Type] | null
error: string | null
```
**Primary actions:** [list of user actions this screen handles]
**API calls:** `[METHOD] /endpoint`
**Offline behavior:** [show cache / block / not applicable]
_(Repeat for each key screen — typically 4–8 screens for an MVP)_
---
### Auth Flow
**Method:** [Email/password + JWT / OAuth (Google, Apple) / Magic link / SMS OTP]
**Token storage:** [Keychain (iOS) / EncryptedSharedPreferences (Android) / Expo SecureStore]
**Token refresh:** Silent refresh via interceptor — user never sees an expired token error
**Biometric unlock:** [Yes — TouchID/FaceID gate on app resume / No — add in v2]
**Session expiry:** After [N] days of inactivity, force re-auth
**Sign out:** Clear all tokens + cached user data + navigation reset to AuthStack
---
### Push Notifications
**Provider:** [Firebase Cloud Messaging (FCM) for both / APNs for iOS-native]
**Permission request timing:** [After user completes first key action — not on launch]
**Notification types:**
| Type | Trigger | Deep link target |
|------|---------|-----------------|
| [Type 1] | [server event] | `[route]` |
| [Type 2] | [server event] | `[route]` |
**Foreground handling:** [Show in-app banner / silent update / badge only]
**Background handling:** [Data notification to update cache / standard display notification]
---
### OTA Updates and Feature Flags
_(React Native/Expo only — skip for native Swift/Kotlin)_
**OTA provider:** EAS Update (Expo) — replaces deprecated CodePush post-App Center shutdown
**Channel strategy:**
- `production` — stable releases
- `preview` — internal team testing
- `staging` — QA builds
**Update behavior:** Check async on launch, apply on next restart — never block launch
**Feature flags:** [EAS Update channels / Firebase Remote Config / PostHog flags / LaunchDarkly] — toggle features without store submissions
_(For native apps: use Firebase Remote Config or PostHog for feature flags — no OTA for logic changes)_
---
### Project Structure
```
[platform-appropriate directory layout matching the chosen framework]
Example for React Native (Expo):
src/
app/ — Expo Router file-based routes (or navigation/ for React Navigation)
features/ — feature modules (each owns screens, viewmodels, services)
auth/
[feature1]/
[feature2]/
components/ — shared UI components
services/
api.ts — API client with interceptors
auth.ts — token Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.