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.
@@ -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.22 Meta-Engine*
4
+ ### *Advanced Edition • v4.1.27 Meta-Engine*
5
5
 
6
- <!-- VISUAL BADGES -->
7
- [![npm version](https://img.shields.io/npm/v/antigravity-ide?style=flat&color=2ea44f&logo=npm)](https://www.npmjs.com/package/antigravity-ide)
8
- [![npm downloads](https://img.shields.io/npm/dm/antigravity-ide?style=flat&color=blueviolet&logo=npm)](https://www.npmjs.com/package/antigravity-ide)
9
- [![CI Status](https://img.shields.io/github/actions/workflow/status/Dokhacgiakhoa/antigravity-ide/npm-publish.yml?style=flat&logo=github&label=BUILD)](https://github.com/Dokhacgiakhoa/antigravity-ide/actions)
10
- [![License](https://img.shields.io/npm/l/antigravity-ide?style=flat&color=orange)](LICENSE)
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>&nbsp;&nbsp;
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>&nbsp;&nbsp;
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>&nbsp;&nbsp;
11
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/antigravity-ide?color=orange" alt="License" /></a>
12
+ </p>
11
13
 
12
- <!-- SECURITY & QUALITY -->
13
- [![Socket Badge](https://socket.dev/api/badge/npm/package/antigravity-ide)](https://socket.dev/npm/package/antigravity-ide)
14
- [![Code Size](https://img.shields.io/github/languages/code-size/Dokhacgiakhoa/antigravity-ide?style=flat&color=blue)](https://github.com/Dokhacgiakhoa/antigravity-ide)
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>&nbsp;&nbsp;
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 Capability Matrix
28
+ ### 📊 System Identity Matrix
23
29
 
24
- | **15** Rules | **22** Agents | **573** Skills | **2977** Patterns | **30** Flows | **135** DNA |
25
- | :---: | :---: | :---: | :---: | :---: | :---: |
26
- | *Governance* | *Specialists* | *Operational* | *Advanced AI* | *Standardized* | *Core Libraries* |
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
- ## ⚡ Global Installation (npx)
38
+ ## ⚡ Smart Installation (npx)
33
39
 
34
- The recommended way to use Antigravity IDE is via **npx**. No global clutter, always the latest engine.
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
- # 🔥 UNIFIED GOD COMMAND
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.22)
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/ # ⛩️ DNA (API/DB/Security Standards)
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
- ├── workflows/ # 🚀 Ops (/create, /debug, /audit)
88
- └── scripts/ # 🧪 Continuous Validation
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
- ## 🧠 Master Ecosystem
96
+ ---
95
97
 
96
- ### 🎭 Virtual Specialist Team
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
- ### 🛠️ Strategic Skill Domains
103
- - **High-Perf Web**: Next.js 15, React 19, Tailwind v4.
104
- - **Offensive Security**: OWASP, Malware, Pentesting.
105
- - **Infra & Cloud**: K8s, Docker, AWS, Vercel, Supabase.
106
- - **Advanced AI**: LangGraph, RAG, Multi-Agent Orchestration.
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
- ## 📚 Documentation
108
+ ## Frequent Questions
111
109
 
112
- - **[Gemini Usage Guide](docs/GEMINI_USAGE.md)**: How to configure and use with Google Gemini.
113
- - **[Master Operations](docs/MASTER_OPERATIONS.md)**: Deep dive into the IDE's core mechanics.
114
- - **[Publishing Guide](docs/PUBLISHING_GUIDE.md)**: How to release your own Agent packages.
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
- ## 🙏 Credits & Acknowledgments
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
- This project is independently developed by **Dokhacgiakhoa**.
125
+ <br>
121
126
 
122
- We respectfully acknowledge the following open-source projects as **references and sources of inspiration** (Note: These authors are not directly involved in the development of this project):
127
+ ---
123
128
 
124
- - **[Agent Skills Standard](https://github.com/HoangNguyen0403/agent-skills-standard)**: Adopted as the core architectural standard for AI engineering.
125
- - **[Antigravity Kit](https://github.com/vudovn/antigravity-kit)**: Inspiration for the "Antigravity" concept and meta-engine philosophy.
126
- - **[Awesome Skills](https://github.com/sickn33/antigravity-awesome-skills)**: Reference for skill directory structure.
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.22 Meta-Engine*
4
+ ### *Phiên bản Nâng cao • v4.1.27 Meta-Engine*
5
5
 
6
- <!-- VISUAL BADGES -->
7
- [![npm version](https://img.shields.io/npm/v/antigravity-ide?style=flat&color=2ea44f&logo=npm)](https://www.npmjs.com/package/antigravity-ide)
8
- [![npm downloads](https://img.shields.io/npm/dm/antigravity-ide?style=flat&color=blueviolet&logo=npm)](https://www.npmjs.com/package/antigravity-ide)
9
- [![CI Status](https://img.shields.io/github/actions/workflow/status/Dokhacgiakhoa/antigravity-ide/npm-publish.yml?style=flat&logo=github&label=BUILD)](https://github.com/Dokhacgiakhoa/antigravity-ide/actions)
10
- [![License](https://img.shields.io/npm/l/antigravity-ide?style=flat&color=orange)](LICENSE)
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>&nbsp;&nbsp;
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>&nbsp;&nbsp;
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>&nbsp;&nbsp;
11
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/antigravity-ide?color=orange" alt="License" /></a>
12
+ </p>
11
13
 
12
- <!-- SECURITY & QUALITY -->
13
- [![Socket Badge](https://socket.dev/api/badge/npm/package/antigravity-ide)](https://socket.dev/npm/package/antigravity-ide)
14
- [![Code Size](https://img.shields.io/github/languages/code-size/Dokhacgiakhoa/antigravity-ide?style=flat&color=blue)](https://github.com/Dokhacgiakhoa/antigravity-ide)
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>&nbsp;&nbsp;
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
- | **15** Quy tắc | **22** Chuyên gia | **573** Kỹ năng | **2977** Chiến thuật | **30** Quy trình | **135** DNA |
25
- | :---: | :---: | :---: | :---: | :---: | :---: |
26
- | *Quản trị* | *Virtual Agents* | *Công cụ lõi* | *Mẫu AI Nâng cao* | *Chuẩn hóa* | *DNA Dùng chung* |
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 đặt Toàn cầu (npx)
38
+ ## ⚡ Cơ Chế Cài Đặt Thông Minh (Smart Sync)
33
39
 
34
- Khuyến khích sử dụng thông qua **npx** để luôn nhận được Engine và Skills mới nhất mà không gây rác hệ thống.
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
- # 🔥 LỆNH VẠN NĂNG (GOD COMMAND)
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.22)
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/ # ⛩️ DNA (API/DB/Security Standards)
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
- ├── workflows/ # 🚀 Quy trình (/create, /debug, /audit)
88
- └── scripts/ # 🧪 Kiểm định & Validation
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
- ## 🧠 Hệ sinh thái Master
96
+ ---
95
97
 
96
- ### 🎭 Đội ngũ Tác nhân Chuyên gia
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
- ### 🛠️ Lĩnh vực Tác chiến Kỹ năng
103
- - **Web Hiệu năng cao**: Next.js 15, React 19, Tailwind v4.
104
- - **Bảo mật Tấn công**: OWASP, Malware, Pentesting.
105
- - **Hạ tầng & Cloud**: K8s, Docker, AWS, Vercel, Supabase.
106
- - **AI Chuyên sâu**: LangGraph, RAG, Điều phối Đa Agent.
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
- ## 📚 Tài liệu tham khảo
108
+ ## Câu Hỏi Thường Gặp
111
109
 
112
- - **[Hướng dẫn Gemini](docs/GEMINI_USAGE.md)**: Cách cấu hình và sử dụng với Google Gemini.
113
- - **[Vận hành Master](docs/MASTER_OPERATIONS.vi.md)**: Tìm hiểu sâu về chế cốt lõi.
114
- - **[Hướng dẫn Phát hành](docs/PUBLISHING_GUIDE.md)**: Cách đóng gói xuất bản Agent của riêng bạn.
110
+ <details>
111
+ <summary><strong>Q: Đây phải chỉ 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 Ức Fractal** (thư mục .agent) trực tiếp vào dự á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
- ## 🙏 Ghi nhận & Tham khảo
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
- Dự án này được phát triển độc lập bởi **Dokhacgiakhoa**.
125
+ <br>
121
126
 
122
- Chúng tôi xin trân trọng ghi nhận các dự án mã nguồn mở sau đây là **nguồn cảm hứng và tài liệu tham khảo** (Lưu ý: Các tác giả này không trực tiếp tham gia vào quá trình phát triển dự án này):
127
+ ---
123
128
 
124
- - **[Agent Skills Standard](https://github.com/HoangNguyen0403/agent-skills-standard)**: Được áp dụng làm chuẩn kiến trúc cốt lõi cho AI.
125
- - **[Antigravity Kit](https://github.com/vudovn/antigravity-kit)**: Nguồn cảm hứng cho khái niệm "Antigravity" và triết lý Meta-Engine.
126
- - **[Awesome Skills](https://github.com/sickn33/antigravity-awesome-skills)**: Tham khảo về cấu trúc thư mục kỹ năng.
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 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ề chế cốt lõi.
131
+ - **[Hướng dẫn Phát hành](docs/PUBLISHING_GUIDE.md)**: Cách đóng gói 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
- if (finalWorkflows.length > 0) {
113
- spinner.start('Setting up workflows...');
114
- workflowCount = await copyWorkflows(projectPath, finalWorkflows);
115
- spinner.succeed(`Configured ${workflowCount} workflows`);
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. Copy Agents (SELECTIVE)
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
- // 6. Copy RESOURCES.md to .agent/ (Internal doc)
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} DNA`)
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('Specialist Agents') + chalk.gray(' • ') + chalk.white('Enterprise DNA'));
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