移动应用架构设计

本条目介绍 移动应用架构设计 的公开用途。DeepSkill 当前公开目录说明:“构建完整的移动应用架构设计 — 平台选择、导航结构、状态管理、数据层、关键页面。适用于“构建移动应用”、“新应用”、“创建 iOS/Android 应用”、“应用架构”或“跨平台应用”等需求场景。” 适用场景包括写代码与代码审查、系统管理。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。

仓库
jeremylongshore/tons-of-skills-marketplace

安装方式

先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。

安装方式

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "touch-app":https://skillpi.com/zh/skills/deepskill-06654a6ee28cca9ad70749d3ca385eb32cef01dfacff9a2e183fc07a7cf45c7e。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/touch-app/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。

运行工具
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/touch-app --skill touch-app
许可协议: —

来源与配置

查看 GitHub 源码

jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

本条目介绍 移动应用架构设计 的公开用途。DeepSkill 当前公开目录说明:“构建完整的移动应用架构设计 — 平台选择、导航结构、状态管理、数据层、关键页面。适用于“构建移动应用”、“新应用”、“创建 iOS/Android 应用”、“应用架构”或“跨平台应用”等需求场景。” 适用场景包括写代码与代码审查、系统管理。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。

↓ 0 下载 ↗ 0 分享点击

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
---
name: touch-app
description: 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".
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion
version: 0.6.4
author: tonone-ai <hello@tonone.ai>
license: MIT
---

# 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 management
    storage.ts      — secure + local storage abstraction
  hooks/            — shared custom hooks
  store/            — global state (minimal — auth, user only)
  types/            — shared TypeScript types
  utils/            — helpers, constants, formatters
assets/             — images, fonts, icons
```

---

### Release Pipeline

**Build automation:** [Fastlane / EAS Build] — configured from day one

**CI:** GitHub Actions

- PR: lint + type-check + unit tests
- Merge to main: build beta + distribute to testers
- Tag: production build + store submission

**Beta distribution:** [TestFlight (iOS) / Firebase App Distribution (Android)]

**Code signing:**

- iOS: `fastlane match` — certificates in private repo or cloud storage
- Android: Keystore in CI secrets, Play App Signing enabled

**Versioning:** `major.minor.patch` — single source of truth (package.json / pubspec.yaml / xcconfig)

---

### Performance Budget

| Metric     | Target                     | How to hit it                                                |
| ---------- | -------------------------- | ------------------------------------------------------------ |
| Cold start | < 2s on mid-range device   | Defer analytics/crash SDK init; show first frame first       |
| Scroll     | 60fps sustained            | No layout computation on main thread; virtualized lists      |
| App size   | < 50MB download            | Lazy-load assets; audit dependencies; enable code splitting  |
| Memory     | No growth on long sessions | Dispose controllers; size images to display size, not source |
| Battery    | No background drain        | Cancel in-flight requests on background; no wake locks       |

---

### Third-Party Dependencies

| Category           | Choice                                     | Rationale |
| ------------------ | ------------------------------------------ | --------- |
| HTTP client        | [Axios / Ktor / URLSession / Dio]          | [why]     |
| State management   | [Zustand / Riverpod / TCA / BLoC]          | [why]     |
| Navigation         | [React Navigation v7 / GoRouter / NavHost] | [why]     |
| Analytics          | [PostHog / Mixpanel / Firebase Analytics]  | [why]     |
| Crash reporting    | [Sentry / Crashlytics]                     | [why]     |
| Push notifications | [FCM / APNs]                               | [why]     |
| Auth               | [Supabase / Firebase Auth / custom JWT]    | [why]     |

**Dependency rule:** Every new dependency must justify its size cost. `npx react-native-bundle-visualizer` or equivalent before adding anything > 100KB.

---

### Done Criteria

Architecture is done enough to build when:

- [ ] Platform choice is made and rationale is written
- [ ] Navigation structure covers all authenticated + unauthenticated flows
- [ ] State management boundaries are defined (global vs local)
- [ ] API client contract is clear (auth, error handling, retry, caching)
- [ ] Every key screen has a ViewModel state shape
- [ ] Release pipeline is configured (Fastlane or EAS) before first feature is built
- [ ] Performance budget is set before any screen is built

**What this architecture does not include:** Pixel-perfect UI design (Draft/Form own that), API endpoint implementation (Spine owns that), backend infrastructure (Forge/Flux own that).

## Delivery

If output exceeds the 40-line CLI budget, invoke `/atlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.

当前收录版本

0.6.4

核对来源版本 ↗

质量评测

满分 100。前四项来自 DeepSkill 收录的质量报告。

场景价值95/100
评分依据

提供完整的移动应用架构设计方案,覆盖平台选择、导航结构、状态管理、数据层等关键方面

触发精准95/100
评分依据

触发词覆盖全面,准确匹配移动应用架构设计相关需求

结构规范95/100
评分依据

结构清晰完整,包含多个逻辑阶段和详细步骤

执行可靠90/100
评分依据

使用了平台允许的工具集

证据可验 (前四项均值)94/100
计算方式

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 313 行
  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 146, 190 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

risk · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。

来源与使用声明 SkillPi 的部分技能资料来自公开来源或创作者提交。第三方内容的权利归各自权利人所有。安装或运行前,请查看原站的许可、权限要求和使用风险。

来源与使用

请按详情页的作者、原始来源和许可证核对使用条件,运行前检查技能需要的权限。目录收录不等于已验证安装或安全性。