Excel Generator
Generate professional Excel files and data analysis reports using the Skywork Excel backend service.
Prerequisites
API Key Configuration (Required First)
This skill requires a
SKYWORKAPIKEY to be configured before use.
If you don't have an API key yet, please visit:
https://skywork.ai
For detailed setup instructions, see:
references/apikey-fetch.md
🚫 CRITICAL: Pass Query As-Is, Do NOT Read User Files
- - NEVER use the
read tool on user-provided files (Excel, PDF, CSV, images, etc.). Pass file paths via --files and let the backend handle reading. - Do NOT rewrite, expand, or reinterpret the user's query. Pass it as-is. The backend agent has its own understanding capabilities.
- Only two modifications are allowed:
1.
Time info: For time-sensitive queries, prepend current time:
[Current time: 2026-03-14] User request: ...
2.
File paths: Replace absolute paths with filenames only (e.g.,
/Users/xxx/report.xlsx →
report.xlsx)
Workflow
Excel tasks take 5-25 minutes. Run the script in background and poll the log every 60 seconds.
Step 1: Start Task
CODEBLOCK0
- -
--files: Upload user-provided files (Excel, CSV, PDF, Image). Omit if no files. --language: zh-CN (default) or en-US — match the user's language.--session <id>: For follow-up tasks — see Multi-Turn Sessions.
Step 2: Monitor Progress
Execution pattern (required):
- - Run the Step 1 start command in background and note the
EXCEL_LOG path from the output. - Then execute the Step 2 monitor command separately every 60 seconds (do not use a while loop).
$EXCEL_LOG does not persist between exec calls — Step 2 MUST recover the path (see monitor command below).
Rules — no exceptions:
- - Poll every 60 seconds by calling exec tool repeatedly. Do NOT use a while loop.
- Show only the last TASK PROGRESS UPDATE block. Do not output full log (
tail -50, etc.) or summarize/interpret it. - Never restart the task. The agent handles errors internally and auto-recovers.
- Ignore transient errors in the log (
❌, Missing parameter, heartbeat pings, etc.) — the agent retries automatically. - Use heartbeat as liveness signal: check heartbeat lines every poll to confirm the task is still running, but do NOT output raw heartbeat lines to the user.
Every 60 seconds, run:
CODEBLOCK1
What to report to user
CRITICAL: Output ONLY the current status. Do NOT repeat or accumulate previous status messages. Each update should be a single, fresh line.
After each log read, output ONLY ONE LINE showing the current status:
CODEBLOCK2
Example (output only this single line, nothing else):
Data Processing | Generating charts | Elapsed: 120s
| Progress contains | Main stage |
|---|
| "读取" / "read" / "load" | Loading data |
| "分析" / "analysis" |
Data analysis |
| "图表" / "chart" / "visualization" | Generating charts |
| "Excel" / "xlsx" | Creating Excel file |
| "HTML" / "报告" / "report" | Generating report |
| "保存" / "save" / "output" | Saving output |
Stop polling when log contains [DONE] or ✅ All done! → read final output:
CODEBLOCK4
- - If NOT done → report progress to user, then call
exec again after 60 seconds with the same monitor command. - Repeat until done — keep calling
exec every 60 seconds until [DONE] or All done appears. - Do NOT stop after a single poll.
Step 3: Deliver Result
After completion, provide the user with both:
- - OSS download URL — cloud link for sharing (show as a clickable hyperlink)
- Local file path — absolute path on their machine
Example reply:
CODEBLOCK5
Do NOT use sandbox:// or [filename](sandbox://...) format — these are not clickable. If oss_url is unavailable, provide the local path only.
Multi-Turn Sessions
To continue a previous task, use --session with the ID printed at the end of the previous run:
CODEBLOCK6
When to use --session: User says "continue", "modify", "add a chart", "change colors", "based on the previous...", or references prior output.
⛔ Without --session, the agent starts fresh and loses all previous context.
Error Handling
| Error | Solution |
|---|
| INLINECODE27 | INLINECODE28 is missing, invalid, or expired — set or rotate the key in OpenClaw skill INLINECODE29 |
| INLINECODE30 |
Use
--timeout 1500 for complex tasks (default: 900s) |
|
Agent produces wrong output | Be more specific; use multi-turn to refine iteratively |
|
Insufficient benefit | See below |
When benefit is insufficient
Script output may show: INLINECODE33
Reply in the user's language:
- - Convey: "Sorry, Excel/report generation failed. This skill requires upgrading your Skywork membership."
- Format: One short sentence +
[Upgrade now →](url) (or equivalent in user's language) - URL: Extract from the
at https://... part of the log output
Security Notes
- - Never commit
SKYWORK_API_KEY to version control - Set the key in OpenClaw skill
env or as an environment variable - Tokens expire — the client will auto-refresh when needed
技能名称: Skywork Excel
详细描述:
Excel 生成器
使用 Skywork Excel 后端服务生成专业的 Excel 文件及数据分析报告。
前置条件
API 密钥配置(必须优先完成)
使用本技能前,需要先配置
SKYWORKAPIKEY。
如果您还没有 API 密钥,请访问:
https://skywork.ai
详细配置说明请参考:
references/apikey-fetch.md
🚫 关键规则:原样传递查询,请勿读取用户文件
- - 切勿使用 read 工具读取用户提供的文件(Excel、PDF、CSV、图片等)。请通过 --files 参数传递文件路径,让后端自行处理读取。
- 请勿重写、扩展或重新解释用户的查询。 请原样传递。后端代理具备自身的理解能力。
- 仅允许两种修改:
1.
时间信息:对于时间敏感的查询,在开头添加当前时间:[当前时间:2026-03-14] 用户请求:...
2.
文件路径:将绝对路径替换为仅文件名(例如,/Users/xxx/report.xlsx → report.xlsx)
工作流程
Excel 任务需要 5-25 分钟。请在后台运行脚本,并每隔 60 秒轮询一次日志。
步骤 1:启动任务
bash
EXCELLOG=/tmp/excel$(date +%s).log
python3 scripts/excelapiclient.py 用户的查询 \
--files /path/to/file1.xlsx /path/to/file2.pdf \
--language zh-CN \
--log-path $EXCEL_LOG \
> /dev/null 2>&1 &
echo 任务已启动。日志:$EXCEL_LOG
- - --files:上传用户提供的文件(Excel、CSV、PDF、图片)。如果没有文件则省略。
- --language:zh-CN(默认)或 en-US — 与用户语言匹配。
- --session :用于后续任务 — 请参阅多轮会话。
步骤 2:监控进度
执行模式(必需):
- - 在后台运行步骤 1 的启动命令,并记下输出中的 EXCELLOG 路径。
- 然后每隔 60 秒单独执行步骤 2 的监控命令(请勿使用 while 循环)。
- $EXCELLOG 在 exec 调用之间不会持久化 — 步骤 2 必须恢复该路径(请参阅下面的监控命令)。
规则 — 无例外:
- - 每隔 60 秒通过重复调用 exec 工具进行轮询。请勿使用 while 循环。
- 仅显示最后一个任务进度更新块。 请勿输出完整日志(tail -50 等)或对其进行总结/解释。
- 切勿重新启动任务。 代理会在内部处理错误并自动恢复。
- 忽略日志中的瞬时错误(❌、缺少参数、心跳检测等)— 代理会自动重试。
- 将心跳作为存活信号:每次轮询时检查心跳行以确认任务仍在运行,但请勿向用户输出原始心跳行。
每隔 60 秒,运行:
bash
恢复日志路径:使用步骤 1 打印的路径,或查找最近的日志
EXCEL
LOG=$(ls -t /tmp/excel*.log 2>/dev/null | head -1)
if [ -z $EXCEL
LOG ] || [ ! -f $EXCELLOG ]; then
echo 错误:未找到日志。请确保步骤 1 使用了 --log-path 参数运行。; exit 1
fi
sleep 60
echo === 进度更新 ===
grep -A8 TASK PROGRESS UPDATE $EXCEL_LOG | tail -10
grep -E \[HEARTBEAT\] $EXCEL_LOG | tail -1
grep -E \[DONE\]|All done $EXCEL_LOG | tail -1
向用户报告的内容
关键:仅输出当前状态。请勿重复或累积之前的状态消息。每次更新应为单独的一行新内容。
每次读取日志后,仅输出一行显示当前状态:
[主要阶段] | [当前操作] | 已用时间:Xs
示例(仅输出这一行,无其他内容):
数据处理 | 生成图表 | 已用时间:120s
| 进度包含 | 主要阶段 |
|---|
| 读取 / read / load | 加载数据 |
| 分析 / analysis |
数据分析 |
| 图表 / chart / visualization | 生成图表 |
| Excel / xlsx | 创建 Excel 文件 |
| HTML / 报告 / report | 生成报告 |
| 保存 / save / output | 保存输出 |
当日志包含 [DONE] 或 ✅ All done! 时停止轮询 → 读取最终输出:
bash
tail -30 $EXCEL_LOG
- - 如果未完成 → 向用户报告进度,然后在 60 秒后使用相同的监控命令再次调用 exec。
- 重复直到完成 — 持续每隔 60 秒调用 exec,直到出现 [DONE] 或 All done。
- 单次轮询后请勿停止。
步骤 3:交付结果
完成后,向用户提供两者:
- - OSS 下载 URL — 用于分享的云链接(显示为可点击的超链接)
- 本地文件路径 — 用户机器上的绝对路径
回复示例:
✅ 报告已生成!
📥 下载:https://picture-search.skywork.ai/skills/upload/2026-03-14/xxx.xlsx
💾 本地:/Users/xxx/.openclaw/workspace/report.xlsx
请勿使用 sandbox:// 或 filename 格式 — 这些格式不可点击。如果 ossurl 不可用,则仅提供本地路径。
多轮会话
要继续之前的任务,请使用 --session 并带上上次运行结束时打印的 ID:
bash
第一轮 — 不需要 --session;会话 ID 在结束时打印
python3 scripts/excel
apiclient.py 创建一份销售报告 \
--language zh-CN --log-path $EXCEL_LOG > /dev/null 2>&1 &
输出:💡 要继续此对话,请使用:--session abc123def456
后续轮次 — 添加 --session
python3 scripts/excel
apiclient.py 添加一个饼图 \
--session abc123def456 \
--language zh-CN --log-path $EXCEL_LOG > /dev/null 2>&1 &
何时使用 --session:当用户说继续、修改、添加图表、更改颜色、基于之前的...,或引用之前的输出时。
⛔ 不使用 --session,代理将从头开始,丢失所有之前的上下文。
错误处理
| 错误 | 解决方案 |
|---|
| Unauthorized (401) | SKYWORKAPIKEY 缺失、无效或已过期 — 在 OpenClaw 技能的 env 中设置或轮换密钥 |
| Connection timeout |
对于复杂任务使用 --timeout 1500(默认值:900 秒) |
| 代理输出错误结果 | 更具体地描述需求;使用多轮会话迭代优化 |
|
收益不足 | 请参见下文 |
收益不足时
脚本输出可能显示:Insufficient benefit. Please upgrade your account at {url}
用用户的语言回复:
- - 传达:抱歉,Excel/报告生成失败。此技能需要升级您的 Skywork 会员。
- 格式:一句简短的话 + 立即升级 →(或用户语言中的等效表达)
- URL:从日志输出的 at https://... 部分提取
安全说明
- - 切勿将 SKYWORKAPIKEY 提交到版本控制
- 在 OpenClaw 技能的 env 中或作为环境变量设置密钥
- 令牌会过期 — 客户端会在需要时自动刷新