Chuyển tới nội dung chính

Rules & Skills

AIDK sử dụng hai cơ chế chính để hướng dẫn AI: RulesSkills. Cả hai đều được đặt trong thư mục .agent/.

Rules

Rules là các file .md trong .agent/rules/. AI đọc chúng trước mọi tác vụ để hiểu các ràng buộc và tiêu chuẩn của dự án.

Cấu trúc một Rule

# Tên Rule

## Mô tả
Mô tả ngắn gọn về rule này làm gì.

## Quy tắc bắt buộc
- Quy tắc 1
- Quy tắc 2

## Ví dụ đúng
...

## Ví dụ sai
...

Các Rules mặc định

RuleƯu tiênMô tả
0-force-rule.md0 (cao nhất)Buộc AI review tất cả rules/skills trước khi làm việc
2-dotenv-environments.md2Chuẩn cấu hình biến môi trường với file .env
3-coding-style.md3Quy tắc coding style (file size, immutability, v.v.)

Thứ tự ưu tiên

Rules có số thứ tự nhỏ hơn sẽ được AI ưu tiên cao hơn. Ví dụ: 0-force-rule.md luôn được áp dụng trước tiên.


Skills

Skills là các thư mục trong .agent/skills/, mỗi thư mục chứa ít nhất một file SKILL.md. Skills cung cấp hướng dẫn chuyên biệt theo từng công nghệ hoặc tác vụ cụ thể.

Cấu trúc một Skill

.agent/skills/
└── my-skill/
├── SKILL.md # Hướng dẫn chính (bắt buộc)
├── examples/ # Ví dụ tham khảo (tùy chọn)
└── templates/ # Template file (tùy chọn)

SKILL.md frontmatter

---
name: my-skill
description: >
Mô tả khi nào nên dùng skill này.
AI sẽ đọc mô tả này để quyết định có áp dụng skill hay không.
---

Các Skills có sẵn

SkillKhi nào dùng
create-skillTạo, viết, hoặc thiết kế skill mới cho Agent AI
cxl-ansibleViết Ansible playbooks
cxl-aws-architectureThiết kế kiến trúc AWS
cxl-brainstormingTrước mọi công việc sáng tạo/xây dựng
cxl-coding-standardsChuẩn TypeScript/JavaScript/React
cxl-docusaurus-setupTạo/cập nhật trang tài liệu Docusaurus
cxl-dynamodbMô hình hóa dữ liệu DynamoDB
cxl-fastapiPhát triển REST API với FastAPI
cxl-gitignoreTạo/cập nhật .gitignore
cxl-laravelPhát triển ứng dụng Laravel 11+
cxl-phpChuẩn code PHP 8.3+
cxl-postgres-patternsThiết kế schema và query PostgreSQL
cxl-pythonChuẩn code Python
cxl-report-poTạo báo cáo PA/DA từ Notion
cxl-security-reviewReview bảo mật khi thêm auth/API
cxl-seoTối ưu SEO
cxl-terraformLàm việc với Terraform/OpenTofu

Tạo skill mới

aidk add skill my-new-skill
# Tạo: .agent/skills/my-new-skill/SKILL.md

Sau đó chỉnh sửa SKILL.md theo nhu cầu của dự án.


Workflows

Workflows là các file .md trong .agent/workflows/ định nghĩa quy trình làm việc có thể gọi bằng lệnh slash.

Các Workflows mặc định

WorkflowSlash commandMô tả
capture-knowledge.md/capture-knowledgeGhi nhận code entry point vào tài liệu knowledge
check-implementation.md/check-implementationSo sánh implementation với design và requirements
code-review.md/code-reviewReview code trước khi push
create-report-po.md/create-report-poTạo báo cáo PA/DA từ Notion
debug.md/debugDebug với phân tích root cause
execute-plan.md/execute-planThực thi kế hoạch task từng bước
make-release.md/make-releaseTạo bản release mới cho CLX AI Kit
new-requirement.md/new-requirementTạo tài liệu từ yêu cầu đến kế hoạch
review-deployment.md/review-deploymentReview chiến lược deployment
review-design.md/review-designReview design tính năng
review-implementation.md/review-implementationReview implementation tính năng
review-monitoring.md/review-monitoringReview cấu hình monitoring
review-requirements.md/review-requirementsReview tài liệu yêu cầu
simplify-implementation.md/simplify-implementationĐơn giản hóa code để giảm độ phức tạp
update-docs.md/update-docsCập nhật README và Docusaurus
update-planning.md/update-planningCập nhật tài liệu planning
update-requirement.md/update-requirementCập nhật tài liệu feature hiện tại từ requirements đến planning
write-tests.md/write-testsViết tests cho tính năng mới