😫 Vấn đề (The Pain Point)
Bạn gửi hợp đồng (Draft 1) cho khách. Khách sửa và gửi lại (Draft 2). Bạn cần biết họ đã sửa những câu chữ nào? Đọc dò bằng mắt 2 bản in thì rất dễ sót.
🚀 Giải pháp Agentic (The Solution)
Tool so sánh (Diff Tool) highlight đỏ những chỗ bị xóa và xanh những chỗ mới thêm vào.
Tính năng:
- Visual Diff: Hiển thị 2 cửa sổ song song hoặc 1 file HTML kết quả với màu sắc rõ ràng.
- Word/Text Support: So sánh nội dung text (copy paste vào).
🤖 Engineering Prompt (Copy & Paste)
**Role:** Python Developer
**Task:** Create a "Text Comparison Tool" (Diff Checker).
**Requirements:**
1. **Tech Stack:** Python, `tkinter`, `difflib` (standard lib).
2. **GUI:**
* Two large Text Areas: "Original Text" vs "Modified Text" (Or file Load buttons).
* "Compare" button.
* **Output:** Generate an HTML file showing side-by-side comparison with color coding (Red for deleted, Green for added) and open it in the web browser. *This is cleaner than trying to render complex rich text in Tkinter.*
3. **Logic:**
* Use `difflib.HtmlDiff().make_file()`.
* Save and `webbrowser.open()`.
4. **Deliverables:**
* `diff_tool.py`
* `run.bat`
* `requirements.txt`
**Context:** Legal review, Code review, Content verification.
🧠 Giải mã Prompt
- HTML Output: Thay vì cố gắng hiển thị màu mè trên giao diện App (rất khó làm đẹp), prompt hướng dẫn AI xuất ra file HTML. Trình duyệt web hiển thị sai khác (Diff) cực tốt và dễ đọc.
🛠️ Hướng dẫn
- Copy Prompt -> Paste -> Chạy.
- Copy nội dung bản cũ -> Paste ô trái. Nội dung bản mới -> Paste ô phải.
- Compare -> Xem kết quả trên trình duyệt.