AI Agent Instructions

Hướng dẫn AI Coding Agents tuân thủ SunLint Standards

GitHub Copilot
Cursor AI
Claude
Gemini
Windsurf
AI Agent Skill
SunLint cung cấp AI Agent Skill - một bộ hướng dẫn chi tiết giúp các AI Coding Agents (như GitHub Copilot, Cursor, Claude, Gemini) tự động tuân thủ 136 quy tắc code quality và security khi viết code cho dự án của bạn.
Quick Start - 1 Lệnh Duy Nhất
Khởi tạo SunLint skill cho dự án của bạn chỉ với 1 lệnh
bash
# Cài đặt sunlint (nếu chưa có)
npm install -g @sun-asterisk/sunlint

# Khởi tạo AI Agent Instructions (chọn tool phù hợp)
cd /path/to/your-project

# Cho GitHub Copilot
sunlint init -t github-copilot -l typescript

# Cho Cursor AI
sunlint init -t cursor -l typescript

# Cho Claude
sunlint init -t claude -l typescript

# Cho Google Antigravity
sunlint init -t antigravity -l typescript

# Cho C# Project (GitHub Copilot)
sunlint init -t github-copilot -l csharp

# Cho Python/PySpark Project
sunlint init -l python

# hoặc: sunlint init

Lệnh sunlint init -t <tool> sẽ tự động:

  • Tạo skill folder theo đúng tool (vd: .github/skills/)
  • Thêm nội dung vào file AGENTS.md
Cấu trúc files được tạo
Folder path thay đổi tùy theo tool được chọn
text
your-project/
├── AGENTS.md                          # Main instructions file
│
├── .github/skills/                    # -t github-copilot
│   └── sunlint-code-quality/
│
├── .cursor/skills/                    # -t cursor
│   └── sunlint-code-quality/
│
├── .claude/skills/                    # -t claude
│   └── sunlint-code-quality/
│
└── .agent/skills/                     # -t antigravity
    └── sunlint-code-quality/
        ├── SKILL.md                   # Chi tiết 65 rules
        ├── AGENTS.md                  # Quick reference cho AI
        └── rules/                     # Individual rule files
            ├── S017-parameterized-queries.md
            ├── C029-catch-log-root-cause.md
            └── ...

Hỗ trợ các AI Coding Tools

GitHub Copilot
Sử dụng với Copilot Chat trong VS Code

GitHub Copilot sẽ nhận diện SunLint rules khi bạn reference file:

  • AGENTS.md - Bảng kiểm tuân thủ (AGENTS.md)
  • .github/skills/ - Hướng dẫn chi tiết (.github/skills/)
Sử dụng lệnh @workspace để Copilot phân tích toàn bộ tiêu chuẩn trong project.

Lợi ích khi sử dụng

Code Quality
  • ✅ Functions ≤ 50 lines
  • ✅ Nesting ≤ 3 levels
  • ✅ Clear naming conventions
  • ✅ No magic numbers
  • ✅ Proper error handling
Security
  • ✅ Parameterized queries
  • ✅ Input validation
  • ✅ Secure session handling
  • ✅ TLS enforcement
  • ✅ No hardcoded secrets

Ngôn ngữ được hỗ trợ

SunLint AI Agent Skill hỗ trợ 9 ngôn ngữ lập trình phổ biến với 65+ rules cho mỗi ngôn ngữ

Backend

🟦

TypeScript

TypeScript/JavaScript cho React, Vue, Angular, Node.js

65 rules
🟣

C#

C# cho .NET, ASP.NET Core, Unity

65 rules
🟠

Java

Java cho Spring Boot, Jakarta EE, Android

65 rules
🟡

Python

Python cho Django, Flask, FastAPI, PySpark

65 rules
🔵

Go

Go cho microservices, cloud-native apps

65 rules
🐘

PHP

PHP cho Laravel, Symfony, WordPress

65 rules
💎

Ruby

Ruby cho Ruby on Rails, Sinatra

110 rules

Mobile

🤖

Kotlin

Kotlin cho Android, Spring Boot, Ktor

65 rules
💙

Dart / Flutter

Dart/Flutter cho cross-platform mobile

25 rules
🍎

Swift

Swift cho iOS, macOS, watchOS, tvOS

35 rules
Chọn ngôn ngữ mục tiêu (mặc định: typescript, csharp, python): -l typescript, -l csharp, -l java, -l python, -l go, -l php, -l ruby, -l kotlin, -l dart, -l swift
Command Options
bash
# Khởi tạo với tool mặc định (antigravity)
sunlint init

# Chọn AI tool cụ thể với -t/--tool
sunlint init -t github-copilot   # .github/skills/
sunlint init -t cursor           # .cursor/skills/
sunlint init -t claude           # .claude/skills/
sunlint init -t antigravity      # .agent/skills/

# Khởi tạo cho một project cụ thể
sunlint init ./path/to/project -t cursor

# Ghi đè nếu đã tồn tại
sunlint init -t claude --force

# Chọn ngôn ngữ mục tiêu (mặc định: typescript, csharp, python)
sunlint init -l csharp
sunlint init -t cursor -l typescript

# Xem help với danh sách tools
sunlint init --help

Questions? Open an issue on GitHub