@leejungkiin/awkit 1.7.1 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/bin/awk.js +576 -84
  2. package/core/CLAUDE.md +1 -1
  3. package/core/GEMINI.md +148 -167
  4. package/core/GEMINI.md.bak +149 -116
  5. package/core/skill-runtime-manifest.json +3 -0
  6. package/docs/Claude Fable 5.md +3826 -0
  7. package/docs/android_kotlin_system_instruction.md +210 -0
  8. package/docs/brainstorm_ponytail_integration.md +146 -0
  9. package/docs/brainstorm_smart_setup.md +113 -0
  10. package/docs/deep-research-report (1).md +293 -0
  11. package/docs/history/GEMINI.v1.md +135 -0
  12. package/docs/history/brainstorm_antigravity_unified_architecture.v1.md +105 -0
  13. package/docs/history/implementation_plan.v1.md +58 -0
  14. package/package.json +4 -1
  15. package/scripts/artifact-storage.js +130 -0
  16. package/scripts/automation-gate.js +35 -2
  17. package/scripts/claude-plan.js +76 -0
  18. package/scripts/dependency-manager.js +210 -0
  19. package/scripts/exec-rtk.js +11 -5
  20. package/scripts/i18n-helper.js +381 -0
  21. package/scripts/multi-model-pipeline.js +144 -0
  22. package/skill-packs/mobile-ios/pack.json +4 -2
  23. package/skill-packs/reverse-engineering/pack.json +1 -0
  24. package/skills/CATALOG.md +20 -0
  25. package/skills/GEMINI.md +9 -1
  26. package/skills/TRIGGER_INDEX.md +10 -0
  27. package/skills/ai-music/SKILL.md +275 -0
  28. package/skills/android-re-analyzer/SKILL.md +238 -0
  29. package/skills/android-re-analyzer/references/api-extraction-patterns.md +119 -0
  30. package/skills/android-re-analyzer/references/call-flow-analysis.md +176 -0
  31. package/skills/android-re-analyzer/references/fernflower-usage.md +115 -0
  32. package/skills/android-re-analyzer/references/jadx-usage.md +116 -0
  33. package/skills/android-re-analyzer/references/setup-guide.md +221 -0
  34. package/skills/android-re-analyzer/scripts/check-deps.sh +129 -0
  35. package/skills/android-re-analyzer/scripts/decompile.sh +375 -0
  36. package/skills/android-re-analyzer/scripts/find-api-calls.sh +118 -0
  37. package/skills/android-re-analyzer/scripts/install-dep.sh +448 -0
  38. package/skills/animal-island-ui-style/SKILL.md +1450 -0
  39. package/skills/app-store-review-agent/SKILL.md +164 -0
  40. package/skills/app-store-review-agent/references/guidelines/README.md +154 -0
  41. package/skills/app-store-review-agent/references/guidelines/by-app-type/ai_apps.md +37 -0
  42. package/skills/app-store-review-agent/references/guidelines/by-app-type/all_apps.md +50 -0
  43. package/skills/app-store-review-agent/references/guidelines/by-app-type/crypto_finance.md +31 -0
  44. package/skills/app-store-review-agent/references/guidelines/by-app-type/games.md +31 -0
  45. package/skills/app-store-review-agent/references/guidelines/by-app-type/health_fitness.md +31 -0
  46. package/skills/app-store-review-agent/references/guidelines/by-app-type/kids.md +27 -0
  47. package/skills/app-store-review-agent/references/guidelines/by-app-type/macos.md +38 -0
  48. package/skills/app-store-review-agent/references/guidelines/by-app-type/social_ugc.md +32 -0
  49. package/skills/app-store-review-agent/references/guidelines/by-app-type/subscription_iap.md +34 -0
  50. package/skills/app-store-review-agent/references/guidelines/by-app-type/vpn.md +18 -0
  51. package/skills/app-store-review-agent/references/rules/design/minimum_functionality.md +96 -0
  52. package/skills/app-store-review-agent/references/rules/design/sign_in_with_apple.md +54 -0
  53. package/skills/app-store-review-agent/references/rules/entitlements/unused_entitlements.md +83 -0
  54. package/skills/app-store-review-agent/references/rules/metadata/accurate_metadata.md +54 -0
  55. package/skills/app-store-review-agent/references/rules/metadata/apple_trademark.md +99 -0
  56. package/skills/app-store-review-agent/references/rules/metadata/china_storefront.md +72 -0
  57. package/skills/app-store-review-agent/references/rules/metadata/competitor_terms.md +56 -0
  58. package/skills/app-store-review-agent/references/rules/metadata/subscription_metadata.md +81 -0
  59. package/skills/app-store-review-agent/references/rules/privacy/privacy_manifest.md +84 -0
  60. package/skills/app-store-review-agent/references/rules/privacy/unnecessary_data.md +60 -0
  61. package/skills/app-store-review-agent/references/rules/subscription/misleading_pricing.md +63 -0
  62. package/skills/app-store-review-agent/references/rules/subscription/missing_tos_pp.md +54 -0
  63. package/skills/awf-ponytail/SKILL.md +91 -0
  64. package/skills/awf-ponytail-review/SKILL.md +67 -0
  65. package/skills/awf-session-restore/SKILL.md +3 -3
  66. package/skills/brainstorm-agent/SKILL.md +11 -2
  67. package/skills/brainstorm-agent/templates/brief-template.md +8 -0
  68. package/skills/claude-planner/SKILL.md +47 -0
  69. package/skills/code-review/SKILL.md +87 -0
  70. package/skills/expo-game-development/SKILL.md +163 -0
  71. package/skills/flutter/LICENSE.txt +202 -0
  72. package/skills/flutter/SKILL.md +127 -0
  73. package/skills/flutter-project-creater/LICENSE.txt +202 -0
  74. package/skills/flutter-project-creater/SKILL.md +106 -0
  75. package/skills/game-developer/SKILL.md +163 -0
  76. package/skills/game-developer/references/ecs-patterns.md +501 -0
  77. package/skills/game-developer/references/multiplayer-networking.md +475 -0
  78. package/skills/game-developer/references/performance-optimization.md +422 -0
  79. package/skills/game-developer/references/unity-patterns.md +271 -0
  80. package/skills/game-developer/references/unreal-cpp.md +352 -0
  81. package/skills/generate-gui-assets/SKILL.md +305 -0
  82. package/skills/generate-gui-assets/agents/openai.yaml +4 -0
  83. package/skills/generate-gui-assets/references/catalog-schema.md +58 -0
  84. package/skills/generate-gui-assets/references/extraction-techniques.md +21 -0
  85. package/skills/generate-gui-assets/references/prompt-patterns.md +58 -0
  86. package/skills/generate-gui-assets/scripts/__pycache__/clean_chroma_edges.cpython-311.pyc +0 -0
  87. package/skills/generate-gui-assets/scripts/build_gui_contact_sheet.py +51 -0
  88. package/skills/generate-gui-assets/scripts/clean_chroma_edges.py +262 -0
  89. package/skills/generate-gui-assets/scripts/copy_approved_icons.py +64 -0
  90. package/skills/generate-gui-assets/scripts/prepare_gui_asset_run.py +91 -0
  91. package/skills/generate-gui-assets/scripts/suggest_grid_options.py +63 -0
  92. package/skills/generate-gui-assets/scripts/validate_gui_catalog.py +50 -0
  93. package/skills/godot-game-development/SKILL.md +142 -0
  94. package/skills/hatch-pet/LICENSE.txt +201 -0
  95. package/skills/hatch-pet/SKILL.md +420 -0
  96. package/skills/hatch-pet/agents/openai.yaml +4 -0
  97. package/skills/hatch-pet/references/animation-rows.md +29 -0
  98. package/skills/hatch-pet/references/codex-pet-contract.md +35 -0
  99. package/skills/hatch-pet/references/qa-rubric.md +60 -0
  100. package/skills/hatch-pet/scripts/__pycache__/clean_chroma_edges.cpython-311.pyc +0 -0
  101. package/skills/hatch-pet/scripts/clean_chroma_edges.py +262 -0
  102. package/skills/hatch-pet/scripts/compose_atlas.py +150 -0
  103. package/skills/hatch-pet/scripts/derive_running_left_from_running_right.py +143 -0
  104. package/skills/hatch-pet/scripts/extract_strip_frames.py +323 -0
  105. package/skills/hatch-pet/scripts/finalize_pet_run.py +382 -0
  106. package/skills/hatch-pet/scripts/generate_pet_images.py +287 -0
  107. package/skills/hatch-pet/scripts/inspect_frames.py +246 -0
  108. package/skills/hatch-pet/scripts/make_contact_sheet.py +96 -0
  109. package/skills/hatch-pet/scripts/package_custom_pet.py +108 -0
  110. package/skills/hatch-pet/scripts/pet_job_status.py +117 -0
  111. package/skills/hatch-pet/scripts/prepare_pet_run.py +673 -0
  112. package/skills/hatch-pet/scripts/queue_pet_repairs.py +172 -0
  113. package/skills/hatch-pet/scripts/record_imagegen_result.py +250 -0
  114. package/skills/hatch-pet/scripts/render_animation_videos.py +134 -0
  115. package/skills/hatch-pet/scripts/render_animation_videos.sh +5 -0
  116. package/skills/hatch-pet/scripts/validate_atlas.py +139 -0
  117. package/skills/i18n-orchestrator/SKILL.md +37 -0
  118. package/skills/ios-simulator-skill/SKILL.md +390 -0
  119. package/skills/ios-simulator-skill/scripts/accessibility_audit.py +300 -0
  120. package/skills/ios-simulator-skill/scripts/app_launcher.py +326 -0
  121. package/skills/ios-simulator-skill/scripts/app_state_capture.py +400 -0
  122. package/skills/ios-simulator-skill/scripts/appearance.py +385 -0
  123. package/skills/ios-simulator-skill/scripts/build_and_test.py +348 -0
  124. package/skills/ios-simulator-skill/scripts/clipboard.py +103 -0
  125. package/skills/ios-simulator-skill/scripts/common/__init__.py +61 -0
  126. package/skills/ios-simulator-skill/scripts/common/cache_utils.py +289 -0
  127. package/skills/ios-simulator-skill/scripts/common/device_utils.py +462 -0
  128. package/skills/ios-simulator-skill/scripts/common/env_config.py +35 -0
  129. package/skills/ios-simulator-skill/scripts/common/hang_pipeline.py +862 -0
  130. package/skills/ios-simulator-skill/scripts/common/hang_sessions.py +490 -0
  131. package/skills/ios-simulator-skill/scripts/common/idb_utils.py +180 -0
  132. package/skills/ios-simulator-skill/scripts/common/screenshot_utils.py +338 -0
  133. package/skills/ios-simulator-skill/scripts/container.py +668 -0
  134. package/skills/ios-simulator-skill/scripts/gesture.py +394 -0
  135. package/skills/ios-simulator-skill/scripts/hang_watcher.py +1533 -0
  136. package/skills/ios-simulator-skill/scripts/keyboard.py +391 -0
  137. package/skills/ios-simulator-skill/scripts/localization_audit.py +483 -0
  138. package/skills/ios-simulator-skill/scripts/location.py +467 -0
  139. package/skills/ios-simulator-skill/scripts/log_monitor.py +493 -0
  140. package/skills/ios-simulator-skill/scripts/model_inspector.py +645 -0
  141. package/skills/ios-simulator-skill/scripts/navigator.py +461 -0
  142. package/skills/ios-simulator-skill/scripts/privacy_manager.py +310 -0
  143. package/skills/ios-simulator-skill/scripts/push_notification.py +240 -0
  144. package/skills/ios-simulator-skill/scripts/screen_mapper.py +296 -0
  145. package/skills/ios-simulator-skill/scripts/sim_health_check.sh +245 -0
  146. package/skills/ios-simulator-skill/scripts/sim_list.py +299 -0
  147. package/skills/ios-simulator-skill/scripts/simctl_boot.py +312 -0
  148. package/skills/ios-simulator-skill/scripts/simctl_create.py +316 -0
  149. package/skills/ios-simulator-skill/scripts/simctl_delete.py +357 -0
  150. package/skills/ios-simulator-skill/scripts/simctl_erase.py +351 -0
  151. package/skills/ios-simulator-skill/scripts/simctl_shutdown.py +290 -0
  152. package/skills/ios-simulator-skill/scripts/simulator_selector.py +375 -0
  153. package/skills/ios-simulator-skill/scripts/status_bar.py +250 -0
  154. package/skills/ios-simulator-skill/scripts/test_recorder.py +323 -0
  155. package/skills/ios-simulator-skill/scripts/visual_diff.py +235 -0
  156. package/skills/ios-simulator-skill/scripts/xcode/__init__.py +13 -0
  157. package/skills/ios-simulator-skill/scripts/xcode/builder.py +397 -0
  158. package/skills/ios-simulator-skill/scripts/xcode/cache.py +204 -0
  159. package/skills/ios-simulator-skill/scripts/xcode/config.py +178 -0
  160. package/skills/ios-simulator-skill/scripts/xcode/reporter.py +343 -0
  161. package/skills/ios-simulator-skill/scripts/xcode/xcresult.py +451 -0
  162. package/skills/ios-visual-qa-strategist/SKILL.md +111 -0
  163. package/skills/ios-visual-qa-strategist/agents/openai.yaml +4 -0
  164. package/skills/ios-visual-qa-strategist/references/ios-tool-selection.md +61 -0
  165. package/skills/ios-visual-qa-strategist/references/minimal-capture-policy.md +56 -0
  166. package/skills/ios-visual-qa-strategist/references/visual-reasoning-heuristics.md +53 -0
  167. package/skills/orchestrator/SKILL.md +0 -20
  168. package/skills/persistent-storage/SKILL.md +55 -0
  169. package/skills/short-maker/SKILL.md +23 -0
  170. package/skills/short-maker/scripts/effects.js +56 -0
  171. package/skills/short-maker/scripts/shortmaker-bridge.js +332 -0
  172. package/skills/short-maker/scripts/videomix.js +601 -0
  173. package/skills/short-maker/templates/hyperframes/cinematic-character.template.html +172 -0
  174. package/skills/short-maker/templates/hyperframes/index.template.html +194 -0
  175. package/skills/smali-to-kotlin/SKILL.md +128 -0
  176. package/skills/smali-to-kotlin/examples/getting-started/tech-stack.md +58 -0
  177. package/skills/smali-to-kotlin/examples/pipeline/data-ui-parity.md +118 -0
  178. package/skills/smali-to-kotlin/examples/pipeline/scanner-and-bootstrap.md +106 -0
  179. package/skills/smali-to-kotlin/library-patterns.md +189 -0
  180. package/skills/smali-to-kotlin/phase-0-discovery.md +128 -0
  181. package/skills/smali-to-kotlin/phase-1-architecture.md +166 -0
  182. package/skills/smali-to-kotlin/phase-2-blueprint-ui.md +347 -0
  183. package/skills/smali-to-kotlin/phase-2-blueprint.md +228 -0
  184. package/skills/smali-to-kotlin/phase-3-build.md +248 -0
  185. package/skills/smali-to-kotlin/phase-3-logic-build.md +268 -0
  186. package/skills/smali-to-kotlin/smali-reading-guide.md +310 -0
  187. package/skills/smali-to-kotlin/templates/app-map.md +101 -0
  188. package/skills/smali-to-kotlin/templates/architecture.md +142 -0
  189. package/skills/smali-to-kotlin/templates/blueprint.md +145 -0
  190. package/skills/spec-gate/SKILL.md +6 -2
  191. package/skills/symphony-enforcer/SKILL.md +8 -0
  192. package/skills/symphony-enforcer/examples/mindful-stop.md +2 -0
  193. package/skills/symphony-enforcer/examples/three-phase.md +16 -0
  194. package/skills/symphony-enforcer/examples/trigger-points.md +7 -1
  195. package/skills/unity-game-development/SKILL.md +231 -0
  196. package/skills/video-edit/SKILL.md +36 -0
  197. package/skills/video-edit/scripts/video_edit.py +324 -0
  198. package/templates/project-identity/android.json +2 -2
  199. package/templates/project-identity/backend-nestjs.json +2 -2
  200. package/templates/project-identity/expo.json +2 -2
  201. package/templates/project-identity/ios.json +2 -2
  202. package/templates/project-identity/web-nextjs.json +2 -2
  203. package/templates/setup-mapping.json +48 -0
  204. package/templates/specs/design-template.md +161 -71
  205. package/templates/specs/requirements-template.md +65 -133
  206. package/templates/specs/task-spec-template.xml +3 -0
  207. package/workflows/_uncategorized/critic.md +40 -0
  208. package/workflows/_uncategorized/git-rebase-flow.md +81 -0
  209. package/workflows/_uncategorized/image-gen.md +118 -0
  210. package/workflows/_uncategorized/multi-model-pipeline.md +60 -0
  211. package/workflows/_uncategorized/pixel-gen.md +86 -0
  212. package/workflows/_uncategorized/pixel-setup.md +90 -0
  213. package/workflows/_uncategorized/ponytail-review.md +59 -0
  214. package/workflows/_uncategorized/reverse-android-build.md +222 -0
  215. package/workflows/_uncategorized/reverse-android-design.md +139 -0
  216. package/workflows/_uncategorized/reverse-android-discover.md +150 -0
  217. package/workflows/_uncategorized/reverse-android-scan.md +158 -0
  218. package/workflows/_uncategorized/reverse-android.md +143 -0
  219. package/workflows/_uncategorized/reverse-ios-build.md +240 -0
  220. package/workflows/_uncategorized/reverse-ios-design.md +112 -0
  221. package/workflows/_uncategorized/reverse-ios-discover.md +120 -0
  222. package/workflows/_uncategorized/reverse-ios-scan.md +155 -0
  223. package/workflows/_uncategorized/reverse-ios.md +152 -0
  224. package/workflows/_uncategorized/safety-router.md +34 -0
  225. package/workflows/_uncategorized/teach.md +89 -0
  226. package/workflows/_uncategorized/verify-ui.md +53 -0
  227. package/workflows/_uncategorized/visualize-screenshots.md +34 -0
  228. package/workflows/ads/ads-analyst.md +201 -0
  229. package/workflows/ads/ads-audit.md +106 -0
  230. package/workflows/ads/ads-optimize.md +97 -0
  231. package/workflows/ads/ads-targeting.md +241 -0
  232. package/workflows/ads/adsExpert.md +160 -0
  233. package/workflows/ads/smali-ads-config.md +400 -0
  234. package/workflows/ads/smali-ads-flow.md +331 -0
  235. package/workflows/ads/smali-ads-interstitial.md +377 -0
  236. package/workflows/ads/smali-ads-native.md +382 -0
  237. package/workflows/context/teach.md +89 -0
  238. package/workflows/gitnexus.md +8 -8
  239. package/workflows/lifecycle/brainstorm.md +43 -0
  240. package/workflows/lifecycle/code.md +5 -0
  241. package/workflows/lifecycle/init.md +23 -5
  242. package/workflows/lifecycle/multi-model-pipeline.md +60 -0
  243. package/workflows/quality/ponytail-review.md +59 -0
  244. package/workflows/roles/critic.md +40 -0
  245. package/workflows/roles/safety-router.md +34 -0
@@ -0,0 +1,248 @@
1
+ # 🔨 Phase 3: Implementation (Ground View — per feature)
2
+
3
+ > **Zoom Level:** 3 — Code Implementation
4
+ > **Goal:** Write actual, production-quality code for ONE feature.
5
+ > **Input:** Approved Blueprint from Phase 2.
6
+ > **Output:** Complete implementation files.
7
+
8
+ ---
9
+
10
+ ## ✅ PREREQUISITES
11
+
12
+ Before writing ANY code, confirm:
13
+ - [ ] Phase 0 App Map exists and is approved
14
+ - [ ] Phase 1 Architecture Blueprint exists and is approved
15
+ - [ ] Phase 2 Feature Blueprint exists for THIS feature and is approved
16
+ - [ ] All contracts (interfaces, models, state) are defined in Blueprint
17
+
18
+ ---
19
+
20
+ ## 📋 Implementation Order (per feature)
21
+
22
+ ### 3.1: Domain Layer
23
+
24
+ 1. **Models** — data classes from Blueprint 2.2
25
+ 2. **Repository interfaces** — from Blueprint 2.3
26
+ 3. **UseCases** — implement invoke() with repository calls
27
+
28
+ ```kotlin
29
+ class LoginUseCase @Inject constructor(
30
+ private val authRepository: AuthRepository
31
+ ) {
32
+ suspend operator fun invoke(email: String, password: String): Result<User> {
33
+ return authRepository.login(email, password)
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### 3.2: Data Layer
39
+
40
+ 1. **DTOs** — @Serializable data classes matching API JSON
41
+ 2. **API interfaces** — Retrofit with correct annotations
42
+ 3. **Room entities + DAOs** (if applicable)
43
+ 4. **DataStore** setup (if applicable)
44
+ 5. **Repository implementation** — offline-first pattern:
45
+
46
+ ```kotlin
47
+ class AuthRepositoryImpl @Inject constructor(
48
+ private val api: AuthApi,
49
+ private val tokenStore: TokenDataStore
50
+ ) : AuthRepository {
51
+
52
+ override suspend fun login(email: String, password: String): Result<User> {
53
+ return runCatching {
54
+ val response = api.login(LoginRequest(email, password))
55
+ tokenStore.saveToken(response.accessToken)
56
+ response.user.toDomain()
57
+ }
58
+ }
59
+
60
+ override fun isLoggedIn(): Flow<Boolean> {
61
+ return tokenStore.tokenFlow.map { it.isNotEmpty() }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### 3.3: DI Module
67
+
68
+ ```kotlin
69
+ @Module
70
+ @InstallIn(SingletonComponent::class)
71
+ abstract class RepositoryModule {
72
+ @Binds
73
+ abstract fun bindAuthRepository(impl: AuthRepositoryImpl): AuthRepository
74
+ }
75
+ ```
76
+
77
+ ### 3.4: ViewModel
78
+
79
+ Implement using UiState + Events from Blueprint:
80
+
81
+ ```kotlin
82
+ @HiltViewModel
83
+ class LoginViewModel @Inject constructor(
84
+ private val loginUseCase: LoginUseCase
85
+ ) : ViewModel() {
86
+
87
+ private val _uiState = MutableStateFlow(LoginUiState())
88
+ val uiState = _uiState.asStateFlow()
89
+
90
+ private val _events = MutableSharedFlow<LoginEvent>()
91
+ val events = _events.asSharedFlow()
92
+
93
+ fun onAction(action: LoginAction) {
94
+ when (action) {
95
+ is LoginAction.UpdateEmail -> _uiState.update { it.copy(email = action.email) }
96
+ is LoginAction.UpdatePassword -> _uiState.update { it.copy(password = action.password) }
97
+ LoginAction.TogglePasswordVisibility -> _uiState.update { it.copy(isPasswordVisible = !it.isPasswordVisible) }
98
+ LoginAction.Submit -> login()
99
+ }
100
+ }
101
+
102
+ private fun login() {
103
+ viewModelScope.launch {
104
+ _uiState.update { it.copy(isLoading = true, error = null) }
105
+ loginUseCase(uiState.value.email, uiState.value.password)
106
+ .onSuccess { user -> _events.emit(LoginEvent.NavigateToHome(user)) }
107
+ .onFailure { e -> _uiState.update { it.copy(error = e.message, isLoading = false) } }
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### 3.5: Compose Screen
114
+
115
+ ```kotlin
116
+ @Composable
117
+ fun LoginScreen(
118
+ viewModel: LoginViewModel = hiltViewModel(),
119
+ onNavigateToHome: () -> Unit
120
+ ) {
121
+ val uiState by viewModel.uiState.collectAsStateWithLifecycle()
122
+
123
+ LaunchedEffect(Unit) {
124
+ viewModel.events.collect { event ->
125
+ when (event) {
126
+ is LoginEvent.NavigateToHome -> onNavigateToHome()
127
+ is LoginEvent.ShowSnackbar -> { /* snackbar */ }
128
+ }
129
+ }
130
+ }
131
+
132
+ // Compose UI from Blueprint wireframe
133
+ Scaffold { padding ->
134
+ Column(
135
+ modifier = Modifier
136
+ .fillMaxSize()
137
+ .padding(padding)
138
+ .padding(24.dp),
139
+ horizontalAlignment = Alignment.CenterHorizontally
140
+ ) {
141
+ // Logo, TextFields, Button — matching wireframe
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### 3.6: Resource Extraction (On-Demand)
148
+
149
+ **ONLY** extract resources used by this screen:
150
+ - Drawables referenced in layout XML
151
+ - Strings used in this Activity's Smali
152
+ - Colors and Dimens for this screen
153
+
154
+ ```bash
155
+ # Find drawables used in layout
156
+ grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_login.xml | sort -u
157
+
158
+ # Find strings used in Activity smali
159
+ grep 'const-string.*R.string' [apktool_dir]/smali/.../LoginActivity.smali
160
+ ```
161
+
162
+ ---
163
+
164
+ ## 🔒 CRYPTO UTILS (Special Handling)
165
+
166
+ If the feature involves encryption/hashing:
167
+
168
+ 1. **Read Smali carefully** — exact algorithm, padding, encoding
169
+ 2. **Implement in Kotlin** — preserve exact input/output
170
+ 3. **Unit test IMMEDIATELY** — with known pairs from original app
171
+
172
+ ```kotlin
173
+ object CryptoUtils {
174
+ fun hashMd5(input: String): String {
175
+ val md = MessageDigest.getInstance("MD5")
176
+ return md.digest(input.toByteArray())
177
+ .joinToString("") { "%02x".format(it) }
178
+ }
179
+ }
180
+
181
+ // TEST (mandatory)
182
+ class CryptoUtilsTest {
183
+ @Test
184
+ fun `md5 matches original app output`() {
185
+ // Capture known pairs from running original app
186
+ assertEquals("expected_hash", CryptoUtils.hashMd5("known_input"))
187
+ }
188
+ }
189
+ ```
190
+
191
+ > ⚠️ Crypto functions MUST produce identical output. Any mismatch breaks server communication.
192
+
193
+ ---
194
+
195
+ ## ✅ Checkpoint (After each feature)
196
+
197
+ ```markdown
198
+ ## ✅ Feature Complete: [Feature Name]
199
+
200
+ ### Files created:
201
+ - domain/model/User.kt
202
+ - domain/repository/AuthRepository.kt
203
+ - domain/usecase/LoginUseCase.kt
204
+ - data/remote/api/AuthApi.kt
205
+ - data/remote/dto/LoginRequest.kt, LoginResponse.kt
206
+ - data/repository/AuthRepositoryImpl.kt
207
+ - presentation/screens/auth/LoginScreen.kt
208
+ - presentation/screens/auth/LoginViewModel.kt
209
+ - presentation/screens/auth/LoginUiState.kt
210
+
211
+ ### Resources extracted:
212
+ - [only what was needed]
213
+
214
+ ### Tests:
215
+ - [ ] Crypto utils verified
216
+ - [ ] API contract matches original
217
+
218
+ ### ⏭️ Next Feature: [Name]
219
+ → Return to Phase 2 (Blueprint) for this feature
220
+ ```
221
+
222
+ ---
223
+
224
+ ## 🔄 Loop
225
+
226
+ ```
227
+ Phase 2 (Blueprint for Feature X) → Phase 3 (Build Feature X) → Checkpoint
228
+
229
+ Phase 2 (Blueprint for Feature Y) → Phase 3 (Build Feature Y) → Checkpoint
230
+
231
+ ... (repeat for all features from Architecture Build Order)
232
+
233
+ Final: Parity Check & Quality Gate
234
+ ```
235
+
236
+ ---
237
+
238
+ ## ✅ Final Parity Check (After all features)
239
+
240
+ 1. **API Parity** — all endpoints match (headers, body, encoding)
241
+ 2. **Data Parity** — crypto/hash output identical
242
+ 3. **UI Parity** — screen-by-screen comparison
243
+ 4. **Edge Cases** — empty states, errors, offline
244
+ 5. **Build & Test** — `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
245
+
246
+ ---
247
+
248
+ *Phase 3: Implementation — One feature at a time, guided by Blueprint*
@@ -0,0 +1,268 @@
1
+ # 🔨 Phase 3: Logic Build (Per Feature) — Android
2
+
3
+ > **Zoom Level:** 3 — Code Implementation
4
+ > **Goal:** Code logic behind the APPROVED UI shell for ONE feature.
5
+ > **Input:** Approved Blueprint + Working UI Shell from Phase 2.
6
+ > **Output:** Feature fully wired — UI + logic connected.
7
+
8
+ ---
9
+
10
+ ## ✅ PREREQUISITES
11
+
12
+ Before writing ANY logic code, confirm:
13
+ - [ ] Phase 0 App Map: approved
14
+ - [ ] Phase 1 Architecture Blueprint: approved
15
+ - [ ] Phase 2 Contracts: approved for THIS feature
16
+ - [ ] Phase 2 UI Shell: approved, runs in Preview/device
17
+
18
+ > ⚠️ If UI is not approved yet, STOP. Go back to Phase 2.
19
+
20
+ ---
21
+
22
+ ## 📋 Implementation Order
23
+
24
+ ### 3.1: Domain Layer
25
+
26
+ Implement from contracts defined in Phase 2:
27
+
28
+ 1. **Models** — data classes (already drafted in 2.2, now create actual files)
29
+ 2. **Repository interfaces** — (already drafted in 2.3, create files)
30
+ 3. **UseCases** — implement invoke() with repository calls
31
+
32
+ ```kotlin
33
+ class LoginUseCase @Inject constructor(
34
+ private val authRepository: AuthRepository
35
+ ) {
36
+ suspend operator fun invoke(email: String, password: String): Result<User> {
37
+ return authRepository.login(email, password)
38
+ }
39
+ }
40
+ ```
41
+
42
+ ### 3.2: Data Layer
43
+
44
+ 1. **DTOs** — @Serializable data classes matching API JSON
45
+ 2. **API interfaces** — Retrofit with correct annotations
46
+ 3. **Room entities + DAOs** (if applicable)
47
+ 4. **DataStore** setup (if applicable)
48
+ 5. **Repository implementation** — offline-first pattern
49
+
50
+ ```kotlin
51
+ class AuthRepositoryImpl @Inject constructor(
52
+ private val api: AuthApi,
53
+ private val tokenStore: TokenDataStore
54
+ ) : AuthRepository {
55
+
56
+ override suspend fun login(email: String, password: String): Result<User> {
57
+ return runCatching {
58
+ val response = api.login(LoginRequest(email, password))
59
+ tokenStore.saveToken(response.accessToken)
60
+ response.user.toDomain()
61
+ }
62
+ }
63
+
64
+ override fun isLoggedIn(): Flow<Boolean> {
65
+ return tokenStore.tokenFlow.map { it.isNotEmpty() }
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### 3.3: DI Module
71
+
72
+ ```kotlin
73
+ @Module
74
+ @InstallIn(SingletonComponent::class)
75
+ abstract class RepositoryModule {
76
+ @Binds
77
+ abstract fun bindAuthRepository(impl: AuthRepositoryImpl): AuthRepository
78
+ }
79
+ ```
80
+
81
+ ### 3.4: ViewModel
82
+
83
+ Implement using UiState + Events + Actions from Phase 2.6:
84
+
85
+ ```kotlin
86
+ @HiltViewModel
87
+ class LoginViewModel @Inject constructor(
88
+ private val loginUseCase: LoginUseCase
89
+ ) : ViewModel() {
90
+
91
+ private val _uiState = MutableStateFlow(LoginUiState())
92
+ val uiState = _uiState.asStateFlow()
93
+
94
+ private val _events = MutableSharedFlow<LoginEvent>()
95
+ val events = _events.asSharedFlow()
96
+
97
+ fun onAction(action: LoginAction) {
98
+ when (action) {
99
+ is LoginAction.UpdateEmail -> _uiState.update { it.copy(email = action.email) }
100
+ is LoginAction.UpdatePassword -> _uiState.update { it.copy(password = action.password) }
101
+ LoginAction.TogglePasswordVisibility -> _uiState.update {
102
+ it.copy(isPasswordVisible = !it.isPasswordVisible)
103
+ }
104
+ LoginAction.Submit -> login()
105
+ }
106
+ }
107
+
108
+ private fun login() {
109
+ viewModelScope.launch {
110
+ _uiState.update { it.copy(isLoading = true, error = null) }
111
+ loginUseCase(uiState.value.email, uiState.value.password)
112
+ .onSuccess { user -> _events.emit(LoginEvent.NavigateToHome(user)) }
113
+ .onFailure { e -> _uiState.update { it.copy(error = e.message, isLoading = false) } }
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### 3.5: Wire UI ↔ Logic ⭐ (NOT "code new UI")
120
+
121
+ > **This step does NOT create new UI.** The UI already exists from Phase 2.8.
122
+ > Only CONNECT the existing UI shell to the real ViewModel.
123
+
124
+ **Changes needed on the UI shell:**
125
+
126
+ ```kotlin
127
+ // Phase 2 code stays as the STATELESS "Content" composable (for Preview):
128
+ @Composable
129
+ fun LoginScreenContent(
130
+ uiState: LoginUiState = LoginUiState(),
131
+ onAction: (LoginAction) -> Unit = {}
132
+ ) {
133
+ // ... all UI code from Phase 2.8 — DO NOT MODIFY
134
+ }
135
+
136
+ // ADD a NEW wrapper that wires ViewModel:
137
+ @Composable
138
+ fun LoginScreen(
139
+ viewModel: LoginViewModel = hiltViewModel(),
140
+ onNavigateToHome: () -> Unit
141
+ ) {
142
+ val uiState by viewModel.uiState.collectAsStateWithLifecycle()
143
+
144
+ LaunchedEffect(Unit) {
145
+ viewModel.events.collect { event ->
146
+ when (event) {
147
+ is LoginEvent.NavigateToHome -> onNavigateToHome()
148
+ is LoginEvent.ShowSnackbar -> { /* snackbar */ }
149
+ }
150
+ }
151
+ }
152
+
153
+ // Delegate to stateless content composable
154
+ LoginScreenContent(
155
+ uiState = uiState,
156
+ onAction = viewModel::onAction
157
+ )
158
+ }
159
+ ```
160
+
161
+ **Wire Checklist:**
162
+ - [ ] Replace hardcoded defaults → ViewModel state
163
+ - [ ] Connect UI actions → ViewModel.onAction()
164
+ - [ ] Bind navigation events
165
+ - [ ] Connect loading/error states
166
+ - [ ] Previews still work (they use the stateless Content composable)
167
+
168
+ ### 3.6: Integration Test ⭐
169
+
170
+ Verify UI + logic end-to-end:
171
+
172
+ ```markdown
173
+ ### 🧪 Integration: [Feature]
174
+
175
+ Functional:
176
+ - [ ] API calls succeed, data displays on UI
177
+ - [ ] Loading state shows/hides at right time
178
+ - [ ] Error state displays correct message
179
+ - [ ] Navigation works as expected
180
+ - [ ] Form validation works
181
+
182
+ Data:
183
+ - [ ] Request format matches original app
184
+ - [ ] Response parses correctly
185
+ - [ ] Token/session stored properly
186
+ - [ ] Crypto output matches original (if applicable)
187
+
188
+ Edge Cases:
189
+ - [ ] Empty input handling
190
+ - [ ] Network error handling
191
+ - [ ] Back navigation
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 🔒 CRYPTO UTILS (Special Handling)
197
+
198
+ If the feature involves encryption/hashing:
199
+
200
+ 1. Read Smali carefully — exact algorithm, padding, encoding
201
+ 2. Implement in Kotlin — preserve exact input/output
202
+ 3. Unit test IMMEDIATELY with known pairs
203
+
204
+ ```kotlin
205
+ object CryptoUtils {
206
+ fun hashMd5(input: String): String {
207
+ val md = MessageDigest.getInstance("MD5")
208
+ return md.digest(input.toByteArray())
209
+ .joinToString("") { "%02x".format(it) }
210
+ }
211
+ }
212
+
213
+ // MANDATORY test
214
+ class CryptoUtilsTest {
215
+ @Test
216
+ fun `md5 matches original app output`() {
217
+ assertEquals("expected_hash", CryptoUtils.hashMd5("known_input"))
218
+ }
219
+ }
220
+ ```
221
+
222
+ > ⚠️ Crypto functions MUST produce identical output. Any mismatch breaks server communication.
223
+
224
+ ---
225
+
226
+ ## ✅ Checkpoint
227
+
228
+ ```markdown
229
+ ## ✅ Feature Complete: [Feature Name]
230
+
231
+ ### Files created:
232
+ - domain/model/User.kt
233
+ - domain/repository/AuthRepository.kt
234
+ - domain/usecase/LoginUseCase.kt
235
+ - data/remote/api/AuthApi.kt
236
+ - data/remote/dto/LoginRequest.kt, LoginResponse.kt
237
+ - data/repository/AuthRepositoryImpl.kt
238
+ - di/RepositoryModule.kt
239
+ - presentation/screens/auth/LoginViewModel.kt
240
+ - presentation/screens/auth/LoginScreen.kt ← wired (from Phase 2)
241
+ - presentation/screens/auth/LoginUiState.kt
242
+
243
+ ### Tests:
244
+ - [ ] Crypto utils verified (if applicable)
245
+ - [ ] API contract matches original
246
+ - [ ] UI + Logic e2e works
247
+
248
+ ### ⏭️ Next Feature: [Name]
249
+ → Return to Phase 2 (Blueprint + UI Design)
250
+ ```
251
+
252
+ ---
253
+
254
+ ## 🔄 Feature Loop
255
+
256
+ ```
257
+ Phase 2 (Blueprint + UI for Feature X) → GATE → Phase 3 (Logic for X) → Checkpoint
258
+
259
+ Phase 2 (Blueprint + UI for Feature Y) → GATE → Phase 3 (Logic for Y) → Checkpoint
260
+
261
+ ... (repeat for all features from Architecture Build Order)
262
+
263
+ Phase 4: Final Parity Check & Quality Gate
264
+ ```
265
+
266
+ ---
267
+
268
+ *Phase 3: Logic Build — Wire logic behind approved UI*