@leejungkiin/awkit 1.0.7 → 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/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
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# 🔨 Phase 3: Implementation (Ground View — per feature) — iOS
|
|
2
|
+
|
|
3
|
+
> **Zoom Level:** 3 — Code Implementation
|
|
4
|
+
> **Goal:** Write actual, production-quality Swift code for ONE feature.
|
|
5
|
+
> **Input:** Approved Blueprint from Phase 2.
|
|
6
|
+
> **Output:** Complete implementation files.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ✅ PREREQUISITES
|
|
11
|
+
|
|
12
|
+
Before writing ANY code, confirm:
|
|
13
|
+
- [ ] Phase 0 App Map approved
|
|
14
|
+
- [ ] Phase 1 Architecture Blueprint approved
|
|
15
|
+
- [ ] Phase 2 Feature Blueprint approved for THIS feature
|
|
16
|
+
- [ ] All contracts (protocols, models, state) defined in Blueprint
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📋 Implementation Order (per feature)
|
|
21
|
+
|
|
22
|
+
### 3.1: Domain Layer
|
|
23
|
+
|
|
24
|
+
1. **Models** — Codable structs from Blueprint 2.2
|
|
25
|
+
2. **Repository protocols** — from Blueprint 2.3
|
|
26
|
+
3. **UseCases** — implement with repository calls
|
|
27
|
+
|
|
28
|
+
```swift
|
|
29
|
+
struct LoginUseCase: Sendable {
|
|
30
|
+
let authRepository: AuthRepository
|
|
31
|
+
|
|
32
|
+
func execute(email: String, password: String) async throws -> User {
|
|
33
|
+
try await authRepository.login(email: email, password: password)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 3.2: Data Layer
|
|
39
|
+
|
|
40
|
+
1. **DTOs** — Codable structs matching API JSON
|
|
41
|
+
2. **Endpoint definitions** — enum with path/method
|
|
42
|
+
3. **APIClient** — URLSession async/await wrapper
|
|
43
|
+
4. **SwiftData models** (if applicable)
|
|
44
|
+
5. **Repository implementation** — offline-first
|
|
45
|
+
|
|
46
|
+
```swift
|
|
47
|
+
final class AuthRepositoryImpl: AuthRepository, Sendable {
|
|
48
|
+
private let apiClient: APIClient
|
|
49
|
+
private let tokenStore: TokenStore
|
|
50
|
+
|
|
51
|
+
func login(email: String, password: String) async throws -> User {
|
|
52
|
+
let response: LoginResponse = try await apiClient.request(
|
|
53
|
+
.login(email: email, password: password)
|
|
54
|
+
)
|
|
55
|
+
await tokenStore.save(response.accessToken)
|
|
56
|
+
return response.user.toDomain()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var isLoggedIn: AsyncStream<Bool> {
|
|
60
|
+
tokenStore.tokenStream.map { !$0.isEmpty }.eraseToStream()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3.3: DI Container
|
|
66
|
+
|
|
67
|
+
```swift
|
|
68
|
+
@MainActor
|
|
69
|
+
final class AppContainer: Observable {
|
|
70
|
+
private let apiClient: APIClient
|
|
71
|
+
|
|
72
|
+
lazy var authRepository: AuthRepository = AuthRepositoryImpl(
|
|
73
|
+
apiClient: apiClient,
|
|
74
|
+
tokenStore: tokenStore
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
lazy var loginUseCase = LoginUseCase(authRepository: authRepository)
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 3.4: ViewModel
|
|
82
|
+
|
|
83
|
+
@Observable with properties from Blueprint:
|
|
84
|
+
|
|
85
|
+
```swift
|
|
86
|
+
@Observable
|
|
87
|
+
final class LoginViewModel {
|
|
88
|
+
var email = ""
|
|
89
|
+
var password = ""
|
|
90
|
+
var isLoading = false
|
|
91
|
+
var showError = false
|
|
92
|
+
var errorMessage = ""
|
|
93
|
+
var isPasswordVisible = false
|
|
94
|
+
|
|
95
|
+
private let loginUseCase: LoginUseCase
|
|
96
|
+
|
|
97
|
+
init(loginUseCase: LoginUseCase) {
|
|
98
|
+
self.loginUseCase = loginUseCase
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
func login() async {
|
|
102
|
+
isLoading = true
|
|
103
|
+
defer { isLoading = false }
|
|
104
|
+
|
|
105
|
+
do {
|
|
106
|
+
let user = try await loginUseCase.execute(email: email, password: password)
|
|
107
|
+
// Navigation handled by parent
|
|
108
|
+
} catch {
|
|
109
|
+
errorMessage = error.localizedDescription
|
|
110
|
+
showError = true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3.5: SwiftUI Screen
|
|
117
|
+
|
|
118
|
+
```swift
|
|
119
|
+
struct LoginScreen: View {
|
|
120
|
+
@State private var viewModel: LoginViewModel
|
|
121
|
+
var onLoginSuccess: (User) -> Void
|
|
122
|
+
|
|
123
|
+
init(loginUseCase: LoginUseCase, onLoginSuccess: @escaping (User) -> Void) {
|
|
124
|
+
_viewModel = State(initialValue: LoginViewModel(loginUseCase: loginUseCase))
|
|
125
|
+
self.onLoginSuccess = onLoginSuccess
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var body: some View {
|
|
129
|
+
ScrollView {
|
|
130
|
+
VStack(spacing: 24) {
|
|
131
|
+
// Logo
|
|
132
|
+
// Email TextField
|
|
133
|
+
TextField("Email", text: $viewModel.email)
|
|
134
|
+
.textContentType(.emailAddress)
|
|
135
|
+
.keyboardType(.emailAddress)
|
|
136
|
+
.textFieldStyle(.roundedBorder)
|
|
137
|
+
|
|
138
|
+
// Password SecureField
|
|
139
|
+
// Login Button
|
|
140
|
+
Button("Login") {
|
|
141
|
+
Task { await viewModel.login() }
|
|
142
|
+
}
|
|
143
|
+
.buttonStyle(.borderedProminent)
|
|
144
|
+
.disabled(viewModel.isLoading)
|
|
145
|
+
}
|
|
146
|
+
.padding(24)
|
|
147
|
+
}
|
|
148
|
+
.overlay { if viewModel.isLoading { ProgressView() } }
|
|
149
|
+
.alert("Error", isPresented: $viewModel.showError) {
|
|
150
|
+
Button("OK") {}
|
|
151
|
+
} message: {
|
|
152
|
+
Text(viewModel.errorMessage)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 3.6: Resource Extraction (On-Demand)
|
|
159
|
+
|
|
160
|
+
**ONLY** extract resources used by this screen:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Images from Assets.car (use assetutil)
|
|
164
|
+
# Strings from Localizable.strings for this VC
|
|
165
|
+
# Colors referenced in storyboard for this screen
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🔒 CRYPTO UTILS (Special Handling)
|
|
171
|
+
|
|
172
|
+
If the feature involves encryption/hashing:
|
|
173
|
+
|
|
174
|
+
```swift
|
|
175
|
+
import CryptoKit
|
|
176
|
+
import CommonCrypto
|
|
177
|
+
|
|
178
|
+
enum CryptoUtils {
|
|
179
|
+
static func md5(_ input: String) -> String {
|
|
180
|
+
let data = Data(input.utf8)
|
|
181
|
+
var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH))
|
|
182
|
+
data.withUnsafeBytes { CC_MD5($0.baseAddress, CC_LONG(data.count), &digest) }
|
|
183
|
+
return digest.map { String(format: "%02x", $0) }.joined()
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
static func sha256(_ input: String) -> String {
|
|
187
|
+
SHA256.hash(data: Data(input.utf8))
|
|
188
|
+
.compactMap { String(format: "%02x", $0) }.joined()
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// XCTest (mandatory)
|
|
193
|
+
final class CryptoUtilsTests: XCTestCase {
|
|
194
|
+
func testMD5MatchesOriginal() {
|
|
195
|
+
XCTAssertEqual(CryptoUtils.md5("test"), "098f6bcd4621d373cade4e832627b4f6")
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
> ⚠️ Crypto functions MUST produce identical output. Test with known pairs from original app.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## ✅ Checkpoint (After each feature)
|
|
205
|
+
|
|
206
|
+
```markdown
|
|
207
|
+
## ✅ Feature Complete: [Feature Name]
|
|
208
|
+
|
|
209
|
+
### Files created:
|
|
210
|
+
- Domain/Models/User.swift
|
|
211
|
+
- Domain/Repositories/AuthRepository.swift
|
|
212
|
+
- Domain/UseCases/LoginUseCase.swift
|
|
213
|
+
- Data/Network/Endpoints/AuthEndpoint.swift
|
|
214
|
+
- Data/Network/DTOs/LoginRequest.swift, LoginResponse.swift
|
|
215
|
+
- Data/Repositories/AuthRepositoryImpl.swift
|
|
216
|
+
- Presentation/Screens/Auth/LoginScreen.swift
|
|
217
|
+
- Presentation/Screens/Auth/LoginViewModel.swift
|
|
218
|
+
|
|
219
|
+
### Resources extracted:
|
|
220
|
+
- [only what was needed]
|
|
221
|
+
|
|
222
|
+
### Tests:
|
|
223
|
+
- [ ] Crypto utils verified
|
|
224
|
+
- [ ] API contract matches original
|
|
225
|
+
|
|
226
|
+
### ⏭️ Next Feature: [Name]
|
|
227
|
+
→ Return to Phase 2 (Blueprint)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🔄 Loop
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
Phase 2 (Blueprint Feature X) → Phase 3 (Build Feature X) → Checkpoint
|
|
236
|
+
↓
|
|
237
|
+
Phase 2 (Blueprint Feature Y) → Phase 3 (Build Feature Y) → Checkpoint
|
|
238
|
+
↓
|
|
239
|
+
... → Final Parity Check
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## ✅ Final Parity Check
|
|
245
|
+
|
|
246
|
+
1. **API Parity** — all endpoints match
|
|
247
|
+
2. **Data Parity** — crypto output identical
|
|
248
|
+
3. **UI Parity** — screen comparison
|
|
249
|
+
4. **Build & Test:**
|
|
250
|
+
```bash
|
|
251
|
+
xcodebuild -scheme App -destination 'generic/platform=iOS' build
|
|
252
|
+
xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 16' test
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
*Phase 3: Implementation — One feature at a time, guided by Blueprint*
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 🗺️ App Map: [App Name] (iOS)
|
|
2
|
+
|
|
3
|
+
**Generated:** [Date]
|
|
4
|
+
**Source:** [Decrypted .app bundle path]
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 📱 Identity
|
|
9
|
+
|
|
10
|
+
| Property | Value |
|
|
11
|
+
|----------|-------|
|
|
12
|
+
| Bundle ID | [com.example.app] |
|
|
13
|
+
| App Name | [Display Name] |
|
|
14
|
+
| Min iOS | [value] |
|
|
15
|
+
| ViewControllers | [count] |
|
|
16
|
+
| Frameworks | [count] embedded |
|
|
17
|
+
| Capabilities | [push, apple pay, etc.] |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🧭 Screen Flow
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
graph LR
|
|
25
|
+
Launch --> Login
|
|
26
|
+
Login --> MainTab
|
|
27
|
+
MainTab --> Home
|
|
28
|
+
MainTab --> Tab2
|
|
29
|
+
MainTab --> Tab3
|
|
30
|
+
Home --> Detail
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📦 Framework Landscape
|
|
36
|
+
|
|
37
|
+
### ✅ Reuse (add via SPM)
|
|
38
|
+
| Framework | Detected | Latest Version | Action |
|
|
39
|
+
|-----------|----------|----------------|--------|
|
|
40
|
+
|
|
41
|
+
### 🔄 Replace (legacy → modern Swift)
|
|
42
|
+
| Old Framework | Detected | Modern Replacement |
|
|
43
|
+
|---------------|----------|-------------------|
|
|
44
|
+
|
|
45
|
+
### 🍏 Apple Frameworks
|
|
46
|
+
| Framework | Purpose | SwiftUI Equivalent |
|
|
47
|
+
|-----------|---------|--------------------|
|
|
48
|
+
|
|
49
|
+
### 📱 Native Libraries
|
|
50
|
+
| File | Notes |
|
|
51
|
+
|------|-------|
|
|
52
|
+
|
|
53
|
+
### 🏷️ App Code (rebuild in Swift)
|
|
54
|
+
| Class Prefix | Estimated Module |
|
|
55
|
+
|-------------|-----------------|
|
|
56
|
+
|
|
57
|
+
### ❓ Unknown
|
|
58
|
+
| Framework | Notes |
|
|
59
|
+
|-----------|-------|
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📊 Complexity Estimate
|
|
64
|
+
|
|
65
|
+
| Area | Rating | Notes |
|
|
66
|
+
|------|--------|-------|
|
|
67
|
+
| Data Layer | ●●●○○ | [N] APIs, [N] local DB, keychain |
|
|
68
|
+
| Core Logic | ●●○○○ | [N] crypto, [N] formatters |
|
|
69
|
+
| UI Screens | ●●●●○ | [N] screens, [N] complex |
|
|
70
|
+
| SDK Integration | ●●○○○ | [N] frameworks, [N] native |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 🔍 Key Observations
|
|
75
|
+
|
|
76
|
+
- [Notable patterns]
|
|
77
|
+
- [Security observations]
|
|
78
|
+
- [Risks]
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
> **Next:** Review map → Phase 1 (Architecture)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# 🏗️ Architecture Blueprint: [App Name] (iOS)
|
|
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/ (NavigationStack) │
|
|
15
|
+
│ ├── Theme/ (AppTheme) │
|
|
16
|
+
│ └── Components/ (Shared Views) │
|
|
17
|
+
├─────────────────────────────────────┤
|
|
18
|
+
│ Domain │
|
|
19
|
+
│ ├── Models/ ([N] business models) │
|
|
20
|
+
│ ├── Repositories/ ([N] protocols) │
|
|
21
|
+
│ └── UseCases/ ([N] use cases) │
|
|
22
|
+
├─────────────────────────────────────┤
|
|
23
|
+
│ Data │
|
|
24
|
+
│ ├── Network/ (APIClient) │
|
|
25
|
+
│ ├── Local/ (SwiftData, Keychain) │
|
|
26
|
+
│ └── Repositories/ (impls) │
|
|
27
|
+
├─────────────────────────────────────┤
|
|
28
|
+
│ DI │
|
|
29
|
+
│ └── AppContainer.swift │
|
|
30
|
+
└─────────────────────────────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🗂️ Feature → File Mapping
|
|
36
|
+
|
|
37
|
+
| Feature | Domain Model | Repository | UseCase | Screen(s) | ViewModel |
|
|
38
|
+
|---------|-------------|-----------|---------|-----------|-----------|
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 🌐 API Endpoints
|
|
43
|
+
|
|
44
|
+
| # | Method | Endpoint | Auth | Notes |
|
|
45
|
+
|---|--------|----------|------|-------|
|
|
46
|
+
|
|
47
|
+
**Base URL:** `[extracted]`
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 💾 Data Schema
|
|
52
|
+
|
|
53
|
+
| Model | Key Fields | Source | Storage |
|
|
54
|
+
|-------|-----------|--------|---------|
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 📁 Xcode Project Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
App/
|
|
62
|
+
├── App.swift
|
|
63
|
+
├── AppDelegate.swift
|
|
64
|
+
├── DI/AppContainer.swift
|
|
65
|
+
├── Data/Network/
|
|
66
|
+
├── Data/Local/
|
|
67
|
+
├── Data/Repositories/
|
|
68
|
+
├── Domain/Models/
|
|
69
|
+
├── Domain/Repositories/
|
|
70
|
+
├── Domain/UseCases/
|
|
71
|
+
├── Presentation/Navigation/
|
|
72
|
+
├── Presentation/Theme/
|
|
73
|
+
├── Presentation/Components/
|
|
74
|
+
├── Presentation/Screens/
|
|
75
|
+
├── Utilities/
|
|
76
|
+
└── Resources/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 🔢 Build Order
|
|
82
|
+
|
|
83
|
+
| # | Phase | Scope | Complexity |
|
|
84
|
+
|---|-------|-------|-----------|
|
|
85
|
+
|
|
86
|
+
**Suggested first feature:** [Name] — because [reason]
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 🔧 Tech Decisions
|
|
91
|
+
|
|
92
|
+
| Decision | Choice | Rationale |
|
|
93
|
+
|----------|--------|-----------|
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
> **Next:** Pick feature → Phase 2 (Blueprint)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 📐 Feature Blueprint: [Feature Name] (iOS)
|
|
2
|
+
|
|
3
|
+
**Generated:** [Date]
|
|
4
|
+
**Architecture:** [App Name]
|
|
5
|
+
**Feature:** [Feature Name]
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🔍 Header/Disassembly Analysis
|
|
10
|
+
|
|
11
|
+
| Item | Value |
|
|
12
|
+
|------|-------|
|
|
13
|
+
| Headers analyzed | [list] |
|
|
14
|
+
| Classes found | [count] |
|
|
15
|
+
| API calls detected | [count] |
|
|
16
|
+
| Delegate patterns | [count] |
|
|
17
|
+
|
|
18
|
+
### Key Observations
|
|
19
|
+
- [Pattern 1]
|
|
20
|
+
- [Pattern 2]
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📦 Domain Models
|
|
25
|
+
|
|
26
|
+
```swift
|
|
27
|
+
struct [Model]: Codable, Identifiable, Sendable {
|
|
28
|
+
let field1: Type
|
|
29
|
+
// ...
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📡 Repository Protocol
|
|
36
|
+
|
|
37
|
+
```swift
|
|
38
|
+
protocol [Feature]Repository: Sendable {
|
|
39
|
+
func [method](...) async throws -> [Type]
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🧩 UseCase Signatures
|
|
46
|
+
|
|
47
|
+
```swift
|
|
48
|
+
struct [Action]UseCase: Sendable {
|
|
49
|
+
func execute(...) async throws -> [Type]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🎨 UI State Design
|
|
56
|
+
|
|
57
|
+
- ViewModel properties list
|
|
58
|
+
- User actions list
|
|
59
|
+
- Navigation events list
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🖼️ Screen Wireframe
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
┌────────────────────────┐
|
|
67
|
+
│ │
|
|
68
|
+
│ [Layout sketch] │
|
|
69
|
+
│ │
|
|
70
|
+
└────────────────────────┘
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 📁 Files to Create
|
|
76
|
+
|
|
77
|
+
| File | Layer | Type |
|
|
78
|
+
|------|-------|------|
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
> **Next:** Approve → Phase 3 (Implementation)
|
|
@@ -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 `awk 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
|