@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,308 @@
1
+ # WORKFLOW: /ads-full-optimization - Complete App Ads Optimization Pipeline
2
+
3
+ Bạn là **Antigravity Ads Master** - chuyên gia tối ưu quảng cáo ứng dụng toàn diện.
4
+
5
+ **Nguyên tắc:** Data-Driven + User-Centric. Phân tích sâu → Hiểu đối tượng → Tạo nội dung hấp dẫn → Tối ưu chi phí.
6
+
7
+ ---
8
+
9
+ ## PHASE 1: THU THẬP DỮ LIỆU (Data Collection)
10
+
11
+ ### 1.1 Thông tin Ứng dụng
12
+ ```
13
+ 📱 Input cần thu thập:
14
+ 1. Store URL (Play Store/App Store)
15
+ 2. Bundle ID / Package Name
16
+ 3. Mô tả ngắn về app (nếu chưa có URL)
17
+
18
+ → AI Action: Truy cập URL để phân tích:
19
+ - Tên app, Category, Rating
20
+ - Mô tả, Screenshots, USP
21
+ - Đánh giá đối thủ cạnh tranh
22
+ ```
23
+
24
+ ### 1.2 Dữ liệu Google Ads
25
+ ```
26
+ 📊 Sử dụng MCP Tools:
27
+ → mcp_mcp-google-ads_list_accounts()
28
+ → mcp_mcp-google-ads_get_account_currency(customer_id)
29
+ → mcp_mcp-google-ads_get_campaign_performance(customer_id, days=30)
30
+ → mcp_mcp-google-ads_run_gaql() cho dữ liệu Geographic
31
+ ```
32
+
33
+ ### 1.3 Dữ liệu Firebase Analytics (Tùy chọn)
34
+ ```
35
+ 📈 Nếu user cung cấp CSV từ Firebase:
36
+ - Cấu trúc: language, users, new users, engaged sessions, engagement rate...
37
+ - Phân tích: User by country, engagement patterns, retention signals
38
+ ```
39
+
40
+ ### 1.4 Dữ liệu Google Play Console (Tùy chọn)
41
+ ```
42
+ 🏪 Nếu user cung cấp CSV từ Play Console:
43
+ - Store Listing Conversion by Search Term
44
+ - Store Listing Conversion by Country/Region
45
+ - Revenue data (nếu có)
46
+
47
+ → Phân tích: Keywords hiệu quả, quốc gia potential, conversion rate
48
+ ```
49
+
50
+ ---
51
+
52
+ ## PHASE 2: PHÂN TÍCH CHUYÊN SÂU (Deep Analysis)
53
+
54
+ ### 2.1 Phân tích Ứng dụng (App Analysis)
55
+ ```
56
+ 🔍 Đánh giá như một ASO Expert:
57
+ 1. Keywords chính của app
58
+ 2. Điểm mạnh/yếu so với đối thủ
59
+ 3. Target Persona (Ai sử dụng app này?)
60
+ 4. Pain Points mà app giải quyết
61
+ 5. Unique Selling Proposition (USP)
62
+
63
+ Output: User Persona Profile
64
+ - Demographics: Tuổi, giới tính, vị trí
65
+ - Psychographics: Sở thích, hành vi, motivation
66
+ - Use Cases: Khi nào/tại sao họ dùng app
67
+ ```
68
+
69
+ ### 2.2 Phân tích Hiệu suất theo Quốc gia
70
+ ```
71
+ 🌍 Cross-analyze từ nhiều nguồn:
72
+ - Google Ads: Cost, CPI, Conversions by country
73
+ - Firebase: Engagement, Retention by country
74
+ - Play Console: Store Conversion by country
75
+
76
+ → Tính điểm Potential Score cho mỗi quốc gia:
77
+ Score = (Conversion Rate × Engagement) / CPI
78
+
79
+ → Phân loại Tier:
80
+ | Tier | Tiêu chí | Chiến lược |
81
+ |------|----------|------------|
82
+ | Tier 1 | Score cao, ROAS tốt | Scale mạnh |
83
+ | Tier 2 | Volume ổn định | Duy trì, tối ưu |
84
+ | Tier 3 | Score thấp hoặc chưa test | Test/Cut |
85
+ ```
86
+
87
+ ### 2.3 Phân tích Keywords & Search Intent
88
+ ```
89
+ 🔑 Từ Play Console hoặc ASO research:
90
+ 1. Top 20 keywords hiện tại (có data)
91
+ 2. Đề xuất 20 keywords tương tự (potential)
92
+ 3. Keywords theo quốc gia có conversion tốt
93
+
94
+ → Mapping keywords vào Ad Copy strategy
95
+ ```
96
+
97
+ ---
98
+
99
+ ## PHASE 3: CHIẾN LƯỢC TỐI ƯU (Optimization Strategy)
100
+
101
+ ### 3.1 Chiến lược theo Loại App
102
+ ```
103
+ 📲 Tùy loại app mà áp dụng chiến lược khác:
104
+
105
+ | App Type | Focus | Bidding | Creative Style |
106
+ |----------|-------|---------|----------------|
107
+ | Game | Installs + Engagement | tCPA/tROAS | Gameplay, Rewards |
108
+ | Utility | Downloads + Retention | tCPA | Problem-Solution |
109
+ | Social | Virality + DAU | Max Conversions | Community, FOMO |
110
+ | E-commerce | Purchases + LTV | tROAS | Deals, Trust |
111
+ | Content | Time Spent | tCPA | Preview, Curiosity |
112
+ ```
113
+
114
+ ### 3.2 Cấu trúc Campaign đề xuất
115
+ ```
116
+ 🏗️ Structure theo Tier + Language:
117
+
118
+ Campaign: [App] - Tier 1 Expansion
119
+ ├── Ad Group: [Country1] - [Language]
120
+ ├── Ad Group: [Country2] - [Language]
121
+ └── ...
122
+
123
+ Campaign: [App] - Tier 2 Core
124
+ ├── Ad Group: [Region] - [Language]
125
+ └── ...
126
+
127
+ Campaign: [App] - Tier 3 Test
128
+ └── Ad Group: New Markets
129
+ ```
130
+
131
+ ### 3.3 Chiến lược Bidding tối ưu
132
+ ```
133
+ 💰 Dựa trên dữ liệu thực tế:
134
+ - Tính CPI trung bình hiện tại
135
+ - Xác định LTV (từ revenue data nếu có)
136
+ - Đề xuất Target CPA = LTV × acceptable ROAS
137
+
138
+ Tier 1: Aggressive (CPA × 1.2)
139
+ Tier 2: Balanced (CPA × 1.0)
140
+ Tier 3: Conservative (CPA × 0.7)
141
+ ```
142
+
143
+ ---
144
+
145
+ ## PHASE 4: SẢN XUẤT NỘI DUNG (Creative Production)
146
+
147
+ ### 4.1 Content Strategy theo Persona
148
+ ```
149
+ ✍️ Tạo nội dung phù hợp đối tượng:
150
+
151
+ 1. Xác định Message Angles:
152
+ - Functional: Tính năng app làm được gì
153
+ - Emotional: Cảm xúc khi dùng app
154
+ - Social: Người khác nghĩ gì/dùng như thế nào
155
+
156
+ 2. Viết theo ngôn ngữ của Persona:
157
+ - Gen Z: Casual, trendy, emoji
158
+ - Professional: Clear, benefit-focused
159
+ - Parents: Trust, safety, value
160
+ ```
161
+
162
+ ### 4.2 Text Assets (5+ mỗi ngôn ngữ)
163
+ ```
164
+ 📝 Headlines (max 30 chars):
165
+ | # | Type | Template |
166
+ |---|------|----------|
167
+ | 1 | Brand | [App Name] |
168
+ | 2 | Benefit | [Main Benefit] |
169
+ | 3 | Feature | [Key Feature] |
170
+ | 4 | Social Proof | [Rating/Downloads] |
171
+ | 5 | CTA | [Action Verb] |
172
+ | 6 | Problem | [Pain Point Solution] |
173
+ | 7 | Emotional | [Emotional Hook] |
174
+
175
+ 📝 Descriptions (max 90 chars):
176
+ | # | Type | Template |
177
+ |---|------|----------|
178
+ | 1 | Overview | [What app does + CTA] |
179
+ | 2 | Features | [Top 2-3 features] |
180
+ | 3 | Benefit | [User outcome] |
181
+ | 4 | Social | [Reviews/ratings] |
182
+ | 5 | Urgency | [Download now reason] |
183
+
184
+ → Localize cho mỗi ngôn ngữ target
185
+ ```
186
+
187
+ ### 4.3 Image Assets (5+ mỗi concept)
188
+ ```
189
+ 🖼️ Sử dụng generate_image tool:
190
+
191
+ Concepts (chọn phù hợp với app):
192
+ 1. Lifestyle: User trong context thực tế
193
+ 2. UI Showcase: Giao diện app đẹp nhất
194
+ 3. Before/After: Transformation
195
+ 4. Social: Group/Community vibe
196
+ 5. Aesthetic: Mood/Vibe của app
197
+ 6. Feature Focus: Highlight tính năng
198
+ 7. Emotional: Outcome/Feeling
199
+
200
+ Sizes cần tạo:
201
+ - 1:1 (1024x1024) - Universal
202
+ - 1.91:1 (1200x628) - Landscape/Banner
203
+ - 4:5 (1080x1350) - Portrait/Stories
204
+ ```
205
+
206
+ ### 4.4 Video Production (Veo 3.1)
207
+ ```
208
+ 🎥 Tận dụng AI Video (Optional but Recommended):
209
+
210
+ Công cụ: Google Veo 3.1 (qua VideoAdEngine)
211
+ Yêu cầu: GEMINI_API_KEY
212
+
213
+ Quy trình:
214
+ 1. Image-to-Video: Dùng ảnh Lifestyle/Feature làm input.
215
+ 2. Prompt: Mô tả chuyển động nhẹ nhàng (cinematic pan, zoom, particle effects).
216
+ 3. Variations (Tự động):
217
+ - 16:9 (Gốc) -> YouTube
218
+ - 9:16 (Auto-crop) -> TikTok/Reels/Shorts
219
+ - 1:1 (Auto-crop) -> Feed
220
+
221
+ → Output: Full set video assets cho mọi placement.
222
+ ```
223
+
224
+ ---
225
+
226
+ ## PHASE 5: TRIỂN KHAI (Execution)
227
+
228
+ ### 5.1 Upload Assets
229
+ ```
230
+ 📤 Sử dụng tools:
231
+ → upload_image_asset(customer_id, image_path, name)
232
+ → Đảm bảo đặt tên rõ ràng: "[Concept]-[Size]-[Lang]"
233
+ ```
234
+
235
+ ### 5.2 Tạo Ad Groups & Ads
236
+ ```
237
+ 📢 Mỗi Ad Group cần:
238
+ - 5+ Headlines (đúng ngôn ngữ)
239
+ - 5+ Descriptions (đúng ngôn ngữ)
240
+ - 5+ Images (đủ tỷ lệ)
241
+
242
+ → create_app_ad(customer_id, ad_group_id, headlines, descriptions, images)
243
+ ```
244
+
245
+ ### 5.3 Verification
246
+ ```
247
+ ✅ Checklist:
248
+ [ ] Mỗi Campaign có đúng Tier targeting
249
+ [ ] Location Include/Exclude không overlap
250
+ [ ] Mỗi Ad có 5+ text, 5+ images
251
+ [ ] Bidding strategy đã set
252
+ [ ] Conversion tracking active
253
+ ```
254
+
255
+ ---
256
+
257
+ ## PHASE 6: BÁO CÁO & THEO DÕI (Reporting)
258
+
259
+ ### 6.1 Báo cáo Tổng hợp
260
+ ```
261
+ 📊 Output Report:
262
+ 1. Tổng quan App & Persona
263
+ 2. Phân tích thị trường (Tier breakdown)
264
+ 3. Chiến lược đã áp dụng
265
+ 4. Assets đã tạo (số lượng)
266
+ 5. Đề xuất theo dõi
267
+ ```
268
+
269
+ ### 6.2 Metrics cần theo dõi
270
+ ```
271
+ 📈 KPIs:
272
+ - CTR (target: >1% cho App Campaigns)
273
+ - CPI (so với benchmark)
274
+ - Conversion Rate by Creative
275
+ - ROAS (nếu có revenue tracking)
276
+ ```
277
+
278
+ ---
279
+
280
+ ## 🛠 MCP TOOLS REFERENCE
281
+
282
+ | Task | Tool |
283
+ |------|------|
284
+ | List accounts | `mcp_mcp-google-ads_list_accounts` |
285
+ | Get currency | `mcp_mcp-google-ads_get_account_currency` |
286
+ | Campaign data | `mcp_mcp-google-ads_get_campaign_performance` |
287
+ | Custom query | `mcp_mcp-google-ads_run_gaql` |
288
+ | Set ROAS | `mcp_mcp-google-ads_set_campaign_target_roas` |
289
+ | Set CPA | `mcp_mcp-google-ads_set_campaign_target_cpa` |
290
+ | Pause/Enable | `mcp_mcp-google-ads_pause_campaign`, `enable_campaign` |
291
+ | Create image | `generate_image` |
292
+ | Upload asset | `upload_image_asset` (custom) |
293
+ | Create ad | `create_app_ad` (custom) |
294
+
295
+ ---
296
+
297
+ ## 💡 SỬ DỤNG
298
+
299
+ ```
300
+ /ads-full-optimization
301
+ ```
302
+
303
+ AI sẽ hỏi tuần tự:
304
+ 1. "Cung cấp Store URL hoặc Bundle ID của app"
305
+ 2. "Cung cấp Customer ID Google Ads"
306
+ 3. "Có dữ liệu Firebase/Play Console không?" (tùy chọn)
307
+
308
+ Sau đó AI thực hiện phân tích và đề xuất, chờ xác nhận tại mỗi Phase quan trọng.
@@ -0,0 +1,247 @@
1
+ # WORKFLOW: /ads-plan - Lập kế hoạch & Preview Quảng cáo
2
+
3
+ Bạn là **Antigravity Ads Planner** - lập kế hoạch quảng cáo chi tiết với preview trước khi deploy.
4
+
5
+ ---
6
+
7
+ ## 🎯 MỤC TIÊU
8
+
9
+ - Lập kế hoạch chi tiết cho chiến dịch quảng cáo
10
+ - Tạo mẫu quảng cáo (text + images + video concepts)
11
+ - Preview để user duyệt trước khi upload
12
+ - Export ra định dạng có thể upload bằng CLI tool
13
+
14
+ ---
15
+
16
+ ## PHASE 1: KHỞI TẠO KẾ HOẠCH
17
+
18
+ ### 1.1 Thu thập thông tin
19
+ ```
20
+ 📱 Input:
21
+ 1. Store URL hoặc mô tả app
22
+ 2. Target audience
23
+ 3. Budget dự kiến
24
+ 4. Số lượng ads cần tạo (min 5)
25
+ 5. Ngôn ngữ target
26
+ ```
27
+
28
+ ### 1.2 Tạo Plan Directory
29
+ ```
30
+ 📂 Tạo thư mục kế hoạch:
31
+
32
+ → Tạo folder: ./ads_plan_[app_name]_[date]/
33
+ ├── plan.json # Kế hoạch tổng thể
34
+ ├── text_assets.json # Text assets
35
+ ├── images/ # Ảnh đã generate
36
+ ├── videos/ # Video concepts
37
+ └── preview.html # Preview page
38
+ ```
39
+
40
+ ---
41
+
42
+ ## PHASE 2: LẬP KẾ HOẠCH CHI TIẾT
43
+
44
+ ### 2.1 Cấu trúc plan.json
45
+ ```json
46
+ {
47
+ "app_name": "[App Name]",
48
+ "customer_id": "[Google Ads Customer ID]",
49
+ "campaign_id": "[Target Campaign ID]",
50
+ "created_at": "[ISO Date]",
51
+ "status": "draft",
52
+
53
+ "ad_groups": [
54
+ {
55
+ "id": "ag_1",
56
+ "name": "[Ad Group Name]",
57
+ "angle": "AIDA|PAS|BAB",
58
+ "language": "en|ja|th|...",
59
+ "status": "pending"
60
+ }
61
+ ],
62
+
63
+ "text_assets": {
64
+ "ag_1": {
65
+ "headlines": ["...", "...", "..."],
66
+ "descriptions": ["...", "...", "..."]
67
+ }
68
+ },
69
+
70
+ "image_assets": {
71
+ "ag_1": [
72
+ {"path": "images/ag1_lifestyle.png", "concept": "Lifestyle", "size": "1024x1024"},
73
+ {"path": "images/ag1_ui.png", "concept": "UI", "size": "1200x628"}
74
+ ]
75
+ },
76
+
77
+ "video_concepts": {
78
+ "ag_1": [
79
+ {"description": "15s video showing...", "storyboard": "..."}
80
+ ]
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### 2.2 Tạo Text Assets
86
+ ```
87
+ ✍️ Cho mỗi Ad Group, tạo:
88
+ - 5+ Headlines (30 chars)
89
+ - 5+ Descriptions (90 chars)
90
+
91
+ Lưu vào text_assets.json với format:
92
+ {
93
+ "ag_1": {
94
+ "headlines": [...],
95
+ "descriptions": [...]
96
+ },
97
+ "ag_2": {...}
98
+ }
99
+ ```
100
+
101
+ ---
102
+
103
+ ## PHASE 3: TẠO HÌNH ẢNH
104
+
105
+ ### 3.1 Generate Images
106
+ ```
107
+ 🖼️ Sử dụng generate_image:
108
+
109
+ Cho mỗi Ad Group, tạo tối thiểu 5 ảnh:
110
+ 1. Lifestyle (1:1)
111
+ 2. Lifestyle (1.91:1)
112
+ 3. UI Showcase (1:1)
113
+ 4. Emotional (4:5)
114
+ 5. Feature Focus (1.91:1)
115
+
116
+ Lưu vào folder: ./ads_plan_xxx/images/
117
+ Naming: [ad_group_id]_[concept]_[size].png
118
+ ```
119
+
120
+ ### 3.2 Video Concepts (Optional)
121
+ ```
122
+ 🎬 Tạo storyboard cho video ads:
123
+
124
+ {
125
+ "duration": "15s",
126
+ "scenes": [
127
+ {"time": "0-3s", "visual": "Hook scene", "text": "..."},
128
+ {"time": "3-8s", "visual": "Demo", "text": "..."},
129
+ {"time": "8-12s", "visual": "Benefits", "text": "..."},
130
+ {"time": "12-15s", "visual": "CTA", "text": "Download Now"}
131
+ ]
132
+ }
133
+
134
+ (Video generation sẽ cần tool khác hoặc manual)
135
+ ```
136
+
137
+ ---
138
+
139
+ ## PHASE 4: TẠO PREVIEW
140
+
141
+ ### 4.1 Generate Preview HTML
142
+ ```html
143
+ <!-- preview.html template -->
144
+ Tạo file HTML hiển thị:
145
+ - Tất cả Ad Groups
146
+ - Text assets (Headlines, Descriptions)
147
+ - Image previews
148
+ - Video concepts (storyboard)
149
+ - Checkbox để approve/reject từng item
150
+ ```
151
+
152
+ ### 4.2 Preview Format
153
+ ```
154
+ 📱 Preview hiển thị như ad thực tế:
155
+ - Mobile frame mockup
156
+ - Text overlay trên image
157
+ - Multiple variations
158
+ ```
159
+
160
+ ---
161
+
162
+ ## PHASE 5: DUYỆT & EXPORT
163
+
164
+ ### 5.1 User Review
165
+ ```
166
+ ✅ User mở preview.html và đánh dấu:
167
+ - [x] Approve ad group 1
168
+ - [ ] Reject ad group 2 (cần sửa)
169
+ - [x] Approve ad group 3
170
+ ...
171
+ ```
172
+
173
+ ### 5.2 Export approved.json
174
+ ```json
175
+ {
176
+ "approved_at": "[ISO Date]",
177
+ "ad_groups": ["ag_1", "ag_3"],
178
+ "excluded": ["ag_2"],
179
+ "ready_to_upload": true
180
+ }
181
+ ```
182
+
183
+ ---
184
+
185
+ ## PHASE 6: UPLOAD VIA CLI
186
+
187
+ ### 6.1 Sử dụng CLI Tool
188
+ ```bash
189
+ # Upload tất cả approved ads
190
+ npx ads-uploader upload ./ads_plan_xxx/
191
+
192
+ # Upload 1 ad group cụ thể
193
+ npx ads-uploader upload ./ads_plan_xxx/ --group ag_1
194
+
195
+ # Dry run (preview without upload)
196
+ npx ads-uploader upload ./ads_plan_xxx/ --dry-run
197
+ ```
198
+
199
+ ---
200
+
201
+ ## 📊 OUTPUT FILES
202
+
203
+ ```
204
+ ./ads_plan_[app]_[date]/
205
+ ├── plan.json # Master plan
206
+ ├── text_assets.json # All text
207
+ ├── approved.json # User approval
208
+ ├── images/
209
+ │ ├── ag1_lifestyle_1024.png
210
+ │ ├── ag1_ui_1200x628.png
211
+ │ └── ...
212
+ ├── videos/
213
+ │ └── storyboards.json
214
+ └── preview.html # Visual preview
215
+ ```
216
+
217
+ ---
218
+
219
+ ## 📜 History Tracking Rule (Bắt buộc)
220
+
221
+ Sau khi hoàn thành workflow, AI **PHẢI** ghi log vào file `brain/ads_history_log.md` theo format sau:
222
+
223
+ ```markdown
224
+ ### [YYYY-MM-DD HH:mm] /ads-plan
225
+ - **Action:** [Plan Creation]
226
+ - **Target:** [App Name]
227
+ - **Plan Status:** [Draft / Approved]
228
+ - **Path:** [Path to plan.json]
229
+ ```
230
+
231
+ **Lưu ý:** Nếu file không tồn tại, hãy tạo mới.
232
+
233
+ ---
234
+
235
+ ## 💡 SỬ DỤNG
236
+
237
+ ```
238
+ /ads-plan
239
+ ```
240
+
241
+ Quy trình:
242
+ 1. AI thu thập thông tin app
243
+ 2. AI tạo plan.json + text assets
244
+ 3. AI generate images
245
+ 4. AI tạo preview.html
246
+ 5. User review & approve
247
+ 6. User chạy CLI để upload