Agent skill

Document Gen Fallback

by HKUDS in HKUDS/OpenSpace

Fallback workflow for multi-format document generation when shellagent encounters errors

MITAuto-check passedDocuments & Office

Install Document Gen Fallback

skills CLI
$ npx skills add HKUDS/OpenSpace --skill document-gen-fallback -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/OpenSpace document-gen-fallback --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/document-gen-fallback .claude/skills/document-gen-fallback && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
document-gen-fallback
GitHub stars
7.7k
Token cost
~917 tokens
SKILL.md length
281 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

Fallback workflow for multi-format document generation when shellagent encounters errors

  • Works in 3 steps: Create Source Content with write_file → Convert to Target Formats with run_shell → Verify Outputs
  • Documents & Office work in your project
  • SKILL.md covers When to Use, Core Technique, Step-by-Step Workflow and Complete Example, plus 4 more sections
  • Calls pandoc, apt-get and brew

What it does

Document Gen Fallback is an agent skill from HKUDS/OpenSpace. Fallback workflow for multi-format document generation when shellagent encounters errors

Its SKILL.md is about 920 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Documents & Office. It works with Pandoc and Microsoft Word. The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.

When your agent uses it

  • Documents & Office work in your project

Example prompts

  • “/document-gen-fallback”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Create Source Content with write_file
  2. Convert to Target Formats with run_shell
  3. Verify Outputs

What it can do on your machine

Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pandoc
    • apt-get
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Document Gen Fallback loads about 917 tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 281 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~917

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 281 words, ~917 tokens.

Download SKILL.mdSave it as .claude/skills/document-gen-fallback/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
document-gen-fallback
description
Fallback workflow for multi-format document generation when shell_agent encounters errors

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:

  1. Content creation → Use write_file to create source document (Markdown)
  2. Format conversion → Use run_shell with pandoc for each target format
  3. 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

markdown
# 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

Aspectshell_agentManual Workflow
Error visibilityOpaque, may retry silentlyEach step shows explicit output
RecoveryAutomatic but may loopManual intervention at specific step
DebuggingHard to isolate failure pointClear which step failed
ControlAgent decides approachYou control each conversion

Common pandoc Commands

bash
# 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 (texlive package) or use --pdf-engine=wkhtmltopdf
  • DOCX formatting issues: Add --reference-doc=template.docx for custom styles
  • Unicode/encoding errors: Add -f markdown+utf8 to pandoc command
  • Missing pandoc: Install via apt-get install pandoc or brew 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.

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in benchmarks/gdpval/skills/document-gen-fallback of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Document Gen Fallback next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Document Gen Fallback compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Document Gen Fallback this skillHKUDS/OpenSpace7.7k—~917Automated safety check: PassMIT
Pandoc DOCX TemplateAchuan-2/pandoc_docx_template1.1k—~1kAutomated safety check: PassNone
Word Document Builderspinabot/brigade11k—~2.1kAutomated safety check: PassMIT
DOCX ToolkitXiaomiMiMo/MiMo-Code14k—~2.4kAutomated safety check: PassApache-2.0
Pandic OfficeTeam-Commonly/commonly1.4k—~642Automated safety check: PassApache-2.0
Doc To Markdowndaymade/claude-code-skills1.4k—~2.5kAutomated safety check: PassMIT

Similar skills

  • Pandoc DOCX Template

    Achuan-2/pandoc_docx_template

    A skill your agent uses when converting Markdown to Word DOCX or DOCX back to Markdown with Pandoc, especially when the output should use the bundled Chinese Word reference templates, heading…

    1.1k GitHub stars~1k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Word Document Builder

    spinabot/brigade

    Creates and edits Word documents along four paths of rising capability, from a quick tool to the docx library, an OOXML round-trip and pandoc, then verifies the file.

    11k GitHub stars~2.1k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • DOCX Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Pandic Office

    Team-Commonly/commonly

    Convert Markdown to PDF (or DOCX/EPUB/HTML) using the pandoc CLI.

    1.4k GitHub stars~642 tokensUpdated today
    Documents & OfficeAuto-check passed
  • Doc To Markdown

    daymade/claude-code-skills

    Converts DOCX/PDF/PPTX and saved HTML/HTM to high-quality Markdown with automatic post-processing.

    1.4k GitHub stars~2.5k tokensUpdated today
    Documents & OfficeAuto-check passed
  • DOCX

    guyi-a/pi-ling

    Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的…

    106 GitHub stars~1.1k tokensUpdated 21 days ago
    Documents & OfficeAuto-check passed

More from HKUDS/OpenSpace

All 199 skills in this repo
  • Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.

    7.7k GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Handle cascading data retrieval tool failures by falling back to embedded knowledge generation

    7.7k GitHub stars~765 tokensUpdated 1 mo ago
    Auto-check passed
  • Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.

    7.7k GitHub stars~588 tokensUpdated 1 mo ago
    Auto-check passed
  • A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.

    7.7k GitHub stars~652 tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback workflow for executing Python code when executecodesandbox fails repeatedly

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Document Gen Fallback

What does Document Gen Fallback do?

Fallback workflow for multi-format document generation when shellagent encounters errors. Document Gen Fallback is an agent skill from HKUDS/OpenSpace.

When should I use Document Gen Fallback?

Document Gen Fallback fits situations like: documents & Office work in your project.

How do I install Document Gen Fallback in Claude Code?

Run `npx skills add HKUDS/OpenSpace --skill document-gen-fallback -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/document-gen-fallback in HKUDS/OpenSpace) into .claude/skills/document-gen-fallback in your project. Claude Code loads it when a task matches its description.

How do I install Document Gen Fallback in Codex?

Run `npx skills add HKUDS/OpenSpace --skill document-gen-fallback -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/document-gen-fallback in HKUDS/OpenSpace) into .agents/skills/document-gen-fallback in your project. Codex loads it when a task matches its description.

Can I use Document Gen Fallback in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill document-gen-fallback -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/document-gen-fallback, .gemini/skills/document-gen-fallback, .github/skills/document-gen-fallback and .opencode/skills/document-gen-fallback in your project.

What does Document Gen Fallback need to run?

Going by SKILL.md and its folder, Document Gen Fallback needs the command-line tools its instructions call (pandoc, apt-get and brew).

Does Document Gen Fallback access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Document Gen Fallback safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Document Gen Fallback use?

Document Gen Fallback is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Document Gen Fallback use?

About 917 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Document Gen Fallback?

Skills that share tags, products or a category with Document Gen Fallback: Pandoc DOCX Template (Achuan-2/pandoc_docx_template, 1.1k stars), Word Document Builder (spinabot/brigade, 11k stars), DOCX Toolkit (XiaomiMiMo/MiMo-Code, 14k stars) and Pandic Office (Team-Commonly/commonly, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Document Gen Fallback?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,743 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.

Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.