@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
@@ -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*
@@ -0,0 +1,101 @@
1
+ # πŸ—ΊοΈ App Map: [App Name]
2
+
3
+ **Generated:** [Date]
4
+ **Source:** [Apktool dir path]
5
+
6
+ ---
7
+
8
+ ## πŸ“± Identity
9
+
10
+ | Property | Value |
11
+ |----------|-------|
12
+ | Package | [com.example.app] |
13
+ | App Name | [Display Name] |
14
+ | Min SDK | [value] |
15
+ | Target SDK | [value] |
16
+ | Screens | [count] Activities |
17
+ | Services | [count] |
18
+ | Receivers | [count] |
19
+ | Providers | [count] |
20
+
21
+ ---
22
+
23
+ ## 🧭 Screen Flow
24
+
25
+ ```
26
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
27
+ β”‚ Splash │───→│ Login │───→│ Main Tab β”‚
28
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
29
+ β”‚ Tab 1: Home β”‚
30
+ β”‚ Tab 2: ... β”‚
31
+ β”‚ Tab 3: ... β”‚
32
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
33
+ β”‚
34
+ β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”
35
+ β”‚ Detail β”‚
36
+ β”‚ ... β”‚
37
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
38
+ ```
39
+
40
+ *Or use Mermaid:*
41
+ ```mermaid
42
+ graph LR
43
+ Splash --> Login
44
+ Login --> MainTab
45
+ MainTab --> Home
46
+ MainTab --> Tab2
47
+ MainTab --> Tab3
48
+ Home --> Detail
49
+ ```
50
+
51
+ ---
52
+
53
+ ## πŸ“¦ Library Landscape
54
+
55
+ ### βœ… Reuse (add to build.gradle)
56
+ | Library | Detected Package | Latest Version | Action |
57
+ |---------|-----------------|----------------|--------|
58
+
59
+ ### πŸ”„ Replace (legacy β†’ modern)
60
+ | Old Library | Detected Package | Modern Replacement |
61
+ |-------------|-----------------|-------------------|
62
+
63
+ ### πŸ”΅ Firebase / Google SDKs
64
+ | SDK | Detected | Action |
65
+ |-----|----------|--------|
66
+
67
+ ### πŸ“± Native (.so) β€” Keep
68
+ | File | Architecture | Notes |
69
+ |------|-------------|-------|
70
+
71
+ ### 🏷️ App Code (rebuild in Kotlin)
72
+ | Package | Estimated Module |
73
+ |---------|-----------------|
74
+
75
+ ### ❓ Unknown (needs investigation)
76
+ | Package | Path | Possible Library |
77
+ |---------|------|-----------------|
78
+
79
+ ---
80
+
81
+ ## πŸ“Š Complexity Estimate
82
+
83
+ | Area | Rating | Notes |
84
+ |------|--------|-------|
85
+ | Data Layer | ●●●○○ | [N] APIs, [N] local DB, [N] DataStores |
86
+ | Core Logic | ●●○○○ | [N] crypto utils, [N] formatters |
87
+ | UI Screens | ●●●●○ | [N] screens, [N] complex layouts |
88
+ | SDK Integration | ●●○○○ | [N] third-party, [N] native libs |
89
+
90
+ ---
91
+
92
+ ## πŸ” Key Observations
93
+
94
+ - [Notable patterns: obfuscation level, unusual architecture, etc.]
95
+ - [Security observations: certificate pinning, root detection, etc.]
96
+ - [Risks: native libs without source, proprietary SDKs, etc.]
97
+
98
+ ---
99
+
100
+ > **Next:** Anh review map nΓ y, cΓ³ gΓ¬ cαΊ§n Δ‘iều chỉnh khΓ΄ng?
101
+ > β†’ OK β†’ Proceed to Phase 1 (Architecture Design)
@@ -0,0 +1,142 @@
1
+ # πŸ—οΈ Architecture Blueprint: [App Name]
2
+
3
+ **Generated:** [Date]
4
+ **Based on:** App Map v[date]
5
+
6
+ ---
7
+
8
+ ## πŸ“ Layer Map
9
+
10
+ ```
11
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
12
+ β”‚ Presentation β”‚
13
+ β”‚ β”œβ”€β”€ screens/ ([N] screens) β”‚
14
+ β”‚ β”œβ”€β”€ navigation/ (NavGraph + Routes) β”‚
15
+ β”‚ β”œβ”€β”€ theme/ (Material 3 Theme) β”‚
16
+ β”‚ └── components/ (Shared UI) β”‚
17
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
18
+ β”‚ Domain β”‚
19
+ β”‚ β”œβ”€β”€ model/ ([N] business models) β”‚
20
+ β”‚ β”œβ”€β”€ repository/ ([N] interfaces) β”‚
21
+ β”‚ └── usecase/ ([N] use cases) β”‚
22
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
23
+ β”‚ Data β”‚
24
+ β”‚ β”œβ”€β”€ remote/ ([N] API services) β”‚
25
+ β”‚ β”œβ”€β”€ local/ (Room DB, DataStore) β”‚
26
+ β”‚ └── repository/ ([N] impls) β”‚
27
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
28
+ β”‚ DI (Hilt) β”‚
29
+ β”‚ └── modules/ (Network, DB, Repo) β”‚
30
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
31
+ ```
32
+
33
+ ---
34
+
35
+ ## πŸ—‚οΈ Feature β†’ File Mapping
36
+
37
+ | Feature | Domain Model | Repository | UseCase | Screen(s) | ViewModel |
38
+ |---------|-------------|-----------|---------|-----------|-----------|
39
+ | Auth | User, Token | AuthRepo | LoginUC, RegisterUC | Login, Register | AuthVM |
40
+ | Home | [Model] | [Repo] | [UC] | Home | HomeVM |
41
+ | Profile | [Model] | [Repo] | [UC] | Profile, Edit | ProfileVM |
42
+ | Settings | [Model] | [Repo] | [UC] | Settings | SettingsVM |
43
+ | ... | ... | ... | ... | ... | ... |
44
+
45
+ ---
46
+
47
+ ## 🌐 API Endpoints
48
+
49
+ | # | Method | Endpoint | Auth | Notes |
50
+ |---|--------|----------|------|-------|
51
+ | 1 | POST | /auth/login | No | JWT response |
52
+ | 2 | GET | /users/me | Bearer | User profile |
53
+ | ... | ... | ... | ... | ... |
54
+
55
+ **Base URL:** `[extracted from Smali]`
56
+ **Auth Type:** [Bearer token / API key / Custom]
57
+
58
+ ---
59
+
60
+ ## πŸ’Ύ Data Schema
61
+
62
+ | Model | Key Fields | Source | Storage |
63
+ |-------|-----------|--------|---------|
64
+ | User | id, name, email, avatar | API + Local | Room |
65
+ | Settings | theme, lang, notif | Local only | DataStore |
66
+ | ... | ... | ... | ... |
67
+
68
+ ---
69
+
70
+ ## πŸ“ Project Structure
71
+
72
+ ```
73
+ app/src/main/java/[package]/
74
+ β”œβ”€β”€ App.kt
75
+ β”œβ”€β”€ di/
76
+ β”‚ β”œβ”€β”€ AppModule.kt
77
+ β”‚ β”œβ”€β”€ NetworkModule.kt
78
+ β”‚ └── DatabaseModule.kt
79
+ β”œβ”€β”€ data/
80
+ β”‚ β”œβ”€β”€ remote/
81
+ β”‚ β”‚ β”œβ”€β”€ api/
82
+ β”‚ β”‚ β”œβ”€β”€ dto/
83
+ β”‚ β”‚ └── interceptor/
84
+ β”‚ β”œβ”€β”€ local/
85
+ β”‚ β”‚ β”œβ”€β”€ db/
86
+ β”‚ β”‚ β”œβ”€β”€ dao/
87
+ β”‚ β”‚ β”œβ”€β”€ entity/
88
+ β”‚ β”‚ └── datastore/
89
+ β”‚ └── repository/
90
+ β”œβ”€β”€ domain/
91
+ β”‚ β”œβ”€β”€ model/
92
+ β”‚ β”œβ”€β”€ repository/
93
+ β”‚ └── usecase/
94
+ β”œβ”€β”€ presentation/
95
+ β”‚ β”œβ”€β”€ navigation/
96
+ β”‚ β”œβ”€β”€ theme/
97
+ β”‚ β”œβ”€β”€ components/
98
+ β”‚ └── screens/
99
+ β”‚ β”œβ”€β”€ splash/
100
+ β”‚ β”œβ”€β”€ auth/
101
+ β”‚ β”œβ”€β”€ home/
102
+ β”‚ └── .../
103
+ └── util/
104
+ ```
105
+
106
+ ---
107
+
108
+ ## πŸ”’ Build Order
109
+
110
+ | # | Phase | Scope | Complexity |
111
+ |---|-------|-------|-----------|
112
+ | 1 | 🟒 Setup | Project + DI skeleton + Theme | Low |
113
+ | 2 | 🟒 Models | Domain data classes | Low |
114
+ | 3 | 🟑 Data | API + Room + DataStore | Medium |
115
+ | 4 | 🟑 Utils | Crypto, formatters (parity test!) | Medium |
116
+ | 5 | πŸ”΄ Feature: [First] | Blueprint β†’ Build | High |
117
+ | 6 | πŸ”΄ Feature: [Second] | Blueprint β†’ Build | High |
118
+ | ... | ... | ... | ... |
119
+ | N | πŸ”΄ Final | Parity check + QA | High |
120
+
121
+ **Suggested first feature:** [Name] β€” because [reason]
122
+
123
+ ---
124
+
125
+ ## πŸ”§ Tech Stack Decisions
126
+
127
+ | Decision | Choice | Rationale |
128
+ |----------|--------|-----------|
129
+ | UI Framework | Jetpack Compose + Material 3 | Modern, declarative |
130
+ | DI | Hilt | Standard Android DI |
131
+ | Network | Retrofit + OkHttp | [Keep/Replace based on scan] |
132
+ | JSON | Kotlin Serialization | Type-safe, KMP ready |
133
+ | Image Loading | [Coil / Keep Glide] | [reason] |
134
+ | Local DB | Room | [reason] |
135
+ | Preferences | DataStore | Replaces SharedPreferences |
136
+ | Async | Coroutines + Flow | Modern concurrency |
137
+
138
+ ---
139
+
140
+ > **Next:** Anh muα»‘n bαΊ―t Δ‘αΊ§u tα»« feature nΓ o?
141
+ > Em suggest: **[Feature]** vì [reason].
142
+ > β†’ Pick feature β†’ Phase 2 (Blueprint)
@@ -0,0 +1,145 @@
1
+ # πŸ“ Feature Blueprint: [Feature Name]
2
+
3
+ **Generated:** [Date]
4
+ **Architecture:** [App Name] v[date]
5
+ **Feature:** [Feature Name]
6
+
7
+ ---
8
+
9
+ ## πŸ” Smali Analysis Summary
10
+
11
+ | Item | Value |
12
+ |------|-------|
13
+ | Files analyzed | [list of Smali files] |
14
+ | Classes found | [count] |
15
+ | API calls detected | [count] |
16
+ | Local storage | [types: SharedPrefs, SQLite, etc.] |
17
+
18
+ ### Key Observations
19
+ - [Pattern 1: e.g., "Uses MD5 + Base64 for password hashing"]
20
+ - [Pattern 2: e.g., "Token stored in SharedPreferences key 'auth_token'"]
21
+ - [Pattern 3: e.g., "Custom header 'X-App-Key' in all requests"]
22
+
23
+ ---
24
+
25
+ ## πŸ“¦ Domain Models
26
+
27
+ ```kotlin
28
+ data class [Model](
29
+ val field1: Type,
30
+ val field2: Type,
31
+ // ...
32
+ )
33
+ ```
34
+
35
+ ---
36
+
37
+ ## πŸ“‘ API Contract
38
+
39
+ ```kotlin
40
+ interface [Feature]Api {
41
+ @[METHOD]("[endpoint]")
42
+ suspend fun [method](@Body request: [Request]): [Response]
43
+ }
44
+ ```
45
+
46
+ **Request/Response DTOs:**
47
+ ```kotlin
48
+ @Serializable
49
+ data class [Request](/* fields */)
50
+
51
+ @Serializable
52
+ data class [Response](/* fields */)
53
+ ```
54
+
55
+ ---
56
+
57
+ ## πŸ—„οΈ Repository Contract
58
+
59
+ ```kotlin
60
+ interface [Feature]Repository {
61
+ suspend fun [method1](...): Result<[Type]>
62
+ fun [method2](): Flow<[Type]>
63
+ }
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 🧩 UseCase Signatures
69
+
70
+ ```kotlin
71
+ class [Action]UseCase(private val repo: [Feature]Repository) {
72
+ suspend operator fun invoke(...): Result<[Type]>
73
+ }
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 🎨 UI State Design
79
+
80
+ ```kotlin
81
+ // State
82
+ data class [Screen]UiState(
83
+ val field1: Type = default,
84
+ val isLoading: Boolean = false,
85
+ val error: String? = null
86
+ )
87
+
88
+ // One-time events
89
+ sealed interface [Screen]Event {
90
+ data class NavigateTo[Next](/* params */) : [Screen]Event
91
+ data class ShowSnackbar(val message: String) : [Screen]Event
92
+ }
93
+
94
+ // User actions
95
+ sealed interface [Screen]Action {
96
+ data class Update[Field](val value: Type) : [Screen]Action
97
+ data object Submit : [Screen]Action
98
+ }
99
+ ```
100
+
101
+ ---
102
+
103
+ ## πŸ–ΌοΈ Screen Wireframe
104
+
105
+ ```
106
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
107
+ β”‚ β”‚
108
+ β”‚ [Layout sketch] β”‚
109
+ β”‚ β”‚
110
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
111
+
112
+ Behaviors:
113
+ - [Interaction 1]
114
+ - [Interaction 2]
115
+ - [Error handling]
116
+ - [Navigation on success]
117
+ ```
118
+
119
+ ---
120
+
121
+ ## πŸ“ Files to Create
122
+
123
+ | File | Layer | Type |
124
+ |------|-------|------|
125
+ | [Model].kt | domain/model | Data class |
126
+ | [Feature]Repository.kt | domain/repository | Interface |
127
+ | [Action]UseCase.kt | domain/usecase | Class |
128
+ | [Feature]Api.kt | data/remote/api | Retrofit interface |
129
+ | [DTOs].kt | data/remote/dto | Serializable |
130
+ | [Feature]RepositoryImpl.kt | data/repository | Implementation |
131
+ | [Screen]Screen.kt | presentation/screens | Composable |
132
+ | [Screen]ViewModel.kt | presentation/screens | ViewModel |
133
+
134
+ ---
135
+
136
+ ## πŸ”— Dependencies
137
+
138
+ - **Depends on:** [other features/modules this needs]
139
+ - **Depended by:** [features that need this]
140
+
141
+ ---
142
+
143
+ > **Next:** Anh xem contracts α»•n khΓ΄ng?
144
+ > β†’ OK β†’ Phase 3 (Implementation)
145
+ > β†’ Adjust β†’ Update blueprint