@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +146 -0
  3. package/VERSION +1 -0
  4. package/bin/awf.js +549 -0
  5. package/bin/awk.js +1759 -0
  6. package/core/AGENTS.md +39 -0
  7. package/core/GEMINI.md +202 -0
  8. package/core/GEMINI.md.bak +244 -0
  9. package/core/orchestrator.md +58 -0
  10. package/package.json +46 -0
  11. package/schemas/brain.schema.json +342 -0
  12. package/schemas/preferences.schema.json +95 -0
  13. package/schemas/session.schema.json +112 -0
  14. package/skill-packs/neural-memory/README.md +111 -0
  15. package/skill-packs/neural-memory/pack.json +35 -0
  16. package/skill-packs/neural-memory/schemas/brain-snapshot.json +167 -0
  17. package/skill-packs/neural-memory/skills/nm-memory-audit/SKILL.md +157 -0
  18. package/skill-packs/neural-memory/skills/nm-memory-evolution/SKILL.md +202 -0
  19. package/skill-packs/neural-memory/skills/nm-memory-intake/SKILL.md +135 -0
  20. package/skill-packs/neural-memory/skills/nm-memory-sync/SKILL.md +184 -0
  21. package/skill-packs/neural-memory/workflows/nm-import.md +73 -0
  22. package/skill-packs/neural-memory/workflows/nm-recall.md +67 -0
  23. package/skill-packs/neural-memory/workflows/nm-snapshot.md +69 -0
  24. package/skills/adaptive-language/SKILL.md +189 -0
  25. package/skills/ambient-brain/SKILL.md +314 -0
  26. package/skills/ambient-brain/brain-router.md +185 -0
  27. package/skills/ambient-brain/brain-templates.md +201 -0
  28. package/skills/auto-save/SKILL.md +223 -0
  29. package/skills/awf-adaptive-language/SKILL.md +189 -0
  30. package/skills/awf-context-help/SKILL.md +180 -0
  31. package/skills/awf-error-translator/SKILL.md +153 -0
  32. package/skills/awf-session-restore/SKILL.md +270 -0
  33. package/skills/awf-version-tracker/SKILL.md +32 -0
  34. package/skills/awf-version-tracker/scripts/snapshot.sh +22 -0
  35. package/skills/beads-manager/SKILL.md +323 -0
  36. package/skills/brainstorm-agent/SKILL.md +295 -0
  37. package/skills/context-help/SKILL.md +180 -0
  38. package/skills/error-translator/SKILL.md +153 -0
  39. package/skills/ios-engineer/SKILL.md +101 -0
  40. package/skills/memory-sync/SKILL.md +378 -0
  41. package/skills/memory-sync/memory-router.md +185 -0
  42. package/skills/memory-sync/memory-templates.md +201 -0
  43. package/skills/orchestrator/SKILL.md +193 -0
  44. package/skills/session-restore/SKILL.md +240 -0
  45. package/templates/CODEBASE.md +80 -0
  46. package/templates/brain.example.json +321 -0
  47. package/templates/preferences.example.json +21 -0
  48. package/templates/project-identity/android.json +28 -0
  49. package/templates/project-identity/backend-nestjs.json +24 -0
  50. package/templates/project-identity/expo.json +27 -0
  51. package/templates/project-identity/ios.json +27 -0
  52. package/templates/project-identity/web-nextjs.json +24 -0
  53. package/templates/session.example.json +53 -0
  54. package/templates/specs/design-template.md +166 -0
  55. package/templates/specs/requirements-template.md +65 -0
  56. package/templates/specs/tasks-template.md +132 -0
  57. package/templates/structures/android.txt +10 -0
  58. package/templates/structures/backend-nestjs.txt +6 -0
  59. package/templates/structures/expo.txt +9 -0
  60. package/templates/structures/ios.txt +9 -0
  61. package/templates/structures/web-nextjs.txt +6 -0
  62. package/templates/workflow_dual_mode_template.md +87 -0
  63. package/workflows/_uncategorized/README.md +339 -0
  64. package/workflows/_uncategorized/ads-creative.md +357 -0
  65. package/workflows/_uncategorized/ads-full-optimization.md +308 -0
  66. package/workflows/_uncategorized/ads-plan.md +247 -0
  67. package/workflows/_uncategorized/ads-user-analysis.md +337 -0
  68. package/workflows/_uncategorized/skill-health.md +35 -0
  69. package/workflows/_uncategorized/skill-rollback.md +35 -0
  70. package/workflows/ads/admob.md +62 -0
  71. package/workflows/ads/ads-analyst.md +201 -0
  72. package/workflows/ads/ads-audit.md +106 -0
  73. package/workflows/ads/ads-optimize.md +97 -0
  74. package/workflows/ads/ads-targeting.md +241 -0
  75. package/workflows/ads/adsExpert.md +160 -0
  76. package/workflows/ads/smali-ads-config.md +400 -0
  77. package/workflows/ads/smali-ads-flow.md +331 -0
  78. package/workflows/ads/smali-ads-interstitial.md +377 -0
  79. package/workflows/ads/smali-ads-native.md +382 -0
  80. package/workflows/context/auto-execution-workflow.md +291 -0
  81. package/workflows/context/auto-implement.md +211 -0
  82. package/workflows/context/codebase-sync.md +163 -0
  83. package/workflows/context/logic-reasoning-workflow.md +260 -0
  84. package/workflows/context/next.md +195 -0
  85. package/workflows/context/recap.md +212 -0
  86. package/workflows/context/save-brain.md +285 -0
  87. package/workflows/context/user-intent-analysis-workflow.md +206 -0
  88. package/workflows/expert/codeExpert.md +126 -0
  89. package/workflows/expert/debugExpert.md +136 -0
  90. package/workflows/expert/planExpert.md +112 -0
  91. package/workflows/git/cloudflare-tunnel.md +135 -0
  92. package/workflows/git/git-commit-workflow.md +75 -0
  93. package/workflows/git/hotfix.md +357 -0
  94. package/workflows/git/release-notes.md +160 -0
  95. package/workflows/git/rollback.md +52 -0
  96. package/workflows/git/smart-git-ops.md +103 -0
  97. package/workflows/lifecycle/brainstorm.md +377 -0
  98. package/workflows/lifecycle/code.md +663 -0
  99. package/workflows/lifecycle/debug.md +116 -0
  100. package/workflows/lifecycle/deploy.md +95 -0
  101. package/workflows/lifecycle/init.md +152 -0
  102. package/workflows/lifecycle/master-code-workflow.md +300 -0
  103. package/workflows/lifecycle/migration.md +196 -0
  104. package/workflows/lifecycle/plan.md +91 -0
  105. package/workflows/lifecycle/refactor.md +165 -0
  106. package/workflows/lifecycle/run.md +52 -0
  107. package/workflows/lifecycle/test.md +91 -0
  108. package/workflows/meta/customize.md +346 -0
  109. package/workflows/meta/file-protection-rules.md +129 -0
  110. package/workflows/meta/help.html +350 -0
  111. package/workflows/meta/project-identity-enforcement.md +180 -0
  112. package/workflows/mobile/app-analysis.md +64 -0
  113. package/workflows/mobile/maestro-qa-workflow.md +470 -0
  114. package/workflows/mobile/maestro-test-workflow.md +84 -0
  115. package/workflows/mobile/structure-clean-architect.md +271 -0
  116. package/workflows/mobile/turbo-mobile-build.md +190 -0
  117. package/workflows/quality/accessibility-audit.md +311 -0
  118. package/workflows/quality/audit.md +217 -0
  119. package/workflows/quality/bug-hunter.md +243 -0
  120. package/workflows/quality/code-janitor.md +209 -0
  121. package/workflows/quality/code-quality-rules.md +132 -0
  122. package/workflows/quality/performance-audit.md +343 -0
  123. package/workflows/quality/project-audit.md +61 -0
  124. package/workflows/quality/self-healing-test.md +192 -0
  125. package/workflows/quality/ui-review.md +130 -0
  126. package/workflows/quality/ux-audit.md +213 -0
  127. package/workflows/quality/visual-debug.md +34 -0
  128. package/workflows/roles/oracle.md +267 -0
  129. package/workflows/roles/product-manager-workflow.md +52 -0
  130. package/workflows/roles/qa-engineer-workflow.md +41 -0
  131. package/workflows/roles/tech-lead-workflow.md +45 -0
  132. package/workflows/roles/ui-ux-designer-workflow.md +42 -0
  133. package/workflows/roles/vibe-coding-master-workflow.md +52 -0
  134. package/workflows/ui/app-screen-analyzer.md +152 -0
  135. package/workflows/ui/create-feature.md +332 -0
  136. package/workflows/ui/create-spec-architect.md +184 -0
  137. package/workflows/ui/design-to-ui.md +308 -0
  138. package/workflows/ui/ui-first-methodology.md +279 -0
  139. package/workflows/ui/visualize.md +298 -0
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: nm-memory-sync
3
+ description: |
4
+ NeuralMemory-powered ambient brain sync. Replaces flat-file memory-sync with
5
+ associative graph recall via spreading activation. Auto-reads/writes brain on
6
+ every session, debug, task, and error — with richer context than keyword matching.
7
+ metadata:
8
+ stage: core
9
+ version: "1.0"
10
+ replaces: memory-sync, ambient-brain
11
+ requires: neural-memory (pip install neural-memory)
12
+ tags: [memory, neural, sync, core, ambient]
13
+ agent: Ambient Neural Brain
14
+ allowed-tools:
15
+ - nmem_remember
16
+ - nmem_recall
17
+ - nmem_context
18
+ - nmem_stats
19
+ - nmem_auto
20
+ ---
21
+
22
+ # NM Memory Sync — Ambient Neural Brain
23
+
24
+ > Drop-in upgrade for `memory-sync` and `ambient-brain`.
25
+ > Uses NeuralMemory's spreading activation instead of keyword overlap.
26
+
27
+ ---
28
+
29
+ ## Core Difference vs memory-sync
30
+
31
+ | Feature | memory-sync (flat-file) | nm-memory-sync (this) |
32
+ |---------|------------------------|----------------------|
33
+ | Storage | Markdown files | SQLite graph (neurons + synapses) |
34
+ | Recall | keyword overlap > 2 | Spreading activation graph |
35
+ | Causality | None | `CAUSED_BY`, `LEADS_TO` links |
36
+ | Time decay | None | Natural decay by age/priority |
37
+ | Dedup | None | Automatic conflict detection |
38
+ | Context | Whole file | Scoped activation subgraph |
39
+
40
+ ---
41
+
42
+ ## READ TRIGGERS (Auto-Read từ Brain)
43
+
44
+ ### R1: Session Start
45
+ **Condition:** Conversation bắt đầu
46
+ **Action:** `nmem_context()` → load recent + high-activation memories
47
+ **Output:** Silent loading, brief summary nếu relevant
48
+
49
+ ### R2: New Task / Debugging
50
+ **Condition:** User bắt đầu task mới hoặc debug session
51
+ **Action:** `nmem_recall(task_keywords)` → associative recall
52
+ **Output:** Show relevant decisions, past errors, solutions
53
+
54
+ ### R3: Error Encountered
55
+ **Condition:** Exception, crash, hoặc lỗi xuất hiện
56
+ **Action:** `nmem_recall(error_type + keywords)` → find past similar errors
57
+ **Output:** Auto-propose known solutions if confidence > 0.7
58
+
59
+ ### R4: Architecture Question
60
+ **Condition:** User hỏi về design, pattern, tech choice
61
+ **Action:** `nmem_recall(topic, depth=3)` → deep associative recall
62
+ **Output:** Related decisions, constraints, context
63
+
64
+ ### R5: Recurring Problem (Enhanced)
65
+ **Condition:** Vấn đề tương tự đã gặp (spreading activation detects similarity)
66
+ **Action:** Activate related memory cluster
67
+ **Output:** "🧠 Similar to [memory]: [solution]" — NO keyword threshold needed
68
+
69
+ ---
70
+
71
+ ## WRITE TRIGGERS (Auto-Write vào Brain)
72
+
73
+ ### W1: Decision Made → `decision` type
74
+ **Condition:** AI hoặc user đưa ra quyết định kỹ thuật
75
+ **Capture:** "Chose X because Y" format
76
+ **Store:** `nmem_remember(content, type="decision", priority=7)`
77
+ **Links:** Auto-link to related memories via NeuralMemory engine
78
+
79
+ ### W2: Bug Fixed → `error` type
80
+ **Condition:** User confirm fix thành công ("xong", "ok", "chạy rồi")
81
+ **Capture:** Error + root cause + solution
82
+ **Store:** `nmem_remember(content, type="error", priority=8)`
83
+ **Links:** `CAUSED_BY` → triggering condition, `LEADS_TO` → fix applied
84
+
85
+ ### W3: Architecture Change → `instruction` type
86
+ **Condition:** File structure thay đổi, pattern mới được áp dụng
87
+ **Capture:** What changed + why
88
+ **Store:** `nmem_remember(content, type="instruction", priority=7)`
89
+ **Links:** `SUPERSEDES` → old pattern if exists
90
+
91
+ ### W4: Task Complete → `workflow` type
92
+ **Condition:** Task marked done trong Beads
93
+ **Capture:** What was done + approach taken
94
+ **Store:** `nmem_remember(content, type="workflow", priority=5)`
95
+
96
+ ### W5: User Preference Detected → `preference` type
97
+ **Condition:** User consistently uses pattern or expresses preference
98
+ **Capture:** The preference + context
99
+ **Store:** `nmem_remember(content, type="preference", priority=6)`
100
+
101
+ ---
102
+
103
+ ## Sync Protocol
104
+
105
+ ### Session Start Flow
106
+ ```
107
+ 1. nmem_context() → get active memory cluster
108
+ 2. Filter by project tags (from .project-identity if available)
109
+ 3. SILENT load — no output unless > 3 highly relevant memories
110
+ 4. If relevant: "🧠 Recalled: [brief summary]"
111
+ ```
112
+
113
+ ### Error Flow
114
+ ```
115
+ 1. Extract: error_type, file, function, keywords
116
+ 2. nmem_recall(f"{error_type} {keywords}", depth=2)
117
+ 3. If match (activation > 0.6):
118
+ → "🧠 Similar error: [past error] — Solution: [fix]"
119
+ 4. After fix confirmed:
120
+ → nmem_remember(error + solution, type="error", tags=[...])
121
+ → Create CAUSED_BY + LEADS_TO synapses
122
+ ```
123
+
124
+ ### Decision Write Flow
125
+ ```
126
+ 1. Detect decision signal words: "chose", "decided", "going with", "will use"
127
+ 2. Extract: choice + reason (requires both for quality decision memory)
128
+ 3. nmem_recall(topic) → check for conflicts
129
+ 4. SILENT store: nmem_remember(content, type="decision", priority=7)
130
+ 5. Confirm: "💾 Saved decision: [brief]"
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Associative Recall Strategy
136
+
137
+ Unlike keyword overlap (old memory-sync), nm-memory-sync uses:
138
+
139
+ ```
140
+ Query: "API authentication failing"
141
+ ↓ spreading activation
142
+ Anchor neurons: [api, auth, fail]
143
+ ↓ activate synapses (depth=2)
144
+ Related neurons: [jwt, token, session, middleware]
145
+ ↓ intersect top activations
146
+ Surface memories:
147
+ - "Decided JWT over sessions for stateless API" (decision, auth tags)
148
+ - "Fixed middleware order causing 401" (error, api tags)
149
+ - "Never store tokens in localStorage" (instruction, security tags)
150
+ ```
151
+
152
+ This surfaces memories that a keyword search would miss.
153
+
154
+ ---
155
+
156
+ ## Notification Behavior
157
+
158
+ | Event | Output |
159
+ |-------|--------|
160
+ | Relevant memory found (activation > 0.7) | `🧠 [brief recall]` |
161
+ | Decision auto-saved | `💾 Saved: [brief]` |
162
+ | Bug solution stored | `🔧 Stored fix: [brief]` |
163
+ | No relevant memory | Silent (no output) |
164
+ | Conflict detected | `⚠️ Conflicts with: [memory]` |
165
+
166
+ ---
167
+
168
+ ## Fallback Mode (NeuralMemory Not Installed)
169
+
170
+ If `nmem` is not available, falls back to flat-file behavior:
171
+ ```
172
+ - Reads from brain/decisions/, brain/solutions/
173
+ - Keyword overlap matching (legacy behavior)
174
+ - Shows warning once: "⚠️ NeuralMemory not installed. Using flat-file fallback."
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Integration
180
+
181
+ - Works alongside `beads-manager` for task lifecycle hooks
182
+ - Reads `.project-identity` for project-scoped memory filtering
183
+ - Feeds data to `nm-memory-audit` for quality checks
184
+ - Activated before `orchestrator` dispatches (priority 2.5 in skill chain)
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Import project knowledge into NeuralMemory (decisions, errors, patterns)
3
+ ---
4
+
5
+ # /nm-import — Project Knowledge Import
6
+
7
+ ## When to use
8
+ - Bắt đầu NeuralMemory trên project đã có sẵn
9
+ - Sau khi `awkit enable-pack neural-memory` lần đầu
10
+ - Muốn bulk-import từ brain/ Markdown files (legacy)
11
+
12
+ ## What to import
13
+
14
+ ```
15
+ Priority 1 — Decisions (brain/decisions/*.md)
16
+ Priority 2 — Solutions (brain/solutions/*.md)
17
+ Priority 3 — CODEBASE.md (architecture patterns)
18
+ Priority 4 — .project-identity (project context)
19
+ Priority 5 — git log (recent changes pattern)
20
+ ```
21
+
22
+ ## Steps
23
+
24
+ ### Step 1: Scan sources
25
+ ```
26
+ Sources found:
27
+ brain/decisions/ — 12 files
28
+ brain/solutions/ — 8 files
29
+ CODEBASE.md — 1 file
30
+ .project-identity — 1 file
31
+
32
+ Total import estimate: ~45 memories
33
+ Proceed? [yes/no]
34
+ ```
35
+
36
+ ### Step 2: Parse each source
37
+ For each file:
38
+ - Extract individual information units
39
+ - Classify by type (decision, error, fact, instruction)
40
+ - Extract tags from content
41
+ - Set priority based on type
42
+
43
+ ### Step 3: Deduplication
44
+ ```python
45
+ # Check NeuralMemory for existing similar memories
46
+ nmem_recall(content_keywords)
47
+ # → Skip if identical
48
+ # → Flag if conflicting
49
+ ```
50
+
51
+ ### Step 4: Batch import preview
52
+ Show 10 at a time, confirm each batch
53
+
54
+ ### Step 5: Build synapse graph
55
+ After import, run:
56
+ ```python
57
+ nmem_auto() # Auto-detect relationships between imported memories
58
+ ```
59
+
60
+ ### Step 6: Import summary
61
+ ```
62
+ ✅ Import Complete
63
+ Imported: 42 memories
64
+ Skipped: 3 duplicates
65
+ Auto-linked: 18 synapse connections
66
+
67
+ Brain is now seeded. Run /memory-audit to check quality.
68
+ ```
69
+
70
+ ## Anti-patterns
71
+ - Do NOT import everything blindly — quality over quantity
72
+ - Do NOT import temporary notes or debug snippets
73
+ - Do NOT skip the deduplication step (creates noise)
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: Query NeuralMemory với associative recall (spreading activation)
3
+ ---
4
+
5
+ # /nm-recall — NeuralMemory Associative Recall
6
+
7
+ ## When to use
8
+ - Cần tìm lại quyết định, lỗi, hoặc patterns từ past sessions
9
+ - Regular recall không đủ — cần associative links
10
+ - Muốn surface hidden connections giữa các memories
11
+
12
+ ## Steps
13
+
14
+ 1. **Extract query keywords** từ user's question
15
+ - Lấy 3-5 keywords cốt lõi
16
+ - Bỏ qua stop words
17
+
18
+ 2. **Run activating recall**
19
+ ```
20
+ nmem_recall(query, depth=2)
21
+ ```
22
+ - `depth=1`: Instant recall — direct matches only
23
+ - `depth=2`: Context recall — + 1 hop via synapses (default)
24
+ - `depth=3`: Deep recall — use for complex architecture questions
25
+
26
+ 3. **Format recall results**
27
+ ```
28
+ 🧠 Recalled [N] memories for: "[query]"
29
+
30
+ [type] "[content excerpt]"
31
+ → Tags: [tags] | Priority: [P] | Age: [X days]
32
+ → Connected to: [related memory brief] via [synapse_type]
33
+
34
+ [type] "[content excerpt]"
35
+ ...
36
+ ```
37
+
38
+ 4. **Surface connections**
39
+ - Highlight `CAUSED_BY`, `LEADS_TO`, `DISCUSSED` links
40
+ - Show causal chains when relevant: A → caused → B → leads to → C
41
+
42
+ 5. **If no results (depth=2)**
43
+ - Try `depth=3` automatically
44
+ - If still empty: "🧠 No relevant memories found. Consider /nm-intake to capture this."
45
+
46
+ ## Output Examples
47
+
48
+ ```
49
+ 🧠 Recalled 3 memories for: "auth JWT"
50
+
51
+ [decision] "Chose JWT over sessions for stateless API auth"
52
+ → Tags: [auth, jwt, api, decision] | Priority: 8 | Age: 14 days
53
+ → Caused by: "Need to support mobile + web clients simultaneously"
54
+ → Leads to: "JWT stored in Authorization header, 24h expiry"
55
+
56
+ [error] "Fixed: JWT middleware running before auth check caused 401 on valid tokens"
57
+ → Tags: [auth, jwt, middleware, error] | Priority: 7 | Age: 5 days
58
+ → Solution: "Reorder middleware: auth check → JWT verify → route handler"
59
+
60
+ [instruction] "Never store JWT in localStorage — XSS vulnerability"
61
+ → Tags: [auth, security, jwt, instruction] | Priority: 9 | Age: 30 days
62
+ ```
63
+
64
+ ## Anti-patterns
65
+ - Do NOT just keyword search — use NeuralMemory's associative engine
66
+ - Do NOT show all memories — only top activations (max 8)
67
+ - Do NOT skip connections — the synapse links ARE the value
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Export NeuralMemory brain state to JSON snapshot (portable consciousness)
3
+ ---
4
+
5
+ # /nm-snapshot — Brain Snapshot Export
6
+
7
+ ## When to use
8
+ - Trước khi switch AI tools hoặc agents
9
+ - Backup trước sprint hoặc major refactor
10
+ - Share brain với teammate/agent
11
+ - "Portable Consciousness" — export & re-import vào agent khác
12
+
13
+ ## Steps
14
+
15
+ ### Step 1: Choose snapshot scope
16
+ ```
17
+ Snapshot scope:
18
+ a) Full brain — all memories + synapses
19
+ b) Topic scope — memories matching [topic]
20
+ c) Recent — memories from last [N] days
21
+ d) High priority — priority >= 7 only
22
+
23
+ [Choose scope]
24
+ ```
25
+
26
+ ### Step 2: Generate snapshot
27
+ ```python
28
+ # Export to JSON
29
+ snapshot = {
30
+ "version": "1.0",
31
+ "exported_at": "2026-02-26T12:00:00Z",
32
+ "project": "<from .project-identity>",
33
+ "scope": "<chosen scope>",
34
+ "memories": [...],
35
+ "synapses": [...],
36
+ "stats": {
37
+ "total_memories": N,
38
+ "total_synapses": N,
39
+ "avg_priority": X.X
40
+ }
41
+ }
42
+ ```
43
+
44
+ ### Step 3: Save + report
45
+ ```
46
+ ✅ Snapshot saved: brain_snapshot_2026-02-26.json
47
+
48
+ Memories: 127
49
+ Synapses: 245
50
+ Size: 48KB
51
+
52
+ 💡 To import into another agent:
53
+ nmem import brain_snapshot_2026-02-26.json
54
+
55
+ 💡 To share with teammate:
56
+ Copy the JSON file and they run nmem import
57
+ ```
58
+
59
+ ## Portable Consciousness
60
+
61
+ This snapshot is the "Brain-as-a-Service" concept from NeuralMemory's vision:
62
+ - All associative reflexes are preserved in the synapse graph
63
+ - Another agent loading this snapshot gets all the relationships
64
+ - Not just facts — but the causal and temporal reasoning
65
+
66
+ ## Anti-patterns
67
+ - Do NOT snapshot before deduplication (exports noise)
68
+ - Do NOT share snapshots with sensitive credentials/tokens in memories
69
+ - DO run /memory-audit before important snapshots
@@ -0,0 +1,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
+ ```