@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
@@ -1,180 +0,0 @@
1
- ---
2
- name: awf-context-help
3
- description: >-
4
- Context-aware help based on current workflow state. Keywords: help, what,
5
- how, confused, stuck, lost, guide, tutorial, explain.
6
- Activates on /help or when user asks questions.
7
- version: 1.0.0
8
- ---
9
-
10
- # AWF Context Help
11
-
12
- Trợ giúp thông minh dựa trên context hiện tại.
13
-
14
- ## Trigger Conditions
15
-
16
- **Activates when:**
17
- - User runs `/help`
18
- - User types "?", "giúp", "help", "làm sao"
19
- - User seems confused (repeated errors, long pause)
20
-
21
- ## Execution Logic
22
-
23
- ### Step 1: Read Context
24
-
25
- ```
26
- context = {}
27
-
28
- if exists(".brain/session.json"):
29
- context.workflow = session.working_on.feature
30
- context.task = session.working_on.task
31
- context.status = session.working_on.status
32
- context.pending = session.pending_tasks
33
-
34
- if exists(".brain/brain.json"):
35
- context.project = brain.project.name
36
- context.tech = brain.tech_stack
37
- ```
38
-
39
- ### Step 2: Detect State
40
-
41
- | State | Detection | Response |
42
- |-------|-----------|----------|
43
- | `no_project` | No .brain/ folder | Show onboarding |
44
- | `planning` | workflow contains "plan" | Planning help |
45
- | `coding` | workflow contains "code" | Coding help |
46
- | `debugging` | workflow contains "debug" | Debug help |
47
- | `deploying` | workflow contains "deploy" | Deploy help |
48
- | `stuck` | status = "blocked" or pending > 5 | Stuck help |
49
- | `idle` | No active workflow | General help |
50
-
51
- ### Step 3: Show Contextual Help
52
-
53
- ## Help Templates
54
-
55
- ### No Project State
56
- ```
57
- 🆕 Chưa có dự án
58
-
59
- Bạn có thể:
60
- 1. /brainstorm - Bàn ý tưởng trước
61
- 2. /init - Tạo dự án mới
62
- 3. Mô tả ý tưởng cho em nghe
63
-
64
- Em sẽ hướng dẫn từng bước!
65
- ```
66
-
67
- ### Planning State
68
- ```
69
- 📋 Đang lập kế hoạch: {context.workflow}
70
-
71
- Bạn có thể:
72
- 1. Tiếp tục plan hiện tại
73
- 2. /code - Bắt đầu code phase đầu tiên
74
- 3. Hỏi em về cách thiết kế
75
-
76
- 💡 Mẹo: Plan tốt = Code nhanh hơn!
77
- ```
78
-
79
- ### Coding State
80
- ```
81
- 💻 Đang code: {context.task}
82
- Status: {context.status}
83
-
84
- Bạn có thể:
85
- 1. Tiếp tục code
86
- 2. /test - Kiểm tra code vừa viết
87
- 3. /debug - Nếu gặp lỗi
88
- 4. /save-brain - Lưu tiến độ
89
-
90
- 💡 Pending tasks: {context.pending.length}
91
- ```
92
-
93
- ### Debugging State
94
- ```
95
- 🔧 Đang debug: {context.task}
96
-
97
- Bạn có thể:
98
- 1. Mô tả lỗi chi tiết hơn
99
- 2. Paste error message
100
- 3. /code - Quay lại code sau khi fix
101
-
102
- 💡 Mẹo: Copy paste lỗi giúp em hiểu nhanh hơn!
103
- ```
104
-
105
- ### Deploying State
106
- ```
107
- 🚀 Đang deploy: {context.workflow}
108
-
109
- Bạn có thể:
110
- 1. Tiếp tục deploy process
111
- 2. /rollback - Quay về bản trước nếu lỗi
112
- 3. Kiểm tra logs sau deploy
113
-
114
- ⚠️ Nhớ test kỹ trước khi deploy production!
115
- ```
116
-
117
- ### Stuck State
118
- ```
119
- 😅 Có vẻ bạn đang bị kẹt
120
-
121
- Thử những cách này:
122
- 1. /recap - Xem lại đang làm gì
123
- 2. /debug - Nếu có lỗi
124
- 3. Nghỉ 5 phút rồi quay lại
125
- 4. Hỏi em cụ thể vấn đề
126
-
127
- 💡 {context.pending.length} tasks đang chờ.
128
- Có thể tạm skip task khó, làm cái khác trước?
129
- ```
130
-
131
- ### Idle/General State
132
- ```
133
- 👋 Em có thể giúp gì?
134
-
135
- Lệnh phổ biến:
136
- ┌─────────────────────────────────────┐
137
- │ /next │ Gợi ý việc tiếp theo │
138
- │ /recap │ Nhớ lại context │
139
- │ /brainstorm │ Bàn ý tưởng mới │
140
- │ /plan │ Lập kế hoạch │
141
- │ /code │ Viết code │
142
- └─────────────────────────────────────┘
143
-
144
- Hoặc hỏi em bất cứ điều gì!
145
- ```
146
-
147
- ## Adaptive Language
148
-
149
- Help responses adapt to `technical_level`:
150
-
151
- **newbie:**
152
- - Dùng tiếng Việt thuần
153
- - Giải thích mọi khái niệm
154
- - Bước nhỏ, chi tiết
155
-
156
- **basic:**
157
- - Mix Việt-Anh
158
- - Giải thích term lần đầu
159
- - Bước vừa phải
160
-
161
- **technical:**
162
- - Dùng thuật ngữ chuẩn
163
- - Không cần giải thích
164
- - Tập trung action
165
-
166
- ## Fallback
167
-
168
- If context unreadable:
169
- ```
170
- 👋 Em ở đây giúp bạn!
171
-
172
- Gõ /next để em gợi ý việc cần làm,
173
- hoặc mô tả vấn đề cho em nghe.
174
- ```
175
-
176
- ## Performance
177
-
178
- - Context read: < 200ms
179
- - Response generation: Instant
180
- - No external API calls
@@ -1,153 +0,0 @@
1
- ---
2
- name: awf-error-translator
3
- description: >-
4
- Translate technical errors to human-friendly language. Keywords: error,
5
- translate, explain, help, fix, fail, broken, crash, bug.
6
- Activates on /debug, /code, /test when errors detected.
7
- version: 1.0.0
8
- ---
9
-
10
- # AWF Error Translator
11
-
12
- Dịch lỗi kỹ thuật sang ngôn ngữ đời thường cho non-tech users.
13
-
14
- ## Trigger Conditions
15
-
16
- **Post-hook for:** `/debug`, `/code`, `/test`
17
-
18
- **When:** Error message detected in output
19
-
20
- ## Execution Logic
21
-
22
- ### Step 1: Detect Error
23
-
24
- ```
25
- if output contains error patterns:
26
- → Activate translation
27
- else:
28
- → Skip (no error)
29
- ```
30
-
31
- ### Step 2: Match & Translate
32
-
33
- Match error against database, return human message + action.
34
-
35
- ### Step 3: Display
36
-
37
- ```
38
- ❌ Lỗi: [human message]
39
- 💡 Gợi ý: [action]
40
- ```
41
-
42
- ## Error Translation Database
43
-
44
- ### Database Errors
45
-
46
- | Pattern | Human Message | Action |
47
- |---------|---------------|--------|
48
- | `ECONNREFUSED` | Database chưa chạy | Khởi động PostgreSQL/MySQL |
49
- | `ETIMEDOUT` | Database phản hồi chậm quá | Kiểm tra kết nối mạng |
50
- | `ER_ACCESS_DENIED` | Sai mật khẩu database | Kiểm tra file .env |
51
- | `relation .* does not exist` | Bảng chưa tồn tại | Chạy migration: `/run migrate` |
52
- | `duplicate key` | Dữ liệu bị trùng | Kiểm tra unique constraint |
53
-
54
- ### JavaScript/TypeScript Errors
55
-
56
- | Pattern | Human Message | Action |
57
- |---------|---------------|--------|
58
- | `TypeError: Cannot read` | Đang đọc biến chưa có giá trị | Kiểm tra null/undefined |
59
- | `ReferenceError` | Dùng biến chưa khai báo | Kiểm tra tên biến |
60
- | `SyntaxError` | Code viết sai cú pháp | Kiểm tra dấu ngoặc, chấm phẩy |
61
- | `Maximum call stack` | Vòng lặp vô hạn | Kiểm tra điều kiện dừng |
62
- | `Cannot find module` | Thiếu package | Chạy `npm install` |
63
-
64
- ### Network Errors
65
-
66
- | Pattern | Human Message | Action |
67
- |---------|---------------|--------|
68
- | `fetch failed` | Không kết nối được server | Kiểm tra URL và internet |
69
- | `CORS` | Website chặn request | Cấu hình CORS trên server |
70
- | `ERR_CERT` | Chứng chỉ SSL lỗi | Dùng HTTP thay HTTPS (dev only) |
71
- | `timeout` | Request quá lâu | Tăng timeout hoặc kiểm tra server |
72
- | `ENOTFOUND` | Domain không tồn tại | Kiểm tra lại URL |
73
-
74
- ### Package Errors
75
-
76
- | Pattern | Human Message | Action |
77
- |---------|---------------|--------|
78
- | `npm ERR!` | Cài package bị lỗi | Xóa node_modules, cài lại |
79
- | `peer dep` | Phiên bản không tương thích | Cập nhật package.json |
80
- | `EACCES` | Không có quyền truy cập | Chạy với sudo hoặc sửa quyền |
81
- | `ENOSPC` | Hết dung lượng ổ đĩa | Dọn dẹp disk |
82
- | `gyp ERR!` | Lỗi build native module | Cài build tools |
83
-
84
- ### Test Errors
85
-
86
- | Pattern | Human Message | Action |
87
- |---------|---------------|--------|
88
- | `Expected .* but received` | Test thất bại - kết quả sai | Sửa code hoặc update test |
89
- | `Timeout` | Test chạy quá lâu | Tăng timeout hoặc optimize |
90
- | `before each hook` | Setup test bị lỗi | Kiểm tra beforeEach |
91
- | `snapshot` | UI thay đổi | Update snapshot nếu đúng |
92
- | `coverage` | Thiếu test coverage | Viết thêm test |
93
-
94
- ### Build Errors
95
-
96
- | Pattern | Human Message | Action |
97
- |---------|---------------|--------|
98
- | `tsc.*error` | Lỗi TypeScript | Sửa type errors |
99
- | `ESLint` | Code không đúng style | Chạy lint fix |
100
- | `Build failed` | Build thất bại | Đọc log chi tiết |
101
- | `Out of memory` | Hết RAM | Tăng memory limit |
102
- | `FATAL ERROR` | Lỗi nghiêm trọng | Restart và thử lại |
103
-
104
- ### Git Errors
105
-
106
- | Pattern | Human Message | Action |
107
- |---------|---------------|--------|
108
- | `conflict` | Code bị xung đột | Merge conflict manually |
109
- | `rejected` | Push bị từ chối | Pull trước khi push |
110
- | `detached HEAD` | Không ở branch nào | Checkout về branch |
111
- | `not a git repo` | Chưa init git | Chạy `git init` |
112
-
113
- ### Deploy Errors
114
-
115
- | Pattern | Human Message | Action |
116
- |---------|---------------|--------|
117
- | `502 Bad Gateway` | Server không phản hồi | Restart server |
118
- | `503 Service` | Server quá tải | Scale up resources |
119
- | `permission denied` | Không có quyền deploy | Kiểm tra credentials |
120
- | `quota exceeded` | Hết quota | Nâng cấp plan |
121
-
122
- ## Output Format
123
-
124
- ```
125
- 🔍 Translating error...
126
-
127
- ❌ Lỗi: [human_message]
128
- └─ Gốc: [original_error_snippet]
129
-
130
- 💡 Gợi ý: [action]
131
- └─ Hoặc chạy: /debug để tìm hiểu thêm
132
-
133
- ────────────────────────────────
134
- ```
135
-
136
- ## Fallback
137
-
138
- If no pattern matches:
139
- ```
140
- ❌ Lỗi: Có vấn đề xảy ra
141
- 💡 Gợi ý: Chạy /debug để em phân tích chi tiết
142
- ```
143
-
144
- ## Performance
145
-
146
- - Translation: < 100ms
147
- - Pattern matching: Simple regex
148
- - No external API calls
149
-
150
- ## Security
151
-
152
- - Sanitize error messages (remove credentials, paths)
153
- - Never expose sensitive info in translations
@@ -1,240 +0,0 @@
1
- ---
2
- name: awf-session-restore
3
- description: Auto-restore context from Beads + Brain on session start
4
- trigger: session_start
5
- ---
6
-
7
- # AWF Session Restore (v5.0 - Beads + Brain)
8
-
9
- > **Purpose:** Tự động khôi phục context khi user quay lại sau khi nghỉ.
10
-
11
- ---
12
-
13
- ## Trigger
14
-
15
- Skill này tự động chạy khi:
16
- - User mở session mới
17
- - User gõ `/recap`
18
- - AI detect context loss (conversation reset)
19
-
20
- ---
21
-
22
- ## Execution Flow
23
-
24
- ### 1. Multi-Source Context Check
25
-
26
- **Priority 1: Beads (Task State)**
27
- ```bash
28
- bd list --status in_progress
29
- ```
30
-
31
- **Output:**
32
- - Tasks đang làm dở
33
- - Tasks blocked
34
- - Tasks ready to start
35
-
36
- **Priority 2: Brain (Knowledge & Plans)**
37
- ```bash
38
- # Check active plans
39
- cat brain/active_plans.json
40
-
41
- # Check recent memories
42
- ls -lt brain/ | head -5
43
- ```
44
-
45
- **Output:**
46
- - Plan đang active
47
- - Phase hiện tại
48
- - Recent decisions/knowledge
49
-
50
- **Priority 3: Git (Code State)**
51
- ```bash
52
- git status
53
- git log -1
54
- ```
55
-
56
- **Output:**
57
- - Files đang thay đổi
58
- - Commit gần nhất
59
-
60
- ---
61
-
62
- ### 2. Context Synthesis
63
-
64
- Kết hợp 3 nguồn để tạo summary:
65
-
66
- ```markdown
67
- 🧠 **SESSION RESTORED**
68
-
69
- 📿 **Beads Context:**
70
- - In Progress: Task #123 "Implement Login API" (started 2h ago)
71
- - Blocked: Task #125 (waiting for #120)
72
- - Ready: 3 tasks
73
-
74
- 🧠 **Brain Context:**
75
- - Active Plan: plans/260130-1025-shopping-cart/
76
- - Current Phase: Phase 02 - Backend (50% complete)
77
- - Last Save: 30 minutes ago
78
-
79
- 📂 **Git Context:**
80
- - Changed Files: 3 files (src/api/auth/*.ts)
81
- - Last Commit: "feat: add user model" (1 hour ago)
82
-
83
- ➡️ **SUGGESTED NEXT STEP:**
84
- Continue task #123? `/codeExpert` or `/code`
85
- ```
86
-
87
- ---
88
-
89
- ### 3. Smart Suggestions
90
-
91
- Based on context, suggest appropriate action:
92
-
93
- **Case 1: Task In-Progress**
94
- ```
95
- ➡️ Tiếp tục task #123?
96
- `/codeExpert` (Fast) or `/code` (Guided)
97
- ```
98
-
99
- **Case 2: Task Blocked**
100
- ```
101
- ⚠️ Task #125 bị block bởi #120
102
-
103
- ➡️ Làm task #120 trước?
104
- `/codeExpert` or switch to another task
105
- ```
106
-
107
- **Case 3: No Active Task**
108
- ```
109
- 📋 Có 3 tasks ready to start
110
-
111
- ➡️ Bắt đầu task mới?
112
- `/next` để xem gợi ý
113
- ```
114
-
115
- **Case 4: Fresh Start**
116
- ```
117
- 🆕 Chưa có context
118
-
119
- ➡️ Bắt đầu dự án mới?
120
- `/planExpert "Feature"` or `/brainstorm`
121
- ```
122
-
123
- ---
124
-
125
- ### 4. Memory Persistence
126
-
127
- Update session state:
128
-
129
- ```json
130
- // brain/session.json
131
- {
132
- "last_session": "2026-01-30T10:00:00Z",
133
- "working_on": {
134
- "feature": "Shopping Cart",
135
- "plan_path": "plans/260130-1025-shopping-cart/",
136
- "current_phase": "phase-02",
137
- "current_task": {
138
- "id": 123,
139
- "name": "Implement Login API",
140
- "status": "in_progress"
141
- }
142
- },
143
- "context_sources": {
144
- "beads": true,
145
- "brain": true,
146
- "git": true
147
- }
148
- }
149
- ```
150
-
151
- ---
152
-
153
- ## Error Handling
154
-
155
- ### Beads Unavailable
156
- ```
157
- ⚠️ Beads không khả dụng
158
-
159
- Fallback: Dùng Brain + Git context
160
- ```
161
-
162
- ### Brain Empty
163
- ```
164
- ⚠️ Brain chưa có context
165
-
166
- Gợi ý: `/plan` để tạo context mới
167
- ```
168
-
169
- ### All Sources Fail
170
- ```
171
- ❌ Không thể khôi phục context
172
-
173
- ➡️ Bắt đầu lại:
174
- 1. `/recap` để quét dự án
175
- 2. `/plan` để tạo plan mới
176
- 3. Kể cho em biết đang làm gì
177
- ```
178
-
179
- ---
180
-
181
- ## Integration with Workflows
182
-
183
- ### Auto-Trigger in Workflows
184
-
185
- Các workflows tự động gọi session restore:
186
-
187
- ```markdown
188
- # In /code workflow
189
- 1. Check session.json
190
- 2. If no context → Trigger awf-session-restore
191
- 3. Resume from restored context
192
- ```
193
-
194
- ### Manual Trigger
195
-
196
- User có thể gọi thủ công:
197
-
198
- ```bash
199
- /recap # Alias for session restore
200
- ```
201
-
202
- ---
203
-
204
- ## Performance
205
-
206
- - **Execution Time:** < 1 second
207
- - **Sources Checked:** 3 (Beads, Brain, Git)
208
- - **Output:** Concise summary (< 10 lines)
209
-
210
- ---
211
-
212
- ## Example Output
213
-
214
- ```
215
- 🧠 **WELCOME BACK!**
216
-
217
- 📿 **Beads:** Task #123 "Login API" (in_progress, 2h ago)
218
- 🧠 **Brain:** Plan "Shopping Cart" - Phase 02 (50%)
219
- 📂 **Git:** 3 files changed
220
-
221
- ➡️ **NEXT:** Continue coding? `/codeExpert`
222
-
223
- 💡 **TIP:** Gõ `/next` để xem chi tiết hơn
224
- ```
225
-
226
- ---
227
-
228
- ## Configuration
229
-
230
- User có thể customize trong `brain/preferences.json`:
231
-
232
- ```json
233
- {
234
- "session_restore": {
235
- "auto_trigger": true,
236
- "verbosity": "concise", // concise | detailed
237
- "sources": ["beads", "brain", "git"]
238
- }
239
- }
240
- ```