@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.
- package/VERSION +1 -1
- package/core/GEMINI.md.bak +168 -181
- package/package.json +2 -2
- package/schemas/brain-snapshot.json +167 -0
- package/skills/CATALOG.md +70 -0
- package/skills/beads-manager/SKILL.md +20 -1
- package/skills/memory-sync/SKILL.md +20 -2
- package/skills/nm-memory-audit/SKILL.md +157 -0
- package/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skills/nm-memory-intake/SKILL.md +135 -0
- package/skills/nm-memory-sync/SKILL.md +184 -0
- package/skills/orchestrator/SKILL.md +41 -50
- package/skills/schemas/brain-snapshot.json +167 -0
- package/skills/skills/nm-memory-audit/SKILL.md +157 -0
- package/skills/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skills/skills/nm-memory-intake/SKILL.md +135 -0
- package/skills/skills/nm-memory-sync/SKILL.md +184 -0
- package/skills/smali-to-kotlin/phase-0-discovery.md +128 -0
- package/skills/smali-to-kotlin/phase-1-architecture.md +166 -0
- package/skills/smali-to-kotlin/phase-2-blueprint-ui.md +347 -0
- package/skills/smali-to-kotlin/phase-2-blueprint.md +228 -0
- package/skills/smali-to-kotlin/phase-3-build.md +248 -0
- package/skills/smali-to-kotlin/phase-3-logic-build.md +268 -0
- package/skills/smali-to-kotlin/templates/app-map.md +101 -0
- package/skills/smali-to-kotlin/templates/architecture.md +142 -0
- package/skills/smali-to-kotlin/templates/blueprint.md +145 -0
- package/skills/smali-to-swift/phase-0-discovery.md +137 -0
- package/skills/smali-to-swift/phase-1-architecture.md +168 -0
- package/skills/smali-to-swift/phase-2-blueprint-ui.md +348 -0
- package/skills/smali-to-swift/phase-2-blueprint.md +173 -0
- package/skills/smali-to-swift/phase-3-build.md +257 -0
- package/skills/smali-to-swift/phase-3-logic-build.md +312 -0
- package/skills/smali-to-swift/templates/app-map.md +82 -0
- package/skills/smali-to-swift/templates/architecture.md +97 -0
- package/skills/smali-to-swift/templates/blueprint.md +82 -0
- package/skills/workflows/nm-import.md +73 -0
- package/skills/workflows/nm-recall.md +67 -0
- package/skills/workflows/nm-snapshot.md +69 -0
- package/workflows/_uncategorized/nm-import.md +73 -0
- package/workflows/_uncategorized/nm-recall.md +67 -0
- package/workflows/_uncategorized/nm-snapshot.md +69 -0
- package/workflows/_uncategorized/reverse-android-build.md +222 -0
- package/workflows/_uncategorized/reverse-android-design.md +139 -0
- package/workflows/_uncategorized/reverse-android-discover.md +150 -0
- package/workflows/_uncategorized/reverse-android-scan.md +158 -0
- package/workflows/_uncategorized/reverse-android.md +143 -0
- package/workflows/_uncategorized/reverse-ios-build.md +240 -0
- package/workflows/_uncategorized/reverse-ios-design.md +112 -0
- package/workflows/_uncategorized/reverse-ios-discover.md +120 -0
- package/workflows/_uncategorized/reverse-ios-scan.md +155 -0
- package/workflows/_uncategorized/reverse-ios.md +152 -0
- package/workflows/mobile/reverse-android-build.md +119 -79
- package/workflows/mobile/reverse-android-design.md +10 -7
- package/workflows/mobile/reverse-android.md +52 -46
- package/workflows/mobile/reverse-ios-build.md +161 -50
- package/workflows/mobile/reverse-ios-design.md +10 -1
- package/workflows/mobile/reverse-ios.md +49 -37
- package/skills/adaptive-language/SKILL.md +0 -189
- package/skills/ambient-brain/SKILL.md +0 -314
- package/skills/ambient-brain/brain-router.md +0 -185
- package/skills/ambient-brain/brain-templates.md +0 -201
- package/skills/context-help/SKILL.md +0 -180
- package/skills/error-translator/SKILL.md +0 -153
- 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
|