Files
skill-lib/skills/office-export-xlsx/SKILL.md
木炎 51913555ad feat: add initial skill authoring workspace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 18:34:56 +08:00

81 lines
2.5 KiB
Markdown

---
name: office-export-xlsx
description: Use when the user wants to export structured table data into a local .xlsx file through the sgClaw Office pipeline.
version: 0.1.0
author: sgclaw
tags:
- office
- xlsx
- export
---
# Office Export Xlsx
Convert a structured table artifact into a local `.xlsx` file. This skill is Office-only: it does not navigate websites, inspect browser DOM, or collect source data. It consumes already prepared rows and hands them to `openxml_office`.
## When to Use
- The user asks to export collected data as Excel.
- An upstream skill already produced `sheet_name`, `columns`, and `rows`.
- The task needs a local workbook path as the final deliverable.
Do not use this skill for:
- browser navigation
- data collection from live pages
- free-form spreadsheet editing without a structured table artifact
## Required Input Artifact
The upstream skill must provide this structure:
```json
{
"source": "https://www.zhihu.com/hot",
"sheet_name": "知乎热榜",
"columns": ["rank", "title", "heat"],
"rows": [[1, "标题", "344万"]]
}
```
Rules:
- `sheet_name` is the target workbook sheet name.
- `columns` is the exact output header order.
- `rows` is the ordered row list to export.
- Do not invent missing rows.
- If the artifact is partial, preserve that status in the final result instead of hiding it.
- If the upstream artifact was blocked by login/verification or another browser-side issue, do not continue export as if the data were complete.
## Tool Contract
- Call `openxml_office` to render the final `.xlsx`.
- Do not use browser tools in this skill.
- Do not use `shell` as the main export path.
- Return the final local `.xlsx` output path after `openxml_office` succeeds.
## Workflow
1. Validate that `sheet_name`, `columns`, and `rows` are present.
2. Choose the workbook template and output path.
3. Pass the structured payload to `openxml_office`.
4. Return the output workbook path plus a short export summary.
Do not:
- recollect browser data from the source page
- reformat the structured artifact into prose before export
- continue other browser exploration after the workbook path is available
## References
- Use [export-flow.md](references/export-flow.md) for the exact export sequence.
- Template assets for this skill belong under `assets/`.
## Common Mistakes
- Mixing browser collection steps into the Office phase.
- Reformatting the rows into prose before export.
- Dropping the header order defined by `columns`.
- Returning success without the generated local file path.