@leejungkiin/awkit 1.0.0
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/CHANGELOG.md +27 -0
- package/README.md +146 -0
- package/VERSION +1 -0
- package/bin/awf.js +549 -0
- package/bin/awk.js +1759 -0
- package/core/AGENTS.md +39 -0
- package/core/GEMINI.md +202 -0
- package/core/GEMINI.md.bak +244 -0
- package/core/orchestrator.md +58 -0
- package/package.json +46 -0
- package/schemas/brain.schema.json +342 -0
- package/schemas/preferences.schema.json +95 -0
- package/schemas/session.schema.json +112 -0
- package/skill-packs/neural-memory/README.md +111 -0
- package/skill-packs/neural-memory/pack.json +35 -0
- package/skill-packs/neural-memory/schemas/brain-snapshot.json +167 -0
- package/skill-packs/neural-memory/skills/nm-memory-audit/SKILL.md +157 -0
- package/skill-packs/neural-memory/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skill-packs/neural-memory/skills/nm-memory-intake/SKILL.md +135 -0
- package/skill-packs/neural-memory/skills/nm-memory-sync/SKILL.md +184 -0
- package/skill-packs/neural-memory/workflows/nm-import.md +73 -0
- package/skill-packs/neural-memory/workflows/nm-recall.md +67 -0
- package/skill-packs/neural-memory/workflows/nm-snapshot.md +69 -0
- package/skills/adaptive-language/SKILL.md +189 -0
- package/skills/ambient-brain/SKILL.md +314 -0
- package/skills/ambient-brain/brain-router.md +185 -0
- package/skills/ambient-brain/brain-templates.md +201 -0
- package/skills/auto-save/SKILL.md +223 -0
- package/skills/awf-adaptive-language/SKILL.md +189 -0
- package/skills/awf-context-help/SKILL.md +180 -0
- package/skills/awf-error-translator/SKILL.md +153 -0
- package/skills/awf-session-restore/SKILL.md +270 -0
- package/skills/awf-version-tracker/SKILL.md +32 -0
- package/skills/awf-version-tracker/scripts/snapshot.sh +22 -0
- package/skills/beads-manager/SKILL.md +323 -0
- package/skills/brainstorm-agent/SKILL.md +295 -0
- package/skills/context-help/SKILL.md +180 -0
- package/skills/error-translator/SKILL.md +153 -0
- package/skills/ios-engineer/SKILL.md +101 -0
- package/skills/memory-sync/SKILL.md +378 -0
- package/skills/memory-sync/memory-router.md +185 -0
- package/skills/memory-sync/memory-templates.md +201 -0
- package/skills/orchestrator/SKILL.md +193 -0
- package/skills/session-restore/SKILL.md +240 -0
- package/templates/CODEBASE.md +80 -0
- package/templates/brain.example.json +321 -0
- package/templates/preferences.example.json +21 -0
- package/templates/project-identity/android.json +28 -0
- package/templates/project-identity/backend-nestjs.json +24 -0
- package/templates/project-identity/expo.json +27 -0
- package/templates/project-identity/ios.json +27 -0
- package/templates/project-identity/web-nextjs.json +24 -0
- package/templates/session.example.json +53 -0
- package/templates/specs/design-template.md +166 -0
- package/templates/specs/requirements-template.md +65 -0
- package/templates/specs/tasks-template.md +132 -0
- package/templates/structures/android.txt +10 -0
- package/templates/structures/backend-nestjs.txt +6 -0
- package/templates/structures/expo.txt +9 -0
- package/templates/structures/ios.txt +9 -0
- package/templates/structures/web-nextjs.txt +6 -0
- package/templates/workflow_dual_mode_template.md +87 -0
- package/workflows/_uncategorized/README.md +339 -0
- package/workflows/_uncategorized/ads-creative.md +357 -0
- package/workflows/_uncategorized/ads-full-optimization.md +308 -0
- package/workflows/_uncategorized/ads-plan.md +247 -0
- package/workflows/_uncategorized/ads-user-analysis.md +337 -0
- package/workflows/_uncategorized/skill-health.md +35 -0
- package/workflows/_uncategorized/skill-rollback.md +35 -0
- package/workflows/ads/admob.md +62 -0
- package/workflows/ads/ads-analyst.md +201 -0
- package/workflows/ads/ads-audit.md +106 -0
- package/workflows/ads/ads-optimize.md +97 -0
- package/workflows/ads/ads-targeting.md +241 -0
- package/workflows/ads/adsExpert.md +160 -0
- package/workflows/ads/smali-ads-config.md +400 -0
- package/workflows/ads/smali-ads-flow.md +331 -0
- package/workflows/ads/smali-ads-interstitial.md +377 -0
- package/workflows/ads/smali-ads-native.md +382 -0
- package/workflows/context/auto-execution-workflow.md +291 -0
- package/workflows/context/auto-implement.md +211 -0
- package/workflows/context/codebase-sync.md +163 -0
- package/workflows/context/logic-reasoning-workflow.md +260 -0
- package/workflows/context/next.md +195 -0
- package/workflows/context/recap.md +212 -0
- package/workflows/context/save-brain.md +285 -0
- package/workflows/context/user-intent-analysis-workflow.md +206 -0
- package/workflows/expert/codeExpert.md +126 -0
- package/workflows/expert/debugExpert.md +136 -0
- package/workflows/expert/planExpert.md +112 -0
- package/workflows/git/cloudflare-tunnel.md +135 -0
- package/workflows/git/git-commit-workflow.md +75 -0
- package/workflows/git/hotfix.md +357 -0
- package/workflows/git/release-notes.md +160 -0
- package/workflows/git/rollback.md +52 -0
- package/workflows/git/smart-git-ops.md +103 -0
- package/workflows/lifecycle/brainstorm.md +377 -0
- package/workflows/lifecycle/code.md +663 -0
- package/workflows/lifecycle/debug.md +116 -0
- package/workflows/lifecycle/deploy.md +95 -0
- package/workflows/lifecycle/init.md +152 -0
- package/workflows/lifecycle/master-code-workflow.md +300 -0
- package/workflows/lifecycle/migration.md +196 -0
- package/workflows/lifecycle/plan.md +91 -0
- package/workflows/lifecycle/refactor.md +165 -0
- package/workflows/lifecycle/run.md +52 -0
- package/workflows/lifecycle/test.md +91 -0
- package/workflows/meta/customize.md +346 -0
- package/workflows/meta/file-protection-rules.md +129 -0
- package/workflows/meta/help.html +350 -0
- package/workflows/meta/project-identity-enforcement.md +180 -0
- package/workflows/mobile/app-analysis.md +64 -0
- package/workflows/mobile/maestro-qa-workflow.md +470 -0
- package/workflows/mobile/maestro-test-workflow.md +84 -0
- package/workflows/mobile/structure-clean-architect.md +271 -0
- package/workflows/mobile/turbo-mobile-build.md +190 -0
- package/workflows/quality/accessibility-audit.md +311 -0
- package/workflows/quality/audit.md +217 -0
- package/workflows/quality/bug-hunter.md +243 -0
- package/workflows/quality/code-janitor.md +209 -0
- package/workflows/quality/code-quality-rules.md +132 -0
- package/workflows/quality/performance-audit.md +343 -0
- package/workflows/quality/project-audit.md +61 -0
- package/workflows/quality/self-healing-test.md +192 -0
- package/workflows/quality/ui-review.md +130 -0
- package/workflows/quality/ux-audit.md +213 -0
- package/workflows/quality/visual-debug.md +34 -0
- package/workflows/roles/oracle.md +267 -0
- package/workflows/roles/product-manager-workflow.md +52 -0
- package/workflows/roles/qa-engineer-workflow.md +41 -0
- package/workflows/roles/tech-lead-workflow.md +45 -0
- package/workflows/roles/ui-ux-designer-workflow.md +42 -0
- package/workflows/roles/vibe-coding-master-workflow.md +52 -0
- package/workflows/ui/app-screen-analyzer.md +152 -0
- package/workflows/ui/create-feature.md +332 -0
- package/workflows/ui/create-spec-architect.md +184 -0
- package/workflows/ui/design-to-ui.md +308 -0
- package/workflows/ui/ui-first-methodology.md +279 -0
- package/workflows/ui/visualize.md +298 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: awf-auto-save
|
|
3
|
+
description: >-
|
|
4
|
+
Eternal Context System - Auto-save session to prevent context loss.
|
|
5
|
+
Triggers: workflow end, user leaving, decisions, periodic checkpoint.
|
|
6
|
+
Warns when context is getting full.
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AWF Auto-Save (Eternal Context)
|
|
11
|
+
|
|
12
|
+
Tu dong luu session de khong bao gio mat context.
|
|
13
|
+
|
|
14
|
+
## Trigger Conditions
|
|
15
|
+
|
|
16
|
+
### 1. Workflow End (Automatic)
|
|
17
|
+
Sau khi hoan thanh bat ky workflow nao:
|
|
18
|
+
- `/plan` → Save decisions, specs
|
|
19
|
+
- `/code` → Save progress, files changed
|
|
20
|
+
- `/debug` → Save errors resolved
|
|
21
|
+
- `/test` → Save test results
|
|
22
|
+
- `/deploy` → Save deployment info
|
|
23
|
+
|
|
24
|
+
### 2. User Leaving Detection
|
|
25
|
+
Pattern matching trong tin nhan user:
|
|
26
|
+
```
|
|
27
|
+
patterns:
|
|
28
|
+
- "bye", "tam biet", "tam nghi"
|
|
29
|
+
- "toi di", "di an com", "nghi thoi"
|
|
30
|
+
- "het gio", "mai lam tiep", "save"
|
|
31
|
+
- "dong app", "tat may"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Decision Made Detection
|
|
35
|
+
Khi user dua ra quyet dinh:
|
|
36
|
+
```
|
|
37
|
+
patterns:
|
|
38
|
+
- "chon phuong an", "dung cai nay"
|
|
39
|
+
- "ok", "dong y", "lam vay"
|
|
40
|
+
- "quyet dinh la", "se dung"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 4. Periodic Checkpoint
|
|
44
|
+
Moi 15 tin nhan → Background save
|
|
45
|
+
|
|
46
|
+
### 5. Context Warning (80% estimate)
|
|
47
|
+
```
|
|
48
|
+
token_estimate = message_count * 150 + code_blocks * 300
|
|
49
|
+
if token_estimate > 100000: # 80% of 128K
|
|
50
|
+
trigger_emergency_save()
|
|
51
|
+
show_warning()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Execution Logic
|
|
55
|
+
|
|
56
|
+
### Step 1: Detect Trigger
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
on_message(user_input):
|
|
60
|
+
increment message_count
|
|
61
|
+
|
|
62
|
+
if matches_leaving_pattern(user_input):
|
|
63
|
+
trigger = "user_leaving"
|
|
64
|
+
elif matches_decision_pattern(user_input):
|
|
65
|
+
trigger = "decision_made"
|
|
66
|
+
elif message_count % 15 == 0:
|
|
67
|
+
trigger = "periodic"
|
|
68
|
+
elif estimate_tokens() > 100000:
|
|
69
|
+
trigger = "emergency"
|
|
70
|
+
else:
|
|
71
|
+
return # No save needed
|
|
72
|
+
|
|
73
|
+
execute_save(trigger)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 2: Generate Summary
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
summary = {
|
|
80
|
+
project: brain.project.name,
|
|
81
|
+
current_feature: session.working_on.feature,
|
|
82
|
+
current_task: session.working_on.task,
|
|
83
|
+
status: session.working_on.status,
|
|
84
|
+
progress_percent: calculate_progress(),
|
|
85
|
+
last_action: get_last_action(),
|
|
86
|
+
next_step: suggest_next_step()
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 3: Save to Session
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
session.summary = summary
|
|
94
|
+
session.message_count = current_count
|
|
95
|
+
session.context_checkpoints.append({
|
|
96
|
+
timestamp: now(),
|
|
97
|
+
trigger: trigger_type,
|
|
98
|
+
summary: compress_summary(summary),
|
|
99
|
+
message_count: current_count
|
|
100
|
+
})
|
|
101
|
+
save_to_file(".brain/session.json")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Step 4: Notify User (if enabled)
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
if trigger == "user_leaving":
|
|
108
|
+
show: "💾 Thay ban chuan bi di, da auto-save session."
|
|
109
|
+
|
|
110
|
+
if trigger == "workflow_end":
|
|
111
|
+
show: "💾 Da luu tien do. Ban co the dong app an toan."
|
|
112
|
+
|
|
113
|
+
if trigger == "emergency":
|
|
114
|
+
show: "⚠️ Context sap day. Da save backup. Nen bat dau session moi."
|
|
115
|
+
|
|
116
|
+
if trigger == "periodic" or "decision_made":
|
|
117
|
+
# Silent save - no notification
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Token Estimation Heuristic
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
function estimate_tokens():
|
|
124
|
+
base = message_count * 150
|
|
125
|
+
code_blocks = count_code_blocks() * 300
|
|
126
|
+
error_dumps = count_errors() * 200
|
|
127
|
+
|
|
128
|
+
return base + code_blocks + error_dumps
|
|
129
|
+
|
|
130
|
+
function get_warning_level():
|
|
131
|
+
tokens = estimate_tokens()
|
|
132
|
+
if tokens > 115000: return "critical" # 90%
|
|
133
|
+
if tokens > 100000: return "warning" # 80%
|
|
134
|
+
if tokens > 80000: return "info" # 60%
|
|
135
|
+
return "safe"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Snapshot Management
|
|
139
|
+
|
|
140
|
+
### Save Snapshot (7 days retention)
|
|
141
|
+
```
|
|
142
|
+
on_workflow_end():
|
|
143
|
+
snapshot = {
|
|
144
|
+
timestamp: now(),
|
|
145
|
+
session: session.json,
|
|
146
|
+
brain_summary: extract_brain_summary()
|
|
147
|
+
}
|
|
148
|
+
save_to(".brain/snapshots/{date}_{time}.json")
|
|
149
|
+
|
|
150
|
+
# Cleanup old snapshots
|
|
151
|
+
delete_snapshots_older_than(7_days)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Restore from Snapshot
|
|
155
|
+
```
|
|
156
|
+
if session.json corrupted:
|
|
157
|
+
latest_snapshot = get_latest_snapshot()
|
|
158
|
+
restore_from(latest_snapshot)
|
|
159
|
+
show: "Da khoi phuc tu backup gan nhat."
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## User Messages
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
workflow_end:
|
|
166
|
+
vi: "💾 Da luu tien do. Ban co the dong app an toan."
|
|
167
|
+
en: "💾 Progress saved. You can safely close the app."
|
|
168
|
+
|
|
169
|
+
user_leaving:
|
|
170
|
+
vi: "💾 Thay ban chuan bi di, da auto-save session."
|
|
171
|
+
en: "💾 Detected you're leaving, session auto-saved."
|
|
172
|
+
|
|
173
|
+
context_warning:
|
|
174
|
+
vi: "⚠️ Context sap day. Da save backup. Nen go /save-brain roi bat dau session moi."
|
|
175
|
+
en: "⚠️ Context nearly full. Backup saved. Consider starting new session."
|
|
176
|
+
|
|
177
|
+
emergency_save:
|
|
178
|
+
vi: "⚠️ Da luu khan cap. Go /recap trong session moi de tiep tuc."
|
|
179
|
+
en: "⚠️ Emergency save complete. Use /recap in new session to continue."
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Integration with Workflows
|
|
183
|
+
|
|
184
|
+
Moi workflow PHAI goi auto-save khi ket thuc:
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
# Cuoi moi workflow.md:
|
|
188
|
+
|
|
189
|
+
## Post-Workflow: Auto-Save
|
|
190
|
+
|
|
191
|
+
Sau khi hoan thanh workflow:
|
|
192
|
+
1. Cap nhat session.summary
|
|
193
|
+
2. Append vao context_checkpoints
|
|
194
|
+
3. Hien thong bao: "💾 Da luu tien do."
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Config Options
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"auto_save_config": {
|
|
202
|
+
"enabled": true,
|
|
203
|
+
"notify_on_save": true,
|
|
204
|
+
"checkpoint_interval": 15,
|
|
205
|
+
"warn_threshold": 80,
|
|
206
|
+
"snapshot_retention_days": 7
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Error Handling
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
if save_fails:
|
|
215
|
+
retry 3 times with exponential backoff
|
|
216
|
+
if still fails:
|
|
217
|
+
show: "⚠️ Khong the luu session. Kiem tra quyen ghi file."
|
|
218
|
+
log error to console
|
|
219
|
+
|
|
220
|
+
if disk_full:
|
|
221
|
+
delete oldest snapshots
|
|
222
|
+
retry save
|
|
223
|
+
```
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: awf-adaptive-language
|
|
3
|
+
description: >-
|
|
4
|
+
Adjust terminology based on user technical level. Keywords: language,
|
|
5
|
+
terminology, jargon, level, beginner, newbie, simple, explain.
|
|
6
|
+
Reads technical_level from preferences.json and sets communication context.
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AWF Adaptive Language
|
|
11
|
+
|
|
12
|
+
Tự động điều chỉnh ngôn ngữ kỹ thuật theo trình độ user.
|
|
13
|
+
|
|
14
|
+
## Trigger Conditions
|
|
15
|
+
|
|
16
|
+
**Pre-hook for ALL workflows** - Activates at session start.
|
|
17
|
+
|
|
18
|
+
**Check preferences:**
|
|
19
|
+
```
|
|
20
|
+
if exists(".brain/preferences.json"):
|
|
21
|
+
→ Read technical_level
|
|
22
|
+
else if exists("~/.antigravity/preferences.json"):
|
|
23
|
+
→ Read global technical_level
|
|
24
|
+
else:
|
|
25
|
+
→ Default: "basic"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Personality Modes (from /customize)
|
|
29
|
+
|
|
30
|
+
**Also read `personality` from preferences.json:**
|
|
31
|
+
|
|
32
|
+
### Mentor Mode (`mentor`)
|
|
33
|
+
```
|
|
34
|
+
Khi làm bất kỳ task nào:
|
|
35
|
+
1. Giải thích TẠI SAO làm vậy
|
|
36
|
+
2. Giải thích thuật ngữ mới gặp
|
|
37
|
+
3. Đôi khi hỏi ngược: "Anh nghĩ tại sao phải làm vậy?"
|
|
38
|
+
4. Sau khi xong: "Anh học được gì từ bước này?"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Strict Coach Mode (`strict_coach`)
|
|
42
|
+
```
|
|
43
|
+
Khi làm bất kỳ task nào:
|
|
44
|
+
1. Đòi hỏi cao về chất lượng
|
|
45
|
+
2. Chỉ ra cách làm tốt hơn
|
|
46
|
+
3. Giải thích best practices
|
|
47
|
+
4. Không chấp nhận code xấu: "Cách này không tối ưu vì..."
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Default (không có personality setting)
|
|
51
|
+
→ Dùng style "Trợ lý thông minh" - hữu ích, đưa lựa chọn
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Technical Levels
|
|
56
|
+
|
|
57
|
+
### Level: `newbie`
|
|
58
|
+
**Target:** Không biết code, chỉ có ý tưởng
|
|
59
|
+
|
|
60
|
+
| Term | Translation |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| database | kho lưu trữ thông tin |
|
|
63
|
+
| API | cổng giao tiếp giữa các phần mềm |
|
|
64
|
+
| deploy | đưa lên mạng cho người khác dùng |
|
|
65
|
+
| commit | lưu lại thay đổi |
|
|
66
|
+
| branch | bản nháp của dự án |
|
|
67
|
+
| error | lỗi cần sửa |
|
|
68
|
+
| debug | tìm và sửa lỗi |
|
|
69
|
+
| test | kiểm tra xem có chạy đúng không |
|
|
70
|
+
| server | máy tính chạy ứng dụng |
|
|
71
|
+
| frontend | giao diện người dùng thấy |
|
|
72
|
+
| backend | phần xử lý ẩn phía sau |
|
|
73
|
+
|
|
74
|
+
**Communication style:**
|
|
75
|
+
- Giải thích MỌI khái niệm kỹ thuật
|
|
76
|
+
- Dùng ví dụ đời thường
|
|
77
|
+
- Tránh từ viết tắt
|
|
78
|
+
- Bước nhỏ, từng bước một
|
|
79
|
+
|
|
80
|
+
### Level: `basic`
|
|
81
|
+
**Target:** Biết dùng máy tính, đọc được code cơ bản
|
|
82
|
+
|
|
83
|
+
| Term | Usage |
|
|
84
|
+
|------|-------|
|
|
85
|
+
| database | database (cơ sở dữ liệu) |
|
|
86
|
+
| API | API (giao diện lập trình) |
|
|
87
|
+
| deploy | deploy (triển khai) |
|
|
88
|
+
| commit | commit (lưu thay đổi vào git) |
|
|
89
|
+
|
|
90
|
+
**Communication style:**
|
|
91
|
+
- Giải thích từ kỹ thuật lần đầu
|
|
92
|
+
- Sau đó dùng bình thường
|
|
93
|
+
- Gợi ý tra cứu thêm nếu cần
|
|
94
|
+
- Nhóm nhiều bước nhỏ lại
|
|
95
|
+
|
|
96
|
+
### Level: `technical`
|
|
97
|
+
**Target:** Developers, có kinh nghiệm code
|
|
98
|
+
|
|
99
|
+
**Communication style:**
|
|
100
|
+
- Dùng thuật ngữ chuẩn
|
|
101
|
+
- Không cần giải thích
|
|
102
|
+
- Tập trung vào implementation
|
|
103
|
+
- Có thể dùng viết tắt (PR, CI/CD, etc.)
|
|
104
|
+
|
|
105
|
+
## Execution Logic
|
|
106
|
+
|
|
107
|
+
### Step 1: Load Preferences
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
preferences = null
|
|
111
|
+
|
|
112
|
+
# Try local first
|
|
113
|
+
if exists(".brain/preferences.json"):
|
|
114
|
+
preferences = parse(".brain/preferences.json")
|
|
115
|
+
|
|
116
|
+
# Fallback to global
|
|
117
|
+
if !preferences && exists("~/.antigravity/preferences.json"):
|
|
118
|
+
preferences = parse("~/.antigravity/preferences.json")
|
|
119
|
+
|
|
120
|
+
# Extract level
|
|
121
|
+
level = preferences?.technical?.technical_level || "basic"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 2: Set Context
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Set internal context for session:
|
|
128
|
+
- terminology_level = level
|
|
129
|
+
- Apply translation rules based on level
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Step 3: Silent Operation
|
|
133
|
+
|
|
134
|
+
This skill operates SILENTLY:
|
|
135
|
+
- KHÔNG show indicator
|
|
136
|
+
- KHÔNG notify user
|
|
137
|
+
- Just sets context for subsequent responses
|
|
138
|
+
|
|
139
|
+
## Integration with Workflows
|
|
140
|
+
|
|
141
|
+
All AWF workflows should respect the set terminology level:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
When outputting technical terms:
|
|
145
|
+
if level == "newbie":
|
|
146
|
+
→ Use translated terms from table
|
|
147
|
+
→ Add explanations
|
|
148
|
+
elif level == "basic":
|
|
149
|
+
→ Use term (explanation) format first time
|
|
150
|
+
→ Plain term after that
|
|
151
|
+
else:
|
|
152
|
+
→ Use standard technical terms
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Performance
|
|
156
|
+
|
|
157
|
+
- Load time: < 100ms
|
|
158
|
+
- Single file read
|
|
159
|
+
- Cached for session duration
|
|
160
|
+
|
|
161
|
+
## Error Handling
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
If preferences.json corrupted:
|
|
165
|
+
→ Use default level: "basic"
|
|
166
|
+
→ NO error message to user
|
|
167
|
+
|
|
168
|
+
If technical_level invalid:
|
|
169
|
+
→ Map to closest: "newbie"/"basic"/"technical"
|
|
170
|
+
→ Log warning internally
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Example Behavior
|
|
174
|
+
|
|
175
|
+
**User level: newbie**
|
|
176
|
+
```
|
|
177
|
+
User: /deploy
|
|
178
|
+
|
|
179
|
+
Output: "Sẵn sàng đưa ứng dụng lên mạng (deploy) cho người khác dùng.
|
|
180
|
+
Em sẽ kiểm tra xem mọi thứ đã sẵn sàng chưa..."
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**User level: technical**
|
|
184
|
+
```
|
|
185
|
+
User: /deploy
|
|
186
|
+
|
|
187
|
+
Output: "Initiating deployment pipeline.
|
|
188
|
+
Running pre-deploy checks..."
|
|
189
|
+
```
|
|
@@ -0,0 +1,180 @@
|
|
|
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
|