document-gen-fallback
Fungsinya
Skill ini memecah pembuatan dokumen menjadi file sumber dan langkah konversi yang terpisah. Skill ini cocok untuk orang yang ingin melihat apa yang dilakukan setiap langkah ketika tugas dokumen gagal.
Kapan dipakai
- โSaat helper mengembalikan galat yang tidak jelas pada dokumen yang harus dibuat dalam beberapa format.
- โSaat saya perlu melihat dengan tepat di mana konversi keliru.
- โSaat saya ingin teks sumber disimpan dulu sebagai Markdown, lalu dikonversi.
Link skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya perlu laporan yang sama sebagai file Word dan file HTML. Tolong simpan dulu sebagai Markdown dan konversi setiap format secara terpisah.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI menulis konten ke file Markdown, menjalankan pandoc sekali untuk setiap format tujuan, lalu memeriksa bahwa setiap file keluaran ada.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Document Generation Fallback Workflow
When to Use
Use this skill when shell_agent returns unknown or unclear errors on complex document generation tasks, especially when:
- Generating documents in multiple formats (e.g.,
.docx,.pdf,.html) - The error message doesn't provide clear debugging information
- You need better visibility into each step of the generation process
Core Technique
Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps:
- Content creation โ Use
write_fileto create source document (Markdown) - Format conversion โ Use
run_shellwithpandocfor each target format - Verification โ Check output files exist and are valid
Step-by-Step Workflow
Step 1: Create Source Content with write_file
Write your document content as Markdown to a temporary source file. This gives you full visibility into the content being generated.
write_file
path: /tmp/document_source.md
content: |
# Document Title
## Section 1
Content here...
## Section 2
More content...
Step 2: Convert to Target Formats with run_shell
Use run_shell with explicit pandoc commands for each format. This isolates conversion errors.
run_shell
command: pandoc /tmp/document_source.md -o output.docx
run_shell
command: pandoc /tmp/document_source.md -o output.pdf
Step 3: Verify Outputs
Check that files were created successfully:
run_shell
command: ls -lh output.docx output.pdf
Complete Example
# Generate Negotiation Strategy Document
## Step 1: Write Markdown source
write_file
path: /tmp/negotiation_strategy.md
content: |
# Negotiation Strategy
## Executive Summary
[Content...]
## Resolution Path
[Content...]
## BATNA Analysis
[Content...]
## Step 2: Convert to DOCX
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.docx
## Step 3: Convert to PDF
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.pdf
## Step 4: Verify
run_shell
command: ls -lh negotiation_strategy.*
Advantages Over shell_agent
| Aspect | shell_agent | Manual Workflow |
|---|---|---|
| Error visibility | Opaque, may retry silently | Each step shows explicit output |
| Recovery | Automatic but may loop | Manual intervention at specific step |
| Debugging | Hard to isolate failure point | Clear which step failed |
| Control | Agent decides approach | You control each conversion |
Common pandoc Commands
# Markdown to Word
pandoc input.md -o output.docx
# Markdown to PDF (requires LaTeX or wkhtmltopdf)
pandoc input.md -o output.pdf
# Markdown to HTML
pandoc input.md -o output.html
# With custom template
pandoc input.md --template=template.html -o output.html
# With metadata
pandoc input.md -o output.pdf --metadata title="Document Title"
Troubleshooting
- PDF generation fails: Ensure LaTeX is installed (
texlivepackage) or use--pdf-engine=wkhtmltopdf - DOCX formatting issues: Add
--reference-doc=template.docxfor custom styles - Unicode/encoding errors: Add
-f markdown+utf8to pandoc command - Missing pandoc: Install via
apt-get install pandocorbrew install pandoc
When to Return to shell_agent
After successfully completing the manual workflow once, you can attempt shell_agent again for similar tasks, now with a known-working fallback if errors recur.
Pertanyaan umum
Mengapa file Markdown ditulis lebih dulu?
Ini memberikan satu sumber yang jelas yang dipakai bersama oleh semua format keluaran.
Alat apa yang mengonversi file?
Panduan ini memakai pandoc untuk setiap format tujuan.
Bagaimana keberhasilan diperiksa?
Panduan ini meminta agar keberadaan dan validitas file keluaran dikonfirmasi.
Detail
Deskripsi asli dari pembuat
Fallback workflow for multi-format document generation when shell_agent encounters errors
repo: HKUDS/AgentPilot
Popularitas
- Bintang GitHub
- 7.8k
- Peringkat
- #12865
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
agentpilot
7.8kMembantu agent Anda meningkatkan proyek langkah demi langkah dengan menyiapkan tugas dan menjalankan loop AgentPilot yang mengusulkan, menguji, dan memberi skor pada perubahan.
openspace
7.8kMembantu agent Anda menyiapkan OpenSpace, alat yang menyimpan dan mengambil skill agent, lalu menghubungkannya ke aplikasi AI Anda melalui MCP.
rsi-arena
7.8kMembantu agent Anda menyiapkan dan menjalankan tes benchmark AI standar, seperti AIME dan Terminal-Bench, untuk membandingkan berbagai metode perbaikan.
experiment-guide
7.8kMembantu agent Anda merencanakan eksperimen kecil, membaca hasilnya, dan mencatat temuan saat menyelidiki cara memperbaiki sebuah program.
Skill serupa
feishu-doc
394kMembantu agent Anda membaca, membuat, dan mengedit dokumen cloud Feishu, termasuk teks, gambar, dan tabel, dengan memakai alat dokumen.
feishu-drive
394kMemungkinkan agent Anda menelusuri, mengatur, dan memberi komentar pada file di folder cloud Feishu yang sudah dibagikan kepada bot.
feishu-perm
394kMembantu agent Anda memeriksa dan mengubah siapa yang dapat mengakses file Feishu, dengan memilih izin terkecil yang memenuhi permintaan Anda.