@xaviele/ag-kit 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +95 -8
  2. package/bin/cli.js +108 -15
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,20 +1,107 @@
1
- # @xaviele/ag-kit
1
+ # @xaviele/ag-kit (Antigravity Agent Kit)
2
2
 
3
- Antigravity Agent Kit - CLI tự động thêm bộ não AI với 45 kĩ năng vào dự án.
3
+ 🌎 **[English](#english-version) | 🇻🇳 [Tiếng Việt](#phiên-bản-tiếng-việt)**
4
4
 
5
- ## Cài đặt
5
+ ---
6
6
 
7
- Sử dụng trực tiếp qua npx:
7
+ ## <a name="english-version"></a> 🇬🇧 English Version
8
+
9
+ 🚀 **Antigravity Agent Kit** is a powerful CLI utility that injects an advanced AI Agent workspace into any of your projects. Packed with **45 specialized skills**, **12 automated workflows**, and smart project configurations.
10
+
11
+ ### 📦 Quick Install
12
+
13
+ Run directly via `npx` in your target project root folder to install the AI system:
8
14
 
9
15
  ```bash
10
16
  npx @xaviele/ag-kit init
11
17
  ```
12
18
 
13
- Hoặc force ghi đè nếu muốn update/làm sạch cái cũ:
19
+ ### 🎯 Specialized Commands
20
+
21
+ | Command | Functionality | Description |
22
+ |---------|---------------|-------------|
23
+ | `init` | Core setup | Automatically generates the `.agent/` directory with the full core system. Use the `--force` flag to overwrite/reset. |
24
+ | `add <skill>` | Add single skill | Swiftly inject any missing individual skill into an installed project (E.g.: `npx @xaviele/ag-kit add clean-code`). |
25
+ | `update` | Safe Sync | Downloads the latest core Skills from the Master Repo but **STRICTLY PRESERVES** your current configurations (Rules, Architecture). |
26
+
27
+ ### 🛠️ What's inside the AI Brain?
28
+
29
+ After installation, your `.agent` directory serves as the control center guiding the behavior of your AI Programming Assistants (Claude, Cursor, Gemini)... with 3 main architectural blocks:
30
+
31
+ #### 1. 🧠 Skills (45 Skills)
32
+ The Kit comes pre-loaded with numerous deep-expertise skills, acting as instruction manuals helping the AI behave like an expert Senior Engineer.
33
+ * **Frontend & Web:** React patterns, Tailwind v4, Mobile Design, Web Testing (Playwright), Waterfall fetching optimization.
34
+ * **System & Backend:** Database architecture logic, REST & GraphQL API design, Server Management, Deployment strategies.
35
+ * **Security & Metrics:** Standardized Clean Code, Vulnerability scanning, Red-team tactics, Core Web Vitals 2025.
36
+ * **Super Apps:** Blazing-fast Zalo Mini App capabilities, premium ZaUI interfaces, UI/UX Pro Max standards.
37
+
38
+ #### 2. 🔄 Automated Workflows (12 Workflows)
39
+ Slash-command shortcuts (like `/slash-commands`) standardizing your development lifecycle. For example:
40
+ * `/brainstorm`: Forces the AI to think and solve edge cases thoroughly before rushing into code.
41
+ * `/plan`: Demands the AI write an Implementation Plan File for components so you can approve it before execution.
42
+ * `/ui-ux-pro-max`: A specialized process preventing the AI from using outdated libraries, forcing Glassmorphism and smooth Gradient designs.
43
+ * `/test`: Automatically scours the Source Code to attach AAA-standard Unit/E2E tests.
44
+
45
+ #### 3. 🛡️ Rules & Architecture
46
+ The area establishing boundaries for the Assistant:
47
+ * `rules/`: Contains rules specific to you or your organization. (E.g., "Always explain in English," "Do not use Moment.js").
48
+ * `ARCHITECTURE.md` / `mcp_config.json`: Documentation noting your unique system architecture (The AI ecosystem scans these first to grasp the current Codebase context).
49
+
50
+ ### 🚀 Use Cases
51
+ 1. **Super App Initialization (e.g., Zalo Mini App):** Setup an empty project, install the Kit, and chat: *"Use `/ui-ux-pro-max` to design the Index screen"* -> The AI immediately complies with flat Mobile design standards and exact Styles.
52
+ 2. **Code & Architecture Review:** Use the `/orchestrate` workflow, and the AI will summon various Virtual Engineers (Frontend Specialist, Backend Architect, Security Auditor) to jointly review your repository's security.
53
+ 3. **Legacy Code Revival:** Drop the Kit into dusty code and chat: *"Clean up trash variables based on `clean-code` and `react-best-practices`"* -> The AI systematically refactors each file.
54
+
55
+ ---
56
+
57
+ ## <a name="phiên-bản-tiếng-việt"></a> 🇻🇳 Phiên bản Tiếng Việt
58
+
59
+ 🚀 **Antigravity Agent Kit** là một tiện ích dòng lệnh CLI mạnh mẽ giúp tự động cấy ghép Không gian làm việc Trợ lý AI nâng cao vào bất kỳ dự án nào của bạn. Gói bao gồm **45 kỹ năng chuyên môn**, **12 quy trình luồng làm việc tự động**, và các cấu hình dự án thông minh.
60
+
61
+ ### 📦 Cài đặt thao tác nhanh
62
+
63
+ Chỉ cần chạy trực tiếp bằng lệnh `npx` ở thư mục gốc của dự án bạn muốn cài đặt hệ thống AI:
64
+
14
65
  ```bash
15
- npx @xaviele/ag-kit init --force
66
+ npx @xaviele/ag-kit init
16
67
  ```
17
68
 
18
- ## Tính năng
69
+ ### 🎯 Các lệnh Chuyên biệt
70
+
71
+ | Lệnh | Tính năng | Mô tả chi tiết |
72
+ |------|-----------|----------------|
73
+ | `init` | Khởi tạo toàn bộ lõi | Tự động sinh mục `.agent/` với toàn bộ hệ thống gốc. Dùng cờ `--force` để cài đè (Reset). |
74
+ | `add <skill>` | Thêm 1 kỹ năng lẻ | Bổ sung siêu tốc bất kỳ kỹ năng nào bị thiếu vào dự án đã cài đặt (VD: `npx @xaviele/ag-kit add clean-code`). |
75
+ | `update` | Cập nhật đồng bộ | Tải các Kỹ năng gốc mới nhất từ Master Repo nhưng **BẢO TOÀN TUYỆT ĐỐI** các cài đặt (Rules, Cấu hình) của bạn hiện tại. |
76
+
77
+ ### 🛠️ Cấu trúc "Bộ não AI" có gì?
78
+
79
+ Sau khi cài đặt xong, thư mục `.agent` của bạn sẽ đóng vai trò điều hướng mọi hành vi của Trợ lý lập trình AI (Claude, Cursor, Gemini)... với 3 khối kiến trúc chính:
80
+
81
+ #### 1. 🧠 Kỹ năng (45 Skills)
82
+ Bộ Kit chứa sẵn vô số kỹ năng chuyên môn sâu, đóng vai trò như cẩm nang hướng dẫn AI làm việc chuẩn xác như một kỹ sư chuyên nghiệp (Senior Engineer).
83
+ * **Frontend & Web:** Kỹ năng viết React, Tailwind v4, Mobile Design, Web Testing (Playwright), Tối ưu hoá Waterfall fetching.
84
+ * **Hệ thống & Backend:** Thiết kế kiến trúc Database logic, REST & GraphQL API, Quản lý Server, Mẹo Deploy an toàn.
85
+ * **Bảo mật & Tối ưu:** Clean Code quy chuẩn quốc tế, Rà quét lỗ hổng rủi ro (Vulnerability scanner), Chiến thuật Red-team, Đo tốc độ web 2025.
86
+ * **Siêu Ứng dụng (Super Apps):** Kỹ năng code Zalo Mini App thần tốc, giao diện ZaUI cao cấp, UI/UX Pro Max.
87
+
88
+ #### 2. 🔄 Luồng làm việc tự động (12 Workflows)
89
+ Các phím tắt quy trình (kiểu `/slash-commands`) chuẩn hóa vòng đời phát triển dự án. Chẳng hạn:
90
+ * `/brainstorm`: Ép AI động não, rào trước đón sau giải quyết triệt để edge-cases trước khi hùng hục lao vào code.
91
+ * `/plan`: Yêu cầu AI viết Kế hoạch triển khai (Implementation Plan) thật kĩ để bạn Phê duyệt trước khi tiến hành viết Code.
92
+ * `/ui-ux-pro-max`: Quy trình chuyên biệt ép AI không được dùng Bootstrap cũ rích mà phải thiết kế giao diện Glassmorphism, Gradient bóng mượt.
93
+ * `/test`: Tự động lùng sục Source Code và đính kèm Unit test chuẩn mô hình cốt lõi.
94
+
95
+ #### 3. 🛡️ Quy tắc (Rules) & Cấu hình (Architecture)
96
+ Khu vực thiết lập giới hạn và điều luật ranh giới cho Trợ lý:
97
+ * `rules/`: Chứa các quy định riêng theo văn hóa tổ chức của bạn. Định dạng file markdown cực kì cơ bản. Ví dụ: "Luôn luôn trả lời Tiếng Việt", "Nghiêm cấm dùng thư viện Moment.js", v.v.
98
+ * `ARCHITECTURE.md` / `mcp_config.json`: Tài liệu ghi chú kiến trúc hệ thống riêng biệt của bạn (Hệ sinh thái AI sẽ scan các file này đầu tiên để móc nối bối cảnh làm việc hiện tại).
99
+
100
+ ### 🚀 Các Trường hợp sử dụng tiêu biểu
101
+
102
+ 1. **Khởi động Nhanh Siêu ứng dụng (VD: Zalo Mini App Taisun):** Bạn tạo dự án trống, cài Gói Kit này bằng lệnh init, sau đó chat với AI: *"Hãy dùng lệnh `/ui-ux-pro-max` và thiết kế màn hình Check-in"* -> AI lập tức tuân thủ quy chuẩn thiết kế Mobile phẳng, áp dụng Style chuẩn xác và giao diện hút mắt.
103
+ 2. **Review Code & Kiến trúc Hệ thống:** Dùng quy trình `/orchestrate` (Điều phối), AI sẽ tự gọi ra Hội Đồng Kỹ sư ảo (Frontend Specialist, Backend Architect, Security Auditor) luân lưu code và dò lổ hổng bảo mật trang Repo cho bạn.
104
+ 3. **Tái sinh mã nguồn cũ rích:** Thả bộ Kit vào đống code đã bám bụi, gõ vào luồng chat: *"Hãy dọn dẹp các biến rác theo chuẩn skill `clean-code` và `react-best-practices`"* -> AI tự thực thi cải tạo và refactor tối ưu theo chuẩn quốc tế 2025 từng đoạn code một.
19
105
 
20
- - Tự động copy toàn bộ kiến trúc agents, workflows và skills template vào thư mục `.agent` của bạn (Bao gồm các kĩ năng Backend, API, Frontend, AI Prompting...).
106
+ ## ⚖️ License
107
+ MIT © Xavie Le
package/bin/cli.js CHANGED
@@ -10,51 +10,144 @@ const packageJson = require('../package.json');
10
10
 
11
11
  program
12
12
  .name('ag-kit')
13
- .description('Trình khởi tạo Antigravity Agent Kit cho dự án của bạn')
13
+ .description('Trình khởi tạo Antigravity Agent Kit (Antigravity Agent Kit Initializer)')
14
14
  .version(packageJson.version);
15
15
 
16
16
  program
17
17
  .command('init')
18
- .description('Khởi tạo thư mục .agent vào dự án hiện hành')
19
- .option('-f, --force', 'Ghi đè nếu thư mục .agent đã tồn tại')
18
+ .description('Khởi tạo thư mục bộ não AI (Initialize the AI Brain directory)')
19
+ .option('-f, --force', 'Ghi đè/Làm mới nếu đã tồn tại (Overwrite/Clean if exists)')
20
20
  .action(async (options) => {
21
21
  const targetDir = path.join(process.cwd(), '.agent');
22
22
  const sourceDir = path.join(__dirname, '..', 'template', '.agent');
23
23
 
24
- console.log(chalk.cyan(`\n✨ Khởi động tiến trình cài đặt @xaviele/ag-kit\n`));
24
+ console.log(chalk.cyan(`\n✨ Khởi động tiến trình cài đặt | Starting initialization for @xaviele/ag-kit\n`));
25
25
 
26
26
  // Check if source exists
27
27
  if (!fs.existsSync(sourceDir)) {
28
- console.log(chalk.red(`❌ Lỗi: Không tìm thấy thư mục template tại ${sourceDir}`));
28
+ console.log(chalk.red(`❌ Lỗi | Error: Không tìm thấy thư viện mẫu tại | Source template not found at ${sourceDir}`));
29
29
  process.exit(1);
30
30
  }
31
31
 
32
32
  // Check if target exists
33
33
  if (fs.existsSync(targetDir) && !options.force) {
34
- console.log(chalk.yellow(`⚠️ Thư mục .agent đã tồn tại trong dự án này.`));
35
- console.log(`Hãy sử dụng flag ${chalk.green('--force')} nếu bạn muốn ghi đè.\n`);
34
+ console.log(chalk.yellow(`⚠️ Cảnh báo | Warning: Thư mục .agent đã tồn tại đây (The .agent folder already exists here).`));
35
+ console.log(`Hãy chạy kèm cờ ${chalk.green('--force')} nếu bạn muốn ghi đè đè code cũ (Use the ${chalk.green('--force')} flag to overwrite).\n`);
36
36
  process.exit(1);
37
37
  }
38
38
 
39
- const spinner = ora('Đang sao chép các kỹ năng cấu hình Agent (45 Skills, 12 Workflows)...').start();
39
+ const spinner = ora('Đang sao chép các kỹ năng | Copying skills & workflows (45 Skills, 12 Workflows)...').start();
40
40
 
41
41
  try {
42
42
  if (options.force && fs.existsSync(targetDir)) {
43
- spinner.text = 'Đang dọn dẹp thư mục .agent cũ...';
43
+ spinner.text = 'Đang dọn dẹp hệ thống | Cleaning up old workspace...';
44
44
  await fs.remove(targetDir);
45
45
  }
46
46
 
47
- spinner.text = 'Đang tiến hành clone Data sang .agent...';
47
+ spinner.text = 'Đang tiến hành nhân bản dữ liệu | Cloning data...';
48
48
  await fs.copy(sourceDir, targetDir);
49
49
 
50
- spinner.succeed(chalk.green('Thành công! Toàn bộ hệ thống Antigravity Agent Kit (.agent) đã được cài đặt.'));
50
+ spinner.succeed(chalk.green('Thành công! Toàn bộ hệ thống Antigravity Agent Kit (.agent) đã được cài đặt | Success! System workspace installed.'));
51
51
 
52
- console.log(`\n${chalk.white.bold('Tiếp theo bạn có thể:')}`);
53
- console.log(`👉 Chạy ${chalk.cyan('npx @xaviele/ag-kit update')} (Tính năng sắp ra mắt)`);
54
- console.log(`👉 Cấu hình thêm Rule tùy chỉnh ${chalk.yellow('.agent/rules/')}\n`);
52
+ console.log(`\n${chalk.white.bold('Tiếp theo bạn có thể | Next steps:')}`);
53
+ console.log(`👉 Chạy lệnh ${chalk.cyan('npx @xaviele/ag-kit update')} (Tính năng sắp ra mắt | Coming soon)`);
54
+ console.log(`👉 Cấu hình Rule hộp thoại ${chalk.yellow('.agent/rules/')} (Config custom rules)\n`);
55
55
 
56
56
  } catch (err) {
57
- spinner.fail(chalk.red('Quá trình sao chép thất bại!'));
57
+ spinner.fail(chalk.red('Quá trình sao chép thất bại! | Installation failed!'));
58
+ console.error(err);
59
+ process.exit(1);
60
+ }
61
+ });
62
+
63
+ program
64
+ .command('add <skillName>')
65
+ .description('Thêm một kỹ năng lẻ vào dự án (Add a single skill into project)')
66
+ .action(async (skillName) => {
67
+ const targetBaseDir = path.join(process.cwd(), '.agent');
68
+ const targetSkillDir = path.join(targetBaseDir, 'skills', skillName);
69
+ const sourceSkillDir = path.join(__dirname, '..', 'template', '.agent', 'skills', skillName);
70
+
71
+ console.log(chalk.cyan(`\n✨ Đang tải nhánh kỹ năng | Downloading skill branch [${skillName}] bằng hệ thống @xaviele/ag-kit\n`));
72
+
73
+ // LỰA CHỌN 2: Ép buộc phải có thư mục hệ thống trước
74
+ if (!fs.existsSync(targetBaseDir)) {
75
+ console.log(chalk.red(`❌ TỪ CHỐI | ACCESS DENIED: Dự án của bạn chưa thiết lập cấu trúc lõi (Core workflow not initialized).`));
76
+ console.log(`💡 Vui lòng tạo nền tảng móng trước bằng lệnh (Please initialize first using): ${chalk.green('npx @xaviele/ag-kit init')}\n`);
77
+ process.exit(1);
78
+ }
79
+
80
+ // Kiểm tra kỹ năng có tồn tại trong template kho hay không?
81
+ if (!fs.existsSync(sourceSkillDir)) {
82
+ console.log(chalk.red(`❌ Lỗi 404 | Error 404: Không tìm thấy kỹ năng (Skill not found) '${skillName}'.`));
83
+ process.exit(1);
84
+ }
85
+
86
+ // Kiểm tra tránh ghi đè lỗi lầm vào Source đã có
87
+ if (fs.existsSync(targetSkillDir)) {
88
+ console.log(chalk.yellow(`⚠️ Báo động | Alert: Kỹ năng (Skill) '${skillName}' đã tồn tại! Từ chối ghi đè để bảo vệ Code (Skipped to protect code).`));
89
+ process.exit(1);
90
+ }
91
+
92
+ const spinner = ora(`Đang giải nén mã nguồn kỹ năng | Extracting skill data ${skillName}...`).start();
93
+
94
+ try {
95
+ await fs.copy(sourceSkillDir, targetSkillDir);
96
+ spinner.succeed(chalk.green(`Tuyệt vời! Kỹ năng | Awesome! Skill '${skillName}' đã trang bị thành công (installed successfully).`));
97
+ console.log(`👉 Cài tại thư mục (Installed at): ${chalk.cyan('.agent/skills/' + skillName)}\n`);
98
+ } catch (err) {
99
+ spinner.fail(chalk.red(`Lỗi giải nén kỹ năng! | Extraction failed for ${skillName}!`));
100
+ console.error(err);
101
+ process.exit(1);
102
+ }
103
+ });
104
+
105
+ program
106
+ .command('update')
107
+ .description('Đồng bộ bộ Kỹ năng gốc từ hệ thống (Sync core skills from the system registry)')
108
+ .action(async () => {
109
+ const targetBaseDir = path.join(process.cwd(), '.agent');
110
+ const sourceDir = path.join(__dirname, '..', 'template', '.agent');
111
+
112
+ console.log(chalk.cyan(`\n✨ Đang khởi chạy tính năng UPDATE đồng bộ từ @xaviele/ag-kit\n`));
113
+
114
+ // Yêu cầu phải có .agent
115
+ if (!fs.existsSync(targetBaseDir)) {
116
+ console.log(chalk.red(`❌ LỖI ĐỒNG BỘ | UPDATE FAILED: Dự án của bạn chưa từng được thiết lập móng .agent lõi.`));
117
+ console.log(`💡 Vui lòng dùng lệnh: ${chalk.green('npx @xaviele/ag-kit init')} trước tiên.\n`);
118
+ process.exit(1);
119
+ }
120
+
121
+ const spinner = ora('Phân tích cập nhật, tạo khiên bảo vệ Cấu hình dự án (User Rules / Configs)...').start();
122
+
123
+ // Thuật toán màng lọc (Immunity Shield)
124
+ const filterSync = (src, dest) => {
125
+ const srcName = path.basename(src);
126
+ // Danh sách các Item bất khả xâm phạm nếu đã tồn tại đẻ bảo vệ Config của Khách Hàng
127
+ const protectedItems = [
128
+ 'rules',
129
+ 'scratch',
130
+ 'ARCHITECTURE.md',
131
+ 'mcp_config.json',
132
+ '.system_generated'
133
+ ];
134
+
135
+ // Nếu folder/file thuộc diện bảo vệ và ĐÃ TỒN TẠI ở máy khách -> BLOCK Không cho đè
136
+ if (protectedItems.includes(srcName) && fs.existsSync(dest)) {
137
+ return false;
138
+ }
139
+ return true; // Mọi thứ khác như skills/, workflows/ được cấp phép update đè
140
+ };
141
+
142
+ try {
143
+ await fs.copy(sourceDir, targetBaseDir, {
144
+ overwrite: true,
145
+ filter: filterSync
146
+ });
147
+ spinner.succeed(chalk.green(`Tuyệt vời! Toàn bộ 45 Skills và 12 Workflows đã được Cập Nhập (Sync) mới nhất.`));
148
+ console.log(`👉 Các hệ thống cá nhân hóa (ARCHITECTURE.md, mcp_config.json, rules) được bảo toàn tuyệt đối 100%.\n`);
149
+ } catch (err) {
150
+ spinner.fail(chalk.red(`Đồng bộ thất bại! | Sync failed!`));
58
151
  console.error(err);
59
152
  process.exit(1);
60
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaviele/ag-kit",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Antigravity Agent Kit - CLI tool to install intelligent agent workspaces",
5
5
  "bin": {
6
6
  "xaviele-ag-kit": "./bin/cli.js",