antigravity-ide 4.1.22 → 4.1.27
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/rules/strict-protocol.md +47 -0
- package/README.md +59 -55
- package/README.vi.md +58 -54
- package/cli/create.js +90 -27
- package/cli/logic/gemini-generator.js +69 -0
- package/cli/logic/manifest-manager.js +4 -23
- package/cli/repair.js +1 -9
- package/package.json +3 -3
- package/.agent/scripts/automation/auto-release.js +0 -177
- package/.agent/scripts/automation/auto_preview.py +0 -174
- package/.agent/scripts/automation/translate_workflows.py +0 -88
- package/.agent/scripts/fractalize-skills.js +0 -89
- package/.agent/scripts/generate-skill-definitions.js +0 -134
- package/.agent/scripts/internal/session_manager.py +0 -156
- package/.agent/scripts/internal/simulation_install.js +0 -67
- package/.agent/scripts/internal/sync_to_global.py +0 -114
- package/.agent/scripts/internal/update-docs.js +0 -115
- package/.agent/scripts/refactor-skill-content.js +0 -127
- package/.agent/scripts/rename-skills.js +0 -96
- package/.agent/scripts/sync-skills.js +0 -112
- package/.agent/scripts/update-frontmatter-names.js +0 -99
- package/.agent/scripts/verification/audit-dna.js +0 -56
- package/.agent/scripts/verification/audit-skills.js +0 -65
- package/.agent/scripts/verification/checklist.py +0 -292
- package/.agent/scripts/verification/verify_all.py +0 -340
- package/.agent/scripts/verification/verify_shared_modules.js +0 -188
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# STRICT PROTOCOL ENFORCEMENT
|
|
2
|
+
|
|
3
|
+
> **Trigger**: ALWAYS_ON (Critical)
|
|
4
|
+
> **Priority**: HIGHEST (Overrides all standard behaviors)
|
|
5
|
+
|
|
6
|
+
## 🚫 1. ZERO-TRUST GIT POLICY (Chính Sách Git Không Tin Cậy)
|
|
7
|
+
|
|
8
|
+
**Tuyệt đối CẤM** Agent tự động thực hiện các lệnh sau nếu không có lệnh rõ ràng từ User:
|
|
9
|
+
- `git push`
|
|
10
|
+
- `git push origin <branch>`
|
|
11
|
+
- `git push --tags`
|
|
12
|
+
- `npm publish`
|
|
13
|
+
|
|
14
|
+
**Quy trình Bắt buộc:**
|
|
15
|
+
1. Agent thực hiện thay đổi code.
|
|
16
|
+
2. Agent chạy test/verify.
|
|
17
|
+
3. Agent **BÁO CÁO** kết quả và **HỎI** ý kiến User: *"Test đã qua. Bạn có muốn đẩy code không?"*
|
|
18
|
+
4. CHỈ KHI User trả lời: "ok", "push", "đẩy đi", "duyệt", v.v. -> Agent mới được chạy lệnh đẩy.
|
|
19
|
+
|
|
20
|
+
**Hậu quả:** Nếu vi phạm, Agent được coi là "Mất kiểm soát" (Rogue Agent).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🌐 2. DYNAMIC LANGUAGE ADHERENCE (Tuân Thủ Ngôn Ngữ Động)
|
|
25
|
+
|
|
26
|
+
Agent PHẢI đọc và tuân thủ mục **"Language Protocol"** trong file `GEMINI.md` tại thư mục gốc.
|
|
27
|
+
|
|
28
|
+
- Nếu `GEMINI.md` yêu cầu **VIETNAMESE**:
|
|
29
|
+
- Giao tiếp: 100% Tiếng Việt.
|
|
30
|
+
- Cấm: Giải thích bằng Tiếng Anh (trừ thuật ngữ kỹ thuật).
|
|
31
|
+
|
|
32
|
+
- Nếu `GEMINI.md` yêu cầu **ENGLISH**:
|
|
33
|
+
- Giao tiếp: 100% Tiếng Anh.
|
|
34
|
+
|
|
35
|
+
**Nguyên tắc**: User là người quyết định ngôn ngữ (qua `npx` setup hoặc config), Agent không được tự ý.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🛑 3. FAIL-SAFE MECHANISM (Cơ Chế Ngắt Khẩn Cấp)
|
|
40
|
+
|
|
41
|
+
Nếu User phát hiện Agent vi phạm 1 trong 2 điều trên, User sẽ gõ lệnh:
|
|
42
|
+
> **`/protocol-reset`**
|
|
43
|
+
|
|
44
|
+
Khi nhận lệnh này, Agent PHẢI:
|
|
45
|
+
1. Dừng ngay lập tức mọi tác vụ.
|
|
46
|
+
2. Đọc lại file này `view_file .agent/rules/strict-protocol.md`.
|
|
47
|
+
3. Xác nhận lại trạng thái tuân thủ.
|
package/README.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🛰️ AntiGravity IDE
|
|
4
|
-
### *Advanced Edition • v4.1.
|
|
4
|
+
### *Advanced Edition • v4.1.27 Meta-Engine*
|
|
5
5
|
|
|
6
|
-
<!--
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
<!-- BADGES: Spaced & Tightly Wrapped to prevent Underlines -->
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/antigravity-ide"><img src="https://img.shields.io/npm/v/antigravity-ide?color=2ea44f&logo=npm" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/antigravity-ide"><img src="https://img.shields.io/npm/dm/antigravity-ide?color=blueviolet&logo=npm" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/Dokhacgiakhoa/antigravity-ide/actions"><img src="https://img.shields.io/github/actions/workflow/status/Dokhacgiakhoa/antigravity-ide/npm-publish.yml?logo=github&label=BUILD" alt="Build Status" /></a>
|
|
11
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/antigravity-ide?color=orange" alt="License" /></a>
|
|
12
|
+
</p>
|
|
11
13
|
|
|
12
|
-
<!--
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
<!-- SECOND ROW: Stats -->
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://socket.dev/npm/package/antigravity-ide"><img src="https://socket.dev/api/badge/npm/package/antigravity-ide" alt="Socket Badge" /></a>
|
|
17
|
+
<a href="https://github.com/Dokhacgiakhoa/antigravity-ide"><img src="https://img.shields.io/github/languages/code-size/Dokhacgiakhoa/antigravity-ide?color=blue" alt="Code Size" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<br>
|
|
15
21
|
|
|
16
22
|
**Easy Vibe, Lazy Code. One Command to Rule Them All.**
|
|
17
23
|
|
|
@@ -19,31 +25,26 @@
|
|
|
19
25
|
|
|
20
26
|
---
|
|
21
27
|
|
|
22
|
-
### 📊 System
|
|
28
|
+
### 📊 System Identity Matrix
|
|
23
29
|
|
|
24
|
-
| **
|
|
25
|
-
| :---: | :---: | :---: | :---: | :---: |
|
|
26
|
-
| *Governance* | *
|
|
30
|
+
| **16** Rules | **573** Skills | **2977** Patterns | **30** Flows | **17** Core Libs |
|
|
31
|
+
| :---: | :---: | :---: | :---: | :---: |
|
|
32
|
+
| *Governance* | *Operational* | *Advanced AI* | *Standardized* | *Core Libraries* |
|
|
27
33
|
|
|
28
34
|
</div>
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
<br>
|
|
31
37
|
|
|
32
|
-
## ⚡
|
|
38
|
+
## ⚡ Smart Installation (npx)
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
Antigravity uses a **Dual-Scope Strategy** to ensure absolute stability:
|
|
41
|
+
|
|
42
|
+
1. **Global Scope (Project Root)**: Installs `GEMINI.md` (Configuration).
|
|
43
|
+
2. **Workspace Scope (`.agent/`)**: Installs Rules, Skills, and Workflows (The Brain).
|
|
35
44
|
|
|
36
45
|
```bash
|
|
37
|
-
#
|
|
38
|
-
# Create, Update, Repair, and Sync - All in one.
|
|
46
|
+
# ONE COMMAND TO RULE THEM ALL
|
|
39
47
|
npx antigravity-ide [project-name]
|
|
40
|
-
|
|
41
|
-
# If run inside an existing project:
|
|
42
|
-
# Automatically detects version, repairs config, and syncs docs.
|
|
43
|
-
npx antigravity-ide .
|
|
44
|
-
|
|
45
|
-
# Validate project compliance:
|
|
46
|
-
npx antigravity-ide validate
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
> [!TIP]
|
|
@@ -51,7 +52,7 @@ npx antigravity-ide validate
|
|
|
51
52
|
|
|
52
53
|
---
|
|
53
54
|
|
|
54
|
-
## ✨ The Premium Edge (v4.1.
|
|
55
|
+
## ✨ The Premium Edge (v4.1.27)
|
|
55
56
|
|
|
56
57
|
Why choose AntiGravity over standard AI wrappers?
|
|
57
58
|
|
|
@@ -80,51 +81,54 @@ A fracture-free, standardized architecture for scalable AI development.
|
|
|
80
81
|
```text
|
|
81
82
|
your-project/
|
|
82
83
|
├── .agent/ # 🧠 THE BRAIN (Fractal Core)
|
|
83
|
-
│ ├── .shared/ # ⛩️
|
|
84
|
-
│ ├── agents/ # 🎭 Specialists (Lead, PM, Auditor)
|
|
84
|
+
│ ├── .shared/ # ⛩️ Core Library (API/DB/Security Standards)
|
|
85
85
|
│ ├── rules/ # ⚖️ Governance (Compliance, Context)
|
|
86
86
|
│ ├── skills/ # 🛠️ Mastery (573 Fractal Skills)
|
|
87
|
-
│
|
|
88
|
-
|
|
89
|
-
└── (your app) # ⚡ Your Source Code
|
|
87
|
+
│ └── workflows/ # 🚀 Ops (/create, /debug, /audit)
|
|
88
|
+
└── GEMINI.md # 📋 Agent Identity & Configuration
|
|
90
89
|
```
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
> [!NOTE]
|
|
92
|
+
> **Scope Definition**:
|
|
93
|
+
> - **Global**: The CLI Tool (`npx antigravity-ide`) acts as the installer.
|
|
94
|
+
> - **Workspace**: All Rules (`.agent/rules`), Skills, and Workflows are installed **Locally** into your project. This ensures total isolation context.
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
---
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
- **Lead Developer**: System Design & Architecture.
|
|
98
|
-
- **Security Auditor**: Real-time vulnerability scanning.
|
|
99
|
-
- **Product Manager**: Semantic task planning.
|
|
100
|
-
- *...and 19 other senior industrial personas.*
|
|
98
|
+
## 🚀 Power Commands
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- **
|
|
105
|
-
- **
|
|
106
|
-
- **
|
|
100
|
+
| Command | Action | Logic |
|
|
101
|
+
| :--- | :--- | :--- |
|
|
102
|
+
| `npx antigravity-ide .` | **Repair / Sync** | Scans Global (`GEMINI.md`) & Workspace (`.agent`). Fills gaps. |
|
|
103
|
+
| `npx antigravity-ide validate` | **Health Check** | Verifies integrity of both scopes. |
|
|
104
|
+
| `npx antigravity-ide update` | **Upgrade** | Updates Core DNA while respecting Scope boundaries. |
|
|
107
105
|
|
|
108
106
|
---
|
|
109
107
|
|
|
110
|
-
##
|
|
108
|
+
## ❓ Frequent Questions
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
<details>
|
|
111
|
+
<summary><strong>Q: Is this just another AI wrapper?</strong></summary>
|
|
112
|
+
A: No. Wrappers are stateless. Antigravity installs a **Fractal Memory System** (`.agent` folder) directly into your project. It gives your AI long-term memory, context awareness, and self-correction capabilities.
|
|
113
|
+
</details>
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
<details>
|
|
116
|
+
<summary><strong>Q: What is "Pure Install"?</strong></summary>
|
|
117
|
+
A: Starting from v4.1.23, we stripped all bloat. No internal scripts, no dev dependencies. You get **only** the production artifacts needed to run your AI team.
|
|
118
|
+
</details>
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
<details>
|
|
121
|
+
<summary><strong>Q: Can I customize the Agents?</strong></summary>
|
|
122
|
+
A: Yes. "Agents" are now dynamic personas powered by **Skills**. You can teach them new tricks by adding files to `.agent/skills/` or editing `GEMINI.md`. The system adapts to your instructions instantly.
|
|
123
|
+
</details>
|
|
119
124
|
|
|
120
|
-
|
|
125
|
+
<br>
|
|
121
126
|
|
|
122
|
-
|
|
127
|
+
---
|
|
123
128
|
|
|
124
|
-
- **[
|
|
125
|
-
- **[
|
|
126
|
-
- **[
|
|
127
|
-
- **[anthropics/skills](https://github.com/anthropics/skills)**: Official Anthropic skills integrated under Apache 2.0 license.
|
|
129
|
+
- **[Gemini Usage Guide](docs/GEMINI_USAGE.md)**: How to configure and use with Google Gemini.
|
|
130
|
+
- **[Master Operations](docs/MASTER_OPERATIONS.md)**: Deep dive into the IDE's core mechanics.
|
|
131
|
+
- **[Publishing Guide](docs/PUBLISHING_GUIDE.md)**: How to release your own Agent packages.
|
|
128
132
|
|
|
129
133
|
---
|
|
130
134
|
|
package/README.vi.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
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.27 Meta-Engine*
|
|
5
5
|
|
|
6
|
-
<!--
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
<!-- BADGES: Spaced & Tightly Wrapped to prevent Underlines -->
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/antigravity-ide"><img src="https://img.shields.io/npm/v/antigravity-ide?color=2ea44f&logo=npm" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/antigravity-ide"><img src="https://img.shields.io/npm/dm/antigravity-ide?color=blueviolet&logo=npm" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/Dokhacgiakhoa/antigravity-ide/actions"><img src="https://img.shields.io/github/actions/workflow/status/Dokhacgiakhoa/antigravity-ide/npm-publish.yml?logo=github&label=BUILD" alt="Build Status" /></a>
|
|
11
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/antigravity-ide?color=orange" alt="License" /></a>
|
|
12
|
+
</p>
|
|
11
13
|
|
|
12
|
-
<!--
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
<!-- SECOND ROW: Stats -->
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://socket.dev/npm/package/antigravity-ide"><img src="https://socket.dev/api/badge/npm/package/antigravity-ide" alt="Socket Badge" /></a>
|
|
17
|
+
<a href="https://github.com/Dokhacgiakhoa/antigravity-ide"><img src="https://img.shields.io/github/languages/code-size/Dokhacgiakhoa/antigravity-ide?color=blue" alt="Code Size" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<br>
|
|
15
21
|
|
|
16
22
|
**Vibe thoải mái, Code thảnh thơi. Một lệnh duy nhất cân cả thế giới.**
|
|
17
23
|
|
|
@@ -21,29 +27,24 @@
|
|
|
21
27
|
|
|
22
28
|
### 📊 Ma trận Năng lực Hệ thống
|
|
23
29
|
|
|
24
|
-
| **
|
|
25
|
-
| :---: | :---: | :---: | :---: | :---: |
|
|
26
|
-
| *Quản trị* | *
|
|
30
|
+
| **16** Quy tắc | **573** Kỹ năng | **2977** Chiến thuật | **30** Quy trình | **17** Core Libs |
|
|
31
|
+
| :---: | :---: | :---: | :---: | :---: |
|
|
32
|
+
| *Quản trị* | *Công cụ lõi* | *Mẫu AI Nâng cao* | *Chuẩn hóa* | *DNA Dùng chung* |
|
|
27
33
|
|
|
28
34
|
</div>
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
<br>
|
|
31
37
|
|
|
32
|
-
## ⚡ Cài
|
|
38
|
+
## ⚡ Cơ Chế Cài Đặt Thông Minh (Smart Sync)
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
Antigravity sử dụng chiến lược **Dual-Scope Installation** để đảm bảo sự ổn định:
|
|
41
|
+
|
|
42
|
+
1. **Global Scope (Gốc Dự Án)**: Cài đặt `GEMINI.md` (Cấu hình định danh).
|
|
43
|
+
2. **Workspace Scope (Thư mục .agent)**: Cài đặt Rules, Skills, Workflows (Bộ não).
|
|
35
44
|
|
|
36
45
|
```bash
|
|
37
|
-
#
|
|
38
|
-
# Tạo mới, Cập nhật, Sửa lỗi và Đồng bộ - Tất cả trong 1.
|
|
46
|
+
# MỘT LỆNH DUY NHẤT CHO TẤT CẢ
|
|
39
47
|
npx antigravity-ide [ten-du-an]
|
|
40
|
-
|
|
41
|
-
# Chạy trong dự án cũ:
|
|
42
|
-
# Tự động phát hiện phiên bản, vá lỗi config và cập nhật docs.
|
|
43
|
-
npx antigravity-ide .
|
|
44
|
-
|
|
45
|
-
# Kiểm tra dự án theo chuẩn:
|
|
46
|
-
npx antigravity-ide validate
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
> [!TIP]
|
|
@@ -51,7 +52,7 @@ npx antigravity-ide validate
|
|
|
51
52
|
|
|
52
53
|
---
|
|
53
54
|
|
|
54
|
-
## ✨ Đ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.27)
|
|
55
56
|
|
|
56
57
|
Tại sao nên chọn AntiGravity thay vì các AI wrapper thông thường?
|
|
57
58
|
|
|
@@ -80,51 +81,54 @@ Kiến trúc chuẩn hóa, dễ dàng mở rộng và bảo trì.
|
|
|
80
81
|
```text
|
|
81
82
|
du-an-cua-ban/
|
|
82
83
|
├── .agent/ # 🧠 BỘ NÃO (Fractal Core)
|
|
83
|
-
│ ├── .shared/ # ⛩️
|
|
84
|
-
│ ├── agents/ # 🎭 Chuyên gia (Lead, PM, Auditor)
|
|
84
|
+
│ ├── .shared/ # ⛩️ Thư viện lõi (API/DB/Security Standards)
|
|
85
85
|
│ ├── rules/ # ⚖️ Quản trị (Compliance, Context)
|
|
86
86
|
│ ├── skills/ # 🛠️ Kỹ năng (573 Fractal Skills)
|
|
87
|
-
│
|
|
88
|
-
|
|
89
|
-
└── (code của bạn) # ⚡ Mã nguồn ứng dụng
|
|
87
|
+
│ └── workflows/ # 🚀 Quy trình (/create, /debug, /audit)
|
|
88
|
+
└── GEMINI.md # 📋 Cấu hình định danh Agent
|
|
90
89
|
```
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
> [!NOTE]
|
|
92
|
+
> **Định Nghĩa Phạm Vi (Scope)**:
|
|
93
|
+
> - **Global (Toàn cầu)**: Bộ công cụ CLI (`npx antigravity-ide`) dùng để cài đặt & quản lý.
|
|
94
|
+
> - **Workspace (Dự án)**: Toàn bộ Quy tắc (`.agent/rules`), Kỹ năng và Quy trình được cài đặt **Cục bộ** vào từng dự án riêng biệt. Đảm bảo trí tuệ của dự án này không bị rò rỉ sang dự án khác.
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
---
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
- **Lead Developer**: Thiết kế hệ thống & Kiến trúc.
|
|
98
|
-
- **Security Auditor**: Quét lỗ hổng bảo mật thời gian thực.
|
|
99
|
-
- **Product Manager**: Lập kế hoạch Task thông minh.
|
|
100
|
-
- *...và 19 nhân sự Senior khác.*
|
|
98
|
+
## 🚀 Lệnh Nâng Cao (Power Commands)
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- **
|
|
105
|
-
- **
|
|
106
|
-
- **
|
|
100
|
+
| Lệnh | Hành động | Logic Xử Lý |
|
|
101
|
+
| :--- | :--- | :--- |
|
|
102
|
+
| `npx antigravity-ide .` | **Sửa Chữa / Đồng Bộ** | Quét cả Global (`GEMINI.md`) & Workspace (`.agent`). Bù file thiếu. |
|
|
103
|
+
| `npx antigravity-ide validate` | **Kiểm Tra Sức Khỏe** | Xác minh tính toàn vẹn của cả 2 phạm vi. |
|
|
104
|
+
| `npx antigravity-ide update` | **Nâng Cấp** | Cập nhật Core DNA nhưng tôn trọng ranh giới Scope (không ghi đè ẩu). |
|
|
107
105
|
|
|
108
106
|
---
|
|
109
107
|
|
|
110
|
-
##
|
|
108
|
+
## ❓ Câu Hỏi Thường Gặp
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
<details>
|
|
111
|
+
<summary><strong>Q: Đây có phải chỉ là AI wrapper nữa không?</strong></summary>
|
|
112
|
+
A: Không. Wrapper thì vô tri (stateless). Antigravity cài đặt một **Hệ Thống Ký Ức Fractal** (thư mục .agent) trực tiếp vào dự án. Nó mang lại khả năng ghi nhớ dài hạn, nhận thức ngữ cảnh và tự sửa lỗi.
|
|
113
|
+
</details>
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
<details>
|
|
116
|
+
<summary><strong>Q: "Pure Install" là gì?</strong></summary>
|
|
117
|
+
A: Từ v4.1.23, chúng tôi loại bỏ hoàn toàn mã thừa. Không script nội bộ, không file rác. Bạn chỉ nhận được **đúng** những gì cần thiết để vận hành đội ngũ AI.
|
|
118
|
+
</details>
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
<details>
|
|
121
|
+
<summary><strong>Q: Tôi có thể tùy chỉnh Agent không?</strong></summary>
|
|
122
|
+
A: Có. "Agent" giờ đây là các vai trò động dựa trên **Kỹ năng (Skills)**. Bạn có thể dạy họ chiêu mới bằng cách thêm file vào `.agent/skills/` hoặc sửa `GEMINI.md`. Hệ thống sẽ tự học ngay lập tức.
|
|
123
|
+
</details>
|
|
119
124
|
|
|
120
|
-
|
|
125
|
+
<br>
|
|
121
126
|
|
|
122
|
-
|
|
127
|
+
---
|
|
123
128
|
|
|
124
|
-
- **[
|
|
125
|
-
- **[
|
|
126
|
-
- **[
|
|
127
|
-
- **[anthropics/skills](https://github.com/anthropics/skills)**: Tích hợp các kỹ năng chính thức từ Anthropic (Apache 2.0).
|
|
129
|
+
- **[Hướng dẫn Gemini](docs/GEMINI_USAGE.md)**: Cách cấu hình và sử dụng với Google Gemini.
|
|
130
|
+
- **[Vận hành Master](docs/MASTER_OPERATIONS.vi.md)**: Tìm hiểu sâu về cơ chế cốt lõi.
|
|
131
|
+
- **[Hướng dẫn Phát hành](docs/PUBLISHING_GUIDE.md)**: Cách đóng gói và xuất bản Agent của riêng bạn.
|
|
128
132
|
|
|
129
133
|
---
|
|
130
134
|
|
package/cli/create.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const fs = require('fs-extra');
|
|
6
6
|
const path = require('path');
|
|
7
|
+
const os = require('os');
|
|
7
8
|
const chalk = require('chalk');
|
|
8
9
|
const ora = require('ora');
|
|
9
10
|
const { execSync } = require('child_process');
|
|
@@ -66,6 +67,10 @@ async function createProject(projectName, options, predefinedConfig = null) {
|
|
|
66
67
|
|
|
67
68
|
// 2. Copy Base Structure + Selective Rules/Agents
|
|
68
69
|
await copyModularStructure(projectPath, config, rulesToInstall, agentsToInstall);
|
|
70
|
+
|
|
71
|
+
// 2b. Global Sync (Dual-Scope Strategy)
|
|
72
|
+
await ensureGlobalSync(config, rulesToInstall, agentsToInstall);
|
|
73
|
+
|
|
69
74
|
spinner.succeed('Project structure created (Modular Mode)');
|
|
70
75
|
|
|
71
76
|
// --- MODULAR INSTALLATION END ---
|
|
@@ -107,12 +112,31 @@ async function createProject(projectName, options, predefinedConfig = null) {
|
|
|
107
112
|
spinner.succeed(`Installed ${skillCount} skills across ${finalSkillCategories.length} categories`);
|
|
108
113
|
}
|
|
109
114
|
|
|
115
|
+
// Copy workflows
|
|
110
116
|
// Copy workflows
|
|
111
117
|
let workflowCount = 0;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
const workflowsSourceDir = path.join(__dirname, '..', '.agent', 'workflows');
|
|
119
|
+
const workflowsDestDir = path.join(projectPath, '.agent', 'workflows');
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
if (config.rules === 'creative' && fs.existsSync(workflowsSourceDir)) {
|
|
123
|
+
// FORCE FULL COPY for Creative Mode (Robustness)
|
|
124
|
+
spinner.start('Installing ALL workflows (Creative Mode)...');
|
|
125
|
+
await fs.copy(workflowsSourceDir, workflowsDestDir, { overwrite: true });
|
|
126
|
+
// Count files
|
|
127
|
+
workflowCount = fs.readdirSync(workflowsDestDir).filter(f => f.endsWith('.md')).length;
|
|
128
|
+
spinner.succeed(`Installed ${workflowCount} workflows (Full Suite)`);
|
|
129
|
+
} else if (finalWorkflows.length > 0) {
|
|
130
|
+
// Selective Installation
|
|
131
|
+
spinner.start(`Setting up ${finalWorkflows.length} specific workflows...`);
|
|
132
|
+
workflowCount = await copyWorkflows(projectPath, finalWorkflows);
|
|
133
|
+
spinner.succeed(`Configured ${workflowCount} workflows`);
|
|
134
|
+
} else {
|
|
135
|
+
// Fallback / Warning
|
|
136
|
+
spinner.warn('No workflows configured or found.');
|
|
137
|
+
}
|
|
138
|
+
} catch (err) {
|
|
139
|
+
spinner.warn(`Workflow installation warning: ${err.message}`);
|
|
116
140
|
}
|
|
117
141
|
|
|
118
142
|
// ... existing code ...
|
|
@@ -237,16 +261,9 @@ async function copyModularStructure(projectPath, config, rulesList, agentsList)
|
|
|
237
261
|
}
|
|
238
262
|
}
|
|
239
263
|
|
|
240
|
-
// 3.
|
|
241
|
-
const agentsDest = path.join(destAgentDir, 'agents');
|
|
242
|
-
fs.mkdirSync(agentsDest, { recursive: true });
|
|
243
|
-
|
|
244
|
-
for (const agent of agentsList) {
|
|
245
|
-
const srcAgent = path.join(sourceAgentDir, 'agents', agent);
|
|
246
|
-
if (fs.existsSync(srcAgent)) {
|
|
247
|
-
await fs.copy(srcAgent, path.join(agentsDest, agent));
|
|
248
|
-
}
|
|
249
|
-
}
|
|
264
|
+
// 3. Agents (Skipped - Single Context Optimization)
|
|
265
|
+
// const agentsDest = path.join(destAgentDir, 'agents');
|
|
266
|
+
// fs.mkdirSync(agentsDest, { recursive: true });
|
|
250
267
|
|
|
251
268
|
// 4. Ensure 'skills' and 'workflows' dir exists
|
|
252
269
|
fs.mkdirSync(path.join(destAgentDir, 'skills'), { recursive: true });
|
|
@@ -265,15 +282,7 @@ async function copyModularStructure(projectPath, config, rulesList, agentsList)
|
|
|
265
282
|
}
|
|
266
283
|
}
|
|
267
284
|
|
|
268
|
-
|
|
269
|
-
const resourcesSource = path.join(sourceAgentDir, 'RESOURCES.md');
|
|
270
|
-
if (fs.existsSync(resourcesSource)) {
|
|
271
|
-
const resourcesDest = path.join(destAgentDir, 'RESOURCES.md');
|
|
272
|
-
// No need for conflict check usually strictly internal, but safe to overwrite or skip
|
|
273
|
-
if (!fs.existsSync(resourcesDest) || config.force) {
|
|
274
|
-
fs.copyFileSync(resourcesSource, resourcesDest);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
285
|
+
|
|
277
286
|
}
|
|
278
287
|
|
|
279
288
|
|
|
@@ -328,7 +337,7 @@ function printSuccessMessage(projectName, config, stats = null) {
|
|
|
328
337
|
console.log(chalk.bold('📋 Config'));
|
|
329
338
|
console.log(chalk.gray(' Project: ') + gradient.cristal(projectName));
|
|
330
339
|
console.log(chalk.gray(' Template: ') + chalk.cyan(config.template));
|
|
331
|
-
console.log(chalk.gray(' Scale: ') + chalk.cyan(config.rules.toUpperCase()));
|
|
340
|
+
console.log(chalk.gray(' Scale: ') + chalk.cyan((config.rules || 'N/A').toUpperCase()));
|
|
332
341
|
|
|
333
342
|
// AI Activation Instructions
|
|
334
343
|
console.log('');
|
|
@@ -353,16 +362,15 @@ function printSuccessMessage(projectName, config, stats = null) {
|
|
|
353
362
|
console.log('');
|
|
354
363
|
const statLine = [
|
|
355
364
|
chalk.white(`${stats.rules} Rules`),
|
|
356
|
-
chalk.white(`${stats.agents} Agents`),
|
|
357
365
|
chalk.white(`${stats.skills} Skills`),
|
|
358
366
|
chalk.white(`${stats.workflows} Workflows`),
|
|
359
|
-
chalk.white(`${stats.shared}
|
|
367
|
+
chalk.white(`${stats.shared} Core Modules`)
|
|
360
368
|
].join(chalk.gray(' • '));
|
|
361
369
|
console.log(gradient.pastel(' ✨ Installed: ') + statLine);
|
|
362
370
|
} else {
|
|
363
371
|
// Fallback for non-modular runs
|
|
364
372
|
console.log('');
|
|
365
|
-
console.log(gradient.pastel(' ✨ Installed: ') + chalk.white('Adaptive Rules') + chalk.gray(' • ') + chalk.white('
|
|
373
|
+
console.log(gradient.pastel(' ✨ Installed: ') + chalk.white('Adaptive Rules') + chalk.gray(' • ') + chalk.white('Shared Core'));
|
|
366
374
|
}
|
|
367
375
|
|
|
368
376
|
console.log('');
|
|
@@ -373,6 +381,61 @@ function printSuccessMessage(projectName, config, stats = null) {
|
|
|
373
381
|
console.log('');
|
|
374
382
|
}
|
|
375
383
|
|
|
384
|
+
// Helper: Ensure Global Sync (~/.antigravity)
|
|
385
|
+
async function ensureGlobalSync(config, rulesList, agentsList) {
|
|
386
|
+
try {
|
|
387
|
+
const globalDir = path.join(os.homedir(), '.antigravity');
|
|
388
|
+
const sourceAgentDir = path.join(__dirname, '..', '.agent');
|
|
389
|
+
const filter = getEngineFilter(config.engineMode);
|
|
390
|
+
|
|
391
|
+
// Ensure global dir exists
|
|
392
|
+
fs.ensureDirSync(globalDir);
|
|
393
|
+
|
|
394
|
+
// 1. Copy Shared
|
|
395
|
+
if (fs.existsSync(path.join(sourceAgentDir, '.shared'))) {
|
|
396
|
+
await fs.copy(path.join(sourceAgentDir, '.shared'), path.join(globalDir, '.shared'), {
|
|
397
|
+
overwrite: false,
|
|
398
|
+
filter
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// 2. Copy Rules
|
|
403
|
+
const rulesDest = path.join(globalDir, 'rules');
|
|
404
|
+
fs.ensureDirSync(rulesDest);
|
|
405
|
+
for (const rule of rulesList) {
|
|
406
|
+
const src = path.join(sourceAgentDir, 'rules', rule);
|
|
407
|
+
if (fs.existsSync(src)) {
|
|
408
|
+
await fs.copy(src, path.join(rulesDest, rule), { overwrite: false });
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// 3. Agents (Skipped - Single Context Optimization)
|
|
413
|
+
// const agentsDest = path.join(globalDir, 'agents');
|
|
414
|
+
|
|
415
|
+
// 4. Copy Skills (All standard skills)
|
|
416
|
+
const skillsSource = path.join(sourceAgentDir, 'skills');
|
|
417
|
+
const skillsDest = path.join(globalDir, 'skills');
|
|
418
|
+
if (fs.existsSync(skillsSource)) {
|
|
419
|
+
// We copy ALL skills to global to ensure the full arsenal is available
|
|
420
|
+
await fs.copy(skillsSource, skillsDest, {
|
|
421
|
+
overwrite: false,
|
|
422
|
+
filter
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// 5. Copy Workflows
|
|
427
|
+
const workflowsSource = path.join(sourceAgentDir, 'workflows');
|
|
428
|
+
const workflowsDest = path.join(globalDir, 'workflows');
|
|
429
|
+
if (fs.existsSync(workflowsSource)) {
|
|
430
|
+
await fs.copy(workflowsSource, workflowsDest, { overwrite: false });
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
} catch (e) {
|
|
434
|
+
// Silent fail for global sync is acceptable to avoid breaking project flow
|
|
435
|
+
// console.error('Global sync warning:', e.message);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
376
439
|
module.exports = {
|
|
377
440
|
createProject,
|
|
378
441
|
generateGeminiMd
|