AI Coding Workflow 2026
Từ cách dùng ChatGPT/Claude như một “chat box” sang workflow kỹ sư có context, rules, Git, verification, Jira/Figma/GitHub connectors, MCP và reusable Skills.
1. Mental model: 5 lớp để dùng AI coding tốt
| Lớp | Mục đích | Ví dụ |
|---|---|---|
| 1. Prompt | Nói task hiện tại | “Fix bug NTA-123, chỉ sửa backend, chạy test X.” |
| 2. Persistent instructions | Luật luôn áp dụng cho repo | AGENTS.md, CLAUDE.md, Copilot instructions |
| 3. Context sources | Cho AI biết ticket/design/code thật | GitHub, Jira, Figma, docs, MCP/plugins |
| 4. Execution & verification | Cho agent đọc/sửa/chạy test và chứng minh | git diff, unit/integration tests, lint, build |
| 5. Reusable workflows | Không lặp prompt dài | Skills, prompt files, slash commands, plugins |
2. Prompt tiếng Việt: dùng thế nào cho hiệu quả
Bạn không cần chuyển toàn bộ sang tiếng Anh. Với coding, tên class, API, error, stack trace, acceptance criteria và command nên giữ nguyên dạng kỹ thuật; phần mô tả task có thể viết tiếng Việt.
Mẫu prompt 6 phần
Mục tiêu:
- Implement <tính năng / bug>.
Context:
- Ticket: NTA-xxxx
- Module liên quan: ...
- File/design liên quan: ...
Ràng buộc:
- Không đổi public API nếu không cần.
- Không sửa file ngoài scope.
- Follow AGENTS.md / CLAUDE.md.
Acceptance criteria:
- ...
Verification:
- Chạy unit test ...
- Chạy build/lint ...
Output cuối:
- Tóm tắt file đã đổi, lý do, test đã chạy, rủi ro còn lại.
OpenAI hiện khuyến nghị prompt rõ ràng, cụ thể, đủ context và refinement theo vòng lặp. Anthropic cũng nhấn mạnh output constraints, step ordering và examples khi cần consistency.
3. Đừng bắt đầu bằng “prompt engineering”; hãy bắt đầu bằng repo instructions
AGENTS.md — lựa chọn trung lập tốt cho multi-agent
# Project context
- Java 21 + Spring Boot + React.
- Backend: /backend, frontend: /frontend.
# Working rules
- Read existing implementation before editing.
- Make the smallest change that satisfies the task.
- Do not change API contracts unless explicitly requested.
- Never modify generated files.
# Verification
- Backend: ./mvnw test
- Frontend: npm test && npm run build
- Before finishing: show git diff summary and test results.
# Style
- Follow existing naming and package structure.
- Prefer existing utilities over introducing new abstractions.
Codex hỗ trợ AGENTS.md theo scope thư mục; GitHub Copilot cũng nhận agent-instruction files ở nhiều surface. Đây là file tốt nếu bạn muốn repo dùng được với nhiều agent.
CLAUDE.md — Claude Code-specific memory
Claude Code tự tải CLAUDE.md theo hierarchy. Nội dung phù hợp: architecture, build/test commands, conventions, “do/don't” của project. Không nên biến nó thành wiki dài; giữ các rule quan trọng, ổn định và có thể kiểm tra được.
4. Workflow chuẩn cho một coding task
- Orient: đọc repo instruction + ticket/design + code liên quan.
- Plan: nêu scope file dự kiến, risk, test strategy.
- Implement: sửa nhỏ nhất có thể, ưu tiên pattern đã có.
- Verify: compile/test/lint; với bug phải có regression test khi phù hợp.
- Review diff: kiểm tra accidental changes, secrets, debug log, generated files.
- Report: file đổi, behavior đổi, tests, unresolved risks.
- PR: con người review trước merge; không coi “agent nói xong” là Definition of Done.
5. Git & GitHub: bước nâng cấp nên làm sớm nhất
Kết nối GitHub giúp AI đọc code/README từ repository thật thay vì bạn copy/paste. Với coding agent, Git cũng là safety net: mỗi thay đổi có diff, dễ revert và review.
Best practices
- Mỗi task một branch/worktree hoặc working tree sạch.
- Cho AI đọc trước, plan trước rồi mới edit với task lớn.
- Yêu cầu test evidence; đừng chỉ yêu cầu “fix it”.
- Review
git difftrước commit/PR. - Không đưa token/password vào prompt, repo rule hoặc MCP config committed.
- Với repo lớn, dùng path-specific instructions thay vì một file rule khổng lồ.
6. Jira: từ copy/paste ticket sang task-grounded coding
Atlassian hiện hỗ trợ mở Jira work item trực tiếp trong coding tools và có Rovo MCP để coding agent lấy context từ Jira/Confluence và cập nhật work item khi workflow cho phép.
Workflow nên dùng
Jira ticket → agent đọc acceptance criteria → agent inspect repo
→ plan → implement → test → PR → draft Jira comment/update
Không cho agent tự đóng ticket ngay từ đầu. Giai đoạn đầu nên để AI read Jira + draft update; sau khi workflow ổn định mới cho write action có approval.
7. Figma: design-to-code đúng cách
Figma cung cấp MCP server chính thức; remote MCP được Figma khuyến nghị cho bộ tool rộng hơn. Agent có thể lấy design context/code/assets trực tiếp từ file thiết kế.
- Đừng prompt “implement screenshot” nếu có Figma node thật.
- Cho agent đọc component/design tokens trước khi code.
- Yêu cầu reuse component hiện có trước khi tạo mới.
- So sánh responsive states, không chỉ desktop frame.
- Sau implementation, review visual diff bằng screenshot/test nếu workflow hỗ trợ.
8. MCP / Plugins / Connectors: hiểu đúng vai trò
MCP là protocol để agent gọi external tools/data. App/connector nối tới dịch vụ như GitHub/Drive/Slack. Plugin có thể đóng gói apps + Skills + workflow. Đừng connect mọi thứ ngay; thêm theo use case có giá trị.
| Ưu tiên | Connect | Lý do |
|---|---|---|
| 1 | GitHub | Context code + PR workflow |
| 2 | Jira | Acceptance criteria và traceability |
| 3 | Figma | Design context cho frontend |
| 4 | Docs/Confluence | Architecture/decision records |
| 5 | Observability | Production debugging khi đã có guardrail |
9. Skills: khi nào nên dùng
Skills là workflow tái sử dụng gồm instruction, ví dụ và có thể cả code. Khi đã cài, ChatGPT có thể tự chọn Skill phù hợp. Đây là bước sau khi bạn đã có workflow thủ công ổn định.
3 Skills phù hợp nhất với bạn
Jira → Implementation
Đọc ticket, extract AC, inspect repo, plan, implement, test, draft Jira update.
Code Review
Review diff theo correctness, regression, security, tests và project conventions.
Demo/Release Handoff
Từ Jira + diff + test evidence tạo demo script, release note và handoff chuẩn.
HTML Study Migration
Workflow bạn đang làm nhiều: đọc contract, migrate semantic content, QA, zip outputs.
Một Skill tốt nên ngắn ở entrypoint, chỉ chứa rule/workflow đặc thù; reference dài để file riêng và script dùng cho bước deterministic.
10. Dùng AI agent an toàn hơn
- Least privilege: chỉ cấp tool/permission cần thiết.
- Human gate: merge, deploy, destructive DB actions và production changes cần approval.
- Observable: luôn yêu cầu command/test evidence.
- Reversible: git commit/branch/worktree trước thay đổi lớn.
- Secrets: dùng env/secret manager; không paste secret vào chat hay committed config.
- Scope: nói rõ files/modules được phép sửa khi task nhạy cảm.
- Trust but verify: AI có thể tạo code compile được nhưng sai behavior; acceptance test vẫn là nguồn thật.
11. Khi nào dùng ChatGPT/Codex, khi nào Claude Code?
| Nhu cầu | Gợi ý |
|---|---|
| Giải thích, research, file/report, cross-tool workflow | ChatGPT/Work phù hợp khi cần nhiều loại artifact/context. |
| Repo coding agent với AGENTS.md, diff/test/PR | Codex. |
| Terminal-centric coding, CLAUDE.md, MCP-rich workflow | Claude Code. |
| Không muốn lock-in | Dùng AGENTS.md cho common rules; bổ sung CLAUDE.md khi cần Claude-specific. |
Không cần chọn “một tool duy nhất”. Tối ưu quy trình và artifacts (instructions, tests, Git, ticket/design links) trước; model/tool có thể thay đổi.
12. Anti-patterns thường gặp
- Prompt “fix giúp tôi” nhưng không cho error, expected behavior và test.
- Copy cả repository vào chat thay vì cho agent repo access.
- Rule file dài hàng nghìn dòng, mâu thuẫn hoặc chứa thông tin hết hạn.
- Cho agent chạy unrestricted command / write Jira / merge PR ngay từ ngày đầu.
- Chỉ hỏi AI “đã test chưa?” thay vì yêu cầu output command thật.
- Dùng AI để viết test khớp implementation sai; test phải bám requirement.
- Chấp nhận refactor lớn trong bugfix nhỏ vì “code đẹp hơn”.
- Không review diff vì output nhìn có vẻ hợp lý.
13. Labs — học bằng workflow thật
Lab 01 — Viết AGENTS.md đầu tiên
Mục tiêu: biến project từ chat-only sang repo-aware.
- Chọn một repo cá nhân hoặc sandbox.
- Viết 15–30 dòng: architecture, build/test, code style, forbidden changes, final report.
- Đưa cùng một task nhỏ cho AI trước và sau khi có AGENTS.md.
- So sánh số lần phải nhắc lại rule.
Done khi:
AI tự chạy đúng command và không sửa ngoài scope mà không cần bạn nhắc lại.
Lab 02 — Prompt tiếng Việt có cấu trúc
- Chọn một bug thật.
- Viết prompt theo 6 phần: mục tiêu, context, constraints, AC, verification, output.
- Không dịch sang tiếng Anh.
- Yêu cầu plan trước rồi implementation.
Done khi:
Bạn có thể đọc prompt trong <2 phút và một developer khác cũng hiểu Definition of Done.
Lab 03 — Git safety loop
- Working tree sạch.
- Cho AI implement task nhỏ.
- Yêu cầu test.
- Review
git diff --statvà full diff. - Cho AI tự review lại diff để tìm accidental change.
Done khi:
Bạn có test evidence và có thể revert toàn bộ thay đổi trong một thao tác Git.
Lab 04 — Connect GitHub
- Kết nối GitHub trên surface bạn dùng.
- Chọn repo test, chỉ cấp access cần thiết.
- Hỏi AI: kiến trúc repo, test command, nơi implement một feature cụ thể.
- So sánh với README/code thật.
Done khi:
AI trả lời dựa trên repo live thay vì bạn upload/copy file thủ công.
Lab 05 — Jira read workflow
- Kết nối Jira/Rovo MCP hoặc integration được workspace cho phép.
- Dùng một ticket không nhạy cảm.
- Yêu cầu extract AC, unknowns, files likely affected, test plan.
- Chỉ cho read ở vòng đầu.
Done khi:
Prompt coding chỉ cần ticket ID + mục tiêu, không cần copy toàn bộ description.
Lab 06 — Figma → implementation
- Kết nối Figma MCP.
- Chọn 1 component nhỏ có desktop/mobile state.
- Yêu cầu agent đọc design context và tìm reusable component trong repo.
- Implement + screenshot review.
Done khi:
Component match layout/tokens và không tạo CSS/component duplicate không cần thiết.
Lab 07 — Tạo Skill đầu tiên
- Chọn workflow đã làm ít nhất 3 lần.
- Ví dụ: “Jira ticket → implementation plan + tests + Jira comment”.
- Tách phần luôn đúng thành Skill; task-specific data vẫn để prompt.
- Test Skill trên 3 ticket khác nhau.
Done khi:
Bạn giảm đáng kể prompt lặp lại nhưng output vẫn consistent.
Lab 08 — Full feature loop
- Jira ticket + Figma node + GitHub repo.
- Agent lấy context từ cả 3.
- Plan → implement → tests → self-review diff.
- Generate PR summary + Jira update draft.
- Bạn review và approve thủ công.
Done khi:
Không copy/paste ticket/design/code giữa apps và vẫn có human gate trước merge/update.
14. Lộ trình 30 ngày
| Tuần | Thực hành | Kết quả mong đợi |
|---|---|---|
| Tuần 1 | Lab 01–03. Chuẩn hóa prompt + AGENTS.md + Git verification. | AI ít “đoán”, diff nhỏ hơn, test rõ hơn. |
| Tuần 2 | Lab 04. GitHub live context; thử path-specific rules nếu repo lớn. | Giảm copy/paste source. |
| Tuần 3 | Lab 05–06. Jira và Figma read-first. | Task/design context đi thẳng vào coding workflow. |
| Tuần 4 | Lab 07–08. Skill + end-to-end workflow. | Một workflow lặp lại, có guardrail và human approval. |
15. Self-assessment checklist
- □ Repo có instruction file ngắn, chính xác, được commit.
- □ Prompt task luôn có acceptance criteria.
- □ AI chạy test/build và đưa evidence.
- □ Tôi review diff trước commit/PR.
- □ GitHub đã connected hoặc agent có repo access trực tiếp.
- □ Jira được dùng làm source-of-truth thay vì copy/paste thủ công.
- □ Figma được connect cho task UI.
- □ Connector/MCP dùng least privilege.
- □ Workflow lặp lại đã được chuyển thành prompt file/Skill.
- □ Merge/deploy/destructive action vẫn có human approval.
16. Official references
- OpenAI — Prompt engineering best practices for ChatGPT
- OpenAI — Skills in ChatGPT
- OpenAI — Plugins in ChatGPT and Codex
- OpenAI — Connecting GitHub to ChatGPT
- OpenAI — Introducing Codex / AGENTS.md
- Anthropic — Claude Code getting started
- Anthropic — Model Context Protocol
- Anthropic — Prompting best practices
- GitHub — Custom instructions
- Atlassian — Open Jira work item in an AI coding tool
- Figma — Guide to the Figma MCP server
Research baseline: 13 September 2026. Product availability, plan restrictions and UI labels may change; verify provider docs when enabling integrations in a managed enterprise workspace.