@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,69 @@
1
+ ---
2
+ description: Export NeuralMemory brain state to JSON snapshot (portable consciousness)
3
+ ---
4
+
5
+ # /nm-snapshot — Brain Snapshot Export
6
+
7
+ ## When to use
8
+ - Trước khi switch AI tools hoặc agents
9
+ - Backup trước sprint hoặc major refactor
10
+ - Share brain với teammate/agent
11
+ - "Portable Consciousness" — export & re-import vào agent khác
12
+
13
+ ## Steps
14
+
15
+ ### Step 1: Choose snapshot scope
16
+ ```
17
+ Snapshot scope:
18
+ a) Full brain — all memories + synapses
19
+ b) Topic scope — memories matching [topic]
20
+ c) Recent — memories from last [N] days
21
+ d) High priority — priority >= 7 only
22
+
23
+ [Choose scope]
24
+ ```
25
+
26
+ ### Step 2: Generate snapshot
27
+ ```python
28
+ # Export to JSON
29
+ snapshot = {
30
+ "version": "1.0",
31
+ "exported_at": "2026-02-26T12:00:00Z",
32
+ "project": "<from .project-identity>",
33
+ "scope": "<chosen scope>",
34
+ "memories": [...],
35
+ "synapses": [...],
36
+ "stats": {
37
+ "total_memories": N,
38
+ "total_synapses": N,
39
+ "avg_priority": X.X
40
+ }
41
+ }
42
+ ```
43
+
44
+ ### Step 3: Save + report
45
+ ```
46
+ ✅ Snapshot saved: brain_snapshot_2026-02-26.json
47
+
48
+ Memories: 127
49
+ Synapses: 245
50
+ Size: 48KB
51
+
52
+ 💡 To import into another agent:
53
+ nmem import brain_snapshot_2026-02-26.json
54
+
55
+ 💡 To share with teammate:
56
+ Copy the JSON file and they run nmem import
57
+ ```
58
+
59
+ ## Portable Consciousness
60
+
61
+ This snapshot is the "Brain-as-a-Service" concept from NeuralMemory's vision:
62
+ - All associative reflexes are preserved in the synapse graph
63
+ - Another agent loading this snapshot gets all the relationships
64
+ - Not just facts — but the causal and temporal reasoning
65
+
66
+ ## Anti-patterns
67
+ - Do NOT snapshot before deduplication (exports noise)
68
+ - Do NOT share snapshots with sensitive credentials/tokens in memories
69
+ - DO run /memory-audit before important snapshots
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Import project knowledge into NeuralMemory (decisions, errors, patterns)
3
+ ---
4
+
5
+ # /nm-import — Project Knowledge Import
6
+
7
+ ## When to use
8
+ - Bắt đầu NeuralMemory trên project đã có sẵn
9
+ - Sau khi `awkit enable-pack neural-memory` lần đầu
10
+ - Muốn bulk-import từ brain/ Markdown files (legacy)
11
+
12
+ ## What to import
13
+
14
+ ```
15
+ Priority 1 — Decisions (brain/decisions/*.md)
16
+ Priority 2 — Solutions (brain/solutions/*.md)
17
+ Priority 3 — CODEBASE.md (architecture patterns)
18
+ Priority 4 — .project-identity (project context)
19
+ Priority 5 — git log (recent changes pattern)
20
+ ```
21
+
22
+ ## Steps
23
+
24
+ ### Step 1: Scan sources
25
+ ```
26
+ Sources found:
27
+ brain/decisions/ — 12 files
28
+ brain/solutions/ — 8 files
29
+ CODEBASE.md — 1 file
30
+ .project-identity — 1 file
31
+
32
+ Total import estimate: ~45 memories
33
+ Proceed? [yes/no]
34
+ ```
35
+
36
+ ### Step 2: Parse each source
37
+ For each file:
38
+ - Extract individual information units
39
+ - Classify by type (decision, error, fact, instruction)
40
+ - Extract tags from content
41
+ - Set priority based on type
42
+
43
+ ### Step 3: Deduplication
44
+ ```python
45
+ # Check NeuralMemory for existing similar memories
46
+ nmem_recall(content_keywords)
47
+ # → Skip if identical
48
+ # → Flag if conflicting
49
+ ```
50
+
51
+ ### Step 4: Batch import preview
52
+ Show 10 at a time, confirm each batch
53
+
54
+ ### Step 5: Build synapse graph
55
+ After import, run:
56
+ ```python
57
+ nmem_auto() # Auto-detect relationships between imported memories
58
+ ```
59
+
60
+ ### Step 6: Import summary
61
+ ```
62
+ ✅ Import Complete
63
+ Imported: 42 memories
64
+ Skipped: 3 duplicates
65
+ Auto-linked: 18 synapse connections
66
+
67
+ Brain is now seeded. Run /memory-audit to check quality.
68
+ ```
69
+
70
+ ## Anti-patterns
71
+ - Do NOT import everything blindly — quality over quantity
72
+ - Do NOT import temporary notes or debug snippets
73
+ - Do NOT skip the deduplication step (creates noise)
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: Query NeuralMemory với associative recall (spreading activation)
3
+ ---
4
+
5
+ # /nm-recall — NeuralMemory Associative Recall
6
+
7
+ ## When to use
8
+ - Cần tìm lại quyết định, lỗi, hoặc patterns từ past sessions
9
+ - Regular recall không đủ — cần associative links
10
+ - Muốn surface hidden connections giữa các memories
11
+
12
+ ## Steps
13
+
14
+ 1. **Extract query keywords** từ user's question
15
+ - Lấy 3-5 keywords cốt lõi
16
+ - Bỏ qua stop words
17
+
18
+ 2. **Run activating recall**
19
+ ```
20
+ nmem_recall(query, depth=2)
21
+ ```
22
+ - `depth=1`: Instant recall — direct matches only
23
+ - `depth=2`: Context recall — + 1 hop via synapses (default)
24
+ - `depth=3`: Deep recall — use for complex architecture questions
25
+
26
+ 3. **Format recall results**
27
+ ```
28
+ 🧠 Recalled [N] memories for: "[query]"
29
+
30
+ [type] "[content excerpt]"
31
+ → Tags: [tags] | Priority: [P] | Age: [X days]
32
+ → Connected to: [related memory brief] via [synapse_type]
33
+
34
+ [type] "[content excerpt]"
35
+ ...
36
+ ```
37
+
38
+ 4. **Surface connections**
39
+ - Highlight `CAUSED_BY`, `LEADS_TO`, `DISCUSSED` links
40
+ - Show causal chains when relevant: A → caused → B → leads to → C
41
+
42
+ 5. **If no results (depth=2)**
43
+ - Try `depth=3` automatically
44
+ - If still empty: "🧠 No relevant memories found. Consider /nm-intake to capture this."
45
+
46
+ ## Output Examples
47
+
48
+ ```
49
+ 🧠 Recalled 3 memories for: "auth JWT"
50
+
51
+ [decision] "Chose JWT over sessions for stateless API auth"
52
+ → Tags: [auth, jwt, api, decision] | Priority: 8 | Age: 14 days
53
+ → Caused by: "Need to support mobile + web clients simultaneously"
54
+ → Leads to: "JWT stored in Authorization header, 24h expiry"
55
+
56
+ [error] "Fixed: JWT middleware running before auth check caused 401 on valid tokens"
57
+ → Tags: [auth, jwt, middleware, error] | Priority: 7 | Age: 5 days
58
+ → Solution: "Reorder middleware: auth check → JWT verify → route handler"
59
+
60
+ [instruction] "Never store JWT in localStorage — XSS vulnerability"
61
+ → Tags: [auth, security, jwt, instruction] | Priority: 9 | Age: 30 days
62
+ ```
63
+
64
+ ## Anti-patterns
65
+ - Do NOT just keyword search — use NeuralMemory's associative engine
66
+ - Do NOT show all memories — only top activations (max 8)
67
+ - Do NOT skip connections — the synapse links ARE the value
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Export NeuralMemory brain state to JSON snapshot (portable consciousness)
3
+ ---
4
+
5
+ # /nm-snapshot — Brain Snapshot Export
6
+
7
+ ## When to use
8
+ - Trước khi switch AI tools hoặc agents
9
+ - Backup trước sprint hoặc major refactor
10
+ - Share brain với teammate/agent
11
+ - "Portable Consciousness" — export & re-import vào agent khác
12
+
13
+ ## Steps
14
+
15
+ ### Step 1: Choose snapshot scope
16
+ ```
17
+ Snapshot scope:
18
+ a) Full brain — all memories + synapses
19
+ b) Topic scope — memories matching [topic]
20
+ c) Recent — memories from last [N] days
21
+ d) High priority — priority >= 7 only
22
+
23
+ [Choose scope]
24
+ ```
25
+
26
+ ### Step 2: Generate snapshot
27
+ ```python
28
+ # Export to JSON
29
+ snapshot = {
30
+ "version": "1.0",
31
+ "exported_at": "2026-02-26T12:00:00Z",
32
+ "project": "<from .project-identity>",
33
+ "scope": "<chosen scope>",
34
+ "memories": [...],
35
+ "synapses": [...],
36
+ "stats": {
37
+ "total_memories": N,
38
+ "total_synapses": N,
39
+ "avg_priority": X.X
40
+ }
41
+ }
42
+ ```
43
+
44
+ ### Step 3: Save + report
45
+ ```
46
+ ✅ Snapshot saved: brain_snapshot_2026-02-26.json
47
+
48
+ Memories: 127
49
+ Synapses: 245
50
+ Size: 48KB
51
+
52
+ 💡 To import into another agent:
53
+ nmem import brain_snapshot_2026-02-26.json
54
+
55
+ 💡 To share with teammate:
56
+ Copy the JSON file and they run nmem import
57
+ ```
58
+
59
+ ## Portable Consciousness
60
+
61
+ This snapshot is the "Brain-as-a-Service" concept from NeuralMemory's vision:
62
+ - All associative reflexes are preserved in the synapse graph
63
+ - Another agent loading this snapshot gets all the relationships
64
+ - Not just facts — but the causal and temporal reasoning
65
+
66
+ ## Anti-patterns
67
+ - Do NOT snapshot before deduplication (exports noise)
68
+ - Do NOT share snapshots with sensitive credentials/tokens in memories
69
+ - DO run /memory-audit before important snapshots
@@ -0,0 +1,222 @@
1
+ ---
2
+ description: 🔨 RE Android Phase 2+3+4 — Blueprint + UI Shell → Logic Build → Final Parity (UI-First)
3
+ parent: reverse-android
4
+ ---
5
+
6
+ # /re-android-build — Blueprint + UI + Build (Per Feature)
7
+
8
+ > **Parent:** [`/reverse-android`](reverse-android.md) → Phase 2+3+4
9
+ > **Prerequisite:** Completed Architecture from [`/re-android-design`](reverse-android-design.md)
10
+ > **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
11
+
12
+ ---
13
+
14
+ ## 🔄 Feature Loop (UI-First)
15
+
16
+ ```
17
+ For each feature (from Architecture Build Order):
18
+ Phase 2: Blueprint + UI (contracts + visual shell)
19
+ ↓ 🚦 GATE: User approves UI + contracts
20
+ Phase 3: Logic Build (domain → data → wire)
21
+ ↓ 📊 CHECKPOINT
22
+ → Next feature
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 📐🎨 Phase 2: Blueprint + UI Design
28
+
29
+ > **Output:** Approved contracts + Working Compose UI shell with mock data.
30
+
31
+ ### Part A: Contracts (signatures only)
32
+
33
+ #### 2.1: Deep Smali Reading
34
+ Read Smali files for the chosen feature. Extract class hierarchy, fields, method signatures,
35
+ string constants, control flow. See `smali-reading-guide.md`.
36
+
37
+ #### 2.2–2.5: Define Contracts
38
+ ```kotlin
39
+ // 2.2 Domain Model
40
+ data class [Model](val field: Type, ...)
41
+
42
+ // 2.3 Repository Interface
43
+ interface [Feature]Repository {
44
+ suspend fun [method](...): Result<[Type]>
45
+ }
46
+
47
+ // 2.4 API Interface
48
+ interface [Feature]Api {
49
+ @[METHOD]("[endpoint]")
50
+ suspend fun [method](...): [Response]
51
+ }
52
+
53
+ // 2.5 UseCase
54
+ class [Action]UseCase(repo: [Feature]Repository) {
55
+ suspend operator fun invoke(...): Result<[Type]> // TODO()
56
+ }
57
+ ```
58
+
59
+ #### 2.6: UI State Design
60
+ ```kotlin
61
+ data class [Screen]UiState(
62
+ val field: Type = default,
63
+ val isLoading: Boolean = false,
64
+ val error: String? = null
65
+ )
66
+ sealed interface [Screen]Event { /* navigation, snackbar */ }
67
+ sealed interface [Screen]Action { /* user interactions */ }
68
+ ```
69
+
70
+ ### Part B: UI Visual Shell
71
+
72
+ #### 2.7: Resource Extraction ⭐ (BEFORE UI code!)
73
+
74
+ ```bash
75
+ # Only resources for THIS screen
76
+ grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
77
+ grep -o '@color/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
78
+ ```
79
+
80
+ Copy ONLY needed resources. Verify they compile.
81
+
82
+ #### 2.8: UI Implementation ⭐ (Visual shell with mock data)
83
+
84
+ - Use UiState from 2.6 with hardcoded defaults
85
+ - Use REAL resources from 2.7
86
+ - Create `[Screen]Content` composable (stateless)
87
+ - Match visual parity with original app
88
+ - NO ViewModel connection, NO real API calls
89
+
90
+ ```kotlin
91
+ @Composable
92
+ fun [Screen]Content(
93
+ uiState: [Screen]UiState = [Screen]UiState(), // Mock
94
+ onAction: ([Screen]Action) -> Unit = {} // No-op
95
+ ) {
96
+ // Full Compose UI matching original app
97
+ }
98
+
99
+ @Preview @Composable
100
+ private fun NormalPreview() { AppTheme { [Screen]Content() } }
101
+
102
+ @Preview @Composable
103
+ private fun LoadingPreview() { AppTheme { [Screen]Content([Screen]UiState(isLoading = true)) } }
104
+
105
+ @Preview @Composable
106
+ private fun ErrorPreview() { AppTheme { [Screen]Content([Screen]UiState(error = "Error")) } }
107
+ ```
108
+
109
+ #### 2.9: Visual Parity Check ⭐
110
+
111
+ Compare with original app:
112
+ - [ ] Layout structure matches
113
+ - [ ] Colors, typography, spacing correct
114
+ - [ ] Icons/images positioned correctly
115
+ - [ ] All states: normal, loading, error, empty
116
+
117
+ ### 🚦 UI + Contracts Gate (MANDATORY)
118
+
119
+ ```
120
+ "📐🎨 Blueprint + UI cho [Feature] xong:
121
+ 📝 Contracts: [N] models, [N] repos, [N] use cases, [N] APIs
122
+ 🎨 UI: [Screen] with [N] state previews
123
+ 📸 Visual Parity: [OK / needs adjustment]
124
+
125
+ → ✅ Approve → Phase 3 (Logic Build)
126
+ → 🎨 Adjust UI → fix then re-check
127
+ → 📝 Adjust contracts → revise"
128
+ ```
129
+
130
+ > ⚠️ **DO NOT proceed to Phase 3 without user approval.**
131
+
132
+ ---
133
+
134
+ ## 🔨 Phase 3: Logic Build
135
+
136
+ > **Output:** Full production-quality Kotlin code. Wire logic to EXISTING UI.
137
+
138
+ ### 3.1: Domain Layer
139
+ Models + Repository interfaces + UseCases (implement invoke with repo calls)
140
+
141
+ ### 3.2: Data Layer
142
+ DTOs + Retrofit API + Room (if applicable) + Repository implementation
143
+
144
+ ### 3.3: DI Module
145
+ Hilt @Module with @Binds for repository
146
+
147
+ ### 3.4: ViewModel
148
+ @HiltViewModel with StateFlow + SharedFlow, implements onAction()
149
+
150
+ ### 3.5: Wire UI ↔ Logic ⭐ (NOT "code new UI")
151
+
152
+ The UI already exists from Phase 2.8. Only CONNECT it:
153
+
154
+ ```kotlin
155
+ // Keep stateless Content composable from Phase 2 (for Preview):
156
+ // [Screen]Content(uiState, onAction) — DO NOT MODIFY
157
+
158
+ // ADD wrapper that wires ViewModel:
159
+ @Composable
160
+ fun [Screen](
161
+ viewModel: [Screen]ViewModel = hiltViewModel(),
162
+ onNavigate: () -> Unit
163
+ ) {
164
+ val uiState by viewModel.uiState.collectAsStateWithLifecycle()
165
+ LaunchedEffect(Unit) {
166
+ viewModel.events.collect { event -> /* handle navigation */ }
167
+ }
168
+ [Screen]Content(uiState = uiState, onAction = viewModel::onAction)
169
+ }
170
+ ```
171
+
172
+ ### 3.6: Integration Test ⭐
173
+ - [ ] API calls succeed, data displays
174
+ - [ ] Loading/error states work
175
+ - [ ] Navigation correct
176
+ - [ ] Crypto output matches (if applicable)
177
+
178
+ ### 🔒 Crypto Utils (Special)
179
+ If crypto involved: implement + unit test IMMEDIATELY with known pairs.
180
+ > ⚠️ MUST produce identical output.
181
+
182
+ ### ✅ Feature Checkpoint
183
+
184
+ ```markdown
185
+ ## ✅ Feature Complete: [Name]
186
+ Files: [list] | Resources: [count] | Tests: [status]
187
+ ⏭️ Next Feature: [Name] → Return to Phase 2
188
+ ```
189
+
190
+ ---
191
+
192
+ ## ✅ Phase 4: Final Parity Check (After ALL features)
193
+
194
+ ### Checklist
195
+ - [ ] API Parity — all endpoints match (headers, body, encoding)
196
+ - [ ] Data Parity — crypto/hash output identical
197
+ - [ ] UI Parity — screen-by-screen comparison
198
+ - [ ] Edge Cases — empty states, errors, offline, lifecycle
199
+ - [ ] Build: `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
200
+
201
+ ### 🎉 Final Summary
202
+
203
+ ```markdown
204
+ ## ✅ Reverse Engineering Complete!
205
+ - Screens: [N] | Features: [N]
206
+ - Libs reused: [N] | Replaced: [N]
207
+ - Tests: [pass/fail] | Lint: [warnings]
208
+
209
+ ⏭️ Next: /test → /deploy → /code-janitor
210
+ ```
211
+
212
+ ---
213
+
214
+ ## 🔗 Related
215
+
216
+ - **Parent:** [`/reverse-android`](reverse-android.md)
217
+ - **Previous:** [`/re-android-design`](reverse-android-design.md) (Phase 1)
218
+ - **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
219
+
220
+ ---
221
+
222
+ *re-android-build v4.0.0 — UI-First Blueprint + Build*
@@ -0,0 +1,139 @@
1
+ ---
2
+ description: 🏗️ RE Android Phase 1 — Architecture Design (NO CODE BODIES)
3
+ parent: reverse-android
4
+ ---
5
+
6
+ # /re-android-design — Architecture Blueprint
7
+
8
+ > **Parent:** [`/reverse-android`](reverse-android.md) → Phase 1
9
+ > **Prerequisite:** Completed App Map from [`/re-android-discover`](reverse-android-discover.md)
10
+ > **Skill:** `smali-to-kotlin` → `phase-1-architecture.md`
11
+ > **Zoom Level:** 1 — District View
12
+ > **Output:** Architecture Blueprint (diagrams, tables, NO CODE BODIES)
13
+
14
+ ---
15
+
16
+ ## ⛔ ZOOM 1 RULE
17
+
18
+ ```
19
+ This workflow produces NO CODE BODIES.
20
+ Allowed: Architecture diagrams, layer maps, feature tables, file paths, API endpoint lists.
21
+ Allowed: build.gradle.kts plugin/dependency declarations (declaration only).
22
+ If you are about to write a function body → STOP → wrong zoom level.
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 📐 Step 1: Layer Design
28
+
29
+ Design Clean Architecture layers based on App Map:
30
+
31
+ ```
32
+ ┌─────────────────────────────────────┐
33
+ │ Presentation │
34
+ │ ├── screens/ ([N] screens) │
35
+ │ ├── navigation/ (NavGraph + Routes) │
36
+ │ ├── theme/ (Material 3) │
37
+ │ └── components/ (Shared UI) │
38
+ ├─────────────────────────────────────┤
39
+ │ Domain │
40
+ │ ├── model/ ([N] models) │
41
+ │ ├── repository/ ([N] interfaces) │
42
+ │ └── usecase/ ([N] use cases) │
43
+ ├─────────────────────────────────────┤
44
+ │ Data │
45
+ │ ├── remote/ ([N] API services) │
46
+ │ ├── local/ (Room, DataStore) │
47
+ │ └── repository/ (implementations) │
48
+ ├─────────────────────────────────────┤
49
+ │ DI (Hilt) │
50
+ │ └── modules/ (Network, DB, Repo) │
51
+ └─────────────────────────────────────┘
52
+ ```
53
+
54
+ ## 📋 Step 2: Feature → File Mapping
55
+
56
+ Map mỗi feature tới Clean Architecture components:
57
+
58
+ | Feature | Domain Model | Repository | UseCase | Screen(s) | ViewModel |
59
+ |---------|-------------|-----------|---------|-----------|-----------|
60
+
61
+ ## 🌐 Step 3: API Endpoint Inventory
62
+
63
+ Trích xuất TẤT CẢ API endpoints từ Smali:
64
+
65
+ | # | Method | Endpoint | Auth | Notes |
66
+ |---|--------|----------|------|-------|
67
+
68
+ **Base URL:** `[from Smali const-string]`
69
+
70
+ ## 💾 Step 4: Data Schema
71
+
72
+ | Model | Key Fields | Source | Storage |
73
+ |-------|-----------|--------|---------|
74
+
75
+ ## 📁 Step 5: Project Structure
76
+
77
+ ```
78
+ app/src/main/java/[package]/
79
+ ├── App.kt
80
+ ├── di/
81
+ ├── data/remote/ + data/local/ + data/repository/
82
+ ├── domain/model/ + domain/repository/ + domain/usecase/
83
+ ├── presentation/navigation/ + screens/ + theme/
84
+ └── util/
85
+ ```
86
+
87
+ ## 🔢 Step 6: Build Order (UI-First) ⭐
88
+
89
+ | # | Phase | Scope | Complexity |
90
+ |---|-------|-------|-----------|
91
+ | 1 | 🟢 Foundation | Project + DI skeleton + Theme/Design System | Low |
92
+ | 2 | 🟢 Navigation | Routes, tab bar, NavGraph | Low |
93
+ | 3 | 🔵 Per Feature | Blueprint (contracts) + UI Shell (visual) | Medium |
94
+ | 4 | 🚦 UI Gate | User approves UI before logic | — |
95
+ | 5 | 🟡 Per Feature | Logic Build (Domain → Data → VM → Wire UI) | High |
96
+ | 6 | 📦 SDKs | Third-party SDK + Native libs integration | Medium |
97
+ | N | 🔴 Final | Full Parity Check | High |
98
+
99
+ > **UI-First:** Design and approve UI before coding logic for each feature.
100
+
101
+ ## 🔧 Step 7: Tech Stack Confirmation
102
+
103
+ | Decision | Choice | Rationale |
104
+ |----------|--------|-----------|
105
+ | UI | Jetpack Compose + M3 | Modern |
106
+ | DI | Hilt | Standard |
107
+ | ... | ... | ... |
108
+
109
+ ---
110
+
111
+ ## 📊 Output: Architecture Blueprint
112
+
113
+ Sử dụng template từ `skills/smali-to-kotlin/templates/architecture.md`.
114
+
115
+ ---
116
+
117
+ ## ✅ Gate: Chuyển sang Phase 2
118
+
119
+ ```
120
+ "🏗️ Architecture Blueprint xong!
121
+ Anh muốn bắt đầu từ feature nào?
122
+ Em suggest: [Feature X] vì [reason]."
123
+
124
+ → User picks feature → /re-android-build (Phase 2: Blueprint for that feature)
125
+ → User wants changes → adjust architecture
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 🔗 Related
131
+
132
+ - **Previous:** [`/re-android-discover`](reverse-android-discover.md) (Phase 0)
133
+ - **Next:** [`/re-android-build`](reverse-android-build.md) (Phase 2+3)
134
+ - **Parent:** [`/reverse-android`](reverse-android.md)
135
+ - **Skill:** `skills/smali-to-kotlin/phase-1-architecture.md`
136
+
137
+ ---
138
+
139
+ *re-android-design v3.0.0 — Phase 1: Architecture Blueprint*