@mrtrinhvn/ag-kit 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -46
- package/bin/cli.js +79 -201
- package/package.json +1 -1
- package/template/.agent/knowledge/USER.md +4 -0
- package/template/.agent/knowledge/ag-kit-ecosystem.md +168 -0
- package/template/.agent/knowledge/ag-kit-elite.md +6 -3
- package/template/.agent/knowledge/context_isolation.md +16 -0
- package/template/.agent/scripts/_post-commit-hook +8 -0
- package/template/.agent/scripts/brain_builder.py +287 -0
- package/template/.agent/scripts/memory_mcp_server.py +423 -0
- package/template/.agent/scripts/memory_tool.py +367 -0
- package/template/.agent/scripts/receptionist_down.sh +5 -5
- package/template/.agent/scripts/receptionist_up.sh +13 -10
- package/template/.agent/scripts/refresh_brain.sh +21 -0
- package/template/.agent/scripts/repomap.py +32 -3
- package/template/.agent/skills/ag-kit-core/SKILL.md +88 -2
- package/template/.agent/skills/intelligent-routing/SKILL.md +20 -10
- package/template/.agent/skills/telegram-agentic-gateway/SKILL.md +3 -0
- package/template/.agent/skills/telegram-agentic-gateway/templates/start.sh.template +2 -2
|
@@ -96,7 +96,7 @@ function analyzeRequest(userMessage) {
|
|
|
96
96
|
- ✅ Transparent decision-making
|
|
97
97
|
- ✅ Still automatic (no /commands needed)
|
|
98
98
|
|
|
99
|
-
## Domain Detection Rules
|
|
99
|
+
## 5. Domain Detection Rules
|
|
100
100
|
|
|
101
101
|
### Single-Domain Tasks (Auto-invoke Single Agent)
|
|
102
102
|
|
|
@@ -117,7 +117,7 @@ function analyzeRequest(userMessage) {
|
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
|
-
##
|
|
120
|
+
## 6. Elite Orchestration: The 8-Stage Pipeline
|
|
121
121
|
|
|
122
122
|
For complex tasks (handled by `orchestrator`), we follow a formal 8-stage state machine to ensure quality and consistency:
|
|
123
123
|
|
|
@@ -132,7 +132,17 @@ For complex tasks (handled by `orchestrator`), we follow a formal 8-stage state
|
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
135
|
-
##
|
|
135
|
+
## 7. 🧭 THẨM ĐỊNH LỘ TRÌNH (ISOLATION VERIFICATION)
|
|
136
|
+
|
|
137
|
+
**TRƯỚC KHI BẮT ĐẦU PHÂN CÔNG (Pre-assignment):**
|
|
138
|
+
|
|
139
|
+
1. **Xác thực Không gian (Spatial Check):** Tuyệt đối không được gán Task liên quan đến các thư mục ngoài thư mục gốc của dự án hiện tại.
|
|
140
|
+
2. **Loại bỏ Định kiến (Bias Filtering):** Nếu User hỏi về dự án khác (như B1/B2 Chứng khoán), bạn phải nhắc nhở: *"Dạ lệnh này thuộc nghiệp vụ dự án Chứng khoán, em đang ở dự án hiện tại, Sếp có chắc muốn em xử lý tại đây không?"*.
|
|
141
|
+
3. **Phân phối Tool (Tool Scoping):** Chỉ cấp quyền sử dụng `vfs` và `grep_search` trên thư mục hiện tại.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 8. Standardized Communication: AgentResult
|
|
136
146
|
|
|
137
147
|
All agents and skills MUST return a standardized result object for better inter-agent reliability:
|
|
138
148
|
|
|
@@ -163,7 +173,7 @@ Example: "Create a secure login system with dark mode UI"
|
|
|
163
173
|
→ Orchestrator will handle: security-auditor, frontend-specialist, test-engineer
|
|
164
174
|
```
|
|
165
175
|
|
|
166
|
-
## Complexity Assessment
|
|
176
|
+
## 9. Complexity Assessment
|
|
167
177
|
|
|
168
178
|
### SIMPLE (Direct agent invocation)
|
|
169
179
|
|
|
@@ -192,7 +202,7 @@ Example: "Create a secure login system with dark mode UI"
|
|
|
192
202
|
|
|
193
203
|
**Action**: Auto-invoke `orchestrator` → will ask Socratic questions
|
|
194
204
|
|
|
195
|
-
## Implementation Rules
|
|
205
|
+
## 10. Implementation Rules
|
|
196
206
|
|
|
197
207
|
### Rule 1: Silent Analysis
|
|
198
208
|
|
|
@@ -227,7 +237,7 @@ User: "Use @backend-specialist to review this"
|
|
|
227
237
|
→ Use explicitly mentioned agent
|
|
228
238
|
```
|
|
229
239
|
|
|
230
|
-
## Edge Cases
|
|
240
|
+
## 11. Edge Cases
|
|
231
241
|
|
|
232
242
|
### Case 1: Generic Question
|
|
233
243
|
|
|
@@ -256,7 +266,7 @@ User: "Add mobile support to the web app"
|
|
|
256
266
|
→ Then route accordingly
|
|
257
267
|
```
|
|
258
268
|
|
|
259
|
-
## Integration with Existing Workflows
|
|
269
|
+
## 12. Integration with Existing Workflows
|
|
260
270
|
|
|
261
271
|
### With /orchestrate Command
|
|
262
272
|
|
|
@@ -277,7 +287,7 @@ User: "Add mobile support to the web app"
|
|
|
277
287
|
- If GEMINI.md specifies explicit routing, follow it
|
|
278
288
|
- Intelligent routing is the DEFAULT when no explicit rule exists
|
|
279
289
|
|
|
280
|
-
## Testing the System
|
|
290
|
+
## 13. Testing the System
|
|
281
291
|
|
|
282
292
|
### Test Cases
|
|
283
293
|
|
|
@@ -313,7 +323,7 @@ Expected: Auto-invoke debugger
|
|
|
313
323
|
Verify: Systematic debugging approach
|
|
314
324
|
```
|
|
315
325
|
|
|
316
|
-
## Performance Considerations
|
|
326
|
+
## 14. Performance Considerations
|
|
317
327
|
|
|
318
328
|
### Token Usage
|
|
319
329
|
|
|
@@ -327,7 +337,7 @@ Verify: Systematic debugging approach
|
|
|
327
337
|
- No additional API calls required
|
|
328
338
|
- Agent selection happens before first response
|
|
329
339
|
|
|
330
|
-
## User Education
|
|
340
|
+
## 15. User Education
|
|
331
341
|
|
|
332
342
|
### Optional: First-Time Explanation
|
|
333
343
|
|
|
@@ -86,6 +86,9 @@ Khi triển khai, hãy hướng dẫn User:
|
|
|
86
86
|
- **Tuyệt đối KHÔNG hardcode cổng cố định (như 9555).** Hạ tầng phải hỗ trợ Scale (sinh nhiều Agent song song).
|
|
87
87
|
- Hãy cấp một dải khoảng 100 cổng (Ví dụ: `9555-9655`).
|
|
88
88
|
- Script khởi động (`start.sh`) phải có logic tự dò cổng nào đang trống trong dải 100 cổng này $\rightarrow$ Gán cho tiến trình Antigravity IDE $\rightarrow$ Cập nhật `.env` (`IDE_PORT=95xx`) $\rightarrow$ Kẻ điều phối (Node.js) đọc file `.env` để kết nối vào đúng IDE đó.
|
|
89
|
+
5. **Độc Lập Tên Gọi (Project-Agnostic Naming)**:
|
|
90
|
+
- Các file script điều phối (`receptionist_up.sh`, `receptionist_down.sh`...) **TUYỆT ĐỐI KHÔNG ĐƯỢC MANG TÊN DỰ ÁN CỤ THỂ** (Ví dụ cấm gõ cứng: `Waking up CEOgravity Bot` hay `.ceogravity_bot.pid`).
|
|
91
|
+
- Phải sử dụng danh xưng danh chuẩn mực là **"AG Gateway Bot"** và các file tracking trung lập (Vd: `.ag_gateway_bot.pid`). Điều này là bắt buộc để biến hệ sinh thái `.agent/` thành một Template hoàn hảo có thể bưng thả (White-label) vào bất kỳ dự án nào (NextJS, Python, Rust...) mà không bị ô nhiễm tên dự án cũ.
|
|
89
92
|
|
|
90
93
|
---
|
|
91
94
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# 🏢
|
|
2
|
+
# 🏢 Agentic Gateway - Startup Orchestrator
|
|
3
3
|
# Golden Combo Edition (V3)
|
|
4
4
|
|
|
5
5
|
# 1. Load config
|
|
@@ -8,5 +8,5 @@ if [ -f .env ]; then
|
|
|
8
8
|
fi
|
|
9
9
|
|
|
10
10
|
# 2. Khởi động Giao diện & Agent (Agent-Defined)
|
|
11
|
-
echo "🚀 Activating
|
|
11
|
+
echo "🚀 Activating Agentic Gateway Portal..."
|
|
12
12
|
bash .agent/scripts/receptionist_up.sh
|