@leejungkiin/awkit 1.0.6 → 1.0.8

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 (64) hide show
  1. package/VERSION +1 -1
  2. package/core/GEMINI.md.bak +168 -181
  3. package/package.json +2 -2
  4. package/schemas/brain-snapshot.json +167 -0
  5. package/skills/CATALOG.md +70 -0
  6. package/skills/beads-manager/SKILL.md +20 -1
  7. package/skills/memory-sync/SKILL.md +20 -2
  8. package/skills/nm-memory-audit/SKILL.md +157 -0
  9. package/skills/nm-memory-evolution/SKILL.md +202 -0
  10. package/skills/nm-memory-intake/SKILL.md +135 -0
  11. package/skills/nm-memory-sync/SKILL.md +184 -0
  12. package/skills/orchestrator/SKILL.md +41 -50
  13. package/skills/schemas/brain-snapshot.json +167 -0
  14. package/skills/skills/nm-memory-audit/SKILL.md +157 -0
  15. package/skills/skills/nm-memory-evolution/SKILL.md +202 -0
  16. package/skills/skills/nm-memory-intake/SKILL.md +135 -0
  17. package/skills/skills/nm-memory-sync/SKILL.md +184 -0
  18. package/skills/smali-to-kotlin/phase-0-discovery.md +128 -0
  19. package/skills/smali-to-kotlin/phase-1-architecture.md +166 -0
  20. package/skills/smali-to-kotlin/phase-2-blueprint-ui.md +347 -0
  21. package/skills/smali-to-kotlin/phase-2-blueprint.md +228 -0
  22. package/skills/smali-to-kotlin/phase-3-build.md +248 -0
  23. package/skills/smali-to-kotlin/phase-3-logic-build.md +268 -0
  24. package/skills/smali-to-kotlin/templates/app-map.md +101 -0
  25. package/skills/smali-to-kotlin/templates/architecture.md +142 -0
  26. package/skills/smali-to-kotlin/templates/blueprint.md +145 -0
  27. package/skills/smali-to-swift/phase-0-discovery.md +137 -0
  28. package/skills/smali-to-swift/phase-1-architecture.md +168 -0
  29. package/skills/smali-to-swift/phase-2-blueprint-ui.md +348 -0
  30. package/skills/smali-to-swift/phase-2-blueprint.md +173 -0
  31. package/skills/smali-to-swift/phase-3-build.md +257 -0
  32. package/skills/smali-to-swift/phase-3-logic-build.md +312 -0
  33. package/skills/smali-to-swift/templates/app-map.md +82 -0
  34. package/skills/smali-to-swift/templates/architecture.md +97 -0
  35. package/skills/smali-to-swift/templates/blueprint.md +82 -0
  36. package/skills/workflows/nm-import.md +73 -0
  37. package/skills/workflows/nm-recall.md +67 -0
  38. package/skills/workflows/nm-snapshot.md +69 -0
  39. package/workflows/_uncategorized/nm-import.md +73 -0
  40. package/workflows/_uncategorized/nm-recall.md +67 -0
  41. package/workflows/_uncategorized/nm-snapshot.md +69 -0
  42. package/workflows/_uncategorized/reverse-android-build.md +222 -0
  43. package/workflows/_uncategorized/reverse-android-design.md +139 -0
  44. package/workflows/_uncategorized/reverse-android-discover.md +150 -0
  45. package/workflows/_uncategorized/reverse-android-scan.md +158 -0
  46. package/workflows/_uncategorized/reverse-android.md +143 -0
  47. package/workflows/_uncategorized/reverse-ios-build.md +240 -0
  48. package/workflows/_uncategorized/reverse-ios-design.md +112 -0
  49. package/workflows/_uncategorized/reverse-ios-discover.md +120 -0
  50. package/workflows/_uncategorized/reverse-ios-scan.md +155 -0
  51. package/workflows/_uncategorized/reverse-ios.md +152 -0
  52. package/workflows/mobile/reverse-android-build.md +119 -79
  53. package/workflows/mobile/reverse-android-design.md +10 -7
  54. package/workflows/mobile/reverse-android.md +52 -46
  55. package/workflows/mobile/reverse-ios-build.md +161 -50
  56. package/workflows/mobile/reverse-ios-design.md +10 -1
  57. package/workflows/mobile/reverse-ios.md +49 -37
  58. package/skills/adaptive-language/SKILL.md +0 -189
  59. package/skills/ambient-brain/SKILL.md +0 -314
  60. package/skills/ambient-brain/brain-router.md +0 -185
  61. package/skills/ambient-brain/brain-templates.md +0 -201
  62. package/skills/context-help/SKILL.md +0 -180
  63. package/skills/error-translator/SKILL.md +0 -153
  64. package/skills/session-restore/SKILL.md +0 -240
@@ -1,170 +1,210 @@
1
1
  ---
2
- description: 🔨 RE Android Phase 2+3 — Per-feature Blueprint → Implementation → Parity Check
2
+ description: 🔨 RE Android Phase 2+3+4 — Blueprint + UI Shell Logic Build Final Parity (UI-First)
3
3
  parent: reverse-android
4
4
  ---
5
5
 
6
- # /re-android-build — Blueprint & Build (Per Feature)
6
+ # /re-android-build — Blueprint + UI + Build (Per Feature)
7
7
 
8
- > **Parent:** [`/reverse-android`](reverse-android.md) → Phase 2+3
8
+ > **Parent:** [`/reverse-android`](reverse-android.md) → Phase 2+3+4
9
9
  > **Prerequisite:** Completed Architecture from [`/re-android-design`](reverse-android-design.md)
10
- > **Skill:** `smali-to-kotlin` → `phase-2-blueprint.md` + `phase-3-build.md`
10
+ > **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
11
11
 
12
12
  ---
13
13
 
14
- ## 🔄 Feature Loop
14
+ ## 🔄 Feature Loop (UI-First)
15
15
 
16
16
  ```
17
17
  For each feature (from Architecture Build Order):
18
- Phase 2: Blueprint (Zoom 2 signatures only)
19
- [User approves]
20
- Phase 3: Implementation (Zoom 3 full code)
21
- [Checkpoint]
18
+ Phase 2: Blueprint + UI (contracts + visual shell)
19
+ 🚦 GATE: User approves UI + contracts
20
+ Phase 3: Logic Build (domain data wire)
21
+ 📊 CHECKPOINT
22
22
  → Next feature
23
23
  ```
24
24
 
25
25
  ---
26
26
 
27
- ## 📐 Phase 2: Feature Blueprint (Zoom 2)
27
+ ## 📐🎨 Phase 2: Blueprint + UI Design
28
28
 
29
- > **Output:** Contracts, interfaces, state design. **Signatures only, no bodies.**
29
+ > **Output:** Approved contracts + Working Compose UI shell with mock data.
30
30
 
31
- ### 2.1: Deep Smali Reading
31
+ ### Part A: Contracts (signatures only)
32
32
 
33
- Read Smali files for the chosen feature. Extract:
34
- - Class hierarchy, fields, method signatures
35
- - String constants (URLs, keys, messages)
36
- - Control flow → business rules (document, don't code)
37
-
38
- ### 2.2: Contracts
39
-
40
- Define for this feature:
33
+ #### 2.1: Deep Smali Reading
34
+ Read Smali files for the chosen feature. Extract class hierarchy, fields, method signatures,
35
+ string constants, control flow. See `smali-reading-guide.md`.
41
36
 
37
+ #### 2.2–2.5: Define Contracts
42
38
  ```kotlin
43
- // Domain Model
44
- data class [Model](val field1: Type, ...)
39
+ // 2.2 Domain Model
40
+ data class [Model](val field: Type, ...)
45
41
 
46
- // Repository Interface
42
+ // 2.3 Repository Interface
47
43
  interface [Feature]Repository {
48
44
  suspend fun [method](...): Result<[Type]>
49
- fun [stream](): Flow<[Type]>
50
45
  }
51
46
 
52
- // API Interface
47
+ // 2.4 API Interface
53
48
  interface [Feature]Api {
54
49
  @[METHOD]("[endpoint]")
55
50
  suspend fun [method](...): [Response]
56
51
  }
57
52
 
58
- // UseCase
53
+ // 2.5 UseCase
59
54
  class [Action]UseCase(repo: [Feature]Repository) {
60
55
  suspend operator fun invoke(...): Result<[Type]> // TODO()
61
56
  }
62
57
  ```
63
58
 
64
- ### 2.3: UI State Design
65
-
59
+ #### 2.6: UI State Design
66
60
  ```kotlin
67
61
  data class [Screen]UiState(
68
62
  val field: Type = default,
69
63
  val isLoading: Boolean = false,
70
64
  val error: String? = null
71
65
  )
72
-
73
66
  sealed interface [Screen]Event { /* navigation, snackbar */ }
74
67
  sealed interface [Screen]Action { /* user interactions */ }
75
68
  ```
76
69
 
77
- ### 2.4: Wireframe + File List
70
+ ### Part B: UI Visual Shell
71
+
72
+ #### 2.7: Resource Extraction ⭐ (BEFORE UI code!)
73
+
74
+ ```bash
75
+ # Only resources for THIS screen
76
+ grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
77
+ grep -o '@color/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
78
+ ```
78
79
 
79
- ASCII wireframe + list of files to create.
80
+ Copy ONLY needed resources. Verify they compile.
80
81
 
81
- ### Blueprint Gate
82
+ #### 2.8: UI Implementation ⭐ (Visual shell with mock data)
82
83
 
84
+ - Use UiState from 2.6 with hardcoded defaults
85
+ - Use REAL resources from 2.7
86
+ - Create `[Screen]Content` composable (stateless)
87
+ - Match visual parity with original app
88
+ - NO ViewModel connection, NO real API calls
89
+
90
+ ```kotlin
91
+ @Composable
92
+ fun [Screen]Content(
93
+ uiState: [Screen]UiState = [Screen]UiState(), // Mock
94
+ onAction: ([Screen]Action) -> Unit = {} // No-op
95
+ ) {
96
+ // Full Compose UI matching original app
97
+ }
98
+
99
+ @Preview @Composable
100
+ private fun NormalPreview() { AppTheme { [Screen]Content() } }
101
+
102
+ @Preview @Composable
103
+ private fun LoadingPreview() { AppTheme { [Screen]Content([Screen]UiState(isLoading = true)) } }
104
+
105
+ @Preview @Composable
106
+ private fun ErrorPreview() { AppTheme { [Screen]Content([Screen]UiState(error = "Error")) } }
83
107
  ```
84
- "📐 Blueprint cho [Feature] xong. Anh xem OK không? → Em bắt đầu code."
108
+
109
+ #### 2.9: Visual Parity Check ⭐
110
+
111
+ Compare with original app:
112
+ - [ ] Layout structure matches
113
+ - [ ] Colors, typography, spacing correct
114
+ - [ ] Icons/images positioned correctly
115
+ - [ ] All states: normal, loading, error, empty
116
+
117
+ ### 🚦 UI + Contracts Gate (MANDATORY)
118
+
119
+ ```
120
+ "📐🎨 Blueprint + UI cho [Feature] xong:
121
+ 📝 Contracts: [N] models, [N] repos, [N] use cases, [N] APIs
122
+ 🎨 UI: [Screen] with [N] state previews
123
+ 📸 Visual Parity: [OK / needs adjustment]
124
+
125
+ → ✅ Approve → Phase 3 (Logic Build)
126
+ → 🎨 Adjust UI → fix then re-check
127
+ → 📝 Adjust contracts → revise"
85
128
  ```
86
129
 
130
+ > ⚠️ **DO NOT proceed to Phase 3 without user approval.**
131
+
87
132
  ---
88
133
 
89
- ## 🔨 Phase 3: Implementation (Zoom 3)
134
+ ## 🔨 Phase 3: Logic Build
90
135
 
91
- > **Output:** Full production-quality Kotlin code for THIS feature only.
136
+ > **Output:** Full production-quality Kotlin code. Wire logic to EXISTING UI.
92
137
 
93
138
  ### 3.1: Domain Layer
94
-
95
- - Models (data classes from Blueprint)
96
- - Repository interfaces (from Blueprint)
97
- - UseCases (implement invoke with repo calls)
139
+ Models + Repository interfaces + UseCases (implement invoke with repo calls)
98
140
 
99
141
  ### 3.2: Data Layer
100
-
101
- - DTOs (@Serializable)
102
- - Retrofit API interface
103
- - Room entities + DAOs (if applicable)
104
- - Repository implementation (offline-first)
142
+ DTOs + Retrofit API + Room (if applicable) + Repository implementation
105
143
 
106
144
  ### 3.3: DI Module
107
-
108
- - Hilt @Module with @Binds for repository
145
+ Hilt @Module with @Binds for repository
109
146
 
110
147
  ### 3.4: ViewModel
148
+ @HiltViewModel with StateFlow + SharedFlow, implements onAction()
111
149
 
112
- - @HiltViewModel with StateFlow + SharedFlow
113
- - Implement onAction() handler from Blueprint actions
114
-
115
- ### 3.5: Compose Screen
150
+ ### 3.5: Wire UI Logic ⭐ (NOT "code new UI")
116
151
 
117
- - Collect state with collectAsStateWithLifecycle()
118
- - UI from wireframe
119
- - LaunchedEffect for events
152
+ The UI already exists from Phase 2.8. Only CONNECT it:
120
153
 
121
- ### 3.6: Resource Extraction (On-Demand only)
122
-
123
- ```bash
124
- # Only resources for THIS screen
125
- grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
154
+ ```kotlin
155
+ // Keep stateless Content composable from Phase 2 (for Preview):
156
+ // [Screen]Content(uiState, onAction) — DO NOT MODIFY
157
+
158
+ // ADD wrapper that wires ViewModel:
159
+ @Composable
160
+ fun [Screen](
161
+ viewModel: [Screen]ViewModel = hiltViewModel(),
162
+ onNavigate: () -> Unit
163
+ ) {
164
+ val uiState by viewModel.uiState.collectAsStateWithLifecycle()
165
+ LaunchedEffect(Unit) {
166
+ viewModel.events.collect { event -> /* handle navigation */ }
167
+ }
168
+ [Screen]Content(uiState = uiState, onAction = viewModel::onAction)
169
+ }
126
170
  ```
127
171
 
128
- ### 🔒 Crypto Utils (Special)
172
+ ### 3.6: Integration Test
173
+ - [ ] API calls succeed, data displays
174
+ - [ ] Loading/error states work
175
+ - [ ] Navigation correct
176
+ - [ ] Crypto output matches (if applicable)
129
177
 
130
- If feature involves crypto/hashing:
131
- 1. Read Smali carefully (exact algorithm)
132
- 2. Implement in Kotlin
133
- 3. Unit test IMMEDIATELY with known pairs
134
-
135
- > ⚠️ Crypto MUST produce identical output to original app.
178
+ ### 🔒 Crypto Utils (Special)
179
+ If crypto involved: implement + unit test IMMEDIATELY with known pairs.
180
+ > ⚠️ MUST produce identical output.
136
181
 
137
182
  ### ✅ Feature Checkpoint
138
183
 
139
184
  ```markdown
140
185
  ## ✅ Feature Complete: [Name]
141
-
142
- ### Files created: [list]
143
- ### Resources extracted: [only needed]
144
- ### Tests: [crypto verified? API matches?]
145
-
146
- ### ⏭️ Next Feature: [Name]
147
- → Return to Phase 2 (Blueprint) for next feature
186
+ Files: [list] | Resources: [count] | Tests: [status]
187
+ ⏭️ Next Feature: [Name] → Return to Phase 2
148
188
  ```
149
189
 
150
190
  ---
151
191
 
152
- ## ✅ Final Parity Check (After ALL features)
192
+ ## ✅ Phase 4: Final Parity Check (After ALL features)
153
193
 
154
194
  ### Checklist
155
195
  - [ ] API Parity — all endpoints match (headers, body, encoding)
156
196
  - [ ] Data Parity — crypto/hash output identical
157
197
  - [ ] UI Parity — screen-by-screen comparison
158
198
  - [ ] Edge Cases — empty states, errors, offline, lifecycle
159
- - [ ] Build & Test: `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
199
+ - [ ] Build: `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
160
200
 
161
201
  ### 🎉 Final Summary
162
202
 
163
203
  ```markdown
164
204
  ## ✅ Reverse Engineering Complete!
165
- - Screens: [count] | Features: [count]
166
- - Libs reused: [count] | Replaced: [count]
167
- - Tests: [pass/fail] | Lint: [pass/warnings]
205
+ - Screens: [N] | Features: [N]
206
+ - Libs reused: [N] | Replaced: [N]
207
+ - Tests: [pass/fail] | Lint: [warnings]
168
208
 
169
209
  ⏭️ Next: /test → /deploy → /code-janitor
170
210
  ```
@@ -175,8 +215,8 @@ If feature involves crypto/hashing:
175
215
 
176
216
  - **Parent:** [`/reverse-android`](reverse-android.md)
177
217
  - **Previous:** [`/re-android-design`](reverse-android-design.md) (Phase 1)
178
- - **Skill:** `smali-to-kotlin` → `phase-2-blueprint.md` + `phase-3-build.md`
218
+ - **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
179
219
 
180
220
  ---
181
221
 
182
- *re-android-build v3.0.0 — Phase 2+3: Blueprint & Build*
222
+ *re-android-build v4.0.0 — UI-First Blueprint + Build*
@@ -84,16 +84,19 @@ app/src/main/java/[package]/
84
84
  └── util/
85
85
  ```
86
86
 
87
- ## 🔢 Step 6: Build Order
87
+ ## 🔢 Step 6: Build Order (UI-First) ⭐
88
88
 
89
89
  | # | Phase | Scope | Complexity |
90
90
  |---|-------|-------|-----------|
91
- | 1 | 🟢 Setup | Project + DI + Theme | Low |
92
- | 2 | 🟢 Models | Domain data classes | Low |
93
- | 3 | 🟡 Data | API + Room + DataStore | Medium |
94
- | 4 | 🟡 Utils | Crypto, formatters | Medium |
95
- | 5 | 🔴 Features | Per-feature Blueprint→Build | High |
96
- | N | 🔴 Final | Parity check | High |
91
+ | 1 | 🟢 Foundation | Project + DI skeleton + Theme/Design System | Low |
92
+ | 2 | 🟢 Navigation | Routes, tab bar, NavGraph | Low |
93
+ | 3 | 🔵 Per Feature | Blueprint (contracts) + UI Shell (visual) | Medium |
94
+ | 4 | 🚦 UI Gate | User approves UI before logic | |
95
+ | 5 | 🟡 Per Feature | Logic Build (Domain → Data → VM → Wire UI) | High |
96
+ | 6 | 📦 SDKs | Third-party SDK + Native libs integration | Medium |
97
+ | N | 🔴 Final | Full Parity Check | High |
98
+
99
+ > **UI-First:** Design and approve UI before coding logic for each feature.
97
100
 
98
101
  ## 🔧 Step 7: Tech Stack Confirmation
99
102
 
@@ -1,20 +1,20 @@
1
1
  ---
2
- description: 🔧 Dịch ngược APK Android (Apktool output) → App Kotlin hiện đại với Jetpack Compose, Clean Architecture. Progressive Disclosure: Map → Blueprint → Build.
2
+ description: 🔧 Dịch ngược APK Android (Apktool output) → App Kotlin hiện đại với Jetpack Compose, Clean Architecture, UI-First methodology.
3
3
  skill: smali-to-kotlin
4
4
  ---
5
5
 
6
6
  # /reverse-android — Android APK Reverse Engineering Workflow
7
7
 
8
8
  > **Skill:** `smali-to-kotlin` v2.0 | **Tech:** Kotlin + Compose + Hilt + Retrofit + Room
9
- > **Philosophy:** "Treat decompiled code as a MAP, not a TODO list"
10
- > **Approach:** Map Blueprint Build (progressive disclosure)
9
+ > **Philosophy:** "Map Blueprint UI First Logic Behind"
10
+ > **Key:** UI is designed and approved BEFORE coding any business logic.
11
11
 
12
12
  ---
13
13
 
14
14
  ## ⚡ QUICK START
15
15
 
16
16
  User cung cấp: Apktool output dir, `AndroidManifest.xml`, hoặc nói "reverse engineer APK này".
17
- Workflow dẫn dắt qua **4 phases** — mỗi phase có zoom level riêng, **không bao giờ nhảy cóc**.
17
+ Workflow dẫn dắt qua **5 phases** — UI-First approach, **không bao giờ nhảy cóc**.
18
18
 
19
19
  ---
20
20
 
@@ -27,10 +27,11 @@ reverse_session:
27
27
  project_name: "[TBD - từ manifest]"
28
28
  apktool_dir: "[path]"
29
29
  current_phase: 0
30
- current_zoom: 0 # 0=satellite, 1=district, 2=block, 3=ground
31
- current_feature: null # set khi user chọn feature ở Phase 2
32
- app_map_done: false
33
- architecture_done: false
30
+ current_feature: null
31
+ phase_2_status:
32
+ contracts: pending
33
+ ui_shell: pending
34
+ resources: pending
34
35
  completed_features: []
35
36
  pending_features: []
36
37
  decisions: []
@@ -39,7 +40,7 @@ reverse_session:
39
40
  ### Bước 0.2: Xác nhận input
40
41
 
41
42
  ```
42
- 🔧 Android Reverse Engineering v2.0 — Map → Blueprint → Build
43
+ 🔧 Android Reverse Engineering v2.0 — UI-First Pipeline
43
44
 
44
45
  Em cần biết:
45
46
  1. Thư mục Apktool output ở đâu?
@@ -50,14 +51,15 @@ Chưa chạy Apktool? → apktool d your-app.apk -o ./decompiled/
50
51
 
51
52
  ---
52
53
 
53
- ## 📋 Pipeline Overview (4 Phases)
54
+ ## 📋 Pipeline Overview (5 Phases — UI-First)
54
55
 
55
- | Phase | Name | Sub-workflow | Zoom | Code? | Gate |
56
- |-------|------|-------------|------|-------|------|
57
- | 0 | 🗺️ Discovery | [`/re-android-discover`](reverse-android-discover.md) | Satellite | ❌ | User approves Map |
58
- | 1 | 🏗️ Architecture | [`/re-android-design`](reverse-android-design.md) | District | ❌ | User approves Architecture |
59
- | 2 | 📐 Blueprint | [`/re-android-build`](reverse-android-build.md) | Block | Signatures | Per-feature approval |
60
- | 3 | 🔨 Implementation | [`/re-android-build`](reverse-android-build.md) | Ground | Full | Per-feature checkpoint |
56
+ | Phase | Name | Sub-workflow | Code? | Gate |
57
+ |-------|------|-------------|-------|------|
58
+ | 0 | 🗺️ Discovery | [`/re-android-discover`](reverse-android-discover.md) | ❌ | User approves Map |
59
+ | 1 | 🏗️ Architecture | [`/re-android-design`](reverse-android-design.md) | ❌ | User approves Architecture |
60
+ | 2 | 📐🎨 Blueprint + UI | [`/re-android-build`](reverse-android-build.md) | UI code | User approves UI + Contracts |
61
+ | 3 | 🔨 Logic Build | [`/re-android-build`](reverse-android-build.md) | Full logic | Feature checkpoint |
62
+ | 4 | ✅ Final Parity | [`/re-android-build`](reverse-android-build.md) | — | Final check |
61
63
 
62
64
  ### Execution Flow
63
65
 
@@ -68,31 +70,34 @@ Phase 0: Discovery (/re-android-discover) → App Map
68
70
  ↓ [User approves]
69
71
  Phase 1: Architecture (/re-android-design) → Architecture Blueprint
70
72
  ↓ [User approves + picks feature]
71
- Phase 2+3 Loop (/re-android-build):
72
- Blueprint Feature X Build Feature X Checkpoint
73
- Blueprint Feature Y Build Feature Y → Checkpoint
74
- ... (repeat for all features)
73
+ Feature Loop (/re-android-build):
74
+ Phase 2: Blueprint + UI (contracts + visual shell + resources)
75
+ 🚦 GATE: User approves UI + contracts
76
+ Phase 3: Logic Build (domain data → DI → VM → wire UI)
77
+ ↓ 📊 CHECKPOINT: Feature done
78
+ → Repeat for next feature
75
79
 
76
- Final: Parity Check & Quality Gate
80
+ Phase 4: Final Parity Check & Quality Gate
77
81
  ```
78
82
 
79
83
  ---
80
84
 
81
85
  ## 🔭 ZOOM CONTROL
82
86
 
83
- AI phải tự check **TRƯỚC MỖI output**:
84
-
85
87
  ```yaml
86
88
  pre_output_check:
87
- - "Đang ở zoom level nào? (0/1/2/3)"
88
- - "Output có đúng zoom level không?"
89
- - "Có function body trong Phase 0/1 không? REMOVE"
90
-
91
- zoom_rules:
92
- zoom_0: "NO CODE. Only diagrams, tables, maps."
93
- zoom_1: "NO CODE BODIES. Only architecture diagrams, file lists."
94
- zoom_2: "SIGNATURES ONLY. Interfaces, data classes, sealed classes."
95
- zoom_3: "FULL CODE. Implementation for ONE feature at a time."
89
+ - "Đang ở phase nào?"
90
+ - "Output có đúng phase rule không?"
91
+ - "Phase 0/1: NO CODE BODIES"
92
+ - "Phase 2: UI code + signatures (no logic bodies)"
93
+ - "Phase 3: Full implementation code"
94
+
95
+ phase_rules:
96
+ phase_0: "NO CODE. Only diagrams, tables, maps."
97
+ phase_1: "NO CODE BODIES. Only architecture diagrams, file lists."
98
+ phase_2_contracts: "SIGNATURES ONLY. Interfaces, data classes, sealed classes."
99
+ phase_2_ui: "FULL UI CODE. Compose with hardcoded mock data + @Preview."
100
+ phase_3: "FULL LOGIC CODE. Domain → Data → DI → VM → Wire UI."
96
101
  ```
97
102
 
98
103
  ---
@@ -101,23 +106,24 @@ zoom_rules:
101
106
 
102
107
  ```yaml
103
108
  never_skip:
104
- - Phase 0 (Discovery) — always first, MUST create App Map
105
- - Phase 1 (Architecture) — MUST design before coding
106
- - User approval at each phase gate
107
- - Per-feature Blueprint before Implementation
109
+ - Phase 0 (Discovery) — always first
110
+ - Phase 1 (Architecture) — design before coding
111
+ - Phase 2 UI Gate user MUST approve UI before Phase 3
112
+ - Per-feature Blueprint before Logic Build
108
113
 
109
114
  never_do:
110
- - Write code in Phase 0 or Phase 1
115
+ - Write logic code before UI is approved
111
116
  - Mass-copy resources from APK (on-demand only)
112
117
  - Implement multiple features simultaneously
113
- - Skip parity check for crypto utils
118
+ - Modify UI significantly in Phase 3 (only wire, don't redesign)
119
+ - Skip crypto parity check
114
120
 
115
121
  always_do:
116
- - Start with App Map (Phase 0)
117
- - Present Architecture for review (Phase 1)
118
- - Create Blueprint before coding each feature (Phase 2)
119
- - Checkpoint after each feature (Phase 3)
120
- - Document all decisions in session state
122
+ - Extract resources BEFORE coding UI (Phase 2.7 → 2.8)
123
+ - Create @Preview for ALL states
124
+ - Keep stateless composable (LoginScreenContent) after wiring
125
+ - Checkpoint after each feature
126
+ - Document all decisions
121
127
  ```
122
128
 
123
129
  ---
@@ -127,11 +133,11 @@ always_do:
127
133
  - **Sub-workflows:**
128
134
  - [`/re-android-discover`](reverse-android-discover.md) — Phase 0: Discovery
129
135
  - [`/re-android-design`](reverse-android-design.md) — Phase 1: Architecture
130
- - [`/re-android-build`](reverse-android-build.md) — Phase 2+3: Blueprint + Build
131
- - **Skill:** `smali-to-kotlin` v2.0 (core knowledge & rules)
136
+ - [`/re-android-build`](reverse-android-build.md) — Phase 2+3+4: Blueprint + UI + Build
137
+ - **Skill:** `smali-to-kotlin` v2.0 (UI-First pipeline)
132
138
  - **Sibling:** `/reverse-ios` (iOS counterpart)
133
139
  - **After RE done:** `/test`, `/deploy`, `/code-janitor`
134
140
 
135
141
  ---
136
142
 
137
- *reverse-android workflow v3.0.0 — Progressive Disclosure RE Pipeline*
143
+ *reverse-android workflow v4.0.0 — UI-First RE Pipeline*