agentleFS
sonhaicodersonhaicoder/haiclaudeskill/skills/mobile-design/SKILL.md

mobile-design

Skill0 starsChanged 6 months agoMITView on GitHub

Design formula cho MOBILE APP (Flutter / React Native / SwiftUI / Jetpack Compose / iOS native / Android native). Auto-trigger khi chạm file .dart/.swift/.kt/.java mobile hoặc user nói build app mobile, màn hình mobile, screen, widget Flutter, RN component. KHÔNG dùng cho web — web có skill frontend-design riêng.

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use intelligent-routing, nextjs-react-expert and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 5 projects that use this

  • SKB3002Skill

    nextjs-react-expert

    React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

    Also in 3 projects that use this

  • xfstudioSkill

    rust-pro

    Master Rust 1.75+ with modern async patterns, advanced type system

    Also in 5 projects that use this

  • jornalistainclusivoSkill

    design-spec

    How to author a DESIGN.md file — the machine-readable design-token + human-rationale format that must exist before any UI is built. YAML front-matter token schema (colors, typography, spacing, rounded, components), type system, token references, and canonical section order.

    Also in 3 projects that use this

  • MicrosoftSkill

    frontend-architecture

    Internal frontend architecture, design, implementation, verification, and audit rules loaded only when an explicitly invoked repository SDD prompt directs the agent to this skill.

    Also in 3 projects that use this

  • zzfancitizenSkill

    verify-changes

    Verify code changes do not break the project by running tests, linter checks, and import validation. Use after making any code changes, editing Python files, modifying imports, updating dependencies, or refactoring.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow Apple HIG / Material 3 spec 100%

    line 50

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mobile Design Formula (MOBILE APP ONLY)

AUTO-TRIGGER

Invoke lần đầu tiên mỗi session khi:

  • User nói: "build app/màn hình/screen/widget Flutter/RN"
  • User nói: "thêm/sửa UI mobile/app"
  • Agent sắp edit/write file .dart .swift .kt .java (trong project mobile)
  • Agent sắp chạm thư mục mobile/ lib/ ios/ android/

KHÔNG dùng khi

  • Web (React, Next.js, Vue, Svelte, HTML/CSS) → dùng frontend-design
  • Backend — không có UI

Tư duy cốt lõi

Mobile ≠ Web thu nhỏ. Công thức khác hoàn toàn:

WebMobile
Typography scaleDynamic clamp(44-72px)Fixed scale (24/20/16/14/12sp)
MotionLong (1.5-3s entrance)Short (200-400ms) — instant feedback
Spacingpy-32 (128px) section16dp/24dp base unit
Touch targetN/AMin 44pt iOS / 48dp Android
NavigationScroll/linkTab bar / bottom nav / stack
AestheticCan be experimentalPlatform conventions (Material 3 / HIG)
PerformanceDepends on deviceCritical — 60fps mandatory

Platform conventions (BẮT BUỘC tuân thủ)

Flutter

  • Material 3 (Android) / Cupertino (iOS) — detect platform, render đúng widget
  • Dùng Theme.of(context) thay hardcode color
  • MediaQuery cho responsive, SafeArea cho notch
  • Hero animation cho screen transition
  • State: Riverpod / BLoC, KHÔNG setState cho state phức tạp

React Native

  • Platform.OS check để render iOS/Android khác nhau
  • SafeAreaView (react-native-safe-area-context)
  • react-native-reanimated cho animation (60fps), KHÔNG Animated API cũ
  • Navigation: React Navigation (stack/tab/drawer)

SwiftUI / Jetpack Compose

  • Follow Apple HIG / Material 3 spec 100%
  • System fonts, system colors (dark mode auto)
  • Accessibility-first: VoiceOver / TalkBack

Design tokens (cho Commerce mobile app)

// Flutter example — lib/core/theme.dart
class AppColors {
  // Light mode
  static const bgPrimary = Color(0xFFF5F5F7);
  static const bgCard = Color(0xFFFFFFFF);
  static const textPrimary = Color(0xFF1A1A1A);
  static const textMuted = Color(0xFF666666);
  static const accent = Color(0xFF007AFF);  // iOS blue — hoặc Material 3 seed
  static const danger = Color(0xFFFF3B30);
  static const border = Color(0xFFE5E5E7);

  // Dark mode
  static const bgPrimaryDark = Color(0xFF000000);
  static const bgCardDark = Color(0xFF1C1C1E);
  static const textPrimaryDark = Color(0xFFF5F0EB);
  // ...
}

class AppSpacing {
  static const xs = 4.0;   // 4dp
  static const sm = 8.0;
  static const md = 16.0;  // base
  static const lg = 24.0;
  static const xl = 32.0;
  static const xxl = 48.0;
}

class AppTypography {
  static const display = TextStyle(fontSize: 32, fontWeight: FontWeight.w700, height: 1.2);
  static const title = TextStyle(fontSize: 24, fontWeight: FontWeight.w600, height: 1.25);
  static const headline = TextStyle(fontSize: 20, fontWeight: FontWeight.w600);
  static const body = TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1.5);
  static const bodySmall = TextStyle(fontSize: 14, fontWeight: FontWeight.w400, height: 1.4);
  static const caption = TextStyle(fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 0.5);
}

class AppRadius {
  static const sm = 8.0;
  static const md = 12.0;
  static const lg = 16.0;  // card/modal default
  static const xl = 24.0;
  static const pill = 999.0;
}

Mobile UX rules

  1. Touch target ≥ 44pt (iOS) / 48dp (Android) — không được nhỏ hơn
  2. Feedback trong 100ms — haptic, visual press state
  3. Loading ≤ 300ms → không cần indicator (user không kịp nhận ra)
  4. Loading > 1s → phải có skeleton/shimmer (không spinner thuần)
  5. Gesture natural — swipe back iOS, pull-to-refresh, long-press menu
  6. Offline-first — cache data local, sync background (quan trọng với Commerce VN)
  7. Keyboard awareness — scroll content lên khi keyboard mở, don't hide inputs
  8. Error recovery — mọi error phải có CTA retry, không dead-end

Anti-patterns

SaiĐúng
Fixed pixel heightMediaQuery.of(context).size.height * x
setState cho toàn screenRiverpod selector / BLoC state slice
print() debugdebugPrint() hoặc logger package
Hardcode colorTheme.of(context).colorScheme.xxx
Blocking main threadcompute() cho heavy work
Image.network không cachecached_network_image package
setState(() {}) sau async gap không check mountedif (!mounted) return;
Web design system (liquid glass, GSAP)Platform conventions — Material/Cupertino

Self-check trước khi ship mobile UI

□ Touch targets ≥ 44pt/48dp?
□ Theme tokens dùng nhất quán (không hardcode color/spacing)?
□ Dark mode support?
□ Loading state (skeleton, không spinner thuần)?
□ Empty state có illustration + CTA?
□ Error state có retry button?
□ Keyboard handling (scroll, dismiss, action button)?
□ SafeArea cho notch/home indicator?
□ Accessibility (semanticsLabel, contrast ≥ 4.5:1)?
□ 60fps khi scroll list dài? (flutter profile mode test)
□ Offline graceful (cached data + sync indicator)?
□ Haptic feedback trên action quan trọng?

TODO — khi Commerce bắt đầu build mobile

Hiện chưa có project mobile nào của anh active. Khi bắt đầu Flutter admin app, expand skill này với:

  • Riverpod patterns cho Commerce state (shops, orders, products)
  • Hive/Isar offline storage cho order pipeline
  • Image caching strategy cho product catalog
  • Barcode scanner integration cho inventory
  • Bluetooth printer cho in đơn (Commerce-specific)
  • VNPay / MoMo SDK mobile integration
  • Push notification (FCM/APNs) cho order updates

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.