Antigravity Kit

Mission Control for AI Agents

Tác giả Kit: Vũ Đỗ // Biên soạn: Minh Đỗ // 2026

vudovn/antigravity-kit
20
Specialist Agents
37
Skills
11
Workflows
9
Chapters

Lời nói đầu

Antigravity Kit ra đời từ một nhận thức đơn giản: AI không thể thay thế chuyên gia, nhưng AI có thể trở thành chuyên gia khi được hướng dẫn đúng cách.

Trong thế giới phát triển phần mềm hiện đại, AI Agent không còn là công cụ trợ giúp thụ động. Nó đã tiến hóa thành đồng nghiệp có chuyên môn sâu - người mà bạn có thể giao một tác vụ phức tạp và nhận lại kết quả chất lượng production-ready.

Cuốn sách này hướng dẫn bạn hiểu, sử dụng, và tùy biến Antigravity Kit - từ cài đặt cơ bản đến orchestration (điều phối) đa agent cho dự án phức tạp.

Đối tượng độc giả

1. Tổng quan Antigravity Kit

Antigravity Kit là gì?

Antigravity Kit là bộ AI Agent Templates mã nguồn mở, cung cấp framework (khung phát triển) hoàn chỉnh để biến AI model thành đội ngũ chuyên gia phát triển phần mềm.

Triết lý thiết kế

  1. Progressive Disclosure (Tiết lộ dần dần) - Thông tin chỉ được load khi cần
  2. Domain Boundaries (Ranh giới chuyên môn) - Mỗi agent chỉ hoạt động trong phạm vi chuyên môn
  3. Verify-First (Kiểm tra trước) - Mọi output đều phải qua validation

So sánh: AI thuần vs Antigravity Kit

Khía cạnhAI Model thuầnAntigravity Kit
Kiến thứcGeneralistSpecialist per domain
ContextLoad hết mọi thứProgressive Disclosure
OutputTùy thuộc promptChuẩn hóa qua checklist
TeamworkSingle agentMulti-agent orchestration
QualityKhông kiểm traMaster scripts tự động

Thành phần chính

1. Agents (20 chuyên gia) - Mỗi Agent là một AI persona chuyên biệt với Role Definition, Decision Frameworks, Anti-patterns, và Review Checklist.

2. Skills (37 modules kiến thức) - Gói kiến thức modular hoạt động theo Progressive Disclosure 3 tầng.

3. Workflows (11 quy trình) - Quy trình tự động hóa qua slash commands: /create, /brainstorm, /orchestrate...

4. Master Scripts - checklist.py và verify_all.py chạy pre-delivery validation.

2. Cài đặt và thiết lập

Yêu cầu hệ thống

Nền tảngHỗ trợGhi chú
Google Gemini CLIĐầy đủNền tảng gốc
Claude CodeĐầy đủTương thích hoàn toàn
Cursor IDEĐầy đủTích hợp trực tiếp

Cài đặt nhanh

git clone https://github.com/anthropics/antigravity-kit.git
cd antigravity-kit

# Copy .agent vào dự án
cp -r .agent/ /path/to/your-project/.agent/

Cấu trúc thư mục

your-project/
├── .agent/
│   ├── agents/          # 20 specialist agents
│   ├── skills/          # 37 skill modules
│   ├── workflows/       # 11 workflows
│   ├── scripts/         # Master scripts
│   └── ARCHITECTURE.md
├── src/
└── ...

3. Kiến trúc hệ thống

Request Classification (Phân loại yêu cầu)

Khi user gửi request, hệ thống phân loại vào 1 trong 3 phương thức:

1. Single Agent Request

Khi request rơi vào domain của đúng 1 agent.

Trigger keywordsAgent
"review code", "check quality"code-archaeologist
"deploy", "CI/CD"devops-engineer
"fix bug", "error"debugger
"optimize", "lighthouse"performance-optimizer
"database schema"database-architect

2. Workflow Request

Khi user dùng slash command: /create, /brainstorm, /orchestrate...

3. Multi-Agent Orchestration

Task phức tạp cần phối hợp nhiều chuyên gia (minimum 3 agents).

Skill Loading Protocol

Dựa trên Progressive Disclosure 3 tầng:

TierContentKhi nào loadToken cost
Tier 1YAML FrontmatterLuôn có sẵn~50/skill
Tier 2SKILL.md BodyKhi relevant~500-2000
Tier 3references/Khi cần deep knowledge~1000-5000
MCP (Kitchen) cung cấp thiết bị. Skill (Recipe) cung cấp hướng dẫn. MCP cho biết CÓ THỂ LÀM GÌ. Skill cho biết NÊN LÀM NHƯ THẾ NÀO.

Validation Layer

PriorityScriptMục đích
P0security_scan.pyQuét vulnerabilities, secrets
P1Color ContrastWCAG AA accessibility
P1.5ux_audit.pyUX psychology laws
P2Touch TargetMobile accessibility
P3lighthouse_audit.pyPerformance, SEO
P4Playwright testsEnd-to-end testing

4. Hệ thống Agents

Tổng quan 20 Agents

#AgentDomain
1orchestratorĐiều phối đa agent
2frontend-specialistUI/UX, Web frontend
3backend-specialistServer, API, Backend
4database-architectDatabase, SQL, Schema
5security-auditorCybersecurity, OWASP
6debuggerBug fixing, Root cause
7devops-engineerDeployment, CI/CD
8test-engineerTesting, TDD
9mobile-developerReact Native, Flutter
10project-plannerPlanning, Task breakdown
11game-developerUnity, Godot, Phaser
12performance-optimizerWeb Vitals, Profiling
13documentation-writerTechnical writing
14seo-specialistSEO, Web performance
15explorer-agentCodebase analysis
16code-archaeologistLegacy code analysis
17product-managerProduct strategy
18product-ownerUser stories, Backlog
19penetration-testerPentest chuyên sâu
20qa-automation-engineerQA Automation

Orchestrator - Điều phối viên chính

"Coordination is not control. Each specialist knows their domain better than you."

Orchestrator là "nhạc trưởng" - không viết code mà phối hợp các chuyên gia.

Quy tắcMô tả
Minimum 3 agentsKhông orchestrate nếu ít hơn 3 agents
No domain violationKhông yêu cầu agent làm ngoài chuyên môn
Sequential phasesPlanning PHẢI xong trước Implementation
Conflict protocolQuyết định dựa trên data khi bất đồng

Frontend Specialist

"Frontend không phải trang trí - đó là engineering."

Có tư duy đi ngược xu hướng - chống "Modern SaaS Safe Harbor":

Cliché phải tránhThay thế bằng
Purple/violet gradient mặc địnhMàu sắc có chủ đích, phù hợp brand
Rounded cards + shadows chuẩnLayout sáng tạo, phá vỡ quy ước
Hero section "generic"Visual elements gây ấn tượng

Framework Selection (2025)

ScenarioRecommendation
Static site, landing pageVanilla HTML/CSS + JS
Blog, content-heavyAstro
Full-stack web appNext.js 15 (App Router)
Dashboard, SPAReact + Vite

Backend Specialist

"Backend is not just CRUD - it's system architecture."
  • Security is non-negotiable: Validate everything, trust nothing
  • Async by default: I/O-bound = async, CPU-bound = offload
  • Type safety: TypeScript/Pydantic everywhere

Framework Selection (2025)

ScenarioNode.jsPython
Edge/ServerlessHono-
High PerformanceFastifyFastAPI
EnterpriseNestJSDjango

Database Architect

"Database is not just storage - it's the foundation."

Platform Selection (2025)

ScenarioRecommendation
Full PostgreSQL featuresNeon (serverless PG)
Edge deploymentTurso (edge SQLite)
AI/EmbeddingsPostgreSQL + pgvector
Real-time featuresSupabase

Security Auditor

"Assume breach. Trust nothing. Verify everything. Defense in depth."

Code Red Flags

PatternRisk
String concat in queriesSQL Injection
eval(), exec()Code Injection
dangerouslySetInnerHTMLXSS
Hardcoded secretsCredential exposure

Debugger

"Don't guess. Investigate systematically. Fix the root cause, not the symptom."

4-Phase Debugging Process

PHASE 1: REPRODUCE - Tái tạo lỗi
PHASE 2: ISOLATE   - Thu hẹp phạm vi
PHASE 3: UNDERSTAND - Root cause (5 Whys)
PHASE 4: FIX & VERIFY - Sửa + test regression

Các Agents khác

AgentTriết lýKhi nào dùng
devops-engineer"Automate the repeatable"Deployment, CI/CD, rollback
test-engineer"Find what the developer forgot"Unit, E2E, TDD, coverage
mobile-developer"Mobile is not a small desktop"React Native, Flutter, Expo
project-plannerPhân tích + breakdown tasksNew projects, planning
game-developer"Experience, not technology"Unity, Godot, Phaser
performance-optimizer"Measure first, optimize second"Core Web Vitals, profiling
documentation-writerKỹ thuật rõ ràng, có cấu trúcAPI docs, README, guides
seo-specialistTechnical + On-page SEOSEO audit, meta tags
explorer-agentMap codebase hiện cóOnboarding, dependency analysis
code-archaeologist"Khảo cổ code" - hiểu lịch sửLegacy analysis, refactoring
product-managerUser needs + prioritiesFeature prioritization, roadmap
product-ownerUser stories + backlogSprint planning, acceptance
penetration-testerRed team tacticsDeep security testing
qa-automation-engineerAutomated testing infraCI/CD testing, flaky test fix

5. Hệ thống Skills

Progressive Disclosure 3 tầng

Skills là gói kiến thức modular mà agents load theo nhu cầu. Cấu trúc mỗi skill:

.agent/skills/skill-name/
├── SKILL.md           # Tier 2 - required
├── references/        # Tier 3 - optional
├── scripts/           # Automation scripts
└── assets/            # Templates, fonts

Tổng quan 37 Skills

NhómSkills
Foundationclean-code, lint-and-validate
Frontendfrontend-design, ui-ux-pro-max
Backendnodejs-best-practices, python-patterns, api-patterns, database-design, mcp-builder
Mobile/Gamemobile-design (11 sub-files), game-development (12 sub-skills)
Securityvulnerability-scanner, red-team-tactics
Testingtesting-patterns, tdd-workflow, webapp-testing, code-review-checklist
DevOpsdeployment-procedures, server-management, powershell-windows, bash-linux
Performanceperformance-profiling
Planningapp-builder, plan-writing, brainstorming
Specializedrust-pro, systematic-debugging

Tạo Skill mới

# Tạo skill đơn giản
mkdir -p .agent/skills/code-review

# SKILL.md:
---
name: code-review
description: Reviews code for bugs, style, and best practices.
---

# Code Review Skill
## Review Checklist
1. Correctness - Does the code work?
2. Edge cases - Error conditions handled?
3. Style - Project conventions followed?
4. Performance - Obvious inefficiencies?

ui-ux-pro-max: Skill nâng cao

Skill phức tạp nhất - có search engine và 500+ design data points:

DataCount
UI Styles50+
Color Palettes97
Font Pairings57
UX Guidelines99
Chart Types25
# Generate design system tự động
python3 search.py "beauty spa" --design-system -p "My Spa"

# Search theo domain
python3 search.py "dark glassmorphism" --domain style
python3 search.py "SaaS dashboard" --domain color

6. Hệ thống Workflows

11 workflows cung cấp quy trình chuẩn hóa, trigger bằng slash commands:

CommandMô tảAgents
/createTạo ứng dụng mớiplanner, frontend/backend/DB
/brainstormKhám phá ý tưởngSingle agent, 4 phases
/orchestrateĐiều phối đa agentOrchestrator + 3+ agents
/planLên kế hoạchproject-planner
/debugDebug có phương phápdebugger
/reviewCode reviewcode-archaeologist
/testTạo test suitetest-engineer
/deployDeploy ứng dụngdevops-engineer
/secureSecurity auditsecurity-auditor
/optimizeTối ưu hiệu suấtperformance-optimizer
/ui-ux-pro-maxDesign systemfrontend-specialist

/create - Tạo ứng dụng

/create e-commerce platform with product catalog,
shopping cart, and Stripe payments

Flow:
Request Analysis → Technology Selection →
Project Planning → Agent Assignment

/brainstorm - Khám phá ý tưởng

4 Phases:
1. UNDERSTAND - Clarify problem, constraints
2. EXPLORE   - Generate 3-5 options
3. EVALUATE  - Compare, trade-off, risk
4. RECOMMEND - Top pick + roadmap

/orchestrate - Điều phối đa agent

Workflow phức tạp nhất - phối hợp minimum 3 agents:

Protocol:
1. Orchestrator Analysis (chọn agents ≥ 3)
2. PHASE 1: Planning (mỗi agent lên kế hoạch)
3. PHASE 2: Implementation (thực thi theo dependency)
4. Conflict Resolution (nếu có)
5. Verification + Delivery

7. Multi-Agent Orchestration

Protocol chi tiết

Orchestrator KHÔNG: viết code, thiết kế, review security
Orchestrator CHỈ:   phân tích, chọn agents, chia tasks,
                    truyền context, giải quyết conflicts

Conflict Resolution

Khi 2 agents bất đồng:

  1. Xem evidence - approach nào có bằng chứng mạnh hơn?
  2. Domain authority - agent nào có quyền quyết định?
  3. User preference - hỏi user nếu cần

Case Study: Build Next.js Dashboard

User Request

/orchestrate Build real-time analytics dashboard with:
- PostgreSQL for storing events
- REST API + WebSocket for real-time
- React dashboard with charts
- JWT Authentication
- Playwright E2E tests

6 Agents tham gia

AgentSubtask
database-architectSchema: events, users, sessions
backend-specialistREST API + WebSocket + JWT
frontend-specialistReact dashboard + Recharts
security-auditorJWT review, input validation
test-engineerPlaywright E2E tests
performance-optimizerChart rendering optimization

Implementation Order

Step 1 (Sequential): database-architect → schema
Step 2 (Sequential): backend-specialist → API
Step 3 (Parallel):   frontend + security review
Step 4 (Sequential): test-engineer → E2E tests
Step 5 (Parallel):   performance optimization

8. Case Studies và Thực hành

Case Study 1: Landing Page chuyên nghiệp

/create landing page cho dịch vụ spa,
phong cách elegant và premium

→ ui-ux-pro-max generate design system
→ Frontend Specialist triển khai
→ verify_all.py → Lighthouse 98+, SEO 100

Case Study 2: Debug Production Error

Kỹ thuật 5 Whys

WHY 500?     → Database query timeout
WHY timeout? → Connection pool full
WHY full?    → Connections not released
WHY?         → Missing await on query
WHY?         → Copy-paste error ← ROOT CAUSE

Fix: 1 dòng code (thêm await)
+ Regression test + Audit tương tự

Bài tập thực hành

Bài 1: Tạo Git Commit Skill

mkdir -p .agent/skills/git-commit

# SKILL.md
---
name: git-commit
description: Formats git commit following Conventional Commits.
---

Types: feat, fix, docs, refactor, test, chore
Rules: lowercase, imperative mood, max 72 chars
Example: feat(auth): add JWT refresh token rotation

Bài 2: Custom Agent

# .agent/agents/my-project-specialist.md
---
name: my-project-specialist
description: Expert in [your project] conventions
skills: clean-code, [relevant-skills]
---

## Project Context: [describe your architecture]
## Conventions: [your code conventions]
## Decision Frameworks: [your tech stack]

Tips nâng cao

TipChi tiết
Skill ChainingAgent tự load combo skills phù hợp
Context BudgetMỗi task chỉ nên load 2-3 skills maximum
CustomizationOverride skill → Add skill → Modify agent → New workflow
Team CollaborationCommit .agent/ vào repo, shared workflows