使用現代架構為新 Android 應用程式建立骨架
何時使用: 當你要開始一個新應用程式,且不想在六個月後才來修正架構上的錯誤。
步驟
-
請 Claude 建立模組結構骨架Use claude-android-skill. Scaffold a multi-module Android app called 'HabitTracker' with features: home, tracking, settings. Compose UI, Hilt DI, Room DB, offline-first.✓ 已複製→ 模組 :app、:core:database、:core:ui、:feature:home… 已產生
-
端對端加入第一個功能Implement the tracking feature: data layer with Room entity, domain layer with use cases, UI with Compose and ViewModel. Include unit tests.✓ 已複製→ 橫跨三個分層的檔案與測試均可編譯
結果: 一個遵循 NowInAndroid 風格模式且可執行的應用程式。
注意事項
- 將一個小型應用程式過度設計成 8 個模組 — 明確告訴技能:'這裡用單一模組就好',適用於簡單專案