@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,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# WORKFLOW: /debug - The Sherlock Holmes (Dual-Mode + Beads)
|
|
6
|
+
|
|
7
|
+
> **Mode A (Expert):** `/debug --auto-fix` -> Tự động phân tích và sửa lỗi.
|
|
8
|
+
> **Mode B (Guided):** `/debug` -> Hướng dẫn thu thập thông tin -> Phân tích -> Menu sửa.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🅰️ Expert Mode (Direct Execution)
|
|
13
|
+
|
|
14
|
+
**Usage:**
|
|
15
|
+
```bash
|
|
16
|
+
/debug --auto-fix --file src/components/Cart.tsx
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Logic:**
|
|
20
|
+
1. **Auto-Detect:**
|
|
21
|
+
- Đọc logs gần nhất.
|
|
22
|
+
- Parse error stack trace.
|
|
23
|
+
- Identify file & line number.
|
|
24
|
+
2. **Root Cause Analysis:**
|
|
25
|
+
- Phân tích code tại vị trí lỗi.
|
|
26
|
+
- Đưa ra 1-2 giả thuyết.
|
|
27
|
+
3. **Auto-Fix (Safe Only):**
|
|
28
|
+
- Lỗi *Safe-to-fix*: Missing import, typo, undefined check -> Sửa ngay.
|
|
29
|
+
- Lỗi *Logic*: Báo cáo và đề xuất (không tự ý sửa).
|
|
30
|
+
4. **Beads Sync:**
|
|
31
|
+
- Nếu lỗi Critical và không thể auto-fix -> `bd create "Fix Critical Bug in Cart.tsx" --label bug`.
|
|
32
|
+
5. **Report:** "✅ Fixed 1 issue. ⚠️ Created task #456 for manual review."
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 🅱️ Guided Mode (Interactive Wizard)
|
|
37
|
+
|
|
38
|
+
### Phase 1: Error Discovery
|
|
39
|
+
1. **Symptom Check:**
|
|
40
|
+
```markdown
|
|
41
|
+
Lỗi xảy ra như thế nào?
|
|
42
|
+
1️⃣ Trang trắng toát
|
|
43
|
+
2️⃣ Loading mãi không dừng
|
|
44
|
+
3️⃣ Báo lỗi đỏ
|
|
45
|
+
4️⃣ Nút không hoạt động
|
|
46
|
+
5️⃣ Dữ liệu sai
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
2. **Context Gathering:**
|
|
50
|
+
- "Lỗi xảy ra khi nào? (Mở app / Sau login / Bấm nút X)"
|
|
51
|
+
- "Có chụp màn hình hoặc copy error message không?"
|
|
52
|
+
|
|
53
|
+
### Phase 2: Investigation
|
|
54
|
+
1. **AI Autonomous Analysis:**
|
|
55
|
+
- Đọc logs, stack trace.
|
|
56
|
+
- Inspect code liên quan.
|
|
57
|
+
- Đưa ra 2-3 giả thuyết.
|
|
58
|
+
|
|
59
|
+
2. **Hypothesis Menu:**
|
|
60
|
+
```markdown
|
|
61
|
+
Em nghĩ có 3 nguyên nhân:
|
|
62
|
+
1️⃣ Database chưa bật (Khả năng cao)
|
|
63
|
+
2️⃣ API trả về lỗi 500
|
|
64
|
+
3️⃣ Biến undefined
|
|
65
|
+
|
|
66
|
+
Muốn em kiểm tra cái nào trước?
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Phase 3: Fix Strategy
|
|
70
|
+
1. **Root Cause Explanation:**
|
|
71
|
+
- Giải thích bằng ngôn ngữ đời thường.
|
|
72
|
+
- Ví dụ: "Danh sách sản phẩm đang trống nên code bị lỗi khi cố hiển thị."
|
|
73
|
+
|
|
74
|
+
2. **Fix Options:**
|
|
75
|
+
```markdown
|
|
76
|
+
1️⃣ 🔧 Em sửa ngay (Auto-fix)
|
|
77
|
+
2️⃣ 📿 Tạo task Beads để sửa sau
|
|
78
|
+
3️⃣ 📝 Hướng dẫn anh tự sửa
|
|
79
|
+
4️⃣ 🔍 Điều tra sâu hơn
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Phase 4: Execution & Verification
|
|
83
|
+
1. **Action:** Thực hiện sửa lỗi.
|
|
84
|
+
2. **Regression Check:** "Chạy lại test để đảm bảo không làm hỏng gì khác."
|
|
85
|
+
3. **Cleanup:** Xóa debug logs đã thêm.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🧠 Brain & Beads Logic
|
|
90
|
+
|
|
91
|
+
### 1. Bug Tracking
|
|
92
|
+
- Mọi lỗi được phát hiện -> Ghi vào `brain/bugs/[date]_[issue].md`.
|
|
93
|
+
- Nếu lỗi Critical -> Auto-create Beads task với tag `bug` và `high-priority`.
|
|
94
|
+
|
|
95
|
+
### 2. Knowledge Base
|
|
96
|
+
- Lỗi đã fix -> Lưu vào `brain/solutions/` để tham khảo sau.
|
|
97
|
+
- Pattern lỗi lặp lại -> Gợi ý tạo Rule hoặc Linter.
|
|
98
|
+
|
|
99
|
+
### 3. Smart Resume
|
|
100
|
+
- Nếu user quay lại debug cùng 1 lỗi -> "Hôm qua anh đang debug lỗi này. Em đã tìm ra [Solution]. Áp dụng không?"
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 🛡️ Resilience Patterns
|
|
105
|
+
|
|
106
|
+
- **False Fix Detection:** Sau khi sửa, tự động chạy test. Nếu fail -> Rollback ngay.
|
|
107
|
+
- **Unknown Error:** Nếu không tìm ra nguyên nhân sau 3 lần -> Tạo task Beads "Investigate Unknown Error" và gợi ý user tìm expert.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## ⚠️ NEXT STEPS (Menu số):
|
|
112
|
+
```
|
|
113
|
+
1️⃣ Chạy test toàn bộ (`/test`)
|
|
114
|
+
2️⃣ Vẫn còn lỗi? (`/debug` lại)
|
|
115
|
+
3️⃣ Xem danh sách bugs (`/todo --label bug`)
|
|
116
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🚀 Deploy lên Production (Dual-Mode v5.0)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# WORKFLOW: /deploy - The Release Manager (Dual-Mode + Beads)
|
|
6
|
+
|
|
7
|
+
> **Mode A (Expert):** `/deploy --prod --force` -> Bỏ qua checks, deploy ngay.
|
|
8
|
+
> **Mode B (Guided):** `/deploy` -> Pre-flight Checks -> Config -> Deploy -> Verify.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🅰️ Expert Mode (Direct Execution)
|
|
13
|
+
|
|
14
|
+
**Usage:**
|
|
15
|
+
```bash
|
|
16
|
+
/deploy --prod --force --skip-tests
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Logic:**
|
|
20
|
+
1. **Safety Check:** (Trừ khi có `--force`)
|
|
21
|
+
- Check Git clean state.
|
|
22
|
+
- Check CI/CD status (nếu có).
|
|
23
|
+
2. **Execute:**
|
|
24
|
+
- Chạy build script (`npm run build`).
|
|
25
|
+
- Chạy deploy command (Vercel/Docker/AWS).
|
|
26
|
+
3. **Beads Sync:**
|
|
27
|
+
- Tạo release tag trong Beads: `bd release create v1.0.0`.
|
|
28
|
+
- Mark tất cả tasks `in_progress` -> `done` (Optional).
|
|
29
|
+
4. **Report:** "✅ Deployed to Production. URL: [Link]"
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🅱️ Guided Mode (Interactive Wizard)
|
|
34
|
+
|
|
35
|
+
### Phase 1: Pre-Audit & Health Check
|
|
36
|
+
1. **Blocker Check:**
|
|
37
|
+
- Check `session.json`: Có test nào đang `skipped` không?
|
|
38
|
+
- Check `bd list`: Có task nào `critical` đang mở không?
|
|
39
|
+
- *If Issue:* ❌ "Khoan! Còn 2 bugs nghiêm trọng chưa fix. Bạn chắc chắn muốn deploy?"
|
|
40
|
+
|
|
41
|
+
2. **Environment Check:**
|
|
42
|
+
- Target: Staging hay Production?
|
|
43
|
+
- Secrets: `.env` đủ chưa?
|
|
44
|
+
|
|
45
|
+
### Phase 2: Build & Optimization
|
|
46
|
+
1. **Action:** Chạy build thử nghiệm (`npm run build`).
|
|
47
|
+
2. **SEO & Assets:**
|
|
48
|
+
- "Có muốn tự động tạo `sitemap.xml` và `robots.txt` không?"
|
|
49
|
+
- "Ảnh chưa tối ưu, muốn chạy nén ảnh không?"
|
|
50
|
+
|
|
51
|
+
### Phase 3: Deployment
|
|
52
|
+
1. **Action:** Thực hiện deploy (theo platform detect được: Vercel, Netlify, VPS...).
|
|
53
|
+
2. **Progress:** Hiển thị realtime logs (đơn giản hóa).
|
|
54
|
+
|
|
55
|
+
### Phase 4: Verification & Handoff
|
|
56
|
+
1. **Smoke Test:**
|
|
57
|
+
- AI tự truy cập URL vừa deploy.
|
|
58
|
+
- Check HTTP 200, check JS errors.
|
|
59
|
+
2. **Beads Release:**
|
|
60
|
+
- "Tạo Release Note từ các tasks đã làm?"
|
|
61
|
+
- Action: `bd release create` kèm danh sách tasks.
|
|
62
|
+
3. **Action Menu:**
|
|
63
|
+
```markdown
|
|
64
|
+
1️⃣ 📢 Thông báo team (Copy release note)
|
|
65
|
+
2️⃣ 💾 Lưu cấu hình deploy (`/save-brain`)
|
|
66
|
+
3️⃣ 🔍 Monitor realtime logs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🧠 Brain & Beads Logic
|
|
72
|
+
|
|
73
|
+
### 1. Release Tracking
|
|
74
|
+
- Mỗi lần deploy thành công -> Tạo bản ghi trong `brain/releases/`.
|
|
75
|
+
- Nội dung: Version, Date, Commit Hash, Link tới Beads Release.
|
|
76
|
+
|
|
77
|
+
### 2. Deployment Knowledge
|
|
78
|
+
- Lưu các preferences của user (vd: "Luôn dung Vercel", "Luôn skip test ở Staging").
|
|
79
|
+
- Tự động suggest lại vào lần sau.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 🛡️ Resilience Patterns
|
|
84
|
+
|
|
85
|
+
- **Rollback Strategy:** Nếu Smoke Test fail -> Tự động gợi ý `/rollback`.
|
|
86
|
+
- **Environment Protection:** Cấm deploy Production vào chiều Thứ 6 (trừ khi `--force`).
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ⚠️ NEXT STEPS (Menu số):
|
|
91
|
+
```
|
|
92
|
+
1️⃣ Monitor logs (`/logs`)
|
|
93
|
+
2️⃣ Rollback nhanh (`/rollback`)
|
|
94
|
+
3️⃣ Đóng task trong Beads (`/done`)
|
|
95
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: ✨ Khởi tạo dự án chuẩn Antigravity (v4.1 - Master Orchestrator)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# WORKFLOW: /init - The Antigravity Orchestrator (v4.1)
|
|
6
|
+
|
|
7
|
+
> **Mission:** Không chỉ tạo file. `/init` thiết lập toàn bộ "Hệ điều hành phát triển" (OS for Development), tích hợp sẵn tư duy Spec-First, Clean Architecture và MCP Tools.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🚀 Giai đoạn 0: Environment & MCP Check (New in v4.1)
|
|
12
|
+
Trước khi làm bất cứ điều gì, kiểm tra "vũ khí":
|
|
13
|
+
|
|
14
|
+
1. **MCP Status Check**:
|
|
15
|
+
* `firebase-mcp-server`: [Check] -> Nếu thiếu, hỏi user có cần Backend/Auth không?
|
|
16
|
+
* `maestro`: [Check] -> Nếu thiếu, warn "Sẽ không thể chạy test UI tự động".
|
|
17
|
+
* `ios-simulator`: [Check] -> Nếu là dự án Mobile, yêu cầu bật Simulator.
|
|
18
|
+
* `google-ads-mcp`: [Check] -> (Optional) Cho Marketing.
|
|
19
|
+
|
|
20
|
+
2. **Dev Environment**:
|
|
21
|
+
* Node/Ruby/Java/Swift versions.
|
|
22
|
+
* Docker status (nếu là Backend).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ⚡ Giai đoạn 1: Context Awareness & Smart Adoption
|
|
27
|
+
*Thay vì hỏi máy móc, hãy quan sát:*
|
|
28
|
+
|
|
29
|
+
**Kịch bản A: Thư mục trống (New Project)**
|
|
30
|
+
* Chạy quy trình phỏng vấn **Vision Capture** (như bản cũ).
|
|
31
|
+
* Hỏi thêm: "Anh muốn dùng template có sẵn không?" (Clean Arch, Boilerplate).
|
|
32
|
+
|
|
33
|
+
**Kịch bản B: Thư mục có Code (Adoption Mode)**
|
|
34
|
+
* AI quét cấu trúc hiện tại.
|
|
35
|
+
* Tự động điền `.project-identity`.
|
|
36
|
+
* Đề xuất: "Em thấy dự án này đang dùng [Stack]. Anh có muốn em setup lại folder `docs/` và `scripts/` để chuẩn hóa theo Antigravity Workflow không?"
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🧠 Giai đoạn 2: The Antigravity Core Injection
|
|
41
|
+
*Đây là "bí mật" tạo nên sự khác biệt. Setup nền tảng cho các workflow nâng cao.*
|
|
42
|
+
|
|
43
|
+
### 2.1. Create Standard Ecosystem
|
|
44
|
+
Tự động tạo các thư mục và file mẫu:
|
|
45
|
+
|
|
46
|
+
1. **Antigravity Core**:
|
|
47
|
+
```bash
|
|
48
|
+
mkdir -p docs/specs/_templates
|
|
49
|
+
mkdir -p docs/architecture/decisions
|
|
50
|
+
mkdir -p .gemini/scripts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. **App Structure (Platform-Specific)**:
|
|
54
|
+
* **Action:** Đọc template cấu trúc từ `~/.gemini/antigravity/templates/structures/[platform].txt`.
|
|
55
|
+
* **Execute:** Tạo folder tree tương ứng.
|
|
56
|
+
* *Ví dụ iOS:* `App/Features`, `App/Shared`, `Tests`, ...
|
|
57
|
+
|
|
58
|
+
### 2.2. Inject Templates (Spec & Architecture)
|
|
59
|
+
Tạo file mẫu để workflow `/plan` (create-spec) hoạt động trơn tru:
|
|
60
|
+
|
|
61
|
+
**`docs/specs/_templates/requirements_template.md`**:
|
|
62
|
+
*(Mẫu chuẩn Requirements từng dùng ở `create-spec-architect`)*
|
|
63
|
+
|
|
64
|
+
**`docs/specs/_templates/architecture_template.md`**:
|
|
65
|
+
*(Mẫu chuẩn Clean Architecture Decision)*
|
|
66
|
+
|
|
67
|
+
### 2.3. Inject Automation Scripts
|
|
68
|
+
Tạo script để user gõ lệnh tắt là chạy workflow:
|
|
69
|
+
|
|
70
|
+
**`scripts/scaffold_feature.sh`**:
|
|
71
|
+
*(Script gọi đến `structure-clean-architect` workflow)*
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🏗️ Giai đoạn 3: Project Skeleton & Hidden Setup
|
|
76
|
+
*(Kế thừa từ v4.0 nhưng mạnh mẽ hơn)*
|
|
77
|
+
|
|
78
|
+
1. **Generate `.project-identity`**: (Bắt buộc, là trái tim của mọi workflow).
|
|
79
|
+
* **Action:** Copy template từ `~/.gemini/antigravity/templates/project-identity/`:
|
|
80
|
+
* `ios.json` cho iOS.
|
|
81
|
+
* `android.json` cho Android.
|
|
82
|
+
* `expo.json` cho Cross-platform.
|
|
83
|
+
* `web-nextjs.json` cho Web App.
|
|
84
|
+
* `backend-nestjs.json` cho API.
|
|
85
|
+
* **Customize:** Thay thế các placeholder (`{{DATE}}`, `projectName`) bằng thông tin thực tế.
|
|
86
|
+
2. **Git Setup**: `.gitignore` thông minh theo stack.
|
|
87
|
+
3. **Linter/Formatter**: Cài ESLint/SwiftLint/Detekt ngay lập tức.
|
|
88
|
+
4. **CI/CD Basics**: Tạo `.github/workflows/ci.yml` cơ bản (build test).
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 🎨 Giai đoạn 4: Visual Vision (The WOW Factor)
|
|
93
|
+
*Không để user chờ đợi với màn hình đen trắng.*
|
|
94
|
+
|
|
95
|
+
1. **Brainstorm UI Concept**:
|
|
96
|
+
* Dựa trên ý tưởng user, AI tự nghĩ ra 1 `prompt` mô tả giao diện cực xịn (Dark/Light mode, Glassmorphism...).
|
|
97
|
+
2. **Generate Mockup**:
|
|
98
|
+
* Gọi tool `generate_image` để tạo ngay 1 ảnh "Vision Art".
|
|
99
|
+
* Hiển thị cho user: "App của anh trông sẽ ngầu như thế này này!"
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 🔗 Giai đoạn 5: Handover to Specialized Workflows
|
|
104
|
+
*Sự kết nối chặt chẽ với các quy trình user yêu thích.*
|
|
105
|
+
|
|
106
|
+
Báo cáo hoàn tất và trỏ ngay sang các bước tiếp theo:
|
|
107
|
+
|
|
108
|
+
### ⚠️ NEXT STEPS (Choose your path):
|
|
109
|
+
|
|
110
|
+
**Path A: The Planner (Chậm mà chắc)**
|
|
111
|
+
> "Tôi muốn lên kế hoạch chi tiết cho tính năng đầu tiên."
|
|
112
|
+
👉 Gõ: **/plan** (Sẽ chạy `create-spec-architect` dùng template vừa tạo).
|
|
113
|
+
|
|
114
|
+
**Path B: The Builder (Mì ăn liền)**
|
|
115
|
+
> "Tôi muốn thấy cấu trúc code ngay."
|
|
116
|
+
👉 Gõ: **/structure** (Sẽ chạy `structure-clean-architect` dựa trên `.project-identity`).
|
|
117
|
+
|
|
118
|
+
**Path C: The Artist (UI First)**
|
|
119
|
+
> "Tôi muốn thiết kế giao diện trước."
|
|
120
|
+
👉 Gõ: **/visualize** (Sẽ chạy `design-to-ui` / `ui-first-methodology`).
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 📝 Example Execution for User
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Antigravity Initializer v4.1
|
|
128
|
+
----------------------------
|
|
129
|
+
✅ Checking Environment... OK
|
|
130
|
+
✅ Checking MCPs... Firebase (OFF), Maestro (ON)
|
|
131
|
+
📂 Project detected: Empty folder
|
|
132
|
+
|
|
133
|
+
🤖 Let's build something great!
|
|
134
|
+
... [Vision Capture Questions] ...
|
|
135
|
+
|
|
136
|
+
🚀 Setting up Antigravity Core...
|
|
137
|
+
+ docs/specs/_templates
|
|
138
|
+
+ .project-identity
|
|
139
|
+
+ .gitignore
|
|
140
|
+
+ scripts/scaffold_feature.sh
|
|
141
|
+
|
|
142
|
+
🎨 Generating Vision Concept... [Done]
|
|
143
|
+
(Image: A sleek, dark-themed dashboard for [AppName])
|
|
144
|
+
|
|
145
|
+
🎉 SETUP COMPLETE!
|
|
146
|
+
Your "Operating System" is ready.
|
|
147
|
+
|
|
148
|
+
What's your first move?
|
|
149
|
+
1. /plan [FeatureName] (Recommended: Create Specs first)
|
|
150
|
+
2. /structure [FeatureName] (Scaffold Code)
|
|
151
|
+
3. /visualize (Design UI)
|
|
152
|
+
```
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quy trình thiết kế tính năng toàn diện từ kiến trúc đến triển khai chi tiết.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /master-code-workflow - Feature Design Pipeline
|
|
6
|
+
|
|
7
|
+
> **Antigravity Lead Architect** - Master workflow for complete feature development
|
|
8
|
+
|
|
9
|
+
**Mission:** Production-ready features with comprehensive specs, clean architecture, and premium UI/UX.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🎯 Pipeline Overview
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
17
|
+
│ FEATURE DESIGN PIPELINE │
|
|
18
|
+
├─────────────────────────────────────────────────────────────┤
|
|
19
|
+
│ Phase 1: PROJECT STEERING (1x per project) │
|
|
20
|
+
│ └── product.md → structure.md → tech.md │
|
|
21
|
+
│ ↓ │
|
|
22
|
+
│ Phase 2: CLEAN ARCHITECTURE │
|
|
23
|
+
│ └── Domain → Data → Presentation layers │
|
|
24
|
+
│ ↓ │
|
|
25
|
+
│ Phase 3: FEATURE SPECS │
|
|
26
|
+
│ └── requirements.md → design.md → bd tasks │
|
|
27
|
+
│ ↓ │
|
|
28
|
+
│ Phase 4: UI/UX DESIGN │
|
|
29
|
+
│ └── Design analysis + Platform guidelines │
|
|
30
|
+
│ ↓ │
|
|
31
|
+
│ Phase 5: IMPLEMENTATION │
|
|
32
|
+
│ └── Code → Tests → Security → Localization │
|
|
33
|
+
│ ↓ │
|
|
34
|
+
│ Phase 6: QUALITY ASSURANCE │
|
|
35
|
+
│ └── Review → Polish → Documentation │
|
|
36
|
+
└─────────────────────────────────────────────────────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 0: Prerequisites
|
|
42
|
+
|
|
43
|
+
### 0.1. Check Project Identity
|
|
44
|
+
// turbo
|
|
45
|
+
```bash
|
|
46
|
+
[ -f ".project-identity" ] && echo "✅ Found" || echo "❌ Missing"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**If missing**: Run `/init` workflow first.
|
|
50
|
+
|
|
51
|
+
### 0.2. Detect Platform
|
|
52
|
+
Read `.project-identity` to detect:
|
|
53
|
+
- **iOS**: Swift/SwiftUI → Apple HIG
|
|
54
|
+
- **Android**: Kotlin/Compose → Material Design 3
|
|
55
|
+
- **Expo**: TypeScript/React Native → Platform-adaptive
|
|
56
|
+
- **Web**: React/Vue/Next.js → Modern web patterns
|
|
57
|
+
|
|
58
|
+
### 0.3. Check Steering Docs
|
|
59
|
+
// turbo
|
|
60
|
+
```bash
|
|
61
|
+
[ -d "docs/steering" ] && echo "✅ Exists" || echo "❌ Missing"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Phase 1: Project Steering (One-time)
|
|
67
|
+
|
|
68
|
+
> **Skip if `docs/steering/` exists and is complete.**
|
|
69
|
+
|
|
70
|
+
### 1.1. Create Steering Directory
|
|
71
|
+
// turbo
|
|
72
|
+
```bash
|
|
73
|
+
mkdir -p docs/steering
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 1.2. Create Steering Documents
|
|
77
|
+
|
|
78
|
+
**Required Files:**
|
|
79
|
+
- `docs/steering/product.md` - Product overview, mission, target users
|
|
80
|
+
- `docs/steering/structure.md` - Project structure, naming conventions
|
|
81
|
+
- `docs/steering/tech.md` - Tech stack, build commands, conventions
|
|
82
|
+
|
|
83
|
+
**Templates:** See `templates/specs/steering-*.md` for detailed templates.
|
|
84
|
+
|
|
85
|
+
**Content Guidelines:**
|
|
86
|
+
- **product.md**: Target users, key features, design philosophy, business model
|
|
87
|
+
- **structure.md**: Directory structure, file naming, architecture patterns
|
|
88
|
+
- **tech.md**: Build system, tech stack, common commands, code style
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Phase 2: Clean Architecture Setup
|
|
93
|
+
|
|
94
|
+
### 2.1. Create Feature Directory Structure
|
|
95
|
+
|
|
96
|
+
Based on platform:
|
|
97
|
+
|
|
98
|
+
**iOS (Swift/SwiftUI):**
|
|
99
|
+
```bash
|
|
100
|
+
mkdir -p Features/[FeatureName]/{Views,ViewModels,Models,Services,Tests}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Android (Kotlin/Compose):**
|
|
104
|
+
```bash
|
|
105
|
+
mkdir -p app/src/main/java/com/[package]/features/[featurename]/{ui,viewmodel,model,repository}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Expo (TypeScript):**
|
|
109
|
+
```bash
|
|
110
|
+
mkdir -p src/features/[featurename]/{screens,hooks,components,types}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 2.2. Architecture Compliance Checklist
|
|
114
|
+
- [ ] Domain layer has no UI/Framework dependencies
|
|
115
|
+
- [ ] Data layer implements Domain interfaces
|
|
116
|
+
- [ ] Presentation layer depends on Domain only
|
|
117
|
+
- [ ] Proper separation of concerns
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Phase 3: Feature Specs (Kiro-style)
|
|
122
|
+
|
|
123
|
+
### 3.1. Create Feature Specs Directory
|
|
124
|
+
// turbo
|
|
125
|
+
```bash
|
|
126
|
+
mkdir -p docs/specs/[feature-name]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 3.2. Generate Spec Documents
|
|
130
|
+
|
|
131
|
+
**Required Files:**
|
|
132
|
+
1. `requirements.md` - User stories & acceptance criteria
|
|
133
|
+
2. `design.md` - Technical design & architecture
|
|
134
|
+
|
|
135
|
+
**Templates Location:**
|
|
136
|
+
- `templates/specs/requirements-template.md`
|
|
137
|
+
- `templates/specs/design-template.md`
|
|
138
|
+
- `templates/specs/tasks-template.md`
|
|
139
|
+
|
|
140
|
+
**Generation Process:**
|
|
141
|
+
1. Copy templates to `docs/specs/[feature-name]/`
|
|
142
|
+
2. Fill in feature-specific details
|
|
143
|
+
3. Ensure traceability: tasks → design → requirements
|
|
144
|
+
|
|
145
|
+
### 3.3. Spec Quality Checklist
|
|
146
|
+
- [ ] All requirements have acceptance criteria
|
|
147
|
+
- [ ] Design includes component hierarchy
|
|
148
|
+
- [ ] Data models are fully defined
|
|
149
|
+
- [ ] Tasks reference specific requirements
|
|
150
|
+
- [ ] Correctness properties defined
|
|
151
|
+
- [ ] UI/UX specifications complete
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Phase 4: UI/UX Design
|
|
156
|
+
|
|
157
|
+
### 4.1. Design Source Analysis
|
|
158
|
+
|
|
159
|
+
**If design file provided:**
|
|
160
|
+
- Analyze layout, components, interactions
|
|
161
|
+
- Extract color palette, typography, spacing
|
|
162
|
+
- Document animations and transitions
|
|
163
|
+
|
|
164
|
+
**If no design file:**
|
|
165
|
+
- Follow platform guidelines (HIG/Material Design)
|
|
166
|
+
- Use design system tokens
|
|
167
|
+
- Ensure accessibility compliance
|
|
168
|
+
|
|
169
|
+
### 4.2. Platform-Specific Adaptations
|
|
170
|
+
|
|
171
|
+
**iOS:**
|
|
172
|
+
- SF Symbols for icons
|
|
173
|
+
- NavigationStack for navigation
|
|
174
|
+
- .ultraThinMaterial for glass effects
|
|
175
|
+
- Haptic feedback on key actions
|
|
176
|
+
|
|
177
|
+
**Android:**
|
|
178
|
+
- Material Icons
|
|
179
|
+
- NavHost for navigation
|
|
180
|
+
- Material Design 3 surfaces
|
|
181
|
+
- Standard Android haptics
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Phase 5: Implementation
|
|
186
|
+
|
|
187
|
+
### 5.1. Recommended Approach
|
|
188
|
+
|
|
189
|
+
**Option A: Manual Implementation**
|
|
190
|
+
Use `/create-feature` for hands-on coding with spec guidance.
|
|
191
|
+
|
|
192
|
+
**Option B: Automated Implementation**
|
|
193
|
+
Use `/auto-implement [feature-name]` for spec-driven auto-coding.
|
|
194
|
+
|
|
195
|
+
### 5.2. Implementation Standards
|
|
196
|
+
|
|
197
|
+
**Must Include:**
|
|
198
|
+
- [ ] Input validation
|
|
199
|
+
- [ ] Error handling (try-catch)
|
|
200
|
+
- [ ] Security measures (auth, validation)
|
|
201
|
+
- [ ] Performance optimization (lazy loading, caching)
|
|
202
|
+
- [ ] Logging for important actions
|
|
203
|
+
- [ ] Localization (no hardcoded strings)
|
|
204
|
+
- [ ] Accessibility labels
|
|
205
|
+
- [ ] Unit tests (>80% coverage)
|
|
206
|
+
|
|
207
|
+
### 5.3. Progress Tracking
|
|
208
|
+
|
|
209
|
+
Update `bd` status as you complete each task:
|
|
210
|
+
```bash
|
|
211
|
+
bd close [id]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Phase 6: Quality Assurance
|
|
217
|
+
|
|
218
|
+
### 6.1. Code Review Checklist
|
|
219
|
+
- [ ] All requirements validated
|
|
220
|
+
- [ ] Build passes without errors
|
|
221
|
+
- [ ] No hardcoded strings
|
|
222
|
+
- [ ] Accessibility implemented
|
|
223
|
+
- [ ] Security measures in place
|
|
224
|
+
- [ ] Tests written and passing
|
|
225
|
+
- [ ] Performance acceptable
|
|
226
|
+
|
|
227
|
+
### 6.2. Final Validation
|
|
228
|
+
- [ ] Test on multiple device sizes
|
|
229
|
+
- [ ] Verify offline functionality
|
|
230
|
+
- [ ] Check error recovery scenarios
|
|
231
|
+
- [ ] Validate all user flows
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Workflow Integration
|
|
236
|
+
|
|
237
|
+
### Related Workflows
|
|
238
|
+
|
|
239
|
+
**Design Phase:**
|
|
240
|
+
- `/design-feature` - Create specs only (no code)
|
|
241
|
+
|
|
242
|
+
**Implementation Phase:**
|
|
243
|
+
- `/auto-implement` - Auto-execute from specs
|
|
244
|
+
- `/create-feature` - Manual implementation with guidance
|
|
245
|
+
|
|
246
|
+
**Quality Phase:**
|
|
247
|
+
- `/code-review` - Pre-push review
|
|
248
|
+
- `/self-healing-test` - Auto-fix failing tests
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Usage Examples
|
|
253
|
+
|
|
254
|
+
### Complete New Feature
|
|
255
|
+
```
|
|
256
|
+
1. /master-code-workflow
|
|
257
|
+
→ Creates steering docs (if needed)
|
|
258
|
+
→ Creates feature specs
|
|
259
|
+
→ Guides through implementation
|
|
260
|
+
|
|
261
|
+
2. /auto-implement [feature-name]
|
|
262
|
+
→ Auto-executes tasks from specs
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Specs Only (Design First)
|
|
266
|
+
```
|
|
267
|
+
1. /design-feature
|
|
268
|
+
→ Creates requirements.md, design.md
|
|
269
|
+
|
|
270
|
+
2. Review and refine specs manually
|
|
271
|
+
|
|
272
|
+
3. /auto-implement [feature-name]
|
|
273
|
+
→ Auto-executes when ready
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Success Criteria
|
|
279
|
+
|
|
280
|
+
✅ **Complete Documentation:**
|
|
281
|
+
- Steering docs (product, structure, tech)
|
|
282
|
+
- Feature specs (requirements, design, tasks)
|
|
283
|
+
|
|
284
|
+
✅ **Clean Architecture:**
|
|
285
|
+
- Proper layer separation
|
|
286
|
+
- Clear dependencies
|
|
287
|
+
- Testable code
|
|
288
|
+
|
|
289
|
+
✅ **Production Quality:**
|
|
290
|
+
- All tests passing
|
|
291
|
+
- Security validated
|
|
292
|
+
- Accessibility compliant
|
|
293
|
+
- Performance optimized
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
**Next Steps After Completion:**
|
|
298
|
+
- `/run` - Test on device
|
|
299
|
+
- `/code-review` - Pre-merge review
|
|
300
|
+
- `/save-brain` - Document decisions
|