feat: add initial skill authoring workspace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
80
skills/office-export-xlsx/SKILL.md
Normal file
80
skills/office-export-xlsx/SKILL.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
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.
|
||||
7
skills/office-export-xlsx/assets/README.md
Normal file
7
skills/office-export-xlsx/assets/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Assets
|
||||
|
||||
This directory stores workbook templates used by `office-export-xlsx`.
|
||||
|
||||
Planned first template:
|
||||
|
||||
- `zhihu_hotlist_template.xlsx`
|
||||
40
skills/office-export-xlsx/references/export-flow.md
Normal file
40
skills/office-export-xlsx/references/export-flow.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Export Flow
|
||||
|
||||
This skill assumes an upstream structured artifact already exists.
|
||||
|
||||
## Input Contract
|
||||
|
||||
Required keys:
|
||||
|
||||
- `sheet_name`
|
||||
- `columns`
|
||||
- `rows`
|
||||
|
||||
Recommended keys:
|
||||
|
||||
- `source`
|
||||
- `partial`
|
||||
- `notes`
|
||||
|
||||
## Export Sequence
|
||||
|
||||
1. Confirm the task is export-only.
|
||||
2. Validate that `sheet_name` is non-empty.
|
||||
3. Validate that `columns` is a non-empty list.
|
||||
4. Validate that `rows` is a list of row arrays aligned to `columns`.
|
||||
5. Call `openxml_office` with:
|
||||
- template path
|
||||
- output `.xlsx` path
|
||||
- `sheet_name`
|
||||
- `columns`
|
||||
- `rows`
|
||||
6. Return the generated workbook path and any partial-data warning.
|
||||
|
||||
## Output Contract
|
||||
|
||||
Return:
|
||||
|
||||
- output file path
|
||||
- sheet name
|
||||
- row count
|
||||
- whether the source artifact was partial
|
||||
Reference in New Issue
Block a user