@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,154 +1,137 @@
|
|
|
1
|
-
#
|
|
1
|
+
# πΊοΈ Phase 0: Discovery (Satellite View) β iOS
|
|
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 Swift code
|
|
15
|
-
β BLOCKED: Any implementation decisions (those come in Phase 1)
|
|
12
|
+
β
ALLOWED: ASCII diagrams, Mermaid, tables, bullet lists, bash scan commands
|
|
13
|
+
β BLOCKED: Swift/ObjC 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 decrypted IPA output:
|
|
25
22
|
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
π iOS Reverse Engineering bαΊ―t ΔαΊ§u!
|
|
24
|
+
|
|
25
|
+
Em cαΊ§n biαΊΏt:
|
|
26
|
+
1. Decrypted .app bundle α» ΔΓ’u?
|
|
27
|
+
2. Class-dump headers α» ΔΓ’u?
|
|
28
|
+
3. TΓͺn app gα»c? Bundle ID?
|
|
29
|
+
|
|
30
|
+
ChΖ°a chuαΊ©n bα»?
|
|
31
|
+
β bagbak -o ~/decrypted/ com.example.app
|
|
32
|
+
β class-dump -H ~/decrypted/App.app -o ~/headers/
|
|
36
33
|
```
|
|
37
34
|
|
|
38
|
-
### 0.2:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
4. **Check embedded dylibs:**
|
|
64
|
-
```bash
|
|
65
|
-
find Payload/App.app -name "*.dylib" -o -name "*.framework" | sort
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
5. **Check for CocoaPods / SPM markers:**
|
|
69
|
-
```
|
|
70
|
-
Pods/ directory β was using CocoaPods
|
|
71
|
-
.package.resolved β was using SPM
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
See `framework-patterns.md` for comprehensive detection patterns.
|
|
75
|
-
|
|
76
|
-
### 0.3: Info.plist & Entitlements Analysis
|
|
77
|
-
|
|
78
|
-
Extract from `Info.plist`:
|
|
79
|
-
|
|
80
|
-
1. Bundle ID (`CFBundleIdentifier`)
|
|
81
|
-
2. Display Name
|
|
82
|
-
3. Min Deployment Target
|
|
83
|
-
4. Permissions (Privacy keys):
|
|
84
|
-
```
|
|
85
|
-
NSCameraUsageDescription β Camera
|
|
86
|
-
NSPhotoLibraryUsageDescription β Photo Library
|
|
87
|
-
NSLocationWhenInUseUsageDescription β Location
|
|
88
|
-
NSMicrophoneUsageDescription β Microphone
|
|
89
|
-
```
|
|
90
|
-
5. URL Schemes (deep links)
|
|
91
|
-
6. Capabilities from entitlements:
|
|
92
|
-
```
|
|
93
|
-
com.apple.developer.associated-domains β Universal Links
|
|
94
|
-
aps-environment β Push Notifications
|
|
95
|
-
com.apple.developer.in-app-payments β Apple Pay
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### 0.4: Class Structure Analysis
|
|
99
|
-
|
|
100
|
-
From class-dump headers:
|
|
101
|
-
|
|
102
|
-
1. **Entry points:** AppDelegate, SceneDelegate
|
|
103
|
-
2. **Root ViewController:** Tab bar? Navigation?
|
|
104
|
-
3. **Major ViewControllers** β future SwiftUI screens
|
|
105
|
-
4. **Model classes** β domain models
|
|
106
|
-
5. **Network managers** β API client
|
|
107
|
-
6. **Singleton/manager classes** β services to extract
|
|
108
|
-
|
|
109
|
-
### 0.5: Screen Flow Map
|
|
110
|
-
|
|
111
|
-
```mermaid
|
|
112
|
-
graph LR
|
|
113
|
-
Launch --> Login
|
|
114
|
-
Login --> MainTab
|
|
115
|
-
MainTab --> Home
|
|
116
|
-
MainTab --> Search
|
|
117
|
-
MainTab --> Profile
|
|
118
|
-
Home --> Detail
|
|
119
|
-
Profile --> Settings
|
|
35
|
+
### 0.2: Structure Scan
|
|
36
|
+
|
|
37
|
+
QuΓ©t IPA structure Δα» hiα»u quy mΓ΄ app:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Embedded frameworks
|
|
41
|
+
ls [app_bundle]/Frameworks/ 2>/dev/null
|
|
42
|
+
|
|
43
|
+
# Linked libraries (non-system)
|
|
44
|
+
otool -L [app_bundle]/[AppName] | grep -v /System | grep -v /usr/lib
|
|
45
|
+
|
|
46
|
+
# Header imports (from class-dump)
|
|
47
|
+
grep -rh "#import <" [headers_dir]/ | sort -u | head -30
|
|
48
|
+
grep -rh "@import " [headers_dir]/ | sort -u
|
|
49
|
+
|
|
50
|
+
# Count ViewControllers
|
|
51
|
+
grep -rl "UIViewController" [headers_dir]/ | wc -l
|
|
52
|
+
|
|
53
|
+
# Resource overview
|
|
54
|
+
ls [app_bundle]/*.car [app_bundle]/*.momd [app_bundle]/*.storyboardc 2>/dev/null
|
|
55
|
+
find [app_bundle] -name "*.json" -o -name "*.plist" | grep -v Info.plist | sort
|
|
56
|
+
|
|
57
|
+
# SDK identifiers in binary
|
|
58
|
+
strings [app_bundle]/[AppName] | grep -i "cocoapods\|carthage\|firebase\|facebook\|google" | head -20
|
|
120
59
|
```
|
|
121
60
|
|
|
61
|
+
### 0.3: Framework Detection
|
|
62
|
+
|
|
63
|
+
Scan for third-party frameworks. Ref: `framework-patterns.md`
|
|
64
|
+
|
|
65
|
+
**PhΓ’n loαΊ‘i thΓ nh 5 nhΓ³m:**
|
|
66
|
+
|
|
67
|
+
| Category | Meaning | Action |
|
|
68
|
+
|----------|---------|--------|
|
|
69
|
+
| β
Reuse | Modern, maintained | Add via SPM |
|
|
70
|
+
| π Replace | Legacy/deprecated | Map to modern Swift |
|
|
71
|
+
| π Apple | System frameworks | Use SwiftUI equivalents |
|
|
72
|
+
| π± Native | C/C++ dylibs | Keep, bridging header |
|
|
73
|
+
| π·οΈ App Code | Original app logic | Rebuild in Swift |
|
|
74
|
+
|
|
75
|
+
### 0.4: Info.plist Analysis
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
plutil -p [app_bundle]/Info.plist
|
|
79
|
+
codesign -d --entitlements :- [app_bundle]/[AppName] 2>/dev/null
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Extract:
|
|
83
|
+
- Bundle ID, Display Name, Min iOS version
|
|
84
|
+
- Privacy permissions (NSCameraUsageDescription, NSLocationWhenInUseUsageDescription, etc.)
|
|
85
|
+
- URL Schemes (deep links)
|
|
86
|
+
- Capabilities from entitlements (push, Apple Pay, Sign In with Apple, etc.)
|
|
87
|
+
- Supported orientations
|
|
88
|
+
|
|
89
|
+
### 0.5: Screen Map
|
|
90
|
+
|
|
91
|
+
Analyze class-dump headers for ViewControllers:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Find all ViewControllers
|
|
95
|
+
grep -rl "UIViewController" [headers_dir]/ | sort
|
|
96
|
+
|
|
97
|
+
# Find tab bar controllers
|
|
98
|
+
grep -rl "UITabBarController" [headers_dir]/
|
|
99
|
+
|
|
100
|
+
# Find navigation controllers
|
|
101
|
+
grep -rl "UINavigationController" [headers_dir]/
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Map VCs β future SwiftUI screens. Draw navigation flow.
|
|
105
|
+
|
|
122
106
|
### 0.6: Complexity Estimate
|
|
123
107
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
| SDK Integration | βββββ | [N] third-party, [N] native dylibs |
|
|
108
|
+
Rate each area 1-5 dots:
|
|
109
|
+
- Data Layer: βββββ (APIs, DB, keychain)
|
|
110
|
+
- Core Logic: βββββ (crypto, formatters, utils)
|
|
111
|
+
- UI Screens: βββββ (screen count, complex layouts)
|
|
112
|
+
- SDK Integration: βββββ (third-party, native libs)
|
|
130
113
|
|
|
131
114
|
---
|
|
132
115
|
|
|
133
116
|
## π Output: App Map
|
|
134
117
|
|
|
135
|
-
|
|
118
|
+
Use template from `templates/app-map.md`. Must include:
|
|
119
|
+
|
|
120
|
+
1. **Identity** β bundle ID, min iOS, screen count
|
|
121
|
+
2. **Screen Flow** β navigation graph (ASCII or Mermaid)
|
|
122
|
+
3. **Framework Landscape** β categorized dependency list
|
|
123
|
+
4. **Complexity Estimate** β visual dots rating
|
|
124
|
+
5. **Key Observations** β anything notable
|
|
136
125
|
|
|
137
126
|
---
|
|
138
127
|
|
|
139
128
|
## β
Gate
|
|
140
129
|
|
|
141
130
|
```
|
|
142
|
-
"πΊοΈ App Map
|
|
143
|
-
|
|
144
|
-
- [N] frameworks found ([N] reuse, [N] replace)
|
|
145
|
-
- [N] native dylibs
|
|
146
|
-
- Complexity: [Low/Medium/High]
|
|
147
|
-
|
|
148
|
-
CΓ³ gΓ¬ cαΊ§n Δiα»u chα»nh khΓ΄ng?
|
|
149
|
-
β OK β Phase 1 (Architecture Design)"
|
|
131
|
+
"πΊοΈ ΔΓ’y lΓ App Map. Anh review xem cΓ³ gΓ¬ cαΊ§n Δiα»u chα»nh khΓ΄ng?"
|
|
132
|
+
β User approves β Proceed to Phase 1 (Architecture)
|
|
150
133
|
```
|
|
151
134
|
|
|
152
135
|
---
|
|
153
136
|
|
|
154
|
-
*Phase 0: Discovery β
|
|
137
|
+
*Phase 0: Discovery β No code, just understanding*
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# ποΈ Phase 1: Architecture (District View) β iOS
|
|
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). **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
|
|
13
|
+
β
ALLOWED: Architecture diagrams, layer maps, feature-to-file mapping tables
|
|
14
14
|
β
ALLOWED: File paths, module names, dependency lists
|
|
15
|
-
β οΈ ALLOWED: Package.swift skeleton (dependencies only)
|
|
16
15
|
β BLOCKED: Function bodies, implementation details, actual Swift code
|
|
16
|
+
β οΈ EXCEPTION: SPM dependency declarations only
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -22,65 +22,69 @@
|
|
|
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/ (NavigationStack) β
|
|
30
|
-
β βββ Theme/ (
|
|
31
|
-
β βββ Components/ (Shared
|
|
32
|
+
β βββ Theme/ (AppTheme) β
|
|
33
|
+
β βββ Components/ (Shared Views) β
|
|
32
34
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
33
35
|
β Domain β
|
|
34
36
|
β βββ Models/ ([N] business models) β
|
|
35
|
-
β βββ Repositories/ ([N] protocols)
|
|
37
|
+
β βββ Repositories/ ([N] protocols) β
|
|
36
38
|
β βββ UseCases/ ([N] use cases) β
|
|
37
39
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
38
40
|
β Data β
|
|
39
|
-
β βββ Network/ (
|
|
40
|
-
β βββ Local/ (SwiftData, Keychain)
|
|
41
|
-
β βββ Repositories/ (implementations)
|
|
41
|
+
β βββ Network/ (APIClient, Endpoints) β
|
|
42
|
+
β βββ Local/ (SwiftData, Keychain) β
|
|
43
|
+
β βββ Repositories/ (implementations)β
|
|
42
44
|
βββββββββββββββββββββββββββββββββββββββ€
|
|
43
|
-
β DI
|
|
44
|
-
β βββ
|
|
45
|
+
β DI β
|
|
46
|
+
β βββ AppContainer.swift β
|
|
45
47
|
βββββββββββββββββββββββββββββββββββββββ
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
### 1.2: Feature β File Mapping
|
|
49
51
|
|
|
50
|
-
| Feature | Domain Model | Repository
|
|
51
|
-
|
|
52
|
-
| Auth | User, Token |
|
|
53
|
-
| Home |
|
|
52
|
+
| Feature | Domain Model | Repository | UseCase | Screen(s) | ViewModel |
|
|
53
|
+
|---------|-------------|-----------|---------|-----------|-----------|
|
|
54
|
+
| Auth | User, Token | AuthRepo | LoginUC | Login, Register | AuthVM |
|
|
55
|
+
| Home | [Model] | [Repo] | [UC] | Home | HomeVM |
|
|
54
56
|
| ... | ... | ... | ... | ... | ... |
|
|
55
57
|
|
|
56
58
|
### 1.3: API Endpoint Inventory
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
Extract ALL API endpoints from class-dump headers + disassembly:
|
|
61
|
+
|
|
62
|
+
| # | Method | Endpoint | Auth | Notes |
|
|
63
|
+
|---|--------|----------|------|-------|
|
|
64
|
+
| 1 | POST | /auth/login | No | JWT response |
|
|
65
|
+
| 2 | GET | /users/me | Bearer | User profile |
|
|
66
|
+
|
|
67
|
+
**How to find in class-dump/disassembly:**
|
|
68
|
+
```
|
|
69
|
+
Look for: NSString init with "https://" or "http://"
|
|
70
|
+
Look for: properties named baseURL, apiURL, endpoint
|
|
71
|
+
Look for: method names like fetchUser, loginWith, getProfile
|
|
72
|
+
Look for: AFHTTPSessionManager or NSURLSession usage patterns
|
|
69
73
|
```
|
|
70
74
|
|
|
71
75
|
### 1.4: Data Schema Inventory
|
|
72
76
|
|
|
73
77
|
| Model | Key Fields | Source | Storage |
|
|
74
78
|
|-------|-----------|--------|---------|
|
|
75
|
-
| User | id, name, email, avatar | API | SwiftData
|
|
76
|
-
| Settings | theme,
|
|
79
|
+
| User | id, name, email, avatar | API + Local | SwiftData |
|
|
80
|
+
| Settings | theme, lang, notif | Local only | @AppStorage |
|
|
77
81
|
|
|
78
|
-
### 1.5: Project Structure
|
|
82
|
+
### 1.5: Xcode Project Structure
|
|
79
83
|
|
|
80
84
|
```
|
|
81
85
|
App/
|
|
82
86
|
βββ App.swift # @main entry point
|
|
83
|
-
βββ AppDelegate.swift # UIKit lifecycle (
|
|
87
|
+
βββ AppDelegate.swift # UIKit lifecycle (if needed)
|
|
84
88
|
βββ Info.plist
|
|
85
89
|
βββ Assets.xcassets/
|
|
86
90
|
βββ DI/
|
|
@@ -97,17 +101,20 @@ App/
|
|
|
97
101
|
β βββ Repositories/
|
|
98
102
|
βββ Domain/
|
|
99
103
|
β βββ Models/
|
|
100
|
-
β βββ Repositories/
|
|
104
|
+
β βββ Repositories/
|
|
101
105
|
β βββ UseCases/
|
|
102
106
|
βββ Presentation/
|
|
103
107
|
β βββ Navigation/
|
|
108
|
+
β β βββ AppNavigation.swift
|
|
109
|
+
β β βββ Route.swift
|
|
104
110
|
β βββ Theme/
|
|
105
|
-
β βββ
|
|
111
|
+
β β βββ AppTheme.swift
|
|
112
|
+
β β βββ Components/
|
|
106
113
|
β βββ Screens/
|
|
107
114
|
β βββ Launch/
|
|
108
115
|
β βββ Auth/
|
|
109
116
|
β βββ Home/
|
|
110
|
-
β βββ
|
|
117
|
+
β βββ .../
|
|
111
118
|
βββ Utilities/
|
|
112
119
|
β βββ Extensions/
|
|
113
120
|
β βββ Crypto/
|
|
@@ -117,57 +124,45 @@ App/
|
|
|
117
124
|
βββ Fonts/
|
|
118
125
|
```
|
|
119
126
|
|
|
120
|
-
### 1.6: Build Order
|
|
127
|
+
### 1.6: Build Order
|
|
121
128
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
4. π Blueprint: Contracts (models, protocols, use cases, state)
|
|
132
|
-
5. π¨ UI Shell: Visual implementation + Resource extraction
|
|
133
|
-
6. π¦ GATE: User approve UI
|
|
134
|
-
7. π¨ Logic: Domain β Data β ViewModel β Wire UI
|
|
135
|
-
8. π§ͺ Test: Integration + Parity
|
|
136
|
-
|
|
137
|
-
Final (one-time):
|
|
138
|
-
9. π¦ SDK Integration + Native libs
|
|
139
|
-
10. β
Full Parity Check
|
|
140
|
-
```
|
|
129
|
+
| # | Phase | Scope | Complexity |
|
|
130
|
+
|---|-------|-------|-----------|
|
|
131
|
+
| 1 | π’ Setup | Xcode project + SPM deps + Theme | Low |
|
|
132
|
+
| 2 | π’ Models | Domain structs | Low |
|
|
133
|
+
| 3 | π‘ Data | APIClient + SwiftData + Keychain | Medium |
|
|
134
|
+
| 4 | π‘ Utils | Crypto, formatters (parity test!) | Medium |
|
|
135
|
+
| 5 | π΄ Feature: [First] | Blueprint β Build | High |
|
|
136
|
+
| 6 | π΄ Feature: [Second] | Blueprint β Build | High |
|
|
137
|
+
| N | π΄ Final | Parity check + QA | High |
|
|
141
138
|
|
|
142
139
|
### 1.7: Tech Stack Decisions
|
|
143
140
|
|
|
144
141
|
| Decision | Choice | Rationale |
|
|
145
142
|
|----------|--------|-----------|
|
|
146
|
-
|
|
|
147
|
-
| State
|
|
148
|
-
|
|
|
149
|
-
|
|
|
143
|
+
| UI | SwiftUI + iOS 17+ | Modern, declarative |
|
|
144
|
+
| State | @Observable | Latest, no Combine boilerplate |
|
|
145
|
+
| Network | URLSession async/await | Apple native, no deps |
|
|
146
|
+
| JSON | Codable | Built-in, type-safe |
|
|
147
|
+
| Local DB | SwiftData | [or Core Data if < iOS 17] |
|
|
148
|
+
| DI | Protocol + init injection | No framework needed |
|
|
149
|
+
| Package Manager | SPM | Standard, no CocoaPods |
|
|
150
150
|
|
|
151
151
|
---
|
|
152
152
|
|
|
153
153
|
## π Output: Architecture Blueprint
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
Use template from `templates/architecture.md`.
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
159
159
|
## β
Gate
|
|
160
160
|
|
|
161
161
|
```
|
|
162
|
-
"ποΈ Architecture Blueprint xong.
|
|
163
|
-
|
|
164
|
-
Anh muα»n bαΊ―t ΔαΊ§u tα»« feature nΓ o?
|
|
165
|
-
Em suggest: [Feature X] vì [reason]."
|
|
166
|
-
|
|
167
|
-
β User picks feature β Phase 2 (Blueprint + UI Design)
|
|
168
|
-
β User wants changes β Adjust architecture
|
|
162
|
+
"ποΈ Architecture Blueprint xong. Anh muα»n bαΊ―t ΔαΊ§u tα»« feature nΓ o?"
|
|
163
|
+
β User picks feature β Phase 2 (Blueprint)
|
|
169
164
|
```
|
|
170
165
|
|
|
171
166
|
---
|
|
172
167
|
|
|
173
|
-
*Phase 1: Architecture β Design before you build
|
|
168
|
+
*Phase 1: Architecture β Design before you build*
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# π Phase 2: Blueprint (Block View β per feature) β iOS
|
|
2
|
+
|
|
3
|
+
> **Zoom Level:** 2 β Feature Detail
|
|
4
|
+
> **Goal:** Design contracts 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: Protocol signatures, struct definitions, enum cases
|
|
14
|
+
β
ALLOWED: Endpoint definitions (path + method, no body)
|
|
15
|
+
β
ALLOWED: State design (@Observable properties, no logic)
|
|
16
|
+
β BLOCKED: Function body implementations
|
|
17
|
+
β BLOCKED: Full ViewModel logic, full View implementations
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## π Sub-steps (per feature)
|
|
23
|
+
|
|
24
|
+
### 2.1: Deep Header/Disassembly Reading
|
|
25
|
+
|
|
26
|
+
Read class-dump headers + Hopper pseudo-code for the chosen feature.
|
|
27
|
+
|
|
28
|
+
**What to extract:**
|
|
29
|
+
- Class hierarchy (@interface ... : NSObject)
|
|
30
|
+
- Properties β model fields
|
|
31
|
+
- Method signatures β API contracts
|
|
32
|
+
- String constants β URLs, keys
|
|
33
|
+
- Delegate/datasource patterns β business rules
|
|
34
|
+
|
|
35
|
+
**ObjC Header Reading Quick Ref:**
|
|
36
|
+
```objc
|
|
37
|
+
@property (nonatomic, copy) NSString *name; // β let name: String
|
|
38
|
+
@property (nonatomic, strong) NSArray *items; // β let items: [Any]
|
|
39
|
+
@property (nonatomic, assign) BOOL isActive; // β let isActive: Bool
|
|
40
|
+
@property (nonatomic, assign) NSInteger count; // β let count: Int
|
|
41
|
+
@property (nullable) NSString *bio; // β let bio: String?
|
|
42
|
+
|
|
43
|
+
- (void)fetchWithCompletion:(void(^)(id, NSError*))completion;
|
|
44
|
+
// β func fetch() async throws -> T
|
|
45
|
+
|
|
46
|
+
+ (instancetype)sharedInstance;
|
|
47
|
+
// β static let shared = ClassName()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2.2: Domain Model Contracts
|
|
51
|
+
|
|
52
|
+
```swift
|
|
53
|
+
struct User: Codable, Identifiable, Sendable {
|
|
54
|
+
let id: String
|
|
55
|
+
let fullName: String
|
|
56
|
+
let email: String
|
|
57
|
+
let avatarUrl: String?
|
|
58
|
+
let isVerified: Bool
|
|
59
|
+
|
|
60
|
+
enum CodingKeys: String, CodingKey {
|
|
61
|
+
case id = "user_id"
|
|
62
|
+
case fullName = "full_name"
|
|
63
|
+
case email
|
|
64
|
+
case avatarUrl = "avatar_url"
|
|
65
|
+
case isVerified = "is_verified"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2.3: Repository Contract
|
|
71
|
+
|
|
72
|
+
```swift
|
|
73
|
+
protocol AuthRepository: Sendable {
|
|
74
|
+
func login(email: String, password: String) async throws -> User
|
|
75
|
+
func register(name: String, email: String, password: String) async throws -> User
|
|
76
|
+
func logout() async
|
|
77
|
+
var isLoggedIn: AsyncStream<Bool> { get }
|
|
78
|
+
var currentUser: AsyncStream<User?> { get }
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2.4: API Contract
|
|
83
|
+
|
|
84
|
+
```swift
|
|
85
|
+
enum AuthEndpoint: Endpoint {
|
|
86
|
+
case login(email: String, password: String)
|
|
87
|
+
case register(name: String, email: String, password: String)
|
|
88
|
+
case currentUser
|
|
89
|
+
|
|
90
|
+
var path: String { /* ... */ }
|
|
91
|
+
var method: HTTPMethod { /* ... */ }
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2.5: UseCase Signatures
|
|
96
|
+
|
|
97
|
+
```swift
|
|
98
|
+
struct LoginUseCase: Sendable {
|
|
99
|
+
let authRepository: AuthRepository
|
|
100
|
+
func execute(email: String, password: String) async throws -> User
|
|
101
|
+
// Implementation: TODO
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 2.6: UI State Design
|
|
106
|
+
|
|
107
|
+
```swift
|
|
108
|
+
// ViewModel properties (will be @Observable)
|
|
109
|
+
// - email: String
|
|
110
|
+
// - password: String
|
|
111
|
+
// - isLoading: Bool
|
|
112
|
+
// - showError: Bool
|
|
113
|
+
// - errorMessage: String
|
|
114
|
+
// - isPasswordVisible: Bool
|
|
115
|
+
|
|
116
|
+
// Actions the view can trigger:
|
|
117
|
+
// - updateEmail(String)
|
|
118
|
+
// - updatePassword(String)
|
|
119
|
+
// - togglePasswordVisibility()
|
|
120
|
+
// - login()
|
|
121
|
+
|
|
122
|
+
// Navigation events:
|
|
123
|
+
// - navigateToHome(User)
|
|
124
|
+
// - showSnackbar(String)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 2.7: UI Wireframe
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
### LoginScreen Wireframe
|
|
131
|
+
ββββββββββββββββββββββββ
|
|
132
|
+
β [App Logo] β
|
|
133
|
+
β β
|
|
134
|
+
β ββββββββββββββββββββ β
|
|
135
|
+
β β Email TextField β β
|
|
136
|
+
β ββββββββββββββββββββ β
|
|
137
|
+
β ββββββββββββββββββββ β
|
|
138
|
+
β β Password Field πβ β
|
|
139
|
+
β ββββββββββββββββββββ β
|
|
140
|
+
β β
|
|
141
|
+
β [βββ Login Button ββ]β
|
|
142
|
+
β β
|
|
143
|
+
β Forgot Password? β
|
|
144
|
+
β Register β
|
|
145
|
+
ββββββββββββββββββββββββ
|
|
146
|
+
|
|
147
|
+
Behaviors:
|
|
148
|
+
- Email: .textContentType(.emailAddress), .keyboardType(.emailAddress)
|
|
149
|
+
- Password: toggle visibility, .textContentType(.password)
|
|
150
|
+
- Button: .disabled when loading, overlay ProgressView
|
|
151
|
+
- Error: .alert modifier
|
|
152
|
+
- Success: NavigationStack push to Home
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## π Output: Feature Blueprint
|
|
158
|
+
|
|
159
|
+
Use template from `templates/blueprint.md`.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## β
Gate
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
"π Blueprint cho [Feature] xong. Anh xem contracts α»n khΓ΄ng?"
|
|
167
|
+
β OK β Phase 3 (Implementation)
|
|
168
|
+
β Adjust β Update blueprint
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
*Phase 2: Blueprint β Contracts before code*
|