Skills
Skills là một open standard để mở rộng khả năng của Agent với các gói kiến thức chuyên biệt.
Skills là gì?
Phần tiêu đề “Skills là gì?”Skills là các thư mục chứa instructions giúp Agent thực hiện các tác vụ đặc thù. Mỗi skill bao gồm:
- SKILL.md (bắt buộc) - File hướng dẫn chính
- scripts/ - Scripts hỗ trợ
- examples/ - Ví dụ tham khảo
- resources/ - Tài nguyên bổ sung
Cấu trúc SKILL.md
Phần tiêu đề “Cấu trúc SKILL.md”File SKILL.md có format YAML frontmatter + Markdown:
---name: React Component Generatordescription: Tạo React components theo best practices---
# React Component Generator
## Khi nào sử dụngSử dụng skill này khi cần tạo React components mới.
## Instructions
### Bước 1: Tạo file componentTạo file trong `src/components/[ComponentName]/index.tsx`
### Bước 2: Structure\`\`\`tsxinterface [ComponentName]Props { // props}
export function [ComponentName]({ ...props }: [ComponentName]Props) { return ( // JSX );}\`\`\`
### Bước 3: ExportThêm export vào `src/components/index.ts`Cách Agent sử dụng Skills
Phần tiêu đề “Cách Agent sử dụng Skills”- Agent phát hiện skill liên quan đến task
- Agent đọc SKILL.md để hiểu instructions
- Agent tuân theo instructions trong quá trình thực hiện
Tạo Custom Skills
Phần tiêu đề “Tạo Custom Skills”Bước 1: Tạo thư mục
Phần tiêu đề “Bước 1: Tạo thư mục”.agent/skills/└── my-skill/ ├── SKILL.md ├── scripts/ │ └── helper.js └── examples/ └── example.mdBước 2: Viết SKILL.md
Phần tiêu đề “Bước 2: Viết SKILL.md”---name: My Custom Skilldescription: Mô tả ngắn về skill---
# My Custom Skill
## OverviewMô tả chi tiết skill làm gì.
## Prerequisites- Requirement 1- Requirement 2
## Instructions1. Bước đầu tiên2. Bước thứ hai3. ...
## ExamplesXem thư mục `examples/` để tham khảo.
## TroubleshootingCác vấn đề thường gặp và cách xử lý.Bước 3: Test Skill
Phần tiêu đề “Bước 3: Test Skill”Yêu cầu Agent sử dụng skill:
"Sử dụng skill my-skill để thực hiện..."Skills có sẵn
Phần tiêu đề “Skills có sẵn”Antigravity đi kèm một số skills mặc định:
| Skill | Mô tả |
|---|---|
| Web Development | Best practices cho web apps |
| API Design | RESTful API conventions |
| Testing | Testing patterns và frameworks |
| Documentation | Writing technical docs |
Best Practices
Phần tiêu đề “Best Practices”✅ Instructions rõ ràng
Phần tiêu đề “✅ Instructions rõ ràng”❌ "Tạo component đẹp"✅ "Tạo functional component với TypeScript, sử dụng Tailwind cho styling"✅ Có ví dụ cụ thể
Phần tiêu đề “✅ Có ví dụ cụ thể”## Example
Input:\`\`\`Create a Button component with primary and secondary variants\`\`\`
Output:\`\`\`tsxinterface ButtonProps { variant: 'primary' | 'secondary'; children: React.ReactNode;}
export function Button({ variant, children }: ButtonProps) { const styles = { primary: 'bg-blue-500 text-white', secondary: 'bg-gray-200 text-gray-800' };
return ( <button className={styles[variant]}> {children} </button> );}\`\`\`✅ Cover edge cases
Phần tiêu đề “✅ Cover edge cases”## Edge Cases
### Empty inputNếu input rỗng, throw error với message rõ ràng.
### Invalid formatValidate input trước khi process.Chia sẻ Skills
Phần tiêu đề “Chia sẻ Skills”Skills là open standard, có thể:
- Share trong team
- Publish lên GitHub
- Import từ community
Skills vs Rules
Phần tiêu đề “Skills vs Rules”| Đặc điểm | Skills | Rules |
|---|---|---|
| Scope | Tác vụ cụ thể | Project-wide |
| Format | Structured instructions | Guidelines |
| Reusability | Cao (có thể share) | Project-specific |
| Complexity | Có thể phức tạp | Nên đơn giản |