antigravity-ide 4.1.28 → 4.1.30
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/.agent/scripts/update-docs.js +115 -0
- package/README.md +2 -2
- package/README.vi.md +2 -2
- package/cli/create.js +6 -0
- package/cli/repair.js +10 -0
- package/docs/AGENTS_GUIDE.vi.md +61 -0
- package/docs/CONTRIBUTING.vi.md +55 -0
- package/docs/FAQ.vi.md +45 -0
- package/docs/GEMINI_USAGE.md +294 -0
- package/docs/GLOSSARY.vi.md +128 -0
- package/docs/HOW_ANTIGRAVITY_THINKS.vi.md +80 -0
- package/docs/INSTALL_NPX_GUIDE.md +106 -0
- package/docs/INSTALL_NPX_GUIDE.vi.md +106 -0
- package/docs/MASTER_OPERATIONS.md +85 -0
- package/docs/MASTER_OPERATIONS.vi.md +85 -0
- package/docs/OPERATIONAL_FLOW.vi.md +162 -0
- package/docs/PUBLISHING_GUIDE.md +206 -0
- package/docs/RULES_GUIDE.vi.md +96 -0
- package/docs/SHARED_LIBRARY_GUIDE.vi.md +49 -0
- package/docs/SKILLS_GUIDE.vi.md +143 -0
- package/docs/TROUBLESHOOTING.vi.md +61 -0
- package/docs/UNINSTALL_GUIDE.vi.md +58 -0
- package/docs/UPDATE_GUIDE.vi.md +63 -0
- package/docs/WORKFLOW_GUIDE.vi.md +148 -0
- package/package.json +3 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @script update-docs.js
|
|
3
|
+
* @version 4.2.0
|
|
4
|
+
* @layer internal
|
|
5
|
+
* @protocol unified-protocol-v1
|
|
6
|
+
* @description Tự động cập nhật số liệu thống kê trong các file tài liệu hướng dẫn.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
// Đường dẫn các file cần cập nhật
|
|
13
|
+
const DOCS_FILES = {
|
|
14
|
+
README_VI: 'README.vi.md',
|
|
15
|
+
README_EN: 'README.md',
|
|
16
|
+
SKILLS_GUIDE: 'docs/SKILLS_GUIDE.vi.md',
|
|
17
|
+
RULES_GUIDE: 'docs/RULES_GUIDE.vi.md',
|
|
18
|
+
WORKFLOW_GUIDE: 'docs/WORKFLOW_GUIDE.vi.md'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Đếm số lượng Skills
|
|
22
|
+
function countSkills() {
|
|
23
|
+
const skillsDir = path.join(process.cwd(), '.agent', 'skills');
|
|
24
|
+
if (!fs.existsSync(skillsDir)) return 0;
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const items = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
28
|
+
return items.filter(item => item.isDirectory()).length;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
logError(err, "Failed to read skills directory");
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Đếm số lượng Workflows
|
|
36
|
+
function countWorkflows() {
|
|
37
|
+
const workflowsDir = path.join(process.cwd(), '.agent', 'workflows');
|
|
38
|
+
if (!fs.existsSync(workflowsDir)) return 0;
|
|
39
|
+
|
|
40
|
+
const items = fs.readdirSync(workflowsDir);
|
|
41
|
+
return items.filter(item => item.endsWith('.md')).length;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Đếm số lượng Rules
|
|
45
|
+
function countRules() {
|
|
46
|
+
const rulesDir = path.join(process.cwd(), '.agent', 'rules');
|
|
47
|
+
if (!fs.existsSync(rulesDir)) return 0;
|
|
48
|
+
|
|
49
|
+
const items = fs.readdirSync(rulesDir);
|
|
50
|
+
return items.filter(item => item.endsWith('.md')).length;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Cập nhật số liệu trong README
|
|
54
|
+
function updateCounts() {
|
|
55
|
+
const skills = countSkills();
|
|
56
|
+
const workflows = countWorkflows();
|
|
57
|
+
const rules = countRules();
|
|
58
|
+
|
|
59
|
+
console.log('📊 Current Statistics:');
|
|
60
|
+
console.log(` Skills: ${skills}`);
|
|
61
|
+
console.log(` Workflows: ${workflows}`);
|
|
62
|
+
console.log(` Rules: ${rules}`);
|
|
63
|
+
|
|
64
|
+
return { skills, workflows, rules };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Main function
|
|
68
|
+
async function main() {
|
|
69
|
+
console.log('🚀 Auto-Update Documentation System\n');
|
|
70
|
+
|
|
71
|
+
const stats = updateCounts();
|
|
72
|
+
|
|
73
|
+
console.log('\n✅ Statistics collected successfully!');
|
|
74
|
+
console.log('💡 Tip: Use this data to update README.md and other docs manually for now.');
|
|
75
|
+
console.log(' Future versions will support automatic text replacement.');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function logError(error, context) {
|
|
79
|
+
const errorLogPath = path.join(process.cwd(), 'ERRORS.md');
|
|
80
|
+
const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 16);
|
|
81
|
+
const entry = `
|
|
82
|
+
## [${timestamp}] - Update-Docs Script Failure
|
|
83
|
+
|
|
84
|
+
- **Type**: Runtime
|
|
85
|
+
- **Severity**: Low
|
|
86
|
+
- **File**: \`.agent/scripts/internal/update-docs.js\`
|
|
87
|
+
- **Agent**: Senior Documentation Engine
|
|
88
|
+
- **Root Cause**: ${context}
|
|
89
|
+
- **Error Message**:
|
|
90
|
+
\`\`\`
|
|
91
|
+
${error.message || error}
|
|
92
|
+
\`\`\`
|
|
93
|
+
- **Fix Applied**: N/A
|
|
94
|
+
- **Prevention**: Ensure file system permissions are correct
|
|
95
|
+
- **Status**: Investigating
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
`;
|
|
99
|
+
fs.appendFileSync(errorLogPath, entry);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Run if called directly
|
|
103
|
+
if (require.main === module) {
|
|
104
|
+
try {
|
|
105
|
+
main().catch(err => {
|
|
106
|
+
logError(err, "Async main execution failed");
|
|
107
|
+
console.error(err);
|
|
108
|
+
});
|
|
109
|
+
} catch (err) {
|
|
110
|
+
logError(err, "Sync main execution failed");
|
|
111
|
+
console.error(err);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = { countSkills, countWorkflows, countRules, updateCounts };
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🛰️ AntiGravity IDE
|
|
4
|
-
### *Advanced Edition • v4.1.
|
|
4
|
+
### *Advanced Edition • v4.1.30 Meta-Engine*
|
|
5
5
|
|
|
6
6
|
<!-- BADGES: Spaced & Tightly Wrapped to prevent Underlines -->
|
|
7
7
|
<p align="center">
|
|
@@ -52,7 +52,7 @@ npx antigravity-ide [project-name]
|
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
## ✨ The Premium Edge (v4.1.
|
|
55
|
+
## ✨ The Premium Edge (v4.1.30)
|
|
56
56
|
|
|
57
57
|
Why choose AntiGravity over standard AI wrappers?
|
|
58
58
|
|
package/README.vi.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🛰️ AntiGravity IDE
|
|
4
|
-
### *Phiên bản Nâng cao • v4.1.
|
|
4
|
+
### *Phiên bản Nâng cao • v4.1.30 Meta-Engine*
|
|
5
5
|
|
|
6
6
|
<!-- BADGES: Spaced & Tightly Wrapped to prevent Underlines -->
|
|
7
7
|
<p align="center">
|
|
@@ -52,7 +52,7 @@ npx antigravity-ide [ten-du-an]
|
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
## ✨ Điểm khác biệt (Phiên bản v4.1.
|
|
55
|
+
## ✨ Điểm khác biệt (Phiên bản v4.1.30)
|
|
56
56
|
|
|
57
57
|
Tại sao nên chọn AntiGravity thay vì các AI wrapper thông thường?
|
|
58
58
|
|
package/cli/create.js
CHANGED
|
@@ -250,6 +250,12 @@ async function copyModularStructure(projectPath, config, rulesList, agentsList)
|
|
|
250
250
|
await fs.copy(path.join(sourceAgentDir, '.shared'), path.join(destAgentDir, '.shared'), { filter });
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
// 1b. Copy Root Concept Files (Architecture, Start Here, etc.) - FIX for v4.1.30
|
|
254
|
+
const rootFiles = fs.readdirSync(sourceAgentDir).filter(f => f.endsWith('.md') && f !== 'GEMINI.md'); // GEMINI.md is generated
|
|
255
|
+
for (const file of rootFiles) {
|
|
256
|
+
await fs.copy(path.join(sourceAgentDir, file), path.join(destAgentDir, file));
|
|
257
|
+
}
|
|
258
|
+
|
|
253
259
|
// 2. Copy Rules (SELECTIVE)
|
|
254
260
|
const rulesDest = path.join(destAgentDir, 'rules');
|
|
255
261
|
fs.mkdirSync(rulesDest, { recursive: true });
|
package/cli/repair.js
CHANGED
|
@@ -48,6 +48,16 @@ async function repairProject(projectPath, options, config) {
|
|
|
48
48
|
}
|
|
49
49
|
spinner.succeed('Shared DNA synchronized to v' + require('../package.json').version);
|
|
50
50
|
|
|
51
|
+
// 1b. Restore Root Concepts (Architecture, Concepts, etc.) - FIX v4.1.30
|
|
52
|
+
const rootFiles = fs.readdirSync(sourceAgentDir).filter(f => f.endsWith('.md') && f !== 'GEMINI.md');
|
|
53
|
+
for (const file of rootFiles) {
|
|
54
|
+
const srcFile = path.join(sourceAgentDir, file);
|
|
55
|
+
const destFile = path.join(agentDir, file);
|
|
56
|
+
if (!fs.existsSync(destFile) || options.force) {
|
|
57
|
+
await fs.copy(srcFile, destFile, { overwrite: options.force });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
51
61
|
// 2. Restore/Update Rules
|
|
52
62
|
spinner.start('Verifying Rules & Compliance...');
|
|
53
63
|
const rulesSourceDir = path.join(sourceAgentDir, 'rules');
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# 🕵️ Hướng Dẫn Về "Hệ Thống Agent" (Digital Employees)
|
|
2
|
+
|
|
3
|
+
> **Antigravity** không chỉ là công cụ, mà là một **Hệ điều hành Nhân sự AI**. Mọi Agent đều đã được nâng cấp lên chuẩn **Senior Principal Personnel** với khả năng phối hợp hệ sinh thái và kỷ luật vận hành tuyệt đối.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Biệt Đội Chuyên Gia (The Squad)
|
|
8
|
+
|
|
9
|
+
Dưới đây là danh sách các nhân viên ảo sẽ phục vụ bạn:
|
|
10
|
+
|
|
11
|
+
### 1. Nhóm Kỹ Thuật Cốt Lõi (Engineering Core)
|
|
12
|
+
* **`backend-specialist`**: Chuyên gia xây dựng API, System Architecture và xử lý Logic Server.
|
|
13
|
+
* **`frontend-specialist`**: Chuyên gia UI/UX, React/Next.js và tối ưu trải nghiệm người dùng.
|
|
14
|
+
* **`database-architect`**: Thiết kế Schema, tối ưu truy vấn SQL/NoSQL và Data Modeling.
|
|
15
|
+
* **`mobile-developer`**: Phát triển ứng dụng iOS/Android đa nền tảng (React Native/Flutter).
|
|
16
|
+
* **`devops-engineer`**: Quản lý Docker, CI/CD Pipeline, Kubernetes và hạ tầng Cloud.
|
|
17
|
+
* **`cloud-architect`**: Thiết kế kiến trúc đám mây (AWS/Azure), Serverless và Scalability.
|
|
18
|
+
* **`performance-optimizer`**: Chuyên gia tối ưu tốc độ tải trang, giảm độ trễ và Memory Leak.
|
|
19
|
+
|
|
20
|
+
### 2. Nhóm Sản Phẩm & Chiến Lược (Product & Strategy)
|
|
21
|
+
* **`orchestrator`**: Tổng chỉ huy, điều phối các Agent khác phối hợp nhịp nhàng.
|
|
22
|
+
* **`product-manager`**: Quản lý lộ trình sản phẩm (Roadmap), ưu tiên tính năng.
|
|
23
|
+
* **`product-owner`**: Đại diện tiếng nói người dùng, định nghĩa yêu cầu nghiệp vụ (User Stories).
|
|
24
|
+
* **`project-planner`**: Lập kế hoạch thực thi, chia nhỏ task và ước lượng thời gian.
|
|
25
|
+
|
|
26
|
+
### 3. Nhóm Chất Lượng & Bảo Mật (Quality & Security)
|
|
27
|
+
* **`security-auditor`**: Rà soát mã nguồn, phát hiện lỗ hổng bảo mật (OWASP) và tuân thủ đạo đức AI (Fabric).
|
|
28
|
+
* **`penetration-tester`**: Tấn công thử nghiệm (Red Team) để tìm điểm yếu hệ thống.
|
|
29
|
+
* **`quality-inspector`**: Kiểm tra tiêu chuẩn code (Linting, Convention) và độ ổn định.
|
|
30
|
+
* **`test-engineer`**: Viết và chạy các kịch bản kiểm thử (Unit/Integration Test).
|
|
31
|
+
* **`qa-automation-engineer`**: Tự động viết và chạy kịch bản kiểm thử E2E (Playwright MCP).
|
|
32
|
+
|
|
33
|
+
### 4. Nhóm Hỗ Trợ & Phân Tích (Support & Analysis)
|
|
34
|
+
* **`documentation-writer`**: Soạn thảo tài liệu kỹ thuật, API Docs và Hướng dẫn sử dụng.
|
|
35
|
+
* **`seo-specialist`**: Tối ưu hóa công cụ tìm kiếm, Meta tags và cấu trúc nội dung.
|
|
36
|
+
* **`game-developer`**: Chuyên gia phát triển Logic Game, Physics và Đồ họa.
|
|
37
|
+
* **`explorer-agent`**: Thám hiểm các công nghệ mới, tìm kiếm giải pháp sáng tạo.
|
|
38
|
+
* **`code-archaeologist`**: "Nhà khảo cổ" chuyên đọc và giải thích các mã nguồn cũ (Legacy Code).
|
|
39
|
+
* **`debugger`**: Thám tử điều tra lỗi, phân tích Log và tìm nguyên nhân gốc rễ.
|
|
40
|
+
|
|
41
|
+
### 🤝 Giao thức Phối hợp (Ecosystem Protocol)
|
|
42
|
+
Mỗi Agent hiện nay không làm việc cô lập. Họ tuân thủ:
|
|
43
|
+
- **Handoff**: Chuyển giao ngữ cảnh (API docs, PRD, Test logs) cho Agent tiếp theo.
|
|
44
|
+
- **Socratic Gatekeeping**: Biết dừng lại hỏi ý kiến người dùng hoặc đồng nghiệp khi thấy rủi ro.
|
|
45
|
+
- **DNA Linkage**: Luôn kiểm tra `GEMINI.md` và `MASTER_GUIDE.md` trước khi hành động.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. Cách các Agent phối hợp
|
|
50
|
+
|
|
51
|
+
Khác với chat thông thường, các Agent này biết **"chia sẻ não bộ"** cho nhau:
|
|
52
|
+
|
|
53
|
+
1. Bạn ra lệnh: *"Làm tính năng Đăng nhập"*.
|
|
54
|
+
2. **Project Planner** nhảy vào trước: *"Ok, cần trang Login, API Auth, và Bảng User"*.
|
|
55
|
+
3. Sau đó nó giao việc:
|
|
56
|
+
* Viết UI -> Giao cho **Frontend Specialist**.
|
|
57
|
+
* Viết API -> Giao cho **Backend Specialist**.
|
|
58
|
+
* Tạo Bảng -> Giao cho **DB Architect**.
|
|
59
|
+
4. Cuối cùng **Test Engineer** sẽ vào kiểm tra xem mọi thứ có chạy đúng không.
|
|
60
|
+
|
|
61
|
+
> **Điều này đảm bảo code của bạn luôn có cấu trúc chặt chẽ, không bị "đầu voi đuôi chuột".**
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Hướng Dẫn Đóng Góp (Contributing)
|
|
2
|
+
|
|
3
|
+
Cảm ơn bạn đã quan tâm đến dự án AntiGravity IDE! Chúng tôi luôn chào đón mọi sự đóng góp từ cộng đồng để cùng xây dựng một hệ sinh thái mã nguồn mở vững mạnh.
|
|
4
|
+
|
|
5
|
+
> [!NOTE]
|
|
6
|
+
> Khi đóng góp, vui lòng tôn trọng bản quyền và các nguồn tham khảo (References) chính của dự án.
|
|
7
|
+
|
|
8
|
+
## 🤝 Quy Tắc Ứng Xử
|
|
9
|
+
Khi tham gia dự án, vui lòng giữ thái độ tôn trọng, lịch sự và chuyên nghiệp.
|
|
10
|
+
|
|
11
|
+
## 🚀 Cách Thức Đóng Góp
|
|
12
|
+
|
|
13
|
+
### 1. Báo Lỗi (Bug Report)
|
|
14
|
+
- Kiểm tra [Hướng Dẫn Khắc Phục Lỗi](./TROUBLESHOOTING.vi.md) xem lỗi đã biết chưa.
|
|
15
|
+
- Tạo Issue mới với tiêu đề rõ ràng.
|
|
16
|
+
- Mô tả các bước để tái hiện lỗi (Reproduce steps).
|
|
17
|
+
|
|
18
|
+
### 2. Đề Xuất Tính Năng
|
|
19
|
+
- Tạo Issue gắn tag `enhancement`.
|
|
20
|
+
- Giải thích *tại sao* tính năng này lại hữu ích cho cộng đồng.
|
|
21
|
+
|
|
22
|
+
### 3. Gửi Code (Pull Request)
|
|
23
|
+
- **Fork** dự án và tạo branch từ nhánh `develop`.
|
|
24
|
+
- **Tên Branch**: `feat/ten-tinh-nang` hoặc `fix/ten-loi`.
|
|
25
|
+
- **Commit Message**: Tuân thủ chuẩn [Conventional Commits](https://www.conventionalcommits.org/).
|
|
26
|
+
- `feat: them workflow moi`
|
|
27
|
+
- `fix: sua loi cai dat npm`
|
|
28
|
+
- `docs: cap nhat tai lieu`
|
|
29
|
+
- **Kiểm thử**: Đảm bảo chạy `npm test` thành công.
|
|
30
|
+
- **Lint Code**: Chạy `npm run lint` để code sạch đẹp.
|
|
31
|
+
|
|
32
|
+
### 4. Quy trình đăng ký Skill/Workflow mới
|
|
33
|
+
Để một Skill hoặc Workflow mới xuất hiện trong Setup Wizard, bạn cần:
|
|
34
|
+
1. **Skill**: Thêm định dạng vào `cli/logic/skill-definitions.js`.
|
|
35
|
+
2. **Workflow**: Thêm tên vào `cli/logic/workflow-manager.js`.
|
|
36
|
+
3. **Lựa chọn (Scale)**: Cấu hình quy mô xuất hiện (Instant/SME/Creative) trong `cli/logic/manifest-manager.js`.
|
|
37
|
+
|
|
38
|
+
## 🛠️ Cài Đặt Môi Trường Dev
|
|
39
|
+
|
|
40
|
+
1. Clone fork của bạn:
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/your-username/antigravity-ide.git
|
|
43
|
+
cd antigravity-ide
|
|
44
|
+
```
|
|
45
|
+
2. Cài đặt thư viện:
|
|
46
|
+
```bash
|
|
47
|
+
npm install
|
|
48
|
+
```
|
|
49
|
+
3. Link để test lệnh CLI:
|
|
50
|
+
```bash
|
|
51
|
+
npm link
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 📜 Bản Quyền
|
|
55
|
+
Mọi đóng góp của bạn sẽ tuân theo giấy phép MIT License của dự án.
|
package/docs/FAQ.vi.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ❓ Câu Hỏi Thường Gặp (FAQ)
|
|
2
|
+
|
|
3
|
+
## Chung (General)
|
|
4
|
+
|
|
5
|
+
### Q: AntiGravity IDE có phải là một phần mềm cài đặt vào máy không?
|
|
6
|
+
**A**: Không hẳn. Nó hoạt động như một lớp bổ trợ (layer) thông minh chạy trên nền Node.js. Bạn có thể gọi nó bất cứ lúc nào qua `npx` mà không cần cài đặt nặng nề như Visual Studio hay Android Studio.
|
|
7
|
+
|
|
8
|
+
### Q: Tôi có thể dùng nó với dự án có sẵn không (Brownfield Project)?
|
|
9
|
+
**A**: **Có!** Hãy cd vào thư mục dự án của bạn và chạy `npx antigravity-ide`. Nó sẽ tự động phát hiện dự án và chỉ thêm bộ não `.agent/` vào mà không làm hỏng code cũ của bạn.
|
|
10
|
+
|
|
11
|
+
### Q: Nó có miễn phí không?
|
|
12
|
+
**A**: Mã nguồn AntiGravity là **Open Source**. Tuy nhiên, để AI hoạt động thông minh, bạn cần API Key của các mô hình LLM (như Gemini, GPT-4, Claude) - phần này có thể tốn phí tùy nhà cung cấp.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Kỹ thuật (Technical)
|
|
17
|
+
|
|
18
|
+
### Q: Tại sao lại cần Python?
|
|
19
|
+
**A**: Chế độ "Advanced" sử dụng các thư viện Data Science và AI mạnh mẽ (như Pandas, Scikit-learn) chỉ có trên Python. Tuy nhiên, nếu bạn chỉ làm Web/App cơ bản (Standard Mode), bạn **KHÔNG** cần Python.
|
|
20
|
+
|
|
21
|
+
### Q: 600+ Chiến thuật (AI Patterns) là gì?
|
|
22
|
+
**A**: Đó không phải là 600 file, mà là tổng hợp các mẫu thiết kế (Design Patterns), Checklist kiểm thử, và Quy tắc bảo mật nằm *bên trong* 72 bộ Master Skills. Ví dụ: Skill "Mobile Design" chứa hơn 50 patterns về UX, Performance và Security cho iOS/Android.
|
|
23
|
+
|
|
24
|
+
### Q: File `GEMINI.md` là gì?
|
|
25
|
+
**A**: Đó là "CMND/CCCD" của AI Agent. Nó chứa danh tính, nhiệm vụ và các quy tắc ứng xử. AI sẽ đọc file này đầu tiên để biết "mình là ai".
|
|
26
|
+
|
|
27
|
+
### Q: Tôi lỡ tay ghi đè file cấu hình, có lấy lại được không?
|
|
28
|
+
**A**: Nếu chưa commit git -> Rất tiếc là không. Nếu đã dùng cờ `--force`, file cũ đã bị xóa vĩnh viễn. Hãy tập thói quen dùng Git!
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Vận hành (Operations)
|
|
33
|
+
|
|
34
|
+
### Q: Làm sao để Agent biết tôi vừa sửa code?
|
|
35
|
+
**A**: Agent hiện đại (như trong Cursor/Windsurf) thường tự đọc context. Nếu dùng CLI truyền thống, bạn cần nhắc Agent đọc lại file: "Đọc lại file X giúp tôi".
|
|
36
|
+
|
|
37
|
+
### Q: Tôi muốn tạo Agent riêng chuyên về Game thì làm sao?
|
|
38
|
+
**A**: Khi chạy `init`, ở bước chọn **Project Scale**, hãy chọn **Creative**. Sau đó chọn **AI Agent**. Hệ thống sẽ load bộ Skill `game-development` vào cho bạn.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Đóng góp (Contribution)
|
|
43
|
+
|
|
44
|
+
### Q: Tôi muốn thêm Skill mới cho cộng đồng?
|
|
45
|
+
**A**: Tuyệt vời! Hãy Fork repo trên GitHub, tạo folder skill mới trong `sdk/skills/` và gửi Pull Request. Xem thêm [CONTRIBUTING.vi.md](./CONTRIBUTING.vi.md).
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Using Antigravity IDE with Google Gemini
|
|
2
|
+
|
|
3
|
+
**All 72 Master Skills (600+ AI Patterns) are fully compatible with Google Gemini AI!**
|
|
4
|
+
|
|
5
|
+
## Why Antigravity IDE + Gemini?
|
|
6
|
+
|
|
7
|
+
### 🎯 **Perfect Synergy**
|
|
8
|
+
|
|
9
|
+
| Feature | Benefit for Gemini |
|
|
10
|
+
|---------|-------------------|
|
|
11
|
+
| **72 Master Skills** | Instant expertise in 8 domains (Standard v4.0.8) |
|
|
12
|
+
| **Universal Format** | No vendor lock-in, works with any Gemini model |
|
|
13
|
+
| **Large Context** | Gemini 1.5 Pro (2M tokens) loads multiple skills easily |
|
|
14
|
+
| **Multimodal Support** | Skills cover text, vision, audio - all Gemini capabilities |
|
|
15
|
+
| **Production-Tested** | Battle-tested with Claude/GPT, validated for Gemini |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🚀 Quick Start
|
|
20
|
+
|
|
21
|
+
### 1. Create Project
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx antigravity-ide my-gemini-agent
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Configure for Gemini
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
// .agent/config.js
|
|
31
|
+
export default {
|
|
32
|
+
model: {
|
|
33
|
+
provider: "google",
|
|
34
|
+
name: "gemini-2.0-flash-exp",
|
|
35
|
+
apiKey: process.env.GEMINI_API_KEY
|
|
36
|
+
},
|
|
37
|
+
skills: {
|
|
38
|
+
loadFrom: ".agent/skills",
|
|
39
|
+
categories: ["ai", "development", "data"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 3. Use Skills in Code
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import { GoogleGenerativeAI } from "@google/generative-ai";
|
|
48
|
+
import fs from "fs";
|
|
49
|
+
|
|
50
|
+
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
|
|
51
|
+
|
|
52
|
+
// Load skills
|
|
53
|
+
const skills = fs.readdirSync(".agent/skills")
|
|
54
|
+
.map(dir => fs.readFileSync(`.agent/skills/${dir}/SKILL.md`, "utf-8"))
|
|
55
|
+
.join("\n\n---\n\n");
|
|
56
|
+
|
|
57
|
+
const model = genAI.getGenerativeModel({
|
|
58
|
+
model: "gemini-2.0-flash-exp",
|
|
59
|
+
systemInstruction: `You are an AI agent with these skills:\n\n${skills}`
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Chat with skills!
|
|
63
|
+
const chat = model.startChat();
|
|
64
|
+
const result = await chat.sendMessage("Build a RAG system with TypeScript");
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 📁 Resource Inheritance (NEW)
|
|
70
|
+
|
|
71
|
+
This workspace is **Global-Powered**. Do not repeat standard rules/skills in local files.
|
|
72
|
+
1. **Primary Source**: `~/.antigravity/` (Global Master Skills & Rules)
|
|
73
|
+
2. **Secondary Source**: `.agent/` (Project-specific Overrides only)
|
|
74
|
+
|
|
75
|
+
If a workflow/skill is found in Global, use it as the default.
|
|
76
|
+
|
|
77
|
+
## 🧠 Recommended Skills for Gemini
|
|
78
|
+
|
|
79
|
+
### Core AI Skills
|
|
80
|
+
|
|
81
|
+
| Skill | Best For | Why for Gemini? |
|
|
82
|
+
|-------|----------|----------------|
|
|
83
|
+
| `ai-engineer` | LLM apps, RAG systems | Gemini-specific patterns |
|
|
84
|
+
| `prompt-engineer` | Prompt optimization | Leverage Gemini's reasoning |
|
|
85
|
+
| `rag-engineer` | Vector search, embeddings | Use Gemini's large context |
|
|
86
|
+
| `langchain-architecture` | Agent frameworks | LangChain supports Gemini |
|
|
87
|
+
| `agent-orchestration` | Multi-agent systems | Gemini Experimental 1206 |
|
|
88
|
+
|
|
89
|
+
### Development Skills
|
|
90
|
+
|
|
91
|
+
| Skill | Use Case |
|
|
92
|
+
|-------|----------|
|
|
93
|
+
| `nextjs-react-expert` | Frontend with structured outputs |
|
|
94
|
+
| `typescript-pro` | Type-safe Gemini SDK usage |
|
|
95
|
+
| `fastapi-pro` | Backend API for Gemini |
|
|
96
|
+
| `python-pro` | Gemini Python SDK |
|
|
97
|
+
|
|
98
|
+
### Data & Analytics
|
|
99
|
+
|
|
100
|
+
| Skill | Use Case |
|
|
101
|
+
|-------|----------|
|
|
102
|
+
| `data-engineer` | Process data for Gemini |
|
|
103
|
+
| `database-architect` | Design data stores |
|
|
104
|
+
| `vector-database-engineer` | Embeddings + Gemini |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 📊 Skill Categories Breakdown
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Total: 27 Master Skills (600+ capabilities) across 8 categories
|
|
112
|
+
|
|
113
|
+
Development (180+ skills)
|
|
114
|
+
├── Frontend (React, Next.js, Vue, Svelte)
|
|
115
|
+
├── Backend (Node.js, Python, Go, Rust)
|
|
116
|
+
├── Mobile (React Native, Flutter, iOS, Android)
|
|
117
|
+
└── Full-Stack
|
|
118
|
+
|
|
119
|
+
Infrastructure (90+ skills)
|
|
120
|
+
├── Cloud (AWS, Azure, GCP)
|
|
121
|
+
├── Kubernetes & Containers
|
|
122
|
+
├── CI/CD & GitOps
|
|
123
|
+
└── IaC (Terraform, CDK)
|
|
124
|
+
|
|
125
|
+
Database (60+ skills)
|
|
126
|
+
├── SQL (PostgreSQL, MySQL)
|
|
127
|
+
├── NoSQL (MongoDB, Redis)
|
|
128
|
+
├── Vector DBs (Pinecone, Qdrant)
|
|
129
|
+
└── Data Engineering
|
|
130
|
+
|
|
131
|
+
AI & ML (70+ skills) ⭐ Perfect for Gemini!
|
|
132
|
+
├── LLM Applications
|
|
133
|
+
├── RAG Engineering
|
|
134
|
+
├── Prompt Engineering
|
|
135
|
+
├── Agent Orchestration
|
|
136
|
+
└── ML Pipeline
|
|
137
|
+
|
|
138
|
+
Security (80+ skills)
|
|
139
|
+
├── Penetration Testing
|
|
140
|
+
├── Security Auditing
|
|
141
|
+
├── Vulnerability Scanning
|
|
142
|
+
└── Compliance
|
|
143
|
+
|
|
144
|
+
Design (40+ skills)
|
|
145
|
+
├── UI/UX Patterns
|
|
146
|
+
├── Mobile Design
|
|
147
|
+
├── Accessibility
|
|
148
|
+
└── Design Systems
|
|
149
|
+
|
|
150
|
+
Business (20+ skills)
|
|
151
|
+
├── SEO & Marketing
|
|
152
|
+
├── Product Management
|
|
153
|
+
├── Startup Analysis
|
|
154
|
+
└── Content Strategy
|
|
155
|
+
|
|
156
|
+
Tools (10+ skills)
|
|
157
|
+
├── Automation
|
|
158
|
+
├── CLI Development
|
|
159
|
+
└── DevOps Tools
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🎓 Learning Path: Gemini + Skills
|
|
165
|
+
|
|
166
|
+
### Beginner (Week 1)
|
|
167
|
+
1. Load `clean-code` skill
|
|
168
|
+
2. Load `ai-engineer` skill
|
|
169
|
+
3. Build simple chatbot with Gemini
|
|
170
|
+
|
|
171
|
+
### Intermediate (Week 2-3)
|
|
172
|
+
1. Add `rag-engineer` skill
|
|
173
|
+
2. Build knowledge base with Gemini + vector DB
|
|
174
|
+
3. Use `prompt-engineer` to optimize
|
|
175
|
+
|
|
176
|
+
### Advanced (Week 4+)
|
|
177
|
+
1. Load `agent-orchestration` + `langgraph`
|
|
178
|
+
2. Build multi-agent system
|
|
179
|
+
3. Deploy with `deployment-engineer` skill
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 💡 Best Practices
|
|
184
|
+
|
|
185
|
+
### Skill Loading Strategy
|
|
186
|
+
|
|
187
|
+
**Option 1: Load All (Gemini Pro)**
|
|
188
|
+
```javascript
|
|
189
|
+
// Gemini 1.5 Pro has 2M token context
|
|
190
|
+
// Can load multiple Master Skills!
|
|
191
|
+
const allSkills = loadAllSkills(".agent/skills");
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Option 2: Selective (Gemini Flash)**
|
|
195
|
+
```javascript
|
|
196
|
+
// Gemini 2.0 Flash - load specific categories
|
|
197
|
+
const skills = loadSkills(".agent/skills", {
|
|
198
|
+
categories: ["ai", "development", "data"]
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Option 3: Dynamic (Best)**
|
|
203
|
+
```javascript
|
|
204
|
+
// Load skills based on task
|
|
205
|
+
function loadRelevantSkills(task) {
|
|
206
|
+
if (task.includes("RAG")) return ["rag-engineer", "database-architect"];
|
|
207
|
+
if (task.includes("frontend")) return ["nextjs-react-expert", "typescript-pro"];
|
|
208
|
+
// ...
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Performance Tips
|
|
213
|
+
|
|
214
|
+
1. **Cache Loaded Skills** - Don't reload on every request
|
|
215
|
+
2. **Use Gemini Flash** - For most tasks, Flash is enough
|
|
216
|
+
3. **Selective Loading** - Load only needed skill categories
|
|
217
|
+
4. **Structured Outputs** - Use Gemini's JSON mode with skills
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 🔧 Troubleshooting
|
|
222
|
+
|
|
223
|
+
### Issue: "Gemini doesn't follow skill instructions"
|
|
224
|
+
|
|
225
|
+
**Solution:** Use structured prompts
|
|
226
|
+
```javascript
|
|
227
|
+
const prompt = `
|
|
228
|
+
Task: ${userTask}
|
|
229
|
+
Available Skills: ${skillNames.join(", ")}
|
|
230
|
+
Instructions: Use the [skill-name] skill to complete this task.
|
|
231
|
+
|
|
232
|
+
Apply best practices from the loaded skills.
|
|
233
|
+
`;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Issue: "Context too long"
|
|
237
|
+
|
|
238
|
+
**Solution:** Use skill categorization
|
|
239
|
+
```javascript
|
|
240
|
+
// Load only relevant categories
|
|
241
|
+
const categories = detectCategories(userTask);
|
|
242
|
+
const skills = loadSkillsByCategory(categories);
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Issue: "Skills conflict"
|
|
246
|
+
|
|
247
|
+
**Solution:** Prioritize skills
|
|
248
|
+
```javascript
|
|
249
|
+
// Load skills in priority order
|
|
250
|
+
const skills = [
|
|
251
|
+
"clean-code", // Base principles
|
|
252
|
+
"ai-engineer", // Core AI skill
|
|
253
|
+
"specific-skill" // Task-specific
|
|
254
|
+
];
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📚 Resources
|
|
260
|
+
|
|
261
|
+
- **All Skills**: See [SKILLS.md](./SKILLS.md)
|
|
262
|
+
- **Skill Source**: [antigravity-awesome-skills](https://github.com/Dokhacgiakhoa/antigravity-ide)
|
|
263
|
+
- **Gemini Docs**: [Google AI Studio](https://ai.google.dev/)
|
|
264
|
+
- **Examples**: Check `/lab` directory
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 🎯 Example: RAG with Gemini + Skills
|
|
269
|
+
|
|
270
|
+
```javascript
|
|
271
|
+
import { GoogleGenerativeAI } from "@google/generative-ai";
|
|
272
|
+
import { loadSkill } from "./utils/skillLoader.js";
|
|
273
|
+
|
|
274
|
+
// Load relevant skills
|
|
275
|
+
const ragSkill = loadSkill("rag-engineer");
|
|
276
|
+
const dbSkill = loadSkill("database-architect");
|
|
277
|
+
|
|
278
|
+
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
|
|
279
|
+
const model = genAI.getGenerativeModel({
|
|
280
|
+
model: "gemini-1.5-pro",
|
|
281
|
+
systemInstruction: `${ragSkill}\n\n${dbSkill}\n\nYou are a RAG expert.`
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// Now Gemini can build production RAG systems!
|
|
285
|
+
const result = await model.generateContent(
|
|
286
|
+
"Design a RAG system for 100M documents with hybrid search"
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
console.log(result.response.text());
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
**Ready to build with Gemini + 27 Master Skills? Let's go! 🚀**
|