resilient-document-pipeline
Skill này làm gì
Skill này là quy trình tạo tài liệu trong điều kiện khó khăn: công cụ hỏng, nhiều định dạng đầu ra và ký tự đặc biệt. Dành cho người cần một tài liệu hoàn chỉnh ngay cả khi không tra cứu được.
Khi nào nên dùng
- ✓Khi đọc tệp hoặc tìm kiếm web liên tục trả về lỗi trong lúc làm tài liệu.
- ✓Khi tôi cần cùng một tài liệu dưới dạng Word, PDF và HTML từ một nguồn.
- ✓Khi tài liệu có dấu gạch dài, dấu nháy cong, mũi tên hoặc ký hiệu khác.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-merged/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm kiếm web liên tục thất bại khi tôi viết báo cáo. Hãy viết từ kiến thức của bạn và cho tôi bản Word và bản PDF.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Sau nhiều lần công cụ thất bại, AI viết nội dung từ kiến thức sẵn có, làm sạch ký tự đặc biệt, thử các cách chuyển đổi lần lượt và kiểm tra từng đầu ra.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Resilient Document Generation Pipeline
When to Use This Skill
Use this workflow when generating documents in challenging environments where:
- Tool failures are likely or have occurred:
read_file,search_web,read_webpage, orexecute_code_sandboxreturn errors - Multiple formats are needed: Generate
.docx,.pdf,.htmlfrom the same source - Unicode/special characters are present: Documents contain em dashes, curly quotes, arrows, symbols, or non-ASCII text
- Primary conversion methods may fail: LaTeX/pandoc may not be available or misconfigured
This skill combines early failure detection, domain-knowledge content creation, progressive conversion fallbacks, and Unicode safety into a single resilient workflow.
Core Workflow Overview
┌─────────────────────────────────────────────────────────────────┐
│ 1. DETECT tool failures (2+ indicators → pivot immediately) │
└────────────────┬────────────────────────────────────────────────┘
│
┌────────────────▼────────────────────────────────────────────────┐
│ 2. CREATE content with write_file using embedded domain │
│ knowledge (professionally structured markdown) │
└────────────────┬────────────────────────────────────────────────┘
│
┌────────────────▼────────────────────────────────────────────────┐
│ 3. SANITIZE unicode (create LaTeX-safe version for PDF) │
└────────────────┬────────────────────────────────────────────────┘
│
┌────────────────▼────────────────────────────────────────────────┐
│ 4. CONVERT with progressive fallbacks: │
│ pandoc → reportlab → fpdf2 → wkhtmltopdf │
└────────────────┬────────────────────────────────────────────────┘
│
┌────────────────▼────────────────────────────────────────────────┐
│ 5. VERIFY outputs exist and are valid │
└─────────────────────────────────────────────────────────────────┘
Step-by-Step Workflow
Step 1: Detect Tool Failure Pattern
Before attempting document generation, check for failure indicators:
TOOL_FAILURE_INDICATORS = [
"read_file returns binary/image data instead of text",
"search_web returns unknown error or empty results",
"read_webpage returns unknown error on multiple URLs",
"execute_code_sandbox fails unexpectedly",
"pandoc command fails with 'unknown error'",
"Multiple consecutive tool failures on data retrieval"
]
Decision point: If 2+ indicators are present within the first 2-3 iterations:
- Stop attempting to fix the failing tools
- Acknowledge the limitation briefly in your output
- Commit to generating the document with available knowledge
- Proceed to Step 2 immediately
Step 2: Create Content with write_file
Write your document as professionally structured Markdown using embedded domain knowledge:
write_file
path: /tmp/document_source.md
content: |
# [Document Title]
## Executive Summary
[Brief overview of key content - use domain knowledge]
## Background
[Context and scope - leverage embedded expertise]
## Main Content
[Organized sections with headers, lists, tables]
## Limitations & Notes
[Transparent about data source limitations if relevant]
## Recommendations/Next Steps
[Actionable guidance based on available information]
Best practices for content:
- Use general domain knowledge appropriately when external data is unavailable
- Clearly distinguish between verified facts and general guidance
- Include actionable frameworks rather than specific unverified data
- Add placeholder notes where specific data would enhance the document:
> **Note**: Specific [metric/data point] would typically be sourced from
> [expected source]. The guidance below reflects established best practices.
Step 3: Sanitize Unicode Characters (Pre-PDF Conversion)
Critical: PDF generation via pandoc typically uses LaTeX, which has limited Unicode support. Create a sanitized version:
Option A: Manual write_file (Recommended for control)
write_file
path: /tmp/document_source_sanitized.md
content: |
[Same content as Step 2, but with these replacements:]
Character replacement table:
| Character | Issue | Safe Replacement |
|---|---|---|
— (em dash) |
May not render |
Câu hỏi thường gặp
Nội dung có được kiểm chứng với nguồn không?
Không khi dùng phương án dự phòng, vì nó dựa vào kiến thức sẵn có, nên AI cần nói rõ điều đó.
Thế nào là lỗi công cụ?
Hướng dẫn nói đến các lỗi lặp lại từ đọc tệp, tìm kiếm web hoặc chạy code.
Những định dạng nào được tạo ra?
Hướng dẫn bao gồm .docx, .pdf và .html được tạo từ cùng một nguồn.
Chi tiết
Mô tả gốc của tác giả
Unified document generation with tool failure detection, domain knowledge fallback, progressive conversion, and Unicode safety
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12863
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
feishu-doc
394kGiúp agent của bạn đọc, tạo và sửa tài liệu đám mây Feishu, gồm văn bản, hình ảnh và bảng, bằng công cụ tài liệu.
feishu-drive
394kCho phép agent của bạn duyệt, sắp xếp và bình luận các file trong một thư mục đám mây Feishu đã được chia sẻ với bot.
feishu-perm
394kGiúp agent của bạn kiểm tra và thay đổi ai có quyền truy cập một file Feishu, chọn quyền nhỏ nhất đáp ứng yêu cầu của bạn.