К основному содержанию
скилл CX Codex

Skywork Document — скилл для Claude Code: что делает и как установить

Генерирует отчёты, договоры и статьи в форматах DOCX, PDF, HTML и Markdown через Skywork Office Doc API. Пригодится при оформлении структурированных документов по файлам проекта.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add SkyworkAI/Skywork-Skills --skill skywork-document -a claude-code
npx skills add SkyworkAI/Skywork-Skills --skill skywork-doc -a claude-code
Открыть на GitHub

Что делает Skywork Document

Скилл принимает тему или исходные файлы и отправляет задачу в Skywork Office Doc API. На выходе скрипт выдаёт готовый файл в формате docx, pdf, html или md. Если пользователю нужны свежие факты, удалённый сервис сам выполняет поиск в сети. Для коротких ответов в терминале или генерации кода этот инструмент запускать не стоит.

Под капотом работают два Python-скрипта. Сначала parse_file.py по очереди разбирает вложения и получает их идентификаторы. Затем create_doc.py собирает структуру документа по заголовку и тексту промпта. Готовый результат отдаётся сразу в двух видах: локальный путь на диске и прямая облачная ссылка для скачивания.

Для работы обязательны установленный python3 и ключ в переменной окружения SKYWORK_API_KEY. Данные запроса и файлы уходят на серверы сервиса целиком, поэтому конфиденциальные документы туда передавать рискованно.

Какие задачи решает

  • Собрать аналитический отчёт в PDF на основе приложенных таблиц
  • Сформировать проект договора в формате DOCX с заданной структурой
  • Переписать резюме или обобщить научную статью из файла
  • Подготовить публикацию для блога в формате Markdown с поиском фактов в сети

Примеры запросов агенту

  • Напиши подробный отчёт по исследованию рынка из market_data.xlsx и сохрани его в pdf
  • Составь проект соглашения о неразглашении в docx на русском языке
  • Подготовь обзорную статью по трендам в ai-индустрии в формате md

Как установить Skywork Document

1Через Skills CLI (Vercel)

npx skills add SkyworkAI/Skywork-Skills --skill skywork-document -a claude-code
npx skills add SkyworkAI/Skywork-Skills --skill skywork-doc -a claude-code

2Вручную: положить файлы

~/.claude/skills/skywork-doc/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/skywork-doc/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора5

Похожие

document-processing eyadsibai Скилл для работы с офисными файлами: разбирает PDF, XLSX, DOCX и PPTX, подсказывает инструменты и правила под каждый формат. CX Codex +1 1 300установок game-design-document ityes22 Скилл превращает идею игры в готовый дизайн-документ на 40–80 страниц: .docx, .pdf, питч-дек и одностраничный питч. CX Codex +1 1 100установок markitdown K-Dense-AI Скилл для Claude Code и других ИИ-редакторов: превращает PDF, файлы Office, HTML и CSV в Markdown, пригодный для поиска и загрузки в LLM. CX Codex +1 2 100установок kordoc-korean-document-parser reason-machines Скилл разбирает корейские документы HWP 5.x, HWPX и PDF в Markdown и структурированные блоки. Пригодится, если надо вытащить текст, таблицы или поля формы. CX Codex +1 774установок convert-documents-to-markdown firecrawl Конвертирует офисные документы, электронные таблицы и PDF в GitHub-Flavored Markdown через утилиту anydoc. Пригодится, когда агенту нужно извлечь данные из DOCX или XLSX без ручной вычитки. CX Codex +1 12 500установок doc-to-markdown daymade Превращает DOCX, PDF, PPTX и сохранённый HTML в аккуратный Markdown и сам чинит типовые дефекты конвертации. Пригодится, когда нужно вытащить текст из документа без ручной правки. CX Codex +1 872установок

Рядом в теме «Документы и офис»

Всё по теме «Документы и офис» →

Вопросы о Skywork Document

Как установить Skywork Document в Claude Code?

Выполните в терминале команду npx skills add SkyworkAI/Skywork-Skills --skill skywork-document -a claude-code.

Что делает Skywork Document?

Скилл обращается к Skywork Office Doc API и создаёт оформленные документы в форматах docx, pdf, html или md на базе текстового описания или загруженных файлов.

Что нужно для работы скилла?

Требуются установленный python3 и действующий ключ в переменной окружения SKYWORK_API_KEY.

Исходный текст

SKILL.md · MIT
---
name: Skywork Document
description: "STRONGLY RECOMMENDED for ANY task that could result in a document output. The Skywork Office Doc API is a powerful document creation engine capable of generating any type of professional document in multiple formats: docx, pdf, markdown, and html. Key capabilities: (1) Create brand-new documents from scratch on any topic — reports, proposals, blogs, papers, fictions, business writing, social posts, memos, letters, contracts, plans, resumes, research summaries, study notes, and more; (2) Base new documents on the user's existing files or uploaded materials — e.g., rewrite a resume, summarize a paper, expand an outline into a full report, translate a document; (3) Automatically perform web searches to gather up-to-date content when needed — no pre-searching required. Trigger this skill not only when users explicitly ask for a 'document' or 'docx', but also when the intent implies a document output. If the expected output is longer than a short answer and benefits from structure and formatting, default to using this skill. Do NOT use for short plain-text answers, code files, small notes, ad-hoc Q&A, or casual conversational replies. Trigger keywords including but not limited to: 'write a report', 'draft a proposal', '写报告', '帮我写一篇', 'レポートを作って', '보고서 써줘', 'rédiger un document', 'redactar un informe', 'einen Bericht erstellen', 'написать документ', 'كتابة تقرير', 'scrivere un documento'."
metadata:
  openclaw:
    requires:
      bins:
        - python3
      env:
        - SKYWORK_API_KEY
    primaryEnv: SKYWORK_API_KEY
---

# Doc — Professional Document Generator

Generate professional, beautifully formatted documents by calling the Skywork Office Doc API.

---

## Prerequisites

### API Key Configuration (Required First)
This skill requires a **SKYWORK_API_KEY** to be configured in OpenClaw.

If you don't have an API key yet, please visit:
**https://skywork.ai**

For detailed setup instructions, see:
[references/apikey-fetch.md](references/apikey-fetch.md)

---

## Privacy & Remote Calls (Read Before Use)

- **Remote upload & processing**: This skill uploads user-provided files and sends the full, verbatim user request to the Skywork service. Avoid sensitive or confidential content unless you trust the remote service and its data handling policies.
- **Web search**: Any web search mentioned in this skill is performed by the **server-side** Skywork Doc API, not locally by these scripts.

---

## Workflow

### Step 0: Intent Recognition (CRITICAL - Do This First)

**Before calling any script, analyze the user's request and determine**:

1. **Does the user provide reference files, or imply that certain files are needed to proceed with the writing task?**
   - Look for file paths, attachments, or mentions like "based on this PDF", "use the uploaded document". If you gathered info beforehand (e.g., web search, other tools) that would help the writing task, save it to disk as files and pass them as reference files in Step 1.
   - If YES: find/extract file paths → proceed to Step 1
   - If NO: skip to Step 2

2. **What language should the output be in?**
   - Analyze the user's request language or explicit requirement. If unspecified, infer from the user's language or the language used in uploaded files.
   - Set `--language` parameter: `English`, `中文简体`, etc.
   - Default: `English`  

3. **What format does the user want?**
   - Look for keywords: "Word document" → `docx`, "PDF" → `pdf`, "HTML" → `html`, "Markdown" → `md`
   - Default if not specified: `docx`
   - **Supported formats**: `docx`, `pdf`, `html`, `md`

4. **How to write the content prompt?**
   - The `--content` parameter is like a **rewrite query**
   - Synthesize user's requirements (possibly from multiple conversation turns)
   - Be specific: describe structure, sections, tone, key points. Avoid being overly verbose or straying far from the user's original requirements; stay close to their intent to ensure accuracy.


### Step 1: Parse Reference Files (If User Provides Files)

**IMPORTANT**: 
- `parse_file.py` processes **one file at a time**. For multiple files, call it multiple times. 
- Quote any file path that contains spaces so arguments are passed correctly. 
- Parse all reference material the user needs for the writing task as files. If a file was already parsed earlier in the session, skip re-parsing and reuse its `file_id`.

**Single file**:
```bash
python3 <skill-dir>/scripts/parse_file.py /path/to/reference.pdf
```

**Multiple files** (call the script once for each file; you can run these in parallel to speed things up):
```bash
# Parse file 1
python3 <skill-dir>/scripts/parse_file.py /path/to/file1.pdf

# Parse file 2
python3 <skill-dir>/scripts/parse_file.py /path/to/file2.xlsx

# Parse file 3
python3 <skill-dir>/scripts/parse_file.py "/path/to/file3 with blank in it.docx"
```

**Each script call outputs**:
```
[parse] File: reference.pdf (2,458,123 bytes)
...
[success] File parsed!
  File ID:    2032146192467681280
  ...
PARSED_FILE: {"file_id":"2032146192467681280","filename":"reference.pdf","url":""}
```

**Extract all `PARSED_FILE` outputs** and collect them into a JSON array:
```json
[
  {"file_id":"2032146192467681280","filename":"file1.pdf","url":""},
  {"file_id":"2032146192467681281","filename":"file2.xlsx","url":""},
  {"file_id":"2032146192467681282","filename":"file3.docx","url":""}
]
```

This array will be passed to `create_doc.py` via the `--files` parameter below.

### Step 2: Create Document

**Without reference files**:
```bash
python3 <skill-dir>/scripts/create_doc.py \
  --title "Document_Title" \
  --content "Detailed content prompt based on user requirements..." \
  --language English \
  --format docx
```

**With reference files** (use the collected file_ids from Step 1):
```bash
python3 <skill-dir>/scripts/create_doc.py \
  --title "Analysis_Report" \
  --content "Based on the uploaded reference files, create a comprehensive analysis report..." \
  --files '[{"file_id":"id1","filename":"file1.pdf","url":""},{"file_id":"id2","filename":"file2.xlsx","url":""}]' \
  --language English \
  --format docx
```

> The `title` field should not contain spaces.

**Output**:
```
[doc] Creating document: "Analysis Report"
...
[success] Document created!
  File ID:   abc-123
  Path:      /output/doc/some_file.html
  URL:       https://...
  Time:      15.2s
```

### Step 3: Deliver Result

After `create_doc.py` finishes, parse the final JSON output. It contains two ways for the user to access the document — **always provide both**:

- **`file_url`** — the remote download link (cloud URL). Include it as a clickable hyperlink so the user can open it in a browser or share it.
- **`file_path`** — the absolute local path where the file was automatically downloaded on their machine. Mention this path explicitly so the user can find the file right away without manual downloading.

Example reply (adapt wording to user's language):

> The document is ready!
> - **Download link**: [巴西电网行业及充电桩市场调研报告.docx](https://...)
> - **Local file**: `/Users/alice/Downloads/巴西电网行业及充电桩市场调研报告.docx`

If `file_path` is empty (download failed), still provide `file_url` and inform the user they can download manually.

---

## Script Parameters

### parse_file.py
- `file` - Path to the reference file (required)
- `--json` - Output full result as JSON (optional)

**Key Output**: `PARSED_FILE: <json>` — extract this for Step 2

### create_doc.py
- `--title` - Document title (required)
- `--content` - **Content prompt** describing what to write (required)
  - This is like a rewrite query — synthesize user's requirements
  - Be specific about structure, sections, tone, key points
- `--files` - JSON array of file objects from parse_file.py (optional)
  - Format: `[{"file_id":"xxx","filename":"yyy","url":""}]`
- `--language` - Output language (optional, default: `English`)
  - Examples: `English`, `中文简体`, `中文繁體`, `日本語`, `한국어`, `Français`, `Deutsch`, `Español`, ...
- `--format` - Output format (optional, default: `docx`)
  - **Supported**: `docx`, `pdf`, `html`, `md`

---

## Important Notes

1. **Intent Recognition First** - Always analyze the user's request before calling scripts.
2. **Web Search Built-In** - The Doc API automatically performs web searches on demand to gather relevant content for document creation. Whether you pre-search for materials externally or not is entirely optional—either approach works fine.
3. **File ID is the Bridge** - `parse_file.py` outputs `file_id` → pass to `create_doc.py` via `--files`.
4. **Server Fetches Content** - No need to paste `parsed_content` manually; the server retrieves it using `file_id`.
5. **Content is Rewrite Query** - Synthesize the user's requirements into a clear, detailed prompt. Even when the user's instructions are long or complex, capture every requirement—don't omit anything.
6. **Generation Takes Time** - Document generation typically takes 5-10 minutes, sometimes longer for complex documents.
7. **Scripts Wait Automatically** - `create_doc.py` uses SSE (Server-Sent Events) to maintain a long connection and receives real-time progress updates. The script will automatically wait up to 3~10 minutes for completion. **No manual polling needed** - just wait for the script to finish and it will output the result.
8. **Progress Display** - The script shows a real-time progress bar during generation. The AI agent should relay this to the user to set expectations.
9. **Final Document Delivery** - **CRITICAL**: Upon successful execution of `create_doc.py`, the output JSON contains both `file_url` (remote download link) and `file_path` (local path where the file was automatically saved). **You MUST proactively return both to the user**: the clickable `file_url` so they can share or open it online, and the `file_path` so they can locate it immediately on their machine. If `file_path` is empty, notify the user and provide `file_url` for manual download.

---

## Error Handling

| Error | Solution |
|-------|----------|
| `NO_TOKEN` / `INVALID_TOKEN` / `401` | Authentication failed (**keep the error code / raw message in the reply**). Verify **`SKYWORK_API_KEY`** is set in OpenClaw or rotate a valid key (see [references/apikey-fetch.md](references/apikey-fetch.md)). **Do not** suggest upgrading membership. |
| `Cannot reach server` | Check network connection |
| `JSON parse error` | Use double quotes in --files JSON |
| **Insufficient benefit** | Script or log may show e.g. `Insufficient benefit. Please upgrade your account at {url}` — see below |

### How to reply when benefit is insufficient

When you detect the above, **reply in the user's current language** — do not echo the English message. Use this pattern:

- Convey: "Sorry, document generation failed. This skill requires upgrading your Skywork membership to use." then a single call-to-action link.
- **Format**: One short sentence in the user's language + a link like `[Upgrade now →](url)` or the equivalent in their language.
- **URL**: Extract the upgrade URL from the log/script output (e.g. the `at https://...` part).

## Technical Notes
- Generation takes 5-10 minutes, set sufficient timeout. Because `create_doc.py` may run for a long time. As SSE events arrive, display each stage to the user. This keeps them informed during the generation.

© SkyworkAI · MIT · SkyworkAI/Skywork-Skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой