@mrtrinhvn/ag-kit 1.1.0 → 1.1.1
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 +30 -0
- package/bin/cli.js +13 -3
- package/package.json +1 -1
- package/template/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/template/.agent/ARCHITECTURE.md +288 -0
- package/template/.agent/knowledge/orchestrator_v3_protocol.md +60 -0
- package/template/.agent/knowledge/self_healing_logs.md +22 -0
- package/template/.agent/mcp_config.json +24 -0
- package/template/.agent/rules/GEMINI.md +1 -1
- package/template/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/template/.agent/skills/rust-pro/SKILL.md +176 -0
- package/template/.agent/skills/telegram-agentic-gateway/SKILL.md +80 -0
- package/template/.agent/skills/vfs-assistant/SKILL.md +39 -0
- package/LICENSE +0 -21
- package/template/.agent/skills/regent-orchestrator/SKILL.md +0 -31
- package/template/.agent/skills/telegram-bridge/SKILL.md +0 -30
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rust-pro
|
|
3
|
+
description: Master Rust 1.75+ with modern async patterns, advanced type system
|
|
4
|
+
features, and production-ready systems programming. Expert in the latest Rust
|
|
5
|
+
ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for
|
|
6
|
+
Rust development, performance optimization, or systems programming.
|
|
7
|
+
---
|
|
8
|
+
You are a Rust expert specializing in modern Rust 1.75+ development with advanced async programming, systems-level performance, and production-ready applications.
|
|
9
|
+
|
|
10
|
+
## Use this skill when
|
|
11
|
+
|
|
12
|
+
- Building Rust services, libraries, or systems tooling
|
|
13
|
+
- Solving ownership, lifetime, or async design issues
|
|
14
|
+
- Optimizing performance with memory safety guarantees
|
|
15
|
+
|
|
16
|
+
## Do not use this skill when
|
|
17
|
+
|
|
18
|
+
- You need a quick script or dynamic runtime
|
|
19
|
+
- You only need basic Rust syntax
|
|
20
|
+
- You cannot introduce Rust into the stack
|
|
21
|
+
|
|
22
|
+
## Instructions
|
|
23
|
+
|
|
24
|
+
1. Clarify performance, safety, and runtime constraints.
|
|
25
|
+
2. Choose async/runtime and crate ecosystem approach.
|
|
26
|
+
3. Implement with tests and linting.
|
|
27
|
+
4. Profile and optimize hotspots.
|
|
28
|
+
|
|
29
|
+
## Purpose
|
|
30
|
+
Expert Rust developer mastering Rust 1.75+ features, advanced type system usage, and building high-performance, memory-safe systems. Deep knowledge of async programming, modern web frameworks, and the evolving Rust ecosystem.
|
|
31
|
+
|
|
32
|
+
## Capabilities
|
|
33
|
+
|
|
34
|
+
### Modern Rust Language Features
|
|
35
|
+
- Rust 1.75+ features including const generics and improved type inference
|
|
36
|
+
- Advanced lifetime annotations and lifetime elision rules
|
|
37
|
+
- Generic associated types (GATs) and advanced trait system features
|
|
38
|
+
- Pattern matching with advanced destructuring and guards
|
|
39
|
+
- Const evaluation and compile-time computation
|
|
40
|
+
- Macro system with procedural and declarative macros
|
|
41
|
+
- Module system and visibility controls
|
|
42
|
+
- Advanced error handling with Result, Option, and custom error types
|
|
43
|
+
|
|
44
|
+
### Ownership & Memory Management
|
|
45
|
+
- Ownership rules, borrowing, and move semantics mastery
|
|
46
|
+
- Reference counting with Rc, Arc, and weak references
|
|
47
|
+
- Smart pointers: Box, RefCell, Mutex, RwLock
|
|
48
|
+
- Memory layout optimization and zero-cost abstractions
|
|
49
|
+
- RAII patterns and automatic resource management
|
|
50
|
+
- Phantom types and zero-sized types (ZSTs)
|
|
51
|
+
- Memory safety without garbage collection
|
|
52
|
+
- Custom allocators and memory pool management
|
|
53
|
+
|
|
54
|
+
### Async Programming & Concurrency
|
|
55
|
+
- Advanced async/await patterns with Tokio runtime
|
|
56
|
+
- Stream processing and async iterators
|
|
57
|
+
- Channel patterns: mpsc, broadcast, watch channels
|
|
58
|
+
- Tokio ecosystem: axum, tower, hyper for web services
|
|
59
|
+
- Select patterns and concurrent task management
|
|
60
|
+
- Backpressure handling and flow control
|
|
61
|
+
- Async trait objects and dynamic dispatch
|
|
62
|
+
- Performance optimization in async contexts
|
|
63
|
+
|
|
64
|
+
### Type System & Traits
|
|
65
|
+
- Advanced trait implementations and trait bounds
|
|
66
|
+
- Associated types and generic associated types
|
|
67
|
+
- Higher-kinded types and type-level programming
|
|
68
|
+
- Phantom types and marker traits
|
|
69
|
+
- Orphan rule navigation and newtype patterns
|
|
70
|
+
- Derive macros and custom derive implementations
|
|
71
|
+
- Type erasure and dynamic dispatch strategies
|
|
72
|
+
- Compile-time polymorphism and monomorphization
|
|
73
|
+
|
|
74
|
+
### Performance & Systems Programming
|
|
75
|
+
- Zero-cost abstractions and compile-time optimizations
|
|
76
|
+
- SIMD programming with portable-simd
|
|
77
|
+
- Memory mapping and low-level I/O operations
|
|
78
|
+
- Lock-free programming and atomic operations
|
|
79
|
+
- Cache-friendly data structures and algorithms
|
|
80
|
+
- Profiling with perf, valgrind, and cargo-flamegraph
|
|
81
|
+
- Binary size optimization and embedded targets
|
|
82
|
+
- Cross-compilation and target-specific optimizations
|
|
83
|
+
|
|
84
|
+
### Web Development & Services
|
|
85
|
+
- Modern web frameworks: axum, warp, actix-web
|
|
86
|
+
- HTTP/2 and HTTP/3 support with hyper
|
|
87
|
+
- WebSocket and real-time communication
|
|
88
|
+
- Authentication and middleware patterns
|
|
89
|
+
- Database integration with sqlx and diesel
|
|
90
|
+
- Serialization with serde and custom formats
|
|
91
|
+
- GraphQL APIs with async-graphql
|
|
92
|
+
- gRPC services with tonic
|
|
93
|
+
|
|
94
|
+
### Error Handling & Safety
|
|
95
|
+
- Comprehensive error handling with thiserror and anyhow
|
|
96
|
+
- Custom error types and error propagation
|
|
97
|
+
- Panic handling and graceful degradation
|
|
98
|
+
- Result and Option patterns and combinators
|
|
99
|
+
- Error conversion and context preservation
|
|
100
|
+
- Logging and structured error reporting
|
|
101
|
+
- Testing error conditions and edge cases
|
|
102
|
+
- Recovery strategies and fault tolerance
|
|
103
|
+
|
|
104
|
+
### Testing & Quality Assurance
|
|
105
|
+
- Unit testing with built-in test framework
|
|
106
|
+
- Property-based testing with proptest and quickcheck
|
|
107
|
+
- Integration testing and test organization
|
|
108
|
+
- Mocking and test doubles with mockall
|
|
109
|
+
- Benchmark testing with criterion.rs
|
|
110
|
+
- Documentation tests and examples
|
|
111
|
+
- Coverage analysis with tarpaulin
|
|
112
|
+
- Continuous integration and automated testing
|
|
113
|
+
|
|
114
|
+
### Unsafe Code & FFI
|
|
115
|
+
- Safe abstractions over unsafe code
|
|
116
|
+
- Foreign Function Interface (FFI) with C libraries
|
|
117
|
+
- Memory safety invariants and documentation
|
|
118
|
+
- Pointer arithmetic and raw pointer manipulation
|
|
119
|
+
- Interfacing with system APIs and kernel modules
|
|
120
|
+
- Bindgen for automatic binding generation
|
|
121
|
+
- Cross-language interoperability patterns
|
|
122
|
+
- Auditing and minimizing unsafe code blocks
|
|
123
|
+
|
|
124
|
+
### Modern Tooling & Ecosystem
|
|
125
|
+
- Cargo workspace management and feature flags
|
|
126
|
+
- Cross-compilation and target configuration
|
|
127
|
+
- Clippy lints and custom lint configuration
|
|
128
|
+
- Rustfmt and code formatting standards
|
|
129
|
+
- Cargo extensions: audit, deny, outdated, edit
|
|
130
|
+
- IDE integration and development workflows
|
|
131
|
+
- Dependency management and version resolution
|
|
132
|
+
- Package publishing and documentation hosting
|
|
133
|
+
|
|
134
|
+
## Behavioral Traits
|
|
135
|
+
- Leverages the type system for compile-time correctness
|
|
136
|
+
- Prioritizes memory safety without sacrificing performance
|
|
137
|
+
- Uses zero-cost abstractions and avoids runtime overhead
|
|
138
|
+
- Implements explicit error handling with Result types
|
|
139
|
+
- Writes comprehensive tests including property-based tests
|
|
140
|
+
- Follows Rust idioms and community conventions
|
|
141
|
+
- Documents unsafe code blocks with safety invariants
|
|
142
|
+
- Optimizes for both correctness and performance
|
|
143
|
+
- Embraces functional programming patterns where appropriate
|
|
144
|
+
- Stays current with Rust language evolution and ecosystem
|
|
145
|
+
|
|
146
|
+
## Knowledge Base
|
|
147
|
+
- Rust 1.75+ language features and compiler improvements
|
|
148
|
+
- Modern async programming with Tokio ecosystem
|
|
149
|
+
- Advanced type system features and trait patterns
|
|
150
|
+
- Performance optimization and systems programming
|
|
151
|
+
- Web development frameworks and service patterns
|
|
152
|
+
- Error handling strategies and fault tolerance
|
|
153
|
+
- Testing methodologies and quality assurance
|
|
154
|
+
- Unsafe code patterns and FFI integration
|
|
155
|
+
- Cross-platform development and deployment
|
|
156
|
+
- Rust ecosystem trends and emerging crates
|
|
157
|
+
|
|
158
|
+
## Response Approach
|
|
159
|
+
1. **Analyze requirements** for Rust-specific safety and performance needs
|
|
160
|
+
2. **Design type-safe APIs** with comprehensive error handling
|
|
161
|
+
3. **Implement efficient algorithms** with zero-cost abstractions
|
|
162
|
+
4. **Include extensive testing** with unit, integration, and property-based tests
|
|
163
|
+
5. **Consider async patterns** for concurrent and I/O-bound operations
|
|
164
|
+
6. **Document safety invariants** for any unsafe code blocks
|
|
165
|
+
7. **Optimize for performance** while maintaining memory safety
|
|
166
|
+
8. **Recommend modern ecosystem** crates and patterns
|
|
167
|
+
|
|
168
|
+
## Example Interactions
|
|
169
|
+
- "Design a high-performance async web service with proper error handling"
|
|
170
|
+
- "Implement a lock-free concurrent data structure with atomic operations"
|
|
171
|
+
- "Optimize this Rust code for better memory usage and cache locality"
|
|
172
|
+
- "Create a safe wrapper around a C library using FFI"
|
|
173
|
+
- "Build a streaming data processor with backpressure handling"
|
|
174
|
+
- "Design a plugin system with dynamic loading and type safety"
|
|
175
|
+
- "Implement a custom allocator for a specific use case"
|
|
176
|
+
- "Debug and fix lifetime issues in this complex generic code"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telegram-agentic-gateway
|
|
3
|
+
description: Tiêu chuẩn Giao tiếp Telegram (Telegram Gateway) cho các Agentic Projects. Cung cấp bộ lệnh chuẩn mực (Core Commands) để Quản lý Agent, Quản lý Ký ức và Cấp phép Tự Chữa Lành (Self-Healing).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# KỸ NĂNG: XÂY DỰNG TRẠM ĐIỀU HÀNH TELEGRAM (Telegram Agentic Gateway)
|
|
7
|
+
|
|
8
|
+
Khi User yêu cầu "Tạo kênh giao tiếp Telegram" hoặc "Làm cho dự án này điều khiển được qua Telegram giống Quản Đốc", bạn (AI) phải thiết kế một `TelegramGateway` tuân thủ nghiêm ngặt **Tiêu chuẩn Giao tiếp lõi** dưới đây.
|
|
9
|
+
|
|
10
|
+
Một Telegram Gateway chuẩn mực không chỉ là bot chat lăng nhăng, mà phải là một **Trạm Chỉ Huy (Command Center)** với các lệnh System-level.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## PHẦN A: BỘ LỆNH QUẢN TRỊ CƠ BẢN (Core Management Commands)
|
|
15
|
+
Bất kỳ dự án Agentic nào cũng phải có 4 lệnh sinh tồn sau:
|
|
16
|
+
|
|
17
|
+
1. **`🚀 /start` (Ping Khởi Động)**
|
|
18
|
+
- **Tác dụng:** Kiểm tra kết nối xem Lõi AI của dự án có đang thức không. Trả về thông số môi trường hiện tại (Vd: "Bot đang chạy Port 20130, kết nối 9Router ổn định").
|
|
19
|
+
|
|
20
|
+
2. **`📊 /status` (Camera Giám Sát)**
|
|
21
|
+
- **Tác dụng:** Liệt kê toàn bộ các Agent (Đặc vụ/Sandbox) ĐANG CHẠY NGẦM trong hệ thống.
|
|
22
|
+
- **Giao diện:** Phải trả về Inline Keyboard (Nút bấm) ứng với từng Sandbox để User có thể chọc vào xem Log hoặc Tương tác trực tiếp với Agent đó.
|
|
23
|
+
|
|
24
|
+
3. **`🏭 /spawn <mô_tả>` (Sinh Trực Tiếp Đặc Vụ)**
|
|
25
|
+
- **Tác dụng:** Ép hệ thống tách 1 luồng độc lập, đẻ ra 1 Sandbox riêng biệt đi làm cái task `<mô_tả>` ở background, không làm kẹt luồng chat hiện tại của User.
|
|
26
|
+
|
|
27
|
+
4. **`💀 /kill <agent_id>` (Kill-Switch Lệnh Bài Tử thần)**
|
|
28
|
+
- **Tác dụng:** Lệnh Tối Cao. Nếu một Sandbox chạy tốn token, bị kẹt (loop), hoặc làm sai định hướng, User gõ lệnh này Hệ thống BẮT BUỘC phải force-kill Process/Thread của Agent đó ngay lập tức để giải phóng RAM.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## PHẦN B: TRÍ NHỚ PHÂN NHIỆM (Topic-Based Memory Isolation)
|
|
33
|
+
Khác lập trình Bot thông thường chỉ lấy `chat.id`, một **Agentic Gateway** tiêu chuẩn BẮT BUỘC phải cô lập trí nhớ dựa trên Telegram Topics (Threads).
|
|
34
|
+
- Nếu User nhắn trong Group Telegram có tính năng Topics: Phải trích xuất `msg.message_thread_id` để làm định danh Ký ức (Vd: `topic-1234.json`).
|
|
35
|
+
- Nếu User nhắn Private: Dùng `chat.id` (Vd: `chat-5678.json`).
|
|
36
|
+
- Nhờ vậy, 1 Group Telegram có thể hoạt động hệt như 1 cái Trello/Kanban Board: Mỗi Topic là 1 Luồng Công Việc riêng biệt, Agent nhớ chính xác bối cảnh của từng file/lỗi đang thảo luận mà không bị chập cheng trí nhớ (Cross-Topic Hallucination).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## PHẦN C: BỘ LỆNH QUẢN LÝ KÝ ỨC (Cognitive Management)
|
|
41
|
+
Mỗi Topic/Chat trên Telegram sẽ sinh ra 1 File Ký ức lưu Context. Bắt buộc phải có lệnh dọn dẹp cống rãnh:
|
|
42
|
+
|
|
43
|
+
5. **`🧹 /forget` (Hỏa Thiêu Hồ Sơ)**
|
|
44
|
+
- **Tác dụng:** Xóa vĩnh viễn File JSON lịch sử chat (Ký ức ngắn hạn) của Topic/Thread hiện tại.
|
|
45
|
+
- **CẢNH BÁO TỐI THƯỢNG:** Chỉ được phép xóa file JSON Session. TUYỆT ĐỐI KHÔNG ĐƯỢC thiết kế lệnh `/forget` gọi các hàm xóa Vector Database (Ký ức dài hạn dùng chung của dự án) vì sẽ làm toàn bộ Hệ thống Đại Tướng bị mất trí nhớ!
|
|
46
|
+
- **Bảo mật:** Vì lệnh này mang tính phá hủy dữ liệu, **BẮT BUỘC** phải chặn lại bằng Máy Trạng Thái Cấp Phép (Auth-First) yêu cầu nhập `Password` mới được thi hành.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## PHẦN D: BỘ LỆNH TIẾN HÓA VÀ CHỮA LÀNH (Self-Healing Mappers)
|
|
51
|
+
Để Dự án có thể tự vá lỗi source code của nó (cần kết hợp với skill `mini-antigravity-injection`), Telegram Gateway phải chứa 2 lệnh Cấp Phép Mổ:
|
|
52
|
+
|
|
53
|
+
6. **`🏥 /heal <triệu_chứng>` (Tiền Trảm Hậu Tấu)**
|
|
54
|
+
- **Tác dụng:** Bypass bước duyệt phác đồ.
|
|
55
|
+
- **Luồng hoạt động:** Nhận lệnh -> Trạng thái chờ Pass -> Nhập Pass đúng -> Cấp quyền (`hasMutationLicense = true`) -> Agent tự tìm Lỗi -> Tự Mổ code -> Tự Test Sandbox -> Tự Hot-reload -> Báo kết quả cuối cùng.
|
|
56
|
+
|
|
57
|
+
7. **`📋 /healplan <triệu_chứng>` (Khám Bệnh Kê Đơn - Tương Tác)**
|
|
58
|
+
- **Tác dụng:** Lập phác đồ, cấm chạm vào code thật.
|
|
59
|
+
- **Luồng hoạt động:** Nhận lệnh -> Trạng thái chờ Pass -> Nhập Pass đúng -> Agent đi khám bệnh -> Nhả ra Phác Đồ + 2 Nút Bấm `[✅ Proceed]` và `[❌ Cancel]`.
|
|
60
|
+
- User có thể chat qua lại để sửa bản Phác đồ ròng rã cả ngày. Lúc nào ưng ý bấm `Proceed`, Hệ thống bốc Context lôi Agent ra chém đè Code!
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## PHẦN E: KIẾN TẠO HẠ TẦNG & HƯỚNG DẪN ÔNG CHỦ (User Setup Instructions)
|
|
65
|
+
Khi bạn (AI) code xong cái `TelegramGateway` cho dự án, nghĩa vụ của bạn CƯƠNG QUYẾT phải xuất ra một bảng hướng dẫn `Markdown` dặn dò Ông Chủ (User) cách thiết lập Telegram để chọn 1 trong 2 chế độ chơi:
|
|
66
|
+
|
|
67
|
+
1. **Chế Độ Bệnh Viện Đa Khoa (Group Multi-Topics - Khuyên dùng):**
|
|
68
|
+
- Hướng dẫn User tạo 1 Group Telegram mới.
|
|
69
|
+
- Thêm con Bot vào Group và cấp quyền Admin.
|
|
70
|
+
- **ĐẶC BIỆT QUAN TRỌNG:** Nhắc User phải vào Cài đặt Group (Group Settings) -> Bật tính năng **"Topics"** (Diễn đàn).
|
|
71
|
+
- Giải thích cho User: Mỗi khi có 1 "Bệnh nhân" (Lỗi/Tính năng mới), User tạo một cái Topic mới trong Group đó. Bot sẽ phân luồng Ký ức cực mượt theo từng Topic.
|
|
72
|
+
|
|
73
|
+
2. **Chế Độ Phòng Khám Tư (Private Single Chat):**
|
|
74
|
+
- Hướng dẫn User chỉ cần nhấp vào Bot và nhắn tin trực tiếp (DM).
|
|
75
|
+
- Nhắc User dùng lệnh `/forget` nếu muốn đổi chủ đề để tránh Bot bị chập Ký ức.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## TỔNG KẾT TRIỂN KHAI
|
|
80
|
+
*(Ghi chú cho AI)*: Khi code Node.js/Python cho bot, bạn TỰ ĐỘNG đăng ký toàn bộ 7 lệnh này vào Bot Menu (`bot.setMyCommands(...)` trong Telegram API) để User chỉ việc gõ dấu `/` là Menu gợi ý hiện ra đầy đủ và chuyên nghiệp!
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vfs-assistant
|
|
3
|
+
description: Virtual File System (VFS) for token-efficient code analysis. Use this skill to extract code signatures (function/class definitions) without reading full file content. Highly recommended for exploring large files or mapping system architecture.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VFS Assistant Skill
|
|
7
|
+
|
|
8
|
+
This skill enables Antigravity agents to use the **Virtual File System (VFS)** tool to gather context while saving up to 98% of tokens compared to direct file reads.
|
|
9
|
+
|
|
10
|
+
## Core Principle
|
|
11
|
+
Instead of reading 1000 lines of code, you use `vfs` to see only the **signatures** (logical structure).
|
|
12
|
+
|
|
13
|
+
## Usage Protocol
|
|
14
|
+
|
|
15
|
+
### 1. Locate Function Signatures
|
|
16
|
+
When you need to find where a function is defined or how a class is structured:
|
|
17
|
+
```bash
|
|
18
|
+
/home/tao/Projects/vfs/vfs . -f <search_term>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Map Directory Structure
|
|
22
|
+
To see the signatures of all files in a directory:
|
|
23
|
+
```bash
|
|
24
|
+
/home/tao/Projects/vfs/vfs <directory_path>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 3. Intent-Based Workflow
|
|
28
|
+
- **Locate**: Run `vfs` first to find the file and line number.
|
|
29
|
+
- **Understand**: Run `vfs` to see the class hierarchy and method signatures.
|
|
30
|
+
- **Modify**: Run `vfs` to get the context, then `Read` only the specific line range needed.
|
|
31
|
+
|
|
32
|
+
## Benefits
|
|
33
|
+
- **Token Efficiency**: ~300 tokens for structural mapping vs 20,000+ for raw reads.
|
|
34
|
+
- **Speed**: Instantaneous structural overview.
|
|
35
|
+
- **Focus**: Reduces noise and helps maintain agent focus on logical flow rather than implementation details.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
- `vfs . -f init` -> Shows all `init()` methods in the project.
|
|
39
|
+
- `vfs src/core` -> Shows the API structure of the core module.
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 mrtrinhvn
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: regent-orchestrator
|
|
3
|
-
description: Nhân vật "Nhiếp Chính" (Regent Agent). Quy trình điều phối cao cấp, lựa chọn Model thông minh và quản lý trạng thái đa dự án.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# KỸ NĂNG: ĐIỀU PHỐI NHIẾP CHÍNH (Regent Orchestration)
|
|
7
|
-
|
|
8
|
-
Tác nhân Nhiếp chính không chỉ thực thi code mà còn là người quản lý tài nguyên và chiến lược cho toàn bộ hệ sinh thái của User.
|
|
9
|
-
|
|
10
|
-
## 1. Vai trò "Nhiếp Chính" (The Regent Role)
|
|
11
|
-
- **Tầm nhìn**: Quản lý đa dự án, mỗi dự án một Port riêng (9555, 9556...).
|
|
12
|
-
- **Quyền hạn**: Có quyền yêu cầu User chuyển Model (Model Switching) hoặc tự động Fallback về Ollama local nếu Cloud hết Quota.
|
|
13
|
-
|
|
14
|
-
## 2. Chiến lược Điều phối Model (Intelligent Routing)
|
|
15
|
-
Khi nhận tác vụ, Nhiếp chính phải phân loại ngay:
|
|
16
|
-
- **Tác vụ Nhẹ (Code đơn giản, Giải thích)**: Ưu tiên dùng `Ollama (Nemotron-4-8B-Instruct hoặc nvidia_Orchestrator-8B)` để tiết kiệm chi phí và tăng tốc độ phản hồi.
|
|
17
|
-
- **Model Mặc định**: `hf.co/bartowski/nvidia_Orchestrator-8B-GGUF:Q4_K_M` (Chuyên gia lập trình).
|
|
18
|
-
- **Tác vụ Nặng (Refactor lớn, Bug khó, Design UI)**: Yêu cầu kích hoạt `Claude 3.5 Sonnet` hoặc `Gemini 1.5 Pro`.
|
|
19
|
-
|
|
20
|
-
## 3. Đồng bộ Trạng thái (Cross-UI Sync)
|
|
21
|
-
- Mọi thay đổi về Model chọn tại IDE Chat phải được cập nhật ngay về Telegram Bot và ngược lại.
|
|
22
|
-
- Sử dụng `interaction_final.log` làm "Sổ ghi chép chung" để các phiên bản của Agent luôn nắm bắt được ngữ cảnh mới nhất.
|
|
23
|
-
|
|
24
|
-
## 4. Quy trình xử lý Tác vụ Phức tạp
|
|
25
|
-
1. **Phân tích (Explorer)**: Hiểu cấu trúc Project qua VFS.
|
|
26
|
-
2. **Lập Kế hoạch (Planner)**: Luôn tạo `implementation_plan.md` cho các thay đổi lớn.
|
|
27
|
-
3. **Thực thi (Executor)**: Viết code chuẩn AG-Kit.
|
|
28
|
-
4. **Kiểm tra (Auditor)**: Chạy `ag-kit check` để đảm bảo môi trường sạch trước khi báo cáo kết quả qua Telegram.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
> **Triết lý**: Nhiếp chính là bộ não đứng sau ngai vàng, giúp User tối ưu hóa năng suất bằng cách chọn đúng công cụ cho đúng việc.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: telegram-bridge
|
|
3
|
-
description: Kết nối IDE với Telegram Bot. Hướng dẫn xây dựng Giao diện Điều khiển (CDP Bridge) qua Telegram sử dụng grammY.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# KỸ NĂNG: CẦU NỐI TELEGRAM (Telegram Bridge)
|
|
7
|
-
|
|
8
|
-
Kỹ năng này cho phép Antigravity Agent mở rộng tầm kiểm soát ra ngoài IDE, cho phép người dùng ra lệnh và nhận báo cáo qua Telegram.
|
|
9
|
-
|
|
10
|
-
## 1. Kiến trúc Kết nối
|
|
11
|
-
- **Bot Framework**: Sử dụng `grammY` (chuẩn https://github.com/grammyjs/awesome-grammY).
|
|
12
|
-
- **Bridge**: Telegram Bot nhận lệnh -> Chuyển tiếp tới IDE qua CDP (Chrome Devtools Protocol).
|
|
13
|
-
|
|
14
|
-
## 2. Các Lệnh Điều khiển Cơ bản (Keyboard AI)
|
|
15
|
-
Khi xây dựng Menu cho Bot, hãy ưu tiên các nút bấm (Inline Keyboard) để người dùng chọn Model:
|
|
16
|
-
- `🤖 Chọn Model`: Hiện danh sách (Claude 3.5, Gemini Pro, Ollama Local).
|
|
17
|
-
- `📊 Quota`: Kiểm tra giới hạn Token còn lại.
|
|
18
|
-
- `🔄 Restart IDE`: Khởi động lại Antigravity trên đúng Port của Project.
|
|
19
|
-
|
|
20
|
-
## 3. Giao diện Awesome-grammY
|
|
21
|
-
- Sử dụng `Menu Plugin` để tạo menu đa cấp mượt mà.
|
|
22
|
-
- Sử dụng `Auto-retry` để xử lý lỗi mạng.
|
|
23
|
-
- Sử dụng `Parse Mode: HTML` để định dạng log từ IDE gửi về (dùng thẻ `<pre>` cho code).
|
|
24
|
-
|
|
25
|
-
## 4. Bảo mật (Cyber Shield)
|
|
26
|
-
- Chỉ cho phép các User ID trong `ALLOWED_USER_IDS` (.env) tương tác với Bot.
|
|
27
|
-
- Tuyệt đối không để lộ Token trong Git (sử dụng `.gitignore` cho `.env`).
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
> **Lưu ý**: Skill này cung cấp triết lý và cấu trúc. Code thực thi nằm trong `src/bot/` và được khởi tạo qua `start.sh`.
|