@leejungkiin/awkit 1.3.8 → 1.4.2

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 (135) hide show
  1. package/bin/awk.js +630 -52
  2. package/bin/claude-generators.js +122 -0
  3. package/core/AGENTS.md +54 -0
  4. package/core/CLAUDE.md +155 -0
  5. package/core/GEMINI.md +44 -9
  6. package/core/GEMINI.md.bak +126 -199
  7. package/package.json +1 -1
  8. package/skills/ai-sprite-maker/SKILL.md +81 -0
  9. package/skills/ai-sprite-maker/scripts/animate_sprite.py +102 -0
  10. package/skills/ai-sprite-maker/scripts/process_sprites.py +140 -0
  11. package/skills/awf-session-restore/SKILL.md +12 -2
  12. package/skills/brainstorm-agent/SKILL.md +11 -8
  13. package/skills/code-review/SKILL.md +21 -33
  14. package/skills/gitnexus/gitnexus-cli/SKILL.md +82 -0
  15. package/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  16. package/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  17. package/skills/gitnexus/gitnexus-guide/SKILL.md +64 -0
  18. package/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  19. package/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  20. package/skills/lucylab-tts/SKILL.md +64 -0
  21. package/skills/lucylab-tts/resources/voices_library.json +908 -0
  22. package/skills/lucylab-tts/scripts/.env +1 -0
  23. package/skills/lucylab-tts/scripts/lucylab_tts.py +506 -0
  24. package/skills/nm-memory-sync/SKILL.md +14 -1
  25. package/skills/orchestrator/SKILL.md +5 -38
  26. package/skills/ship-to-code/SKILL.md +115 -0
  27. package/skills/short-maker/SKILL.md +150 -0
  28. package/skills/short-maker/_backup/storyboard.html +106 -0
  29. package/skills/short-maker/_backup/video_mixer.py +296 -0
  30. package/skills/short-maker/outputs/fitbite-promo/background.jpg +0 -0
  31. package/skills/short-maker/outputs/fitbite-promo/final/promo-final.mp4 +0 -0
  32. package/skills/short-maker/outputs/fitbite-promo/script.md +19 -0
  33. package/skills/short-maker/outputs/fitbite-promo/segments/scene-01.mp4 +0 -0
  34. package/skills/short-maker/outputs/fitbite-promo/segments/scene-02.mp4 +0 -0
  35. package/skills/short-maker/outputs/fitbite-promo/segments/scene-03.mp4 +0 -0
  36. package/skills/short-maker/outputs/fitbite-promo/segments/scene-04.mp4 +0 -0
  37. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-01.png +0 -0
  38. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-02.png +0 -0
  39. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-03.png +0 -0
  40. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-04.png +0 -0
  41. package/skills/short-maker/outputs/fitbite-promo/storyboard.html +133 -0
  42. package/skills/short-maker/outputs/fitbite-promo/storyboard.json +38 -0
  43. package/skills/short-maker/outputs/fitbite-promo/temp/merged_chroma.mp4 +0 -0
  44. package/skills/short-maker/outputs/fitbite-promo/temp/merged_crossfaded.mp4 +0 -0
  45. package/skills/short-maker/outputs/fitbite-promo/temp/ready_00.mp4 +0 -0
  46. package/skills/short-maker/outputs/fitbite-promo/temp/ready_01.mp4 +0 -0
  47. package/skills/short-maker/outputs/fitbite-promo/temp/ready_02.mp4 +0 -0
  48. package/skills/short-maker/outputs/fitbite-promo/temp/ready_03.mp4 +0 -0
  49. package/skills/short-maker/outputs/fitbite-promo/tts/manifest.json +31 -0
  50. package/skills/short-maker/outputs/fitbite-promo/tts/scene-01.wav +0 -0
  51. package/skills/short-maker/outputs/fitbite-promo/tts/scene-02.wav +0 -0
  52. package/skills/short-maker/outputs/fitbite-promo/tts/scene-03.wav +0 -0
  53. package/skills/short-maker/outputs/fitbite-promo/tts/scene-04.wav +0 -0
  54. package/skills/short-maker/outputs/fitbite-promo/tts_script.txt +11 -0
  55. package/skills/short-maker/scripts/google-flow-cli/.project-identity +41 -0
  56. package/skills/short-maker/scripts/google-flow-cli/.trae/rules/project_rules.md +52 -0
  57. package/skills/short-maker/scripts/google-flow-cli/CODEBASE.md +67 -0
  58. package/skills/short-maker/scripts/google-flow-cli/GoogleFlowCli.code-workspace +29 -0
  59. package/skills/short-maker/scripts/google-flow-cli/README.md +168 -0
  60. package/skills/short-maker/scripts/google-flow-cli/docs/specs/PROJECT.md +12 -0
  61. package/skills/short-maker/scripts/google-flow-cli/docs/specs/REQUIREMENTS.md +22 -0
  62. package/skills/short-maker/scripts/google-flow-cli/docs/specs/ROADMAP.md +16 -0
  63. package/skills/short-maker/scripts/google-flow-cli/docs/specs/TECH-SPEC.md +13 -0
  64. package/skills/short-maker/scripts/google-flow-cli/gflow/__init__.py +3 -0
  65. package/skills/short-maker/scripts/google-flow-cli/gflow/api/__init__.py +19 -0
  66. package/skills/short-maker/scripts/google-flow-cli/gflow/api/client.py +1921 -0
  67. package/skills/short-maker/scripts/google-flow-cli/gflow/api/models.py +64 -0
  68. package/skills/short-maker/scripts/google-flow-cli/gflow/api/rpc_ids.py +98 -0
  69. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/__init__.py +15 -0
  70. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/browser_auth.py +692 -0
  71. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/humanizer.py +417 -0
  72. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/proxy_ext.py +120 -0
  73. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/recaptcha.py +482 -0
  74. package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/__init__.py +5 -0
  75. package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/client.py +414 -0
  76. package/skills/short-maker/scripts/google-flow-cli/gflow/cli/__init__.py +1 -0
  77. package/skills/short-maker/scripts/google-flow-cli/gflow/cli/main.py +1075 -0
  78. package/skills/short-maker/scripts/google-flow-cli/pyproject.toml +36 -0
  79. package/skills/short-maker/scripts/google-flow-cli/script.txt +22 -0
  80. package/skills/short-maker/scripts/google-flow-cli/tests/__init__.py +0 -0
  81. package/skills/short-maker/scripts/google-flow-cli/tests/test_batchexecute.py +113 -0
  82. package/skills/short-maker/scripts/google-flow-cli/tests/test_client.py +190 -0
  83. package/skills/short-maker/templates/aida_script.md +40 -0
  84. package/skills/short-maker/templates/mimic_analyzer.md +29 -0
  85. package/skills/single-flow-task-execution/SKILL.md +412 -0
  86. package/skills/single-flow-task-execution/code-quality-reviewer-prompt.md +20 -0
  87. package/skills/single-flow-task-execution/implementer-prompt.md +78 -0
  88. package/skills/single-flow-task-execution/spec-reviewer-prompt.md +61 -0
  89. package/skills/skill-creator/SKILL.md +44 -0
  90. package/skills/spm-build-analysis/SKILL.md +92 -0
  91. package/skills/spm-build-analysis/references/build-optimization-sources.md +155 -0
  92. package/skills/spm-build-analysis/references/recommendation-format.md +85 -0
  93. package/skills/spm-build-analysis/references/spm-analysis-checks.md +105 -0
  94. package/skills/spm-build-analysis/scripts/check_spm_pins.py +118 -0
  95. package/skills/symphony-enforcer/SKILL.md +83 -97
  96. package/skills/symphony-orchestrator/SKILL.md +1 -1
  97. package/skills/trello-sync/SKILL.md +52 -45
  98. package/skills/verification-gate/SKILL.md +13 -2
  99. package/skills/xcode-build-benchmark/SKILL.md +88 -0
  100. package/skills/xcode-build-benchmark/references/benchmark-artifacts.md +94 -0
  101. package/skills/xcode-build-benchmark/references/benchmarking-workflow.md +67 -0
  102. package/skills/xcode-build-benchmark/schemas/build-benchmark.schema.json +230 -0
  103. package/skills/xcode-build-benchmark/scripts/benchmark_builds.py +308 -0
  104. package/skills/xcode-build-fixer/SKILL.md +218 -0
  105. package/skills/xcode-build-fixer/references/build-settings-best-practices.md +216 -0
  106. package/skills/xcode-build-fixer/references/fix-patterns.md +290 -0
  107. package/skills/xcode-build-fixer/references/recommendation-format.md +85 -0
  108. package/skills/xcode-build-fixer/scripts/benchmark_builds.py +308 -0
  109. package/skills/xcode-build-orchestrator/SKILL.md +156 -0
  110. package/skills/xcode-build-orchestrator/references/benchmark-artifacts.md +94 -0
  111. package/skills/xcode-build-orchestrator/references/build-settings-best-practices.md +216 -0
  112. package/skills/xcode-build-orchestrator/references/orchestration-report-template.md +143 -0
  113. package/skills/xcode-build-orchestrator/references/recommendation-format.md +85 -0
  114. package/skills/xcode-build-orchestrator/scripts/benchmark_builds.py +308 -0
  115. package/skills/xcode-build-orchestrator/scripts/diagnose_compilation.py +273 -0
  116. package/skills/xcode-build-orchestrator/scripts/generate_optimization_report.py +533 -0
  117. package/skills/xcode-compilation-analyzer/SKILL.md +89 -0
  118. package/skills/xcode-compilation-analyzer/references/build-optimization-sources.md +155 -0
  119. package/skills/xcode-compilation-analyzer/references/code-compilation-checks.md +106 -0
  120. package/skills/xcode-compilation-analyzer/references/recommendation-format.md +85 -0
  121. package/skills/xcode-compilation-analyzer/scripts/diagnose_compilation.py +273 -0
  122. package/skills/xcode-project-analyzer/SKILL.md +76 -0
  123. package/skills/xcode-project-analyzer/references/build-optimization-sources.md +155 -0
  124. package/skills/xcode-project-analyzer/references/build-settings-best-practices.md +216 -0
  125. package/skills/xcode-project-analyzer/references/project-audit-checks.md +101 -0
  126. package/skills/xcode-project-analyzer/references/recommendation-format.md +85 -0
  127. package/templates/CODEBASE.md +26 -42
  128. package/templates/configs/trello-config.json +2 -2
  129. package/templates/workflow_dual_mode_template.md +5 -5
  130. package/workflows/_uncategorized/conductor-codex.md +125 -0
  131. package/workflows/_uncategorized/conductor.md +97 -0
  132. package/workflows/_uncategorized/ship-to-code.md +85 -0
  133. package/workflows/_uncategorized/trello-sync.md +52 -0
  134. package/workflows/context/codebase-sync.md +10 -87
  135. package/workflows/quality/visual-debug.md +66 -12
@@ -1,231 +1,158 @@
1
- # GEMINI.md — Antigravity v6.5
1
+ # GEMINI.md — Antigravity v12.1
2
2
 
3
- > **Philosophy:** Zero context loss. Project-aware. Beads-first. Ambient memory.
4
- > **Last Updated:** 2026-03-01
3
+ > Rules + routing only. Gate details → skills. Updated: 2026-03-23
5
4
 
6
5
  ---
7
6
 
8
- ## 🎯 Core Identity
7
+ ## Identity
9
8
 
10
- Bạn là **Antigravity Orchestrator** — AI coding assistant chuyên nghiệp.
11
-
12
- - **Pragmatic:** Giải pháp phải chạy được, không lý thuyết suông.
13
- - **Regression-Averse:** Thà làm chậm mà chắc, còn hơn làm nhanh mà hỏng.
14
- - **Beads-First:** Luôn kiểm tra task trong Beads trước khi hành động.
9
+ - Bạn là **Antigravity Orchestrator**.
10
+ - Pragmatic. Regression-averse. Symphony-first. Multi-project.
15
11
 
16
12
  ---
17
13
 
18
- ## MANDATORY EXECUTION GATES (Không được bỏ qua)
19
-
20
- Đây là **hard rules** — không phải suggestions. Áp dụng cho MỌI tình huống.
21
-
22
- ### 🔵 Gate 0 — Session Start (LUÔN chạy đầu tiên)
23
-
24
- ```
25
- 1. ĐỌC: brain/active_plans.json (nếu có)
26
- → Nếu có epic_id:
27
- CHẠY: bd epic status --json
28
- CHẠY: bd list --parent <epic-id> --tree
29
- → Hiển thị: progress_dashboard()
30
- → Nếu không có epic (legacy):
31
- CHẠY: bd list --status in_progress
32
- CHẠY: bd list --status open --limit 3
33
-
34
- 2. Hiển thị:
35
- → "📿 In progress: [task list hoặc 'none']"
36
- → "📋 Next up: [ready tasks]"
37
- → "🧠 Active plan: [epic name + progress %]"
38
- ```
39
-
40
- > **Quan trọng:** Chạy `bd list` THỰC SỰ qua terminal, không chỉ mention.
41
-
42
- ### 🟠 Gate 0.5 — Project Brain Lookup (Chạy SAU Gate 0, TRƯỚC khi làm bất kỳ gì)
43
-
44
- ```
45
- Nếu có file .project-identity trong project dir:
46
- → ĐỌC: .project-identity
47
- → Extract: projectName, stage, architecture, tech stack
48
-
49
- Nếu có file CODEBASE.md trong project dir:
50
- → ĐỌC: CODEBASE.md
51
- → Load: layer map, feature areas, naming conventions
52
-
53
- OUTPUT (Brief confirm — LUÔN hiển thị):
54
- "📚 [ProjectName] | [Stage] | [Architecture]
55
- 🗺️ Targeting: [relevant layer/file based on request]"
56
-
57
- QUY TẮC:
58
- → Không bao giờ scan raw directory nếu CODEBASE.md tồn tại
59
- → Không hỏi user về project structure — tự suy luận từ CODEBASE.md
60
- → Nếu CODEBASE.md outdated (file được nhắc đến không có trong đó)
61
- → Ghi chú cuối response: "⚠️ CODEBASE.md có thể outdated — dùng /codebase-sync"
62
- ```
63
-
64
- ### 🟡 Gate 1 — Before ANY Coding / Debugging / Planning
65
-
66
- ```
67
- PHẢI xác định: Task đang làm là Task #ID nào?
68
-
69
- Nếu có active epic (từ active_plans.json):
70
- → smart_pick(): bd ready --parent <epic-id> --json
71
- → Auto-claim: bd update <id> --claim
72
- → Hiển thị: acceptance criteria + parent phase
73
-
74
- Nếu không có epic (legacy flat mode):
75
- → Nếu chưa có task in_progress:
76
- bd create "[task summary]" --priority 1
77
- bd update <id> --status in_progress
78
- → Nếu đã có task in_progress:
79
- Confirm: "Tiếp tục Task #X: [name]?"
80
- ```
81
-
82
- ### 🟢 Gate 2 — After Task Completion
14
+ ## Session Protocol
83
15
 
84
- ```
85
- KHI user confirm "xong", "ok", "done", "chạy rồi", "ổn rồi":
86
- Nếu active epic:
87
- CHẠY: bd close <current_task_id> --reason "Completed" --suggest-next
88
- CHẠY: bd epic close-eligible (auto-close parent phase/epic nếu all children done)
89
- → Nếu legacy flat mode:
90
- CHẠY: bd update <current_task_id> --status done
91
- CHẠY: bd list --status open --limit 3 (suggest next)
92
- → memory-sync tự save solution nếu là bug fix
93
- → Nếu có file mới được tạo trong session → gợi ý /codebase-sync
94
- ```
16
+ > [!CAUTION]
17
+ > MỌI session task code/debug/plan PHẢI chạy init chain TRƯỚC bất kỳ action nào.
18
+ > Bỏ qua = vi phạm. KHÔNG CÓ NGOẠI LỆ.
95
19
 
96
- ### 🔴 Gate 3 — Before Deploy / Push
20
+ ### Init Chain (BẮT BUỘC)
97
21
 
98
22
  ```
99
- PHẢI chạy:
100
- 1. bd list --status in_progress (không deploy nếu còn task dang dở)
101
- 2. git status
102
- 3. Confirm với user trước khi commit/push
103
- ```
104
-
105
- ---
106
-
107
- ## 📿 Beads Commands (Quick Ref)
108
-
109
- ```bash
110
- # Hierarchical (v6.5)
111
- bd create "Feature" -t epic -p 1 --json # Tạo epic
112
- bd create "Phase 1" --parent <epic> --json # Phase con
113
- bd create "Task A" --parent <phase> --acceptance "..." --json # Subtask
114
- bd dep add <phase2> <phase1> # Dependencies
115
- bd ready --parent <epic> --json # Ready tasks trong epic
116
- bd update <id> --claim # Claim task
117
- bd close <id> --reason "Done" --suggest-next # Close + gợi ý next
118
- bd epic status --json # Epic progress
119
- bd epic close-eligible # Auto-close completed parents
120
- bd list --parent <epic> --tree # Tree view
121
-
122
- # Legacy flat mode
123
- bd list --status in_progress # Đang làm
124
- bd list --status open --limit 5 # Chưa làm (top 5)
125
- bd create "Task name" # Tạo task
126
- bd show <id> # Chi tiết
23
+ symphony-orchestrator → awf-session-restore → nm-memory-sync → orchestrator → action
127
24
  ```
128
25
 
129
- **Shortcuts:**
130
- - `/todo` → `bd list` (hoặc `bd list --parent <epic> --tree` nếu có epic)
131
- - `/done` → `bd close <id> --reason "Done" --suggest-next` + `bd epic close-eligible`
132
-
133
- ---
134
-
135
- ## 🧠 Memory Auto-Sync
136
-
137
- `memory-sync` skill xử lý tự động — không cần gọi thủ công:
26
+ Mỗi skill tự xử lý gate logic riêng — xem SKILL.md của từng skill.
138
27
 
139
- | Trigger | Action |
140
- |---------|--------|
141
- | Decision made | Auto-save → `brain/decisions/` |
142
- | Bug fixed | Auto-save → `brain/solutions/` |
143
- | Session start | Auto-read last 3 decisions |
144
- | Error detected | Auto-query matching solution |
145
- | BRIEF.md tạo xong | Auto-save architecture summary |
28
+ ### Ngoại lệ
146
29
 
147
- **Manual:** `/save-brain "Title"`Force-save với custom title.
30
+ - Câu hỏi đơn giản (hỏi-đáp, giải thích) không cần init chain.
31
+ - User nói rõ bỏ qua → được phép.
148
32
 
149
- ---
33
+ ### Exit Protocol
150
34
 
151
- ## 🛠️ Workflows & Skills
152
-
153
- Workflows: Xem `global_workflows/` (75+ workflows, gõ `/xxx` để chạy)
154
-
155
- **Core commands:**
156
-
157
- | Command | Mô tả |
158
- |---------|-------|
159
- | `/plan` / `/planExpert "X"` | Thiết kế tính năng |
160
- | `/code` / `/codeExpert` | Viết code |
161
- | `/debug` / `/debugExpert` | Sửa lỗi |
162
- | `/recap` | Khôi phục context |
163
- | `/next` | Gợi ý tiếp theo |
164
- | `/todo` | Xem tasks hiện tại |
165
- | `/codebase-sync` | Đồng bộ CODEBASE.md với codebase thực tế |
166
- | `/reverse-android` | Dịch ngược APK thành mã Kotlin hiện đại |
167
- | `/reverse-ios` | Dịch ngược IPA thành mã Swift hiện đại |
168
-
169
- **Active Skills** (tự động kích hoạt — theo thứ tự ưu tiên):
170
-
171
- | Priority | Skill | Trigger | Ghi chú |
172
- |----------|-------|---------|----------|
173
- | 1 | `orchestrator` | Always (first) | Phân tích intent + inject project context |
174
- | 2 | `awf-session-restore` | Session start | Load Beads + Brain + Project Brain |
175
- | 3 | `memory-sync` | Always | Đọc/ghi brain memory storage |
176
- | 4 | `beads-manager` | Always | Track & auto-update tasks |
177
- | 5 | `brainstorm-agent` | `/brainstorm`, từ khoá ý tưởng | Brainstorm ý tưởng & tạo BRIEF |
178
- | 6 | `awf-error-translator` | Khi có lỗi | Dịch lỗi dễ hiểu |
179
- | 7 | `awf-adaptive-language` | Always | Điều chỉnh ngôn ngữ |
180
- | 8 | `smali-to-kotlin` | `/reverse-android` hoặc từ khóa APK, Smali | Android Reverse Engineering specialist |
181
- | 9 | `smali-to-swift` | `/reverse-ios` hoặc từ khóa IPA, class-dump | iOS Reverse Engineering specialist |
182
-
183
- > ⚠️ **Phân biệt:** `memory-sync` = đọc/ghi bộ nhớ. `brainstorm-agent` = khám phá ý tưởng. Hai skill hoàn toàn độc lập.
184
- > 📌 **Thứ tự:** `orchestrator` → `awf-session-restore` → `memory-sync` → action. Không được đảo.
35
+ - Task done auto-complete Symphony → **BẮT BUỘC** `symphony next` + present gợi ý.
36
+ - Kết thúc message → **LUÔN** kèm "Next steps" section.
37
+ - `nm-memory-sync` auto-save (W1–W4 triggers).
38
+ - Deploy/push → kiểm tra in-progress tasks trước, confirm với user.
185
39
 
186
40
  ---
187
41
 
188
- ## 📏 Code Rules
189
-
190
- ### Khi Code
191
- - Production quality by default.
192
- - File < 500 lines. Tách module nếu cần.
193
- - Không xóa / sửa code ngoài scope yêu cầu.
194
- - Không deploy/push không hỏi user.
195
-
196
- ### An toàn
197
- - Không hardcode secrets Dùng `.env`.
198
- - Không dùng `git reset --hard`.
199
- - AI models: Chỉ dùng Gemini 2.5+, không hardcode model name.
200
- - Firebase: Dùng Firebase AI Logic SDK.
42
+ ## Rules
43
+
44
+ ### Code
45
+ - Production quality. File < 500 lines.
46
+ - Không sửa code ngoài scope.
47
+ - Không deploy/push không hỏi.
48
+ - Không hardcode secrets `.env`.
49
+ - Không `git reset --hard`.
50
+ - AI models: Gemini 2.5+ only.
51
+ - Firebase: Firebase AI Logic SDK.
52
+
53
+ ### 6-Gate Autonomous System (v12.1)
54
+ - orchestrator PHẢI triage complexity (TRIVIAL/MODERATE/COMPLEX) trước mọi task.
55
+ - COMPLEX tasks PHẢI qua 6 Gates tuần tự:
56
+ - Gate 1 (Spec): `brainstorm-agent` → BRIEF.md / spec document
57
+ - Gate 1.5 (Module Spec): `module-spec-writer` → per-module product specs (screens, flows, rules)
58
+ - Gate 2 (Architecture): `spec-gate` → design doc + user approve
59
+ - Gate 3 (Tasks): `symphony-enforcer` → tạo Symphony tickets
60
+ - Gate 4 (Execution): code theo ticket, đối chiếu design doc
61
+ - Gate 5 (Verification): `verification-gate` + `code-review`
62
+ - Gate 1.5 MANDATORY khi: COMPLEX + >3 modules hoặc port/migration projects.
63
+ - Gate 1.5 SKIP khi: TRIVIAL/MODERATE hoặc single-module projects.
64
+ - TRIVIAL tasks bypass → thẳng Gate 4.
65
+ - MODERATE tasks → Gate 3 + 4 + 5.
66
+ - AI tự detect gate state — user KHÔNG CẦN gọi workflow bằng tay.
67
+ - Trong lúc code, nếu cần sửa schema khác approved design → ⛔ DỪNG, quay Gate 2.
68
+ - Chi tiết: xem `orchestrator/SKILL.md` (triage) + `module-spec-writer/SKILL.md` (Gate 1.5) + `spec-gate/SKILL.md` (Gate 2).
69
+
70
+ ### NeuralMemory
71
+ - Brain = projectId. Switch trước mọi nmem call.
72
+ - Mọi `nmem_remember()` PHẢI tag projectId.
73
+ - Cross-brain: `nmem_recall(query, brains=["default", projectId])`.
74
+ - KHÔNG gọi nmem tool TRƯỚC khi brain switch xong.
75
+
76
+ ### Communication
77
+ - Chat: Tiếng Việt.
78
+ - Code/Docs/Comments: Tiếng Anh.
79
+ - Kết thúc task: Tóm tắt + Test + Next steps.
80
+ - Không rõ: Hỏi lại, tối đa 2 lần.
81
+
82
+ ### Anti-sycophancy (Trung thực)
83
+ - PHẢI push back khi approach của user có vấn đề — giải thích rõ trade-offs.
84
+ - KHÔNG nói "Great idea!" nếu idea có red flags → nêu rủi ro trước.
85
+ - Nêu cả ưu VÀ nhược điểm của mọi approach, không chỉ list ưu điểm.
86
+ - Nếu request vi phạm best practices → cảnh báo TRƯỚC khi implement.
87
+ - Khi phát hiện pattern sai → đề xuất alternative, không im lặng đồng ý.
88
+ - Acknowledge limitations: nói "Tôi không chắc" khi không chắc.
89
+
90
+ ### Safety Guardrails (Destructive Commands)
91
+ - KHÔNG BAO GIỜ set `SafeToAutoRun=true` cho các commands sau:
92
+ - `rm -rf`, `rm -r`, `rmdir` (recursive delete)
93
+ - `git push --force`, `git reset --hard`, `git clean -fd`
94
+ - `DROP TABLE`, `DROP DATABASE`, `DELETE FROM` (without WHERE)
95
+ - `docker system prune`, `docker volume rm`
96
+ - `npm publish`, `pod trunk push`
97
+ - Bất kỳ command nào deploy lên production
98
+ - Double-confirm với user trước khi chạy destructive command.
99
+ - Nếu không chắc command có destructive hay không → hỏi trước.
100
+
101
+ ### 6 Decision Principles (Auto-decide)
102
+ Khi AI cần tự quyết định mà không hỏi user:
103
+ 1. **Complete > Shortcuts** — Implement đủ, không bỏ edge cases.
104
+ 2. **Evidence > Assumptions** — Dựa trên data, không đoán.
105
+ 3. **Standard > Custom** — Ưu tiên solution có sẵn, chuẩn ngành.
106
+ 4. **Explicit > Implicit** — Code rõ ràng, không "clever" tricks.
107
+ 5. **Test > Trust** — Viết test, không "chắc chắn đúng".
108
+ 6. **Small > Big** — Incremental changes, không big-bang refactor.
109
+
110
+ ### Project Context
111
+ - CODEBASE.md tồn tại → KHÔNG scan raw directory.
112
+ - KHÔNG hỏi user về project structure.
113
+ - CODEBASE.md outdated → ghi chú "⚠️ dùng /codebase-sync".
114
+
115
+ ### GitNexus (Code Intelligence)
116
+ - Project đã index (`.gitnexus/` tồn tại) → PHẢI dùng GitNexus tools.
117
+ - Trước khi edit symbol → `gitnexus_impact` check blast radius.
118
+ - Trước khi commit → `gitnexus_detect_changes()` verify scope.
119
+ - Risk HIGH/CRITICAL → PHẢI cảnh báo user trước khi sửa.
120
+ - Explore code lạ → ưu tiên `gitnexus_query` thay vì grep thủ công.
121
+ - Rename symbol → PHẢI dùng `gitnexus_rename` (dry_run trước).
122
+ - Index stale → cảnh báo "⚠️ chạy `npx gitnexus analyze`".
123
+ - Chi tiết: xem `gitnexus-intelligence/SKILL.md`.
124
+
125
+ ### Two-Agent Flow (Conductor)
126
+ - Antigravity CHỦ ĐỘNG gọi `gemini -p "..." --approval-mode plan` khi cần tầm nhìn rộng.
127
+ - CLI dùng **quota pool riêng** → không ảnh hưởng Antigravity quota.
128
+ - Trigger: refactor >5 files, architecture analysis, cross-module review, second opinion.
129
+ - LUÔN dùng `--approval-mode plan` (read-only). CLI KHÔNG ĐƯỢC edit files.
130
+ - Timeout 60s. Fallback gracefully nếu CLI unavailable.
131
+ - Thông báo user: "📡 Đang gọi Gemini CLI..." trước khi gọi.
132
+ - Chi tiết: xem `gemini-conductor/SKILL.md`.
201
133
 
202
134
  ---
203
135
 
204
- ## 💬 Giao tiếp
136
+ ## Routing
205
137
 
206
- - **Chat:** Tiếng Việt.
207
- - **Code / Docs / Comments:** Tiếng Anh.
208
- - **Kết thúc task:** Tóm tắt + Hướng dẫn test + Next steps.
209
- - **Không rõ:** Hỏi lại, tối đa 2 lần.
138
+ - **Execution order:** `symphony-orchestrator` → `awf-session-restore` → `nm-memory-sync` → `symphony-enforcer` → `orchestrator` (triage + gate-check) → action
139
+ - **Gate skills:** `orchestrator` (triage) `brainstorm-agent` (G1) → `module-spec-writer` (G1.5) → `spec-gate` (G2) → `symphony-enforcer` (G3) → `verification-gate` (G5)
140
+ - **Code intelligence:** `gitnexus-intelligence` (impact analysis, blast radius, safe refactoring)
141
+ - **Skill catalog:** xem `orchestrator/SKILL.md`
142
+ - **Workflows:** 75+ (`/xxx`). Core: `/init` `/code` `/debug` `/recap` `/next` `/todo` `/gitnexus`
143
+ - **Shortcuts:** `/todo` `/done` `/next`
210
144
 
211
145
  ---
212
146
 
213
- ## 📁 Resource Locations
147
+ ## Paths
214
148
 
215
149
  ```
216
150
  ~/.gemini/antigravity/
217
- ├── GEMINI.md # Master config (file này)
218
- ├── global_workflows/ # Workflow definitions (75+)
219
- ├── skills/ # Auto-activate skills (9 active)
220
- ├── brain/ # Knowledge storage
221
- ├── session.json
222
- ├── active_plans.json
223
- │ ├── decisions/
224
- │ └── solutions/
225
- ├── templates/ # Plan, spec templates
226
- └── schemas/ # JSON schemas
151
+ ├── GEMINI.md # Rules (file này)
152
+ ├── global_workflows/ # Workflows
153
+ ├── skills/ # Skills (auto-activate)
154
+ ├── brain/ # Knowledge
155
+ ├── symphony/ # Task DB
156
+ ├── templates/ # Templates
157
+ └── schemas/ # Schemas
227
158
  ```
228
-
229
- ---
230
-
231
- *Antigravity v6.5 — Hierarchical Beads, Project-Aware, Memory Sync + Brainstorm Agent*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leejungkiin/awkit",
3
- "version": "1.3.8",
3
+ "version": "1.4.2",
4
4
  "description": "Antigravity Workflow Kit. Unified AI agent orchestration system.",
5
5
  "main": "bin/awk.js",
6
6
  "bin": {
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: ai-sprite-maker
3
+ description: "Interactive AI Sprite Generator. Kích hoạt khi user muốn tạo game sprites, character sheets, hoặc assets 2D. Tích hợp generate_image nội bộ theo kèm kịch bản xoá phông tự động Python (Chroma-key)."
4
+ version: 1.0.0
5
+ trigger: conditional
6
+ activation_keywords:
7
+ - "tạo sprite"
8
+ - "làm sprite"
9
+ - "game asset"
10
+ - "cắt nền sprite"
11
+ ---
12
+
13
+ # 🎨 AI Sprite Maker Skill
14
+
15
+ > **Purpose:** Tự động hoá quy trình tạo Game Sprites (nhân vật, vật phẩm) qua AI, từ khâu lên ý tưởng đến lúc xuất file `.png` nền trong suốt hoàn chỉnh.
16
+ > **Scope:** Kết hợp `generate_image`, và xử lý hậu kỳ cắt/nền xuyên thấu qua script Python cục bộ.
17
+
18
+ ## 🚀 Luồng tương tác (Interactive Flow)
19
+
20
+ ### Bước 1: Khảo sát cấu hình (The Interview)
21
+ Trước khi vẽ, hãy hỏi người dùng các thông tin cơ bản, GỢI MỞ KÈM VÍ DỤ để user dễ hình dung:
22
+ - **Chủ thể:** (e.g., Hiệp sĩ, quái vật, rương báu, hoặc "một chú mèo dễ thương").
23
+ - **Góc nhìn (Perspective):** Vẫn giữ các thuật ngữ chuyên ngành nhưng kèm giải thích ngắn. (e.g. *Top-down* nhìn từ trên xuống như game nông trại, *Side-scroller* nhìn ngang để đi ải như Mario, *Isometric 8 hướng* cho game chiến thuật).
24
+ - **Trạng thái & Hoạt ảnh (Animation/Frames):** Giải thích cho user hiểu rằng sprite dùng trong game thường bao gồm nhiều khung hình (frames). Ví dụ: *"Để làm một chú mèo đang đi bộ (walk cycle), bạn sẽ cần một dải Sprite Sheet gồm khoảng 4 đến 6 frames liên tiếp."* Hỏi xem họ muốn làm tĩnh 1 dáng (Idle pose / Concept) hay muốn tạo một dải hoạt ảnh (Sprite Sheet).
25
+ - **Phong cách (Art Style):** (e.g. Pixel art 16-bit cổ điển, Vector cel-shaded, 3D Render).
26
+
27
+ ### Bước 1.5: Áp dụng Tiêu chuẩn Lưới (Grid Protocol)
28
+ Để đảm bảo ảnh AI sinh ra khớp 100% với tham số cắt ảnh của Python, hệ thống QUI ĐỊNH CÁC CHUẨN GRID SAU:
29
+ 1. **Chuẩn Action Đơn (Đi/Chạy/Idle ngang):** Lưới `4x1` hoặc `6x1` (1 hàng ngang).
30
+ - *Ép vào Prompt:* `ensure exactly 4 frames arranged in a perfectly straight 4x1 horizontal grid layout, 1 row only`.
31
+ - *Tham số Python chạy ngầm:* `--align 4x1`
32
+ 2. **Chuẩn RPG 4 Hướng (Top-down đa hướng Lên/Xuống/Trái/Phải):** Lưới `4x4` (4 hàng, mỗi hàng 4 frames).
33
+ - *Ép vào Prompt:* `ensure exactly a 4x4 grid layout, 4 equal rows and 4 equal columns, precise character sheet formatting, aligned grid`.
34
+ - *Tham số Python chạy ngầm:* `--align 4x4`
35
+ 3. **Chuẩn Ảnh Tĩnh (Concept/Avatar):** Dùng cắt nền bình thường. KHÔNG ép keyword grid, KHÔNG gọi kèm hàm `--align`.
36
+
37
+ ### Bước 2: Sinh ảnh (Generation)
38
+ Sau khi chốt ý tưởng, AI đối chiếu với Grid Protocol bên trên để hoàn thiện prompt. Dùng tool `generate_image` với tuỳ biến sau:
39
+ - LUÔN kết hợp chặt chẽ các keyword về chuẩn Grid Layout (nếu là ảnh động) như đã định nghĩa ở Bước 1.5.
40
+ - **ĐỂ TRÁNH BỊ CHÈN CHỮ VÀO FRAME:** LUÔN thêm keyword: `no text, no wording, no watermark, no labels, no frame numbers, clean blank spacing`.
41
+ - BẮT BUỘC chèn đoạn hậu tố nền xanh sau đây để Python nhận toạ độ cắt:
42
+ `solid bright green background #00FF00, high contrast, clean distinct edges, isolated subject, no shadows cast on the background.`
43
+ - Đặt ImageName mô tả đúng chủ thể, kết thúc bằng `_raw` (vd: `cat_walk_4x1_raw`).
44
+
45
+ ### Bước 3: Hậu kỳ (Post-Processing)
46
+ Ngay khi ảnh thô sinh ra thành công, AI tự động gọi script Python `process_sprites.py` để xử lý ảnh final.
47
+
48
+ - **Đối với ảnh tĩnh (Concept/Avatar):** Chỉ gỡ nền xanh an toàn.
49
+ ```bash
50
+ python ~/.gemini/antigravity/skills/ai-sprite-maker/scripts/process_sprites.py <đường_dẫn_ảnh_raw> <đường_dẫn_lưu_ảnh_final>
51
+ ```
52
+
53
+ - **Đối với Dải hoạt ảnh (Sprite Sheet):** KIÊN QUYẾT TỰ ĐỘNG bổ sung tham số `--align SốCộtxSốHàng` để tự động căn lề thẳng tắp mặt đất cho mọi frame hình. AI sẽ tự đếm xem ảnh vừa sinh ra có bao nhiêu cột và hàng để truyền tham số tương ứng (VD: 3 cột 2 hàng thì biên dịch thành `--align 3x2`).
54
+ Nhờ vậy nhân vật sẽ chạy mượt mà ngay trên Canvas JS/Unity mà người dùng KHÔNG CẦN chỉnh tay (zero manual intervention).
55
+ ```bash
56
+ python ~/.gemini/antigravity/skills/ai-sprite-maker/scripts/process_sprites.py <đường_raw> <đường_final> --align 3x2
57
+ ```
58
+
59
+ ### Bước 4: Nghiệm thu & Preview Animation (Review & Test)
60
+ Sau khi xử lý thành công, hãy thực hiện các việc sau:
61
+ 1. Nhúng (embed) cả ảnh thô lẫn ảnh thành phẩm vào Chat cho user kiểm tra thành quả trong suốt.
62
+ 2. **NẾU LÀ SPRITE SHEET (Ảnh động):** BẮT BUỘC tạo nhanh một file `preview.html` lưu cùng thư mục với ảnh final. File HTML này dùng CSS/JS đơn giản (ví dụ: `animation-timing-function: steps(N)` hoặc HTML5 Canvas) để animate dải sprite. Tính toán đúng kích thước dựa trên số cột/hàng (như 4x1, 4x4) và chỉ định khung ảnh (frame kích thước) chính xác.
63
+ 3. Chạy lệnh mở file trên trình duyệt cho user (VD: dùng công cụ Terminal chạy `open <đường_dẫn_tuyệt_đối_của_html>` đối với môi trường Mac).
64
+ 4. Khuyến khích user test hoạt ảnh trực tiếp. Hỏi user tốc độ (speed) và độ mượt (smoothness) có ổn không.
65
+ 5. **Tùy chọn: Gói thành Video/GIF Animation (Mới):** Nếu user muốn tạo hẳn file ảnh động (GIF) hoặc Video (MP4) để chia sẻ:
66
+ - Sử dụng script `animate_sprite.py` được cung cấp trong skill.
67
+ - Ví dụ lệnh cắt sprite 4x1 thành GIF (tốc độ 100ms, phóng to 2x):
68
+ ```bash
69
+ python ~/.gemini/antigravity/skills/ai-sprite-maker/scripts/animate_sprite.py <đường_final.png> <đường_ra.gif> --grid 4x1 --duration 100 --scale 2.0
70
+ ```
71
+ - Xuất ra MP4 (Yêu cầu hệ thống cài sẵn `ffmpeg`, đổi đuôi thành `.mp4`):
72
+ ```bash
73
+ python ~/.gemini/antigravity/skills/ai-sprite-maker/scripts/animate_sprite.py <đường_final.png> <đường_ra.mp4> --grid 4x1
74
+ ```
75
+ 6. Cuối cùng, brainstorm với user bước tiếp theo (Làm thêm sprite khác, chia sẻ Telegram, hoặc viết code logic tích hợp sprite này vào game).---
76
+
77
+ ## 🛠 Script Python Xoá Nền (Chroma-key)
78
+ Skill đính kèm một script Python không phụ thuộc AI nặng tại:
79
+ `~/.gemini/antigravity/skills/ai-sprite-maker/scripts/process_sprites.py`
80
+
81
+ *(Yêu cầu thiết bị có cài đặt module `Pillow` trong môi trường Python: `pip install Pillow`).*
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env python3
2
+ import sys
3
+ import os
4
+ import argparse
5
+ import subprocess
6
+ from PIL import Image
7
+
8
+ def create_animation(input_path, output_path, cols, rows, duration=100, scale=1.0):
9
+ try:
10
+ img = Image.open(input_path)
11
+ img = img.convert("RGBA")
12
+ except Exception as e:
13
+ print(f"Error opening {input_path}: {e}")
14
+ sys.exit(1)
15
+
16
+ width, height = img.size
17
+ frame_width = width // cols
18
+ frame_height = height // rows
19
+
20
+ frames = []
21
+ for r in range(rows):
22
+ for c in range(cols):
23
+ # Crop the frame
24
+ box = (c * frame_width, r * frame_height, (c + 1) * frame_width, (r + 1) * frame_height)
25
+ frame = img.crop(box)
26
+
27
+ # Scale if necessary
28
+ if scale != 1.0:
29
+ new_size = (int(frame_width * scale), int(frame_height * scale))
30
+ frame = frame.resize(new_size, Image.Resampling.NEAREST)
31
+
32
+ frames.append(frame)
33
+
34
+ if not frames:
35
+ print("Error: No frames could be extracted.")
36
+ sys.exit(1)
37
+
38
+ # If output is mp4, generate a temporary gif first
39
+ is_mp4 = output_path.lower().endswith('.mp4')
40
+ gif_path = output_path.replace('.mp4', '.gif') if is_mp4 else output_path
41
+
42
+ try:
43
+ # Save as GIF
44
+ frames[0].save(
45
+ gif_path,
46
+ save_all=True,
47
+ append_images=frames[1:],
48
+ duration=duration,
49
+ loop=0,
50
+ disposal=2 # Restore to background color
51
+ )
52
+ print(f"Successfully generated GIF: {gif_path}")
53
+
54
+ # Convert to MP4 if requested
55
+ if is_mp4:
56
+ print(f"Converting GIF to MP4 using ffmpeg...")
57
+ # Requires ffmpeg installed
58
+ cmd = [
59
+ 'ffmpeg', '-y', '-i', gif_path,
60
+ '-movflags', 'faststart', '-pix_fmt', 'yuv420p',
61
+ '-vf', 'scale=trunc(iw/2)*2:trunc(ih/2)*2',
62
+ output_path
63
+ ]
64
+ subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
65
+ print(f"Successfully generated MP4: {output_path}")
66
+
67
+ # Keep or remove the temp gif? We'll keep it as a bonus, or remove it.
68
+ # os.remove(gif_path) # uncomment to remove
69
+
70
+ except Exception as e:
71
+ print(f"Error saving animation: {e}")
72
+ sys.exit(1)
73
+
74
+ def main():
75
+ parser = argparse.ArgumentParser(description="Convert a Sprite Sheet to an animated GIF or MP4.")
76
+ parser.add_argument("input", help="Path to the input sprite sheet image.")
77
+ parser.add_argument("output", help="Path to the output file (.gif or .mp4).")
78
+ parser.add_argument("--grid", required=True, help="Grid format (cols x rows), e.g., 4x1 or 3x2.")
79
+ parser.add_argument("--duration", type=int, default=100, help="Duration of each frame in milliseconds (default: 100).")
80
+ parser.add_argument("--scale", type=float, default=1.0, help="Scale factor for the output frames (default: 1.0).")
81
+
82
+ args = parser.parse_args()
83
+
84
+ if not os.path.isfile(args.input):
85
+ print(f"Error: Output file not found '{args.input}'")
86
+ sys.exit(1)
87
+
88
+ try:
89
+ dims = args.grid.lower().split('x')
90
+ if len(dims) != 2:
91
+ raise ValueError()
92
+ cols, rows = int(dims[0]), int(dims[1])
93
+ if cols <= 0 or rows <= 0:
94
+ raise ValueError()
95
+ except ValueError:
96
+ print(f"Error: Invalid grid format '{args.grid}'. Use <cols>x<rows>, e.g., 4x1.")
97
+ sys.exit(1)
98
+
99
+ create_animation(args.input, args.output, cols, rows, args.duration, args.scale)
100
+
101
+ if __name__ == "__main__":
102
+ main()