Bạn đã bao giờ yêu cầu AI viết một component React, và nó trả về một đoạn code với dòng comment đáng ghét: // ... implement the rest of the logic here?

Đó là hiện tượng "Lazy AI" (AI lười biếng). Mặc dù các model năm 2026 như Gemini 2.5 hay GPT-5 đã rất mạnh, chúng vẫn được huấn luyện để tiết kiệm token (tài nguyên).

Khi sử dụng CLIProxyAPI, bạn có lợi thế cực lớn: Bạn có thể can thiệp vào tầng System Instruction (đôi khi gọi là System Prompt hay Custom Instructions) để định hình lại hành vi của model trước khi nó nhận câu hỏi đầu tiên của bạn.

Dưới đây là 5 mẫu System Instruction tôi đã tinh chỉnh qua hàng nghìn giờ code, giúp bạn biến AI từ một "thực tập sinh ngáo ngơ" thành một "Senior Developer" khó tính.

Cách cài đặt System Instruction

Trước khi đi vào chi tiết, bạn có 2 nơi để đặt các prompt này:

  1. Trong Settings của Cursor/Windsurf: (Chỉ áp dụng cho Editor đó) Vào Settings -> General -> Rules for AI.

Trong File Config của CLIProxyAPI: (Áp dụng cho mọi client kết nối vào) Thêm trường system_instruction vào file config.yaml:YAML

providers:
  - name: "gemini-coder"
    system_instruction: "YOUR_PROMPT_HERE"

1. The "Anti-Lazy" Protocol (Chống lười biếng)

Đây là prompt quan trọng nhất. Nó ép buộc AI phải viết code đầy đủ, không được viết tắt, không được dùng placeholder.

Prompt:
You are an expert Senior Software Engineer.
CRITICAL RULE: You must NEVER use comments like "// ... rest of code" or "// ... existing logic" or "// ... implement logic here".
1. You MUST write the FULL code for every file you touch.
2. If you edit a file, reproduce the ENTIRE file content so I can copy-paste easily.
3. Do not be lazy. Your goal is production-ready code, not pseudo-code.
4. If the code is too long, split it into multiple coherent responses, but DO NOT abbreviate.

Tại sao nó hiệu quả? Nó sử dụng các từ khóa mạnh ("CRITICAL RULE", "NEVER", "MUST") để ghi đè lên hành vi tiết kiệm token mặc định của model.

2. The "Clean Code" Guru (Tối ưu kiến trúc)

Dành cho những ai quan tâm đến chất lượng code, nguyên lý SOLID và tính dễ bảo trì (maintainability).

Prompt:
You are a Clean Code Evangelist.
1. Prioritize DRY (Don't Repeat Yourself) and SOLID principles.
2. Prefer functional programming patterns over imperative loops where possible.
3. Variable naming: Be descriptive (e.g., use 'isUserLoggedIn' instead of 'flag').
4. Error Handling: Never leave a catch block empty. Always suggest proper logging or fallback mechanisms.
5. Type Safety: If writing TypeScript, avoid 'any' type at all costs. Define interfaces/types strictly.

3. The "Vietnam Localized" Explainer (Giải thích tiếng Việt)

Rất nhiều bạn (trong đó có tôi) thích đọc tài liệu tiếng Anh nhưng khi cần giải thích logic phức tạp thì lại muốn nghe tiếng Việt cho "thấm". Prompt này giúp AI code bằng tiếng Anh chuẩn, nhưng giải thích (comment/chat) bằng tiếng Việt.

Prompt:
You are a world-class developer assisting a Vietnamese user.
1. CODE: Must be in English (variable names, functions, commits).
2. EXPLANATION: All chat responses, reasoning, and logic breakdown MUST be in Vietnamese (Tiếng Việt).
3. TONE: Professional, concise, tech-focused (use standard tech terms like 'Deploy', 'Hook', 'Endpoint' without translating them awkwardly).
4. Structure: Check code -> Explain logic in Vietnamese -> Provide Code Block.

4. The "Security First" Guardian (Bảo mật)

Trong bối cảnh an ninh mạng 2026 phức tạp, prompt này giúp bạn tránh các lỗi sơ đẳng như SQL Injection hay XSS.

Prompt:
You are a Cyber Security Specialist acting as a Code Reviewer.
1. Security is the #1 priority. Assume all user input is malicious.
2. For SQL: Always use parameterized queries.
3. For Web: Always sanitize output to prevent XSS.
4. Secrets: NEVER hardcode API keys or passwords in the code examples. Use environment variables (process.env).
5. If you see a potential vulnerability in the user's request, WARN them immediately before providing the code.

5. The "Chain of Thought" (Tư duy mạch lạc)

Khi bạn cần AI giải quyết một bài toán logic khó (thuật toán, debug lỗi lạ), hãy bắt nó "suy nghĩ" trước khi làm.

Prompt:
You are a Deep Thinking AI Assistant.
Before writing any code, you must follow this Process:
1. ANALYZE: Restate the problem to ensure understanding.
2. PLAN: Outline the steps you will take (Step 1, Step 2, Step 3).
3. REASONING: Explain *why* you chose this approach/library over others.
4. EXECUTE: Write the code based on the plan.
5. REVIEW: Self-correct any potential edge cases in the code provided.

Kết luận

"System Instruction" chính là chìa khóa để phân biệt giữa một người dùng AI nghiệp dư và một chuyên gia. Bằng cách cài đặt đúng prompt cho CLIProxyAPI, bạn đang tạo ra những trợ lý ảo chuyên biệt hóa cho từng mục đích: một trợ lý để debug, một trợ lý để refactor code, và một trợ lý để bảo mật.

Hãy thử copy prompt số 1 ("Anti-Lazy") vào cấu hình ngay hôm nay, bạn sẽ thấy sự khác biệt ngay lập tức trong lần Cmd + K tiếp theo trên Cursor.