@leejungkiin/awkit 1.0.7 β 1.0.9
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/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/SKILL.md +331 -85
- package/skills/smali-to-kotlin/phase-0-discovery.md +93 -94
- package/skills/smali-to-kotlin/phase-1-architecture.md +67 -58
- 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/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/SKILL.md +532 -91
- package/skills/smali-to-swift/phase-0-discovery.md +101 -118
- package/skills/smali-to-swift/phase-1-architecture.md +62 -67
- 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/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/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
|
@@ -1,129 +1,128 @@
|
|
|
1
|
-
#
|
|
1
|
+
# πΊοΈ Phase 0: Discovery (Satellite View)
|
|
2
2
|
|
|
3
|
-
> **Zoom Level:** 0 β
|
|
4
|
-
> **Goal:**
|
|
5
|
-
> **Output:**
|
|
3
|
+
> **Zoom Level:** 0 β Bird's Eye
|
|
4
|
+
> **Goal:** Create an "App Map" β understand WHAT the app is and WHAT it contains.
|
|
5
|
+
> **Output:** Diagrams, tables, maps. **NO CODE.**
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## β OUTPUT RULE
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
β
ALLOWED:
|
|
13
|
-
|
|
14
|
-
β BLOCKED: Any Kotlin code
|
|
15
|
-
β BLOCKED: Any implementation decisions (those come in Phase 1)
|
|
12
|
+
β
ALLOWED: ASCII diagrams, Mermaid, tables, bullet lists, bash scan commands
|
|
13
|
+
β BLOCKED: Kotlin/Java code, function signatures, class definitions
|
|
16
14
|
```
|
|
17
15
|
|
|
18
16
|
---
|
|
19
17
|
|
|
20
18
|
## π Sub-steps
|
|
21
19
|
|
|
22
|
-
### 0.1:
|
|
20
|
+
### 0.1: Confirm Input
|
|
23
21
|
|
|
24
|
-
Verify Apktool output structure:
|
|
25
22
|
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
π§ Android Reverse Engineering bαΊ―t ΔαΊ§u!
|
|
24
|
+
|
|
25
|
+
Em cαΊ§n biαΊΏt:
|
|
26
|
+
1. ThΖ° mα»₯c Apktool output α» ΔΓ’u?
|
|
27
|
+
2. TΓͺn app gα»c? Package name?
|
|
28
|
+
|
|
29
|
+
ChΖ°a chαΊ‘y Apktool? β apktool d your-app.apk -o ./decompiled/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 0.2: Structure Scan
|
|
33
|
+
|
|
34
|
+
QuΓ©t folder structure Δα» hiα»u quy mΓ΄ app:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Top-level packages (app code vs libraries)
|
|
38
|
+
find [apktool_dir]/smali -maxdepth 3 -type d | sed 's|.*/smali/||' | sort
|
|
39
|
+
|
|
40
|
+
# Multi-dex check
|
|
41
|
+
find [apktool_dir] -name "smali*" -maxdepth 1 -type d
|
|
42
|
+
|
|
43
|
+
# Resource overview
|
|
44
|
+
ls [apktool_dir]/res/layout/ | wc -l # Number of layouts
|
|
45
|
+
ls [apktool_dir]/res/drawable*/ | wc -l # Number of drawables
|
|
46
|
+
cat [apktool_dir]/res/values/strings.xml | grep '<string' | wc -l # Strings count
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 0.3: Library Detection
|
|
50
|
+
|
|
51
|
+
QuΓ©t smali directories Δα» nhαΊn diα»n thΖ° viα»n. Ref: `library-patterns.md`
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Known library packages
|
|
55
|
+
find [apktool_dir]/smali -maxdepth 3 -type d | grep -E "(google|facebook|squareup|airbnb|bumptech|jakewharton|reactivex|greenrobot)" | sort
|
|
56
|
+
|
|
57
|
+
# Native libraries
|
|
58
|
+
find [apktool_dir]/lib -name "*.so" 2>/dev/null
|
|
59
|
+
|
|
60
|
+
# Assets (ML models, WebView, configs)
|
|
61
|
+
ls [apktool_dir]/assets/ 2>/dev/null
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**PhΓ’n loαΊ‘i thΓ nh 5 nhΓ³m:**
|
|
65
|
+
|
|
66
|
+
| Category | Meaning | Action |
|
|
67
|
+
|----------|---------|--------|
|
|
68
|
+
| β
Reuse | Modern, still maintained | Add to build.gradle |
|
|
69
|
+
| π Replace | Legacy/deprecated | Map to modern replacement |
|
|
70
|
+
| π΅ Firebase/Google | Platform SDKs | Use latest version |
|
|
71
|
+
| π± Native (.so) | JNI libraries | Keep, create bridge |
|
|
72
|
+
| π·οΈ App Code | Original app logic | Rebuild in Kotlin |
|
|
73
|
+
|
|
74
|
+
### 0.4: Manifest Analysis
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cat [apktool_dir]/AndroidManifest.xml
|
|
33
78
|
```
|
|
34
79
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
smali/com/jakewharton/ β Butterknife, Timber
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
2. **Check `lib/` for native libraries (.so)**:
|
|
53
|
-
```
|
|
54
|
-
lib/arm64-v8a/*.so β 64-bit native libs
|
|
55
|
-
lib/armeabi-v7a/*.so β 32-bit native libs
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
3. **Check `assets/` for embedded resources:**
|
|
59
|
-
- ML models (.tflite, .onnx)
|
|
60
|
-
- WebView HTML/JS bundles
|
|
61
|
-
- Config files (JSON, XML)
|
|
62
|
-
|
|
63
|
-
4. **Output: Library Detection Report** β see `library-patterns.md` for comprehensive patterns.
|
|
64
|
-
|
|
65
|
-
### 0.3: AndroidManifest Analysis
|
|
66
|
-
|
|
67
|
-
Extract from `AndroidManifest.xml`:
|
|
68
|
-
|
|
69
|
-
1. Application ID (`package` attribute)
|
|
70
|
-
2. Min/Target SDK versions
|
|
71
|
-
3. Permissions (group by category: network, storage, camera, etc.)
|
|
72
|
-
4. Entry points:
|
|
73
|
-
- `Application` class (custom init?)
|
|
74
|
-
- Launcher Activity (SplashActivity? MainActivity?)
|
|
75
|
-
5. All components:
|
|
76
|
-
- Activities β future Compose screens
|
|
77
|
-
- Services β WorkManager candidates?
|
|
78
|
-
- BroadcastReceivers β keep or replace with Flow?
|
|
79
|
-
- ContentProviders β keep or replace with Room?
|
|
80
|
-
6. Intent-filters and deep links
|
|
81
|
-
|
|
82
|
-
### 0.4: Screen Flow Map
|
|
83
|
-
|
|
84
|
-
Map navigation based on Activities:
|
|
85
|
-
|
|
86
|
-
```mermaid
|
|
87
|
-
graph LR
|
|
88
|
-
Splash --> Login
|
|
89
|
-
Login --> MainTab
|
|
90
|
-
MainTab --> Home
|
|
91
|
-
MainTab --> Search
|
|
92
|
-
MainTab --> Profile
|
|
93
|
-
Home --> Detail
|
|
94
|
-
Profile --> Settings
|
|
80
|
+
Extract:
|
|
81
|
+
- Application ID + Package name
|
|
82
|
+
- Min/Target SDK
|
|
83
|
+
- Permissions (grouped by category)
|
|
84
|
+
- Entry points: Application class, Launcher Activity
|
|
85
|
+
- All components: Activities, Services, Receivers, Providers
|
|
86
|
+
- Deep links / Intent filters
|
|
87
|
+
|
|
88
|
+
### 0.5: Screen Map
|
|
89
|
+
|
|
90
|
+
Map Activities β future Compose screens. Draw navigation flow:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Activities found β Group by feature β Draw screen graph
|
|
95
94
|
```
|
|
96
95
|
|
|
97
|
-
### 0.
|
|
96
|
+
### 0.6: Complexity Estimate
|
|
98
97
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| SDK Integration | βββββ | [N] third-party, [N] native libs |
|
|
98
|
+
Rate each area 1-5 dots:
|
|
99
|
+
- Data Layer: βββββ (APIs, DB, preferences)
|
|
100
|
+
- Core Logic: βββββ (crypto, formatters, utils)
|
|
101
|
+
- UI Screens: βββββ (screen count, complex layouts)
|
|
102
|
+
- SDK Integration: βββββ (third-party, native libs)
|
|
105
103
|
|
|
106
104
|
---
|
|
107
105
|
|
|
108
106
|
## π Output: App Map
|
|
109
107
|
|
|
110
|
-
Use template from `templates/app-map.md`.
|
|
108
|
+
Use template from `templates/app-map.md`. Must include:
|
|
109
|
+
|
|
110
|
+
1. **Identity** β package, SDK levels, screen count
|
|
111
|
+
2. **Screen Flow** β navigation graph (ASCII or Mermaid)
|
|
112
|
+
3. **Library Landscape** β categorized dependency list
|
|
113
|
+
4. **Complexity Estimate** β visual dots rating
|
|
114
|
+
5. **Key Observations** β anything notable (obfuscation, unusual patterns)
|
|
111
115
|
|
|
112
116
|
---
|
|
113
117
|
|
|
114
118
|
## β
Gate
|
|
115
119
|
|
|
116
120
|
```
|
|
117
|
-
"πΊοΈ App Map
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
- [N] native libs
|
|
121
|
-
- Complexity: [Low/Medium/High]
|
|
122
|
-
|
|
123
|
-
CΓ³ gΓ¬ cαΊ§n Δiα»u chα»nh khΓ΄ng?
|
|
124
|
-
β OK β Phase 1 (Architecture Design)"
|
|
121
|
+
"πΊοΈ ΔΓ’y lΓ App Map. Anh review xem cΓ³ gΓ¬ cαΊ§n diα»u chα»nh khΓ΄ng?"
|
|
122
|
+
β User approves β Proceed to Phase 1 (Architecture)
|
|
123
|
+
β User has questions β Investigate and update map
|
|
125
124
|
```
|
|
126
125
|
|
|
127
126
|
---
|
|
128
127
|
|
|
129
|
-
*Phase 0: Discovery β
|
|
128
|
+
*Phase 0: Discovery β No code, just understanding*
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# ποΈ Phase 1: Architecture (District View)
|
|
1
|
+
# ποΈ Phase 1: Architecture (District View)
|
|
2
2
|
|
|
3
3
|
> **Zoom Level:** 1 β Architecture Design
|
|
4
|
-
> **Goal:** Design overall architecture
|
|
4
|
+
> **Goal:** Design the overall architecture BEFORE writing any code.
|
|
5
5
|
> **Input:** Completed App Map from Phase 0.
|
|
6
|
-
> **Output:** Architecture Blueprint
|
|
6
|
+
> **Output:** Architecture Blueprint (layer maps, feature tables, API list). **NO CODE BODIES.**
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## β OUTPUT RULE
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
β
ALLOWED: Architecture diagrams, layer maps, feature-to-file mapping, API endpoint tables
|
|
13
|
+
β
ALLOWED: Architecture diagrams, layer maps, feature-to-file mapping tables, API endpoint tables
|
|
14
14
|
β
ALLOWED: File paths, package names, dependency lists
|
|
15
|
-
β οΈ ALLOWED: build.gradle.kts skeleton (plugins + dependencies only)
|
|
16
15
|
β BLOCKED: Function bodies, implementation details, actual Kotlin code
|
|
16
|
+
β οΈ EXCEPTION: build.gradle.kts skeleton (plugin + dependency declarations only)
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -22,113 +22,116 @@
|
|
|
22
22
|
|
|
23
23
|
### 1.1: Layer Design
|
|
24
24
|
|
|
25
|
+
Design Clean Architecture layers based on App Map:
|
|
26
|
+
|
|
25
27
|
```
|
|
26
28
|
βββββββββββββββββββββββββββββββββββββββ
|
|
27
29
|
β Presentation β
|
|
28
30
|
β βββ screens/ ([N] screens) β
|
|
29
31
|
β βββ navigation/ (NavGraph) β
|
|
30
|
-
β
|
|
31
|
-
β βββ components/ (Shared composables)β
|
|
32
|
+
β βββ theme/ (Material3) β
|
|
32
33
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
33
34
|
β Domain β
|
|
34
35
|
β βββ model/ ([N] business models) β
|
|
35
|
-
β βββ repository/ ([N] interfaces)
|
|
36
|
+
β βββ repository/ ([N] interfaces) β
|
|
36
37
|
β βββ usecase/ ([N] use cases) β
|
|
37
38
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
38
39
|
β Data β
|
|
39
|
-
β βββ remote/ ([N] API services)
|
|
40
|
-
β βββ local/ (Room, DataStore)
|
|
41
|
-
β βββ repository/ (implementations)
|
|
40
|
+
β βββ remote/ ([N] API services) β
|
|
41
|
+
β βββ local/ (Room, DataStore) β
|
|
42
|
+
β βββ repository/ (implementations) β
|
|
42
43
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
43
|
-
β DI
|
|
44
|
-
β βββ modules,
|
|
44
|
+
β DI β
|
|
45
|
+
β βββ modules/ (Network, DB, Repo) β
|
|
45
46
|
βββββββββββββββββββββββββββββββββββββββ
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
### 1.2: Feature β File Mapping
|
|
49
50
|
|
|
51
|
+
Map each feature to its Clean Architecture components:
|
|
52
|
+
|
|
50
53
|
| Feature | Domain Model | Repository | UseCase | Screen | ViewModel |
|
|
51
54
|
|---------|-------------|-----------|---------|--------|-----------|
|
|
52
55
|
| Auth | User, Token | AuthRepo | LoginUC | Login | AuthVM |
|
|
53
|
-
| Home |
|
|
56
|
+
| Home | Data | HomeRepo | GetDataUC | Home | HomeVM |
|
|
54
57
|
| ... | ... | ... | ... | ... | ... |
|
|
55
58
|
|
|
56
59
|
### 1.3: API Endpoint Inventory
|
|
57
60
|
|
|
61
|
+
Extract ALL API endpoints from Smali analysis:
|
|
62
|
+
|
|
58
63
|
| # | Method | Endpoint | Auth | Request | Response | Notes |
|
|
59
64
|
|---|--------|----------|------|---------|----------|-------|
|
|
60
|
-
| 1 | POST | /auth/login | No | email, pwd | JWT | - |
|
|
61
|
-
| 2 | GET | /users/me | Bearer | - | User | - |
|
|
65
|
+
| 1 | POST | /auth/login | No | email, pwd | JWT token | - |
|
|
66
|
+
| 2 | GET | /users/me | Bearer | - | User object | - |
|
|
62
67
|
|
|
63
68
|
**How to find in Smali:**
|
|
64
69
|
```
|
|
65
|
-
const-string β "https://" or "http://"
|
|
66
|
-
.field β BASE_URL, API_URL
|
|
67
|
-
StringBuilder + append (endpoint construction)
|
|
68
|
-
|
|
70
|
+
Look for: const-string β "https://" or "http://"
|
|
71
|
+
Look for: .field β BASE_URL, API_URL
|
|
72
|
+
Look for: StringBuilder + append patterns (endpoint construction)
|
|
73
|
+
Look for: annotation patterns (@GET, @POST in okhttp/retrofit)
|
|
69
74
|
```
|
|
70
75
|
|
|
71
76
|
### 1.4: Data Schema Inventory
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
List ALL data structures found:
|
|
79
|
+
|
|
80
|
+
| Model | Fields (key ones) | Source | Storage |
|
|
81
|
+
|-------|-------------------|--------|---------|
|
|
75
82
|
| User | id, name, email, avatar | API | Room + Memory |
|
|
76
|
-
| Settings | theme, language | Local | DataStore |
|
|
83
|
+
| Settings | theme, language, notifications | Local | DataStore |
|
|
77
84
|
|
|
78
85
|
### 1.5: Project Structure
|
|
79
86
|
|
|
87
|
+
Propose directory structure based on features:
|
|
88
|
+
|
|
80
89
|
```
|
|
81
90
|
app/src/main/java/com/package/
|
|
82
91
|
βββ App.kt
|
|
83
92
|
βββ di/ (AppModule, NetworkModule, DatabaseModule)
|
|
84
93
|
βββ data/
|
|
85
|
-
β βββ remote/api/
|
|
86
|
-
β βββ remote/dto/
|
|
87
|
-
β βββ local/db/
|
|
88
|
-
β βββ local/datastore/
|
|
89
|
-
β βββ repository/
|
|
94
|
+
β βββ remote/api/ ([N] Retrofit interfaces)
|
|
95
|
+
β βββ remote/dto/ (DTOs)
|
|
96
|
+
β βββ local/db/ (Room)
|
|
97
|
+
β βββ local/datastore/ (DataStore)
|
|
98
|
+
β βββ repository/ (Implementations)
|
|
90
99
|
βββ domain/
|
|
91
|
-
β βββ model/
|
|
92
|
-
β βββ repository/
|
|
93
|
-
β βββ usecase/
|
|
100
|
+
β βββ model/ (Business models)
|
|
101
|
+
β βββ repository/ (Interfaces)
|
|
102
|
+
β βββ usecase/ (Use cases)
|
|
94
103
|
βββ presentation/
|
|
95
|
-
β βββ navigation/
|
|
96
|
-
β βββ theme/
|
|
97
|
-
β βββ components/
|
|
104
|
+
β βββ navigation/ (NavGraph, Routes)
|
|
105
|
+
β βββ theme/ (Colors, Typography, Theme)
|
|
106
|
+
β βββ components/ (Shared composables)
|
|
98
107
|
β βββ screens/
|
|
99
108
|
β βββ splash/
|
|
100
109
|
β βββ auth/
|
|
101
110
|
β βββ home/
|
|
102
111
|
β βββ [feature]/
|
|
103
|
-
βββ util/
|
|
112
|
+
βββ util/ (Extensions, helpers)
|
|
104
113
|
```
|
|
105
114
|
|
|
106
|
-
### 1.6: Build Order
|
|
115
|
+
### 1.6: Build Order Suggestion
|
|
107
116
|
|
|
108
|
-
|
|
117
|
+
Recommend order based on dependency graph:
|
|
109
118
|
|
|
110
119
|
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
4. π¨ UI Shell: Visual implementation + Resource extraction
|
|
118
|
-
5. π¦ GATE: User approve UI
|
|
119
|
-
6. π¨ Logic: Domain β Data β ViewModel β Wire UI
|
|
120
|
-
7. π§ͺ Test: Integration + Parity
|
|
121
|
-
|
|
122
|
-
Final (one-time):
|
|
123
|
-
8. π¦ SDK Integration + Native libs
|
|
124
|
-
9. β
Full Parity Check
|
|
120
|
+
1. π’ Project setup + DI skeleton + Theme
|
|
121
|
+
2. π’ Domain models (data classes β no logic)
|
|
122
|
+
3. π‘ Data layer (API interfaces + Room entities)
|
|
123
|
+
4. π‘ Core utils (crypto, formatters β need parity testing)
|
|
124
|
+
5. π΄ UI screens (per-feature, starting from auth)
|
|
125
|
+
6. π΄ SDK integration + Parity check
|
|
125
126
|
```
|
|
126
127
|
|
|
127
128
|
### 1.7: Tech Stack Decisions
|
|
128
129
|
|
|
130
|
+
Confirm decisions from Phase 0 Library Report:
|
|
131
|
+
|
|
129
132
|
| Decision | Choice | Rationale |
|
|
130
133
|
|----------|--------|-----------|
|
|
131
|
-
| Image Loading | Coil | Modern, Compose-native |
|
|
134
|
+
| Image Loading | Coil (replace Glide) | Modern, Compose-native |
|
|
132
135
|
| JSON | Kotlin Serialization | Type-safe, no reflection |
|
|
133
136
|
| ... | ... | ... |
|
|
134
137
|
|
|
@@ -136,22 +139,28 @@ Final (one-time):
|
|
|
136
139
|
|
|
137
140
|
## π Output: Architecture Blueprint
|
|
138
141
|
|
|
139
|
-
Use template from `templates/architecture.md`.
|
|
142
|
+
Use template from `templates/architecture.md`. Must include:
|
|
143
|
+
|
|
144
|
+
1. **Layer Map** β ASCII architecture diagram with counts
|
|
145
|
+
2. **Feature Table** β feature β file mapping
|
|
146
|
+
3. **API Inventory** β all endpoints found
|
|
147
|
+
4. **Data Schema** β all models with key fields
|
|
148
|
+
5. **Project Structure** β proposed directory tree
|
|
149
|
+
6. **Build Order** β suggested implementation sequence
|
|
150
|
+
7. **Tech Decisions** β confirmed choices
|
|
140
151
|
|
|
141
152
|
---
|
|
142
153
|
|
|
143
154
|
## β
Gate
|
|
144
155
|
|
|
145
156
|
```
|
|
146
|
-
"ποΈ Architecture Blueprint xong.
|
|
147
|
-
Build order: UI-First per feature.
|
|
148
|
-
Anh muα»n bαΊ―t ΔαΊ§u tα»« feature nΓ o?
|
|
157
|
+
"ποΈ Architecture Blueprint xong. Anh muα»n bαΊ―t ΔαΊ§u tα»« feature nΓ o?
|
|
149
158
|
Em suggest: [Feature X] vΓ¬ [reason β e.g., nhiα»u feature khΓ‘c phα»₯ thuα»c]."
|
|
150
159
|
|
|
151
|
-
β User picks feature β Phase 2 (Blueprint
|
|
160
|
+
β User picks feature β Proceed to Phase 2 (Blueprint) for that feature
|
|
152
161
|
β User wants changes β Adjust architecture
|
|
153
162
|
```
|
|
154
163
|
|
|
155
164
|
---
|
|
156
165
|
|
|
157
|
-
*Phase 1: Architecture β Design before you build
|
|
166
|
+
*Phase 1: Architecture β Design before you build*
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# π Phase 2: Blueprint (Block View β per feature)
|
|
2
|
+
|
|
3
|
+
> **Zoom Level:** 2 β Feature Detail
|
|
4
|
+
> **Goal:** Design contracts, interfaces, and state for ONE specific feature.
|
|
5
|
+
> **Input:** Architecture Blueprint (Phase 1) + user's chosen feature.
|
|
6
|
+
> **Output:** Feature Blueprint with code signatures. **NO implementation bodies yet.**
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## β OUTPUT RULE
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
β
ALLOWED: Interface/protocol signatures, data class definitions, sealed classes
|
|
14
|
+
β
ALLOWED: Retrofit interface with @GET/@POST annotations (no body)
|
|
15
|
+
β
ALLOWED: UiState sealed class, Event sealed class
|
|
16
|
+
β BLOCKED: Function body implementations (use TODO() or // ... )
|
|
17
|
+
β BLOCKED: Full ViewModel logic, full Composable implementations
|
|
18
|
+
β οΈ EXCEPTION: Simple data class fields are OK (they ARE the contract)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## π Sub-steps (per feature)
|
|
24
|
+
|
|
25
|
+
### 2.1: Deep Smali Reading
|
|
26
|
+
|
|
27
|
+
Read the Smali/Java files specifically for the chosen feature.
|
|
28
|
+
|
|
29
|
+
**What to extract:**
|
|
30
|
+
- Class hierarchy (extends, implements)
|
|
31
|
+
- Field declarations β model properties
|
|
32
|
+
- Method signatures β API contracts
|
|
33
|
+
- String constants β URLs, keys, messages
|
|
34
|
+
- Control flow β business rules (document, don't code)
|
|
35
|
+
|
|
36
|
+
**Smali Reading Quick Ref:**
|
|
37
|
+
```
|
|
38
|
+
.field β class fields (properties)
|
|
39
|
+
.method β method start
|
|
40
|
+
.end method β method end
|
|
41
|
+
invoke-virtual β instance method call
|
|
42
|
+
invoke-static β static method call
|
|
43
|
+
const-string β string literal
|
|
44
|
+
new-instance β object creation
|
|
45
|
+
if-eqz/if-nez β conditional branches
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2.2: Domain Model Contracts
|
|
49
|
+
|
|
50
|
+
Define data classes with exact field mapping:
|
|
51
|
+
|
|
52
|
+
```kotlin
|
|
53
|
+
// Domain model
|
|
54
|
+
data class User(
|
|
55
|
+
val id: String,
|
|
56
|
+
val fullName: String,
|
|
57
|
+
val email: String,
|
|
58
|
+
val avatarUrl: String?,
|
|
59
|
+
val isVerified: Boolean
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
// DTO (from API)
|
|
63
|
+
@Serializable
|
|
64
|
+
data class UserDto(
|
|
65
|
+
@SerialName("user_id") val userId: String,
|
|
66
|
+
@SerialName("full_name") val fullName: String,
|
|
67
|
+
@SerialName("email") val email: String,
|
|
68
|
+
@SerialName("avatar_url") val avatarUrl: String?,
|
|
69
|
+
@SerialName("is_verified") val isVerified: Boolean
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 2.3: Repository Contract
|
|
74
|
+
|
|
75
|
+
Define interfaces (NO implementation):
|
|
76
|
+
|
|
77
|
+
```kotlin
|
|
78
|
+
interface AuthRepository {
|
|
79
|
+
suspend fun login(email: String, password: String): Result<User>
|
|
80
|
+
suspend fun register(name: String, email: String, password: String): Result<User>
|
|
81
|
+
suspend fun logout()
|
|
82
|
+
fun isLoggedIn(): Flow<Boolean>
|
|
83
|
+
fun getCurrentUser(): Flow<User?>
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2.4: API Contract
|
|
88
|
+
|
|
89
|
+
Define Retrofit interface:
|
|
90
|
+
|
|
91
|
+
```kotlin
|
|
92
|
+
interface AuthApi {
|
|
93
|
+
@POST("auth/login")
|
|
94
|
+
suspend fun login(@Body request: LoginRequest): LoginResponse
|
|
95
|
+
|
|
96
|
+
@POST("auth/register")
|
|
97
|
+
suspend fun register(@Body request: RegisterRequest): RegisterResponse
|
|
98
|
+
|
|
99
|
+
@GET("auth/me")
|
|
100
|
+
suspend fun getCurrentUser(@Header("Authorization") token: String): UserDto
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 2.5: UseCase Signatures
|
|
105
|
+
|
|
106
|
+
```kotlin
|
|
107
|
+
class LoginUseCase(private val authRepo: AuthRepository) {
|
|
108
|
+
suspend operator fun invoke(email: String, password: String): Result<User>
|
|
109
|
+
// Implementation: TODO()
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 2.6: UI State Design
|
|
114
|
+
|
|
115
|
+
This is CRITICAL β design UiState + Events BEFORE coding the ViewModel:
|
|
116
|
+
|
|
117
|
+
```kotlin
|
|
118
|
+
// State
|
|
119
|
+
data class LoginUiState(
|
|
120
|
+
val email: String = "",
|
|
121
|
+
val password: String = "",
|
|
122
|
+
val isLoading: Boolean = false,
|
|
123
|
+
val error: String? = null,
|
|
124
|
+
val isPasswordVisible: Boolean = false
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
// Events (one-time actions)
|
|
128
|
+
sealed interface LoginEvent {
|
|
129
|
+
data class NavigateToHome(val user: User) : LoginEvent
|
|
130
|
+
data class ShowSnackbar(val message: String) : LoginEvent
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Actions (user interactions)
|
|
134
|
+
sealed interface LoginAction {
|
|
135
|
+
data class UpdateEmail(val email: String) : LoginAction
|
|
136
|
+
data class UpdatePassword(val password: String) : LoginAction
|
|
137
|
+
data object TogglePasswordVisibility : LoginAction
|
|
138
|
+
data object Submit : LoginAction
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 2.7: UI Wireframe
|
|
143
|
+
|
|
144
|
+
Describe the screen layout in structured text (NOT code):
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
### LoginScreen Wireframe
|
|
148
|
+
ββββββββββββββββββββββββ
|
|
149
|
+
β [App Logo] β
|
|
150
|
+
β β
|
|
151
|
+
β ββββββββββββββββββββ β
|
|
152
|
+
β β Email TextField β β
|
|
153
|
+
β ββββββββββββββββββββ β
|
|
154
|
+
β ββββββββββββββββββββ β
|
|
155
|
+
β β Password Field πβ β
|
|
156
|
+
β ββββββββββββββββββββ β
|
|
157
|
+
β β
|
|
158
|
+
β [βββ Login Button ββ]β
|
|
159
|
+
β β
|
|
160
|
+
β Forgot Password? β
|
|
161
|
+
β Don't have account?β
|
|
162
|
+
β Register β
|
|
163
|
+
ββββββββββββββββββββββββ
|
|
164
|
+
|
|
165
|
+
Behaviors:
|
|
166
|
+
- Email: validate format on focus lost
|
|
167
|
+
- Password: toggle visibility icon
|
|
168
|
+
- Button: disabled when loading, show progress
|
|
169
|
+
- Error: Snackbar at bottom
|
|
170
|
+
- Success: Navigate to HomeScreen
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## π Output: Feature Blueprint
|
|
176
|
+
|
|
177
|
+
Present a clean summary:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
## π Blueprint: [Feature Name]
|
|
181
|
+
|
|
182
|
+
### Smali Analysis Summary
|
|
183
|
+
- Files analyzed: [list]
|
|
184
|
+
- Key observations: [patterns, encryption, special logic]
|
|
185
|
+
|
|
186
|
+
### Contracts
|
|
187
|
+
- Domain Models: [list with field count]
|
|
188
|
+
- Repository Interface: [method signatures]
|
|
189
|
+
- API Interface: [endpoint signatures]
|
|
190
|
+
- UseCases: [list]
|
|
191
|
+
|
|
192
|
+
### UI Design
|
|
193
|
+
- UiState: [field list]
|
|
194
|
+
- Events: [list]
|
|
195
|
+
- Actions: [list]
|
|
196
|
+
- Wireframe: [see above]
|
|
197
|
+
|
|
198
|
+
### Dependencies
|
|
199
|
+
- Depends on: [other features/modules]
|
|
200
|
+
- Depended by: [features that need this]
|
|
201
|
+
|
|
202
|
+
### Estimated Files
|
|
203
|
+
| File | Layer | Type |
|
|
204
|
+
|------|-------|------|
|
|
205
|
+
| User.kt | Domain/Model | Data class |
|
|
206
|
+
| AuthRepository.kt | Domain/Repository | Interface |
|
|
207
|
+
| AuthRepositoryImpl.kt | Data/Repository | Implementation |
|
|
208
|
+
| AuthApi.kt | Data/Remote | Retrofit interface |
|
|
209
|
+
| LoginUseCase.kt | Domain/UseCase | Class |
|
|
210
|
+
| LoginViewModel.kt | Presentation | ViewModel |
|
|
211
|
+
| LoginScreen.kt | Presentation | Composable |
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## β
Gate
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
"π Blueprint cho [Feature] xong. Anh xem contracts cΓ³ α»n khΓ΄ng?
|
|
220
|
+
Khi OK em sαΊ½ bαΊ―t ΔαΊ§u implement (Phase 3)."
|
|
221
|
+
|
|
222
|
+
β User approves β Proceed to Phase 3 (Implementation) for this feature
|
|
223
|
+
β User wants changes β Adjust blueprint
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
*Phase 2: Blueprint β Contracts before code*
|