@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,312 @@
1
+ # 🔨 Phase 3: Logic Build (Per Feature) — iOS
2
+
3
+ > **Zoom Level:** 3 — Code Implementation
4
+ > **Goal:** Code logic behind the APPROVED UI shell for ONE feature.
5
+ > **Input:** Approved Blueprint + Working SwiftUI Shell from Phase 2.
6
+ > **Output:** Feature fully wired — UI + logic connected.
7
+
8
+ ---
9
+
10
+ ## ✅ PREREQUISITES
11
+
12
+ Before writing ANY logic code, confirm:
13
+ - [ ] Phase 0 App Map: approved
14
+ - [ ] Phase 1 Architecture Blueprint: approved
15
+ - [ ] Phase 2 Contracts: approved for THIS feature
16
+ - [ ] Phase 2 UI Shell: approved, runs in Preview/Simulator
17
+
18
+ > ⚠️ If UI is not approved yet, STOP. Go back to Phase 2.
19
+
20
+ ---
21
+
22
+ ## 📋 Implementation Order
23
+
24
+ ### 3.1: Domain Layer
25
+
26
+ Implement from contracts defined in Phase 2:
27
+
28
+ 1. **Models** — structs (already drafted in 2.2, create actual files)
29
+ 2. **Repository protocols** — (already drafted in 2.3, create files)
30
+ 3. **UseCases** — implement execute() with repository calls
31
+
32
+ ```swift
33
+ struct LoginUseCase {
34
+ private let authRepo: AuthRepository
35
+
36
+ func execute(email: String, password: String) async throws -> User {
37
+ try await authRepo.login(email: email, password: password)
38
+ }
39
+ }
40
+ ```
41
+
42
+ ### 3.2: Data Layer
43
+
44
+ 1. **DTOs** — Codable structs matching API JSON
45
+ 2. **API Client** — async URLSession with proper error handling
46
+ 3. **SwiftData @Model** classes (if applicable)
47
+ 4. **Keychain / UserDefaults** wrappers (if applicable)
48
+ 5. **Repository implementation** — offline-first pattern
49
+
50
+ ```swift
51
+ final class AuthRepositoryImpl: AuthRepository {
52
+ private let apiClient: APIClient
53
+ private let tokenStore: TokenStore
54
+
55
+ func login(email: String, password: String) async throws -> User {
56
+ let dto = try await apiClient.request(
57
+ AuthEndpoint.login(email: email, password: password),
58
+ responseType: LoginResponseDTO.self
59
+ )
60
+ await tokenStore.save(dto.accessToken)
61
+ return dto.user.toDomain()
62
+ }
63
+
64
+ func isLoggedIn() -> Bool {
65
+ tokenStore.hasToken
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### 3.3: DI Container
71
+
72
+ ```swift
73
+ @MainActor
74
+ final class AppContainer {
75
+ // Singletons
76
+ lazy var apiClient = APIClient(baseURL: Config.apiBaseURL)
77
+ lazy var tokenStore = TokenStore()
78
+
79
+ // Repositories
80
+ lazy var authRepository: AuthRepository = AuthRepositoryImpl(
81
+ apiClient: apiClient,
82
+ tokenStore: tokenStore
83
+ )
84
+
85
+ // UseCases
86
+ func makeLoginUseCase() -> LoginUseCase {
87
+ LoginUseCase(authRepo: authRepository)
88
+ }
89
+
90
+ // ViewModels
91
+ func makeLoginViewModel() -> LoginViewModel {
92
+ LoginViewModel(loginUseCase: makeLoginUseCase())
93
+ }
94
+ }
95
+ ```
96
+
97
+ ### 3.4: ViewModel
98
+
99
+ Implement using ViewState + Events + Actions from Phase 2.6:
100
+
101
+ ```swift
102
+ @Observable
103
+ final class LoginViewModel {
104
+ var state = LoginViewState()
105
+
106
+ private let loginUseCase: LoginUseCase
107
+ private var onEvent: ((LoginEvent) -> Void)?
108
+
109
+ init(loginUseCase: LoginUseCase) {
110
+ self.loginUseCase = loginUseCase
111
+ }
112
+
113
+ func setEventHandler(_ handler: @escaping (LoginEvent) -> Void) {
114
+ self.onEvent = handler
115
+ }
116
+
117
+ func handle(_ action: LoginAction) {
118
+ switch action {
119
+ case .updateEmail(let email):
120
+ state.email = email
121
+ case .updatePassword(let password):
122
+ state.password = password
123
+ case .togglePasswordVisibility:
124
+ state.isPasswordVisible.toggle()
125
+ case .submit:
126
+ login()
127
+ }
128
+ }
129
+
130
+ private func login() {
131
+ state.isLoading = true
132
+ state.error = nil
133
+ Task {
134
+ do {
135
+ let _ = try await loginUseCase.execute(
136
+ email: state.email,
137
+ password: state.password
138
+ )
139
+ state.isLoading = false
140
+ onEvent?(.navigateToHome)
141
+ } catch {
142
+ state.isLoading = false
143
+ state.error = error.localizedDescription
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ ### 3.5: Wire UI ↔ Logic ⭐ (NOT "code new UI")
151
+
152
+ > **This step does NOT create new UI.** The UI already exists from Phase 2.8.
153
+ > Only CONNECT the existing UI shell to the real ViewModel.
154
+
155
+ **Changes needed on the UI shell:**
156
+
157
+ ```swift
158
+ // Phase 2 code stays as the STATELESS "Content" view (for Preview):
159
+ struct LoginScreenContent: View {
160
+ var state: LoginViewState = .normal
161
+ var onAction: (LoginAction) -> Void = { _ in }
162
+
163
+ var body: some View {
164
+ // ... all UI code from Phase 2.8 — DO NOT MODIFY
165
+ }
166
+ }
167
+
168
+ // Previews still work:
169
+ #Preview("Normal") { LoginScreenContent(state: .normal) }
170
+ #Preview("Loading") { LoginScreenContent(state: .loading) }
171
+
172
+ // ADD a NEW wrapper that wires ViewModel:
173
+ struct LoginScreen: View {
174
+ @State private var viewModel: LoginViewModel
175
+ var onNavigateToHome: () -> Void
176
+
177
+ init(container: AppContainer, onNavigateToHome: @escaping () -> Void) {
178
+ _viewModel = State(initialValue: container.makeLoginViewModel())
179
+ self.onNavigateToHome = onNavigateToHome
180
+ }
181
+
182
+ var body: some View {
183
+ LoginScreenContent(
184
+ state: viewModel.state,
185
+ onAction: viewModel.handle
186
+ )
187
+ .onAppear {
188
+ viewModel.setEventHandler { event in
189
+ switch event {
190
+ case .navigateToHome:
191
+ onNavigateToHome()
192
+ case .showError(let msg):
193
+ // handle
194
+ break
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ **Wire Checklist:**
203
+ - [ ] Wrapper view injects ViewModel from DI container
204
+ - [ ] State bindings: ViewModel.state → Content view
205
+ - [ ] Action bindings: Content onAction → ViewModel.handle()
206
+ - [ ] Event handling: navigation, alerts
207
+ - [ ] Previews still work (they use the stateless Content view)
208
+
209
+ ### 3.6: Integration Test ⭐
210
+
211
+ Verify UI + logic end-to-end:
212
+
213
+ ```markdown
214
+ ### 🧪 Integration: [Feature]
215
+
216
+ Functional:
217
+ - [ ] API calls succeed, data displays on UI
218
+ - [ ] Loading state shows/hides at right time
219
+ - [ ] Error state displays correct message
220
+ - [ ] Navigation works as expected
221
+ - [ ] Form validation works
222
+
223
+ Data:
224
+ - [ ] Request format matches original app
225
+ - [ ] Response parses correctly
226
+ - [ ] Token/session stored properly
227
+ - [ ] Crypto output matches original (if applicable)
228
+
229
+ Edge Cases:
230
+ - [ ] Empty input handling
231
+ - [ ] Network error handling
232
+ - [ ] Back navigation
233
+ - [ ] App backgrounding/foregrounding
234
+ ```
235
+
236
+ ---
237
+
238
+ ## 🔒 CRYPTO UTILS (Special Handling)
239
+
240
+ If the feature involves encryption/hashing:
241
+
242
+ 1. Read disassembly carefully — exact algorithm, padding, encoding
243
+ 2. Implement in Swift — preserve exact input/output
244
+ 3. Unit test IMMEDIATELY with known pairs
245
+
246
+ ```swift
247
+ import CryptoKit
248
+ import CommonCrypto
249
+
250
+ enum CryptoUtils {
251
+ static func md5Hash(_ input: String) -> String {
252
+ let data = Data(input.utf8)
253
+ var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH))
254
+ data.withUnsafeBytes { CC_MD5($0.baseAddress, CC_LONG(data.count), &digest) }
255
+ return digest.map { String(format: "%02x", $0) }.joined()
256
+ }
257
+ }
258
+
259
+ // MANDATORY test
260
+ final class CryptoUtilsTests: XCTestCase {
261
+ func testMD5MatchesOriginal() {
262
+ XCTAssertEqual("expected_hash", CryptoUtils.md5Hash("known_input"))
263
+ }
264
+ }
265
+ ```
266
+
267
+ > ⚠️ Crypto functions MUST produce identical output. Any mismatch breaks server communication.
268
+
269
+ ---
270
+
271
+ ## ✅ Checkpoint
272
+
273
+ ```markdown
274
+ ## ✅ Feature Complete: [Feature Name]
275
+
276
+ ### Files created:
277
+ - Domain/Models/User.swift
278
+ - Domain/Repositories/AuthRepository.swift
279
+ - Domain/UseCases/LoginUseCase.swift
280
+ - Data/Network/Endpoints/AuthEndpoint.swift
281
+ - Data/Network/DTOs/LoginRequestDTO.swift, LoginResponseDTO.swift
282
+ - Data/Repositories/AuthRepositoryImpl.swift
283
+ - DI/AppContainer.swift (updated)
284
+ - Presentation/Screens/Auth/LoginViewModel.swift
285
+ - Presentation/Screens/Auth/LoginScreen.swift ← wired (from Phase 2)
286
+
287
+ ### Tests:
288
+ - [ ] Crypto utils verified (if applicable)
289
+ - [ ] API contract matches original
290
+ - [ ] UI + Logic e2e works
291
+
292
+ ### ⏭️ Next Feature: [Name]
293
+ → Return to Phase 2 (Blueprint + UI Design)
294
+ ```
295
+
296
+ ---
297
+
298
+ ## 🔄 Feature Loop
299
+
300
+ ```
301
+ Phase 2 (Blueprint + UI for Feature X) → GATE → Phase 3 (Logic for X) → Checkpoint
302
+
303
+ Phase 2 (Blueprint + UI for Feature Y) → GATE → Phase 3 (Logic for Y) → Checkpoint
304
+
305
+ ... (repeat for all features from Architecture Build Order)
306
+
307
+ Phase 4: Final Parity Check & Quality Gate
308
+ ```
309
+
310
+ ---
311
+
312
+ *Phase 3: Logic Build — Wire logic behind approved UI*
@@ -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