本文へスキップ
Skillpedia
PDF・Word・スライド7.8k · #12863

resilient-document-pipeline

できること

このスキルは、ツールの失敗、複数の出力形式、特殊な文字がそろう厳しい条件での文書作成の手順です。検索が機能しなくても、完成した文書が必要な人向けです。

使う場面

  • ✓文書作業中に、ファイルの読み取りやウェブ検索でエラーが繰り返されるとき。
  • ✓同じ元データから、Word、PDF、HTMLの文書が必要なとき。
  • ✓文書に、ダッシュ、カーリークォート、矢印などの記号が含まれているとき。

スキルのリンク

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-merged/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-merged/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“レポートを書いている途中で、ウェブ検索が失敗し続けています。自分の知識で書いて、WordとPDFの版をください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールが繰り返し失敗した後、AIは内蔵の知識から内容を書き、特殊な文字を整え、変換の方法を順に試し、各出力を確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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, or execute_code_sandbox return errors
  • Multiple formats are needed: Generate .docx, .pdf, .html from 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:

  1. Stop attempting to fix the failing tools
  2. Acknowledge the limitation briefly in your output
  3. Commit to generating the document with available knowledge
  4. 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
よくある質問

内容は情報源と照合されますか?

代替手段を使った場合は照合されません。内蔵の知識に頼るため、AIはその旨を伝えるべきです。

ツールの失敗とは何を指しますか?

ファイルの読み取り、ウェブ検索、コードの実行ツールで、エラーが繰り返されることです。

どの形式が作られますか?

同じ元データから作る.docx、.pdf、.htmlをガイドは扱います。

詳細

作者による元の説明

Unified document generation with tool failure detection, domain knowledge fallback, progressive conversion, and Unicode safety

repo: HKUDS/AgentPilot

人気

GitHubのスター
7.8k
ランキング
#12863
ライセンス
MIT
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル