Skip to main content

AI Coding Assistant

1. Tổng quan

  • Các công cụ AI phổ biến: Cursor, Windsurf, Claude Code, GitHub Copilot, Tabnine
  • Cursor - "AI trong IDE": Dựa trên VS Code, hoạt động như "người đồng hành lập trình". Cung cấp gợi ý code đa dòng, refactor thông minh, và chat có ngữ cảnh với toàn bộ codebase. Có cộng đồng lớn chia sẻ mẹo sử dụng và rule files (.cursorrules, .mdc) để AI hiểu phong cách code của team.
  • Claude Code - "AI làm thay bạn": Theo hướng agentic, tập trung vào CLI như "người cộng sự cấp cao". Tự động xử lý toàn bộ quy trình: đọc GitHub Issue → viết code → chạy test → tạo Pull Request. Tính năng Agentic search giúp hiểu codebase và chỉnh sửa nhiều file đồng bộ mà không cần chỉ định thủ công. Có cộng đồng chia sẻ mẹo sử dụng và sub-agent cho các tác vụ cụ thể. Phù hợp với lập trình viên cao cấp, quan tâm automation và CI/CD.

2. Phân tích chi tiết

2.1. Tính năng kỹ thuật

Tính năngCursorClaude CodeGitHub CopilotTabnineKhuyết nghị
Tích hợp IDE❌ IDE riêngClaude, Copilot, Tabnine
Sinh mã và file✅ Hoàn thành nhiều dòng, theo ngữ cảnh, tự động import, hỗ trợ tạo file, diff preview dễ theo dõi⚠️ Sinh code đa file, mạnh về automation, ít trực quan⚠️ Hoàn thành nhiều dòng, theo ngữ cảnh, hỗ trợ tạo file nhưng chưa tốt bằng cursor⚠️ Hoàn thành nhiều dòng, theo ngữ cảnh, không sinh fileCursor, Claude
Ngữ cảnh và trò chuyện với AI✅ Hiểu ngữ cảnh tốt, cho phép kéo thả thư mục vào chat, cho phép tham chiếu images/files/code thông qua @Files/@Code.✅ Repo-level context, agentic search rất mạnh⚠️ Hạn chế⚠️ Hạn chếCursor, Claude
Tích hợp TerminalAll
Tác nhân AI (Agent)✅ Rất tốt✅ Rất tốt, có thể tạo sub-agent⚠️ Chậm, không ổn định⚠️ Chỉ có các Agent: Chat/Review/Test/JiraCursor/Claude
Generate Commit Message✅ Tin nhắn chi tiết, có thể tùy chỉnh qua .cursorrules✅ Mặc định là tin nhắn ngắn gọnCursor, Copilot
MCP (e.g: Figma to Code)✅ Cấu hình qua CLICursor, Claude, Copilot
Rà soát mã✅ Đề xuất sửa lỗi cục bộ trong IDE✅ Rà soát toàn repo, /security-review, CI/CD⚠️ Hạn chế⚠️ Hạn chếCursor, Claude
Git/SCM✅ Tích hợp GitHub mạnh, auto PR, CI/CDAll
Triển khai, huấn luyện từ mã nội bộ✅ EnterpriseTabnine

2.2. Chi phí

Đối tượngGói/Tính năngCursorClaude CodeGitHub CopilotTabnineĐánh giá
Cá nhânMiễn phíMiễn phí 2 tuần Pro trial, limited agent requests-Miễn phí 50 requests và 2000 completions trên một thángDev Preview: Free 14 ngàyCursor
Cá nhânPro/Dev$20/tháng$20/tháng$10/tháng$9/tháng (30 ngày free trial)Tabnine
Cá nhânHigh-usage$200/tháng (20x)$100/tháng (5x) hoặc $200/tháng (20x)$39/tháng-GitHub Copilot
Nhóm nhỏ (10-50 users)Team/Business$40/user/tháng (SAML/OIDC, admin features, enforced Privacy Mode)$150/user/tháng (tối thiểu 5 thành viên)$19/user/tháng$39/user/thángGitHub Copilot
Tổ chức lớn (>500 users)Enterpriseliên hệ riêngliên hệ riêng$60/user/tháng (gồm GitHub Enterprise $21/user/tháng)$39/user/tháng (self-hosting)Tabnine

GitHub Copilot:

  • Enterprise bắt buộc phải có GitHub Enterprise Cloud (~$21/user/tháng) → Tổng $60/user/tháng.

Tabnine:

  • Enterprise Private Installation Package ($39/user/tháng), with a minimum of 100 developers.

Claude Code (Tham khảo)

  • Tích hợp vào gói dịch vụ của Anthropic: Pro (20 USD/tháng), Max 5x (100 USD), Max 20x (200 USD).
  • Ngoài ra có mô hình trả theo token cho API. Linh hoạt nhưng dễ phát sinh chi phí đột biến nếu dùng nhiều.
  • Phù hợp cho power users hoặc tổ chức lớn chấp nhận chi phí để đổi lấy sức mạnh agentic.
Tiêu chíPro ($20/tháng)Max ($100/tháng – 5× / $200/tháng – 20×)
Các model khả dụng- Claude 4 Sonnet (mặc định cho Claude Code)
- Claude 4 Haiku (nhẹ, tốc độ cao)
- Không có Opus
- Claude 4 Sonnet (mặc định Claude Code)
- Claude 4 Haiku (nhẹ, nhanh)
- Claude 4 Opus (mạnh nhất, suy luận phức tạp)
Giới hạn sử dụng (mỗi 5 giờ)~45 tin nhắn Claude (tùy độ dài) / 10–40 prompts Claude Code- Max 5× Pro: ~225 tin nhắn hoặc 50–200 prompts
- Max 20× Pro: ~900 tin nhắn hoặc 200–800 prompts
Tổng thời gian/tuần~40–80 giờ Sonnet 4- Max 5× Pro: ~140–280 giờ Sonnet 4 và ~15-35 giờ Opus 4
- Max 20× Pro: ~240–480 giờ Sonnet 4 và ~24-40 giờ Opus 4

2.3. Bảo mật & Quyền riêng tư

Tiêu chíCursorClaude CodeGitHub CopilotTabnine
Gửi mã nguồn ra ngoài?⚠️ (tuỳ chọn - Privacy Mode)❌ (Enterprise)❌ (On-premise) / ✅ (SaaS)
Lưu trữ mã nguồn?⚠️ (tuỳ chọn - Privacy Mode)⚠️ ≤ 30 ngày (vận hành) / 5 năm (nếu đồng ý training)✅ (28 ngày)❌ (On-premise) / ⚠️ (SaaS - tạm thời)
Huấn luyện AI bằng mã người dùng?⚠️ (tuỳ chọn - Privacy Mode)⚠️ (tùy chọn - hỏi khi mới dùng)
On-premise
Kiểm soát mã nguồn✅ (chấp thuận thủ công)✅ (chấp thuận thủ công)✅ (chấp thuận thủ công)✅ (chấp thuận thủ công)
Local LLM
Chứng chỉ bảo mậtSOC 2 Type IISOC 2 Type II, ISO 27001SOC 2, GDPRSOC 2 Type II, ISO 9001, GDPR
Tích hợp LDAP/SSO✅(Microsoft Entra / Azure AD)
Ghi chúPrivacy Mode (zero data retention): mặc định tắt ở gói Free/Pro, bật mặc định ở gói BusinessAnthropic cam kết không dùng dữ liệu khách hàng để huấn luyện. Hướng tới automated security reviews – AI kiểm tra mã để tìm lỗ hổng.Business/Enterprise có kiểm soát bảo mật bổ sungOn-premise phù hợp bảo mật cao; SaaS vẫn an toàn nhưng chạy trên đám mây

Ghi Chú: MCP có lỗ hổng tiềm ẩn (prompt injection, tool poisoning), cần cảnh giác khi dùng.


3. Đánh giá và đề xuất

Công cụPhù hợp choKhi nào dùng
CursorNhóm R&D, startup, kỹ sư cá nhân hoặc team nhỏDự án nhỏ, không cần bảo mật quá cao, VSCode-based IDE, người dùng muốn học hỏi từ AI
Claude CodeTổ chức lớn, DevOps, power users, người dùng cao cấpTác vụ lớn đa tệp, automation toàn bộ pipeline, CI/CD phức tạp, chấp nhận chi phí cao để đổi lấy khả năng agentic vượt trội, có kinh nghiệm và thích làm việc qua CLI.
GitHub Copilot
TabnineDoanh nghiệp lớn, yêu cầu bảo mật caoDự án nhạy cảm, IDE đa dạng, muốn kiểm soát mô hình AI
  • Nhiều lập trình viên dùng Cursor để coding hàng ngày, và Claude Code để xử lý tác vụ lớn, nặng. Đây là cách tận dụng “best of both worlds”.

4. Demo

4.1. Cursor

Tự động hoàn thành mã (Auto-complete Example)

// a + b
const sum = (a: number, b: number): number => {
return a + b;
};

// a - b
const subtract = (a: number, b: number): number => {
return a - b;
};

// a * b
const multiply = (a: number, b: number): number => {
return a * b;
};

// a / b
const divide = (a: number, b: number): number => {
return a / b;
};

// a % b
const modulo = (a: number, b: number): number => {
return a % b;
};

// a ^ b
const power = (a: number, b: number): number => {
return a ** b;
};

Auto Import

4.2. Claude Code

Issue to Pull Request

4.3. Both Cursor and Claude Code

Terminal Commands

Delete a installation file

Figma to Code using MCP

  • Cursor
{
"mcpServers": {
"Framelink Figma MCP": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"figma-developer-mcp",
"--figma-api-key=YourFigmaKey",
"--stdio"
]
}
},
}
  • Claude Code
claude mcp add "Framelink_Figma_MCP" --scope user -- cmd /c npx -y figma-developer-mcp --figma-api-key=YourFigmaKey --stdio
  • Prompt
Create a pixel-perfect, responsive React application from this Figma design: https://www.figma.com/design-link

**Core Requirements:**
- Match colors, typography, spacing, and visual effects exactly
- Implement responsive design with mobile-first approach
- Build reusable TypeScript components with proper props
- Add basic hover states and interactions

**Technical Stack:**
- React with TypeScript and CSS (Grid, Flexbox)
- CSS modules or styled-components for styling
- Basic state management for interactive components
- Form validation

**Features:**
- Clean component architecture
- Responsive layout

Create a functional application that matches the original design.

Nhận biết ngữ cảnh, rà soát, tối ưu hóa, giải thích và viết tài liệu mã (đa tệp)

Please review all components in the source code. Analyze each component for potential improvements, performance optimizations, and best practices. Provide clear explanations of how each component works and add comprehensive documentation including comments, JSDoc annotations, and usage examples where appropriate. Focus on component architecture, reusability, and maintainability across the entire codebase.
Implement multiple languages (including Vietnamese and English) for all components in this project.

Writing Backend APIs

Create a backend API project for a hotel management system. Build a Node.js/Express application with TypeScript. Implement the following features:

**Core Entities:**
- Hotels (name, address, rating, amenities)
- Rooms (room number, type, price, capacity, availability, hotel_id)
- Bookings (guest info, check-in/out dates, total cost, room_id, hotel_id)
- Users (customers and staff with roles)

**API Features:**
- JWT authentication
- Role-based authorization (admin, staff, customer)
- Basic search and filtering (by location, price range, availability)
- Pagination for list endpoints
- Input validation
- API documentation with Swagger

**Database Design:**
- Use SQLite with Prisma ORM
- Implement foreign key relationships
- Basic database indexes
- Database file created automatically on first run

**Project Structure:**
- Separate concerns (controllers, services, models)
- Clean folder organization

Create a functional application that demonstrates good backend development practices.