office-xlsx
The office-xlsx skill generates production-ready Excel workbooks with formulas, charts, data validation, and conditional formatting from JSON specifications or CSV/TSV files. Use it when creating budgets, financial models, dashboards, trackers, or converting tabular data into structured spreadsheets with calculated fields and professional formatting that require formula auditing and verification.
git clone --depth 1 https://github.com/shiwenwen/hope-agent /tmp/office-xlsx && cp -r /tmp/office-xlsx/skills/office-xlsx ~/.claude/skills/office-xlsxSKILL.md
# Office XLSX
Use the bundled scripts in this skill package to produce editable `.xlsx`
workbooks. The builder writes formulas, styles, bar/column/line/pie charts,
real Excel tables, data validation, conditional formatting, and workbook
recalculation hints. The skill activation metadata includes `Skill directory`;
treat that as `SKILL_DIR` and run scripts from `SKILL_DIR/scripts/`.
## Workbook Shape
For nontrivial workbooks, prefer:
1. Summary or dashboard sheet first.
2. Inputs / assumptions sheet next.
3. Detail or source data sheets after that.
4. Checks sheet only when formulas, reconciliations, or model integrity matter.
## Workflow
1. Normalize source data before writing the workbook.
2. Use formulas for derived values instead of hardcoded calculated outputs.
Strings beginning with `=` are written as Excel formulas.
3. For structured workbook creation, create a JSON spec in the working
directory and run:
```bash
python3 "$SKILL_DIR/scripts/check_env.py"
python3 "$SKILL_DIR/scripts/build_xlsx.py" --spec spec.json --out output.xlsx
python3 "$SKILL_DIR/scripts/inspect_xlsx.py" --verify output.xlsx
python3 "$SKILL_DIR/scripts/formula_audit.py" output.xlsx
```
4. For CSV/TSV conversion, run one or more inputs into one workbook:
```bash
python3 "$SKILL_DIR/scripts/csv_to_xlsx.py" --input data.csv --input lookup.tsv --sheet Data --sheet Lookup --out output.xlsx
python3 "$SKILL_DIR/scripts/inspect_xlsx.py" --verify output.xlsx
```
5. If visual QA matters and LibreOffice is available, run:
```bash
python3 "$SKILL_DIR/scripts/render_preview.py" output.xlsx
```
6. To patch an existing workbook without rebuilding it, create a patch JSON and
run:
```bash
python3 "$SKILL_DIR/scripts/patch_xlsx.py" --input existing.xlsx --patch patch.json --out output.xlsx
python3 "$SKILL_DIR/scripts/inspect_xlsx.py" --verify output.xlsx
python3 "$SKILL_DIR/scripts/formula_audit.py" output.xlsx --write-cache cached-output.xlsx
```
Patch actions:
```json
{
"actions": [
{"action": "append_rows", "sheet": "Data", "rows": [["New", 123, "=B2*2"]]},
{"action": "set_cell", "sheet": "Summary", "cell": "B2", "value": "=SUM(Data!B:B)"}
]
}
```
7. When formulas matter, use `formula_audit.py --write-cache` and deliver the
cached workbook unless the audit reports unsupported formulas that require
Excel/LibreOffice recalculation. For broad formula coverage, run:
```bash
python3 "$SKILL_DIR/scripts/recalculate_xlsx.py" output.xlsx --out recalculated.xlsx
python3 "$SKILL_DIR/scripts/inspect_xlsx.py" --verify recalculated.xlsx
```
8. Deliver the `.xlsx` path or attach it with `send_attachment`.
## Spec Shape
```json
{
"title": "Workbook title",
"sheets": [
{
"name": "Summary",
"rows": [["Metric", "Value"], ["Revenue", 1200000], ["Margin", "=B2*0.42"]],
"tables": [{"name": "SummaryTable", "ref": "A1:B3"}],
"data_validations": [{"range": "A2:A10", "type": "list", "formula1": ["Revenue", "Margin"]}],
"conditional_formats": [{"range": "B2:B10", "type": "colorScale"}],
"charts": [
{"type": "column", "title": "Summary", "categories": "$A$2:$A$3", "values": "$B$2:$B$3", "anchor": "D2"},
{"type": "line", "title": "Trend", "categories": "$A$2:$A$3", "values": "$B$2:$B$3", "anchor": "D18"}
],
"column_formats": ["text", "currency"],
"column_widths": [24, 16],
"freeze_top_row": true,
"autofilter": true
}
]
}
```
## Quality Bar
- Keep important values visible; avoid tiny columns and clipped headers.
- Use one workbook, not many disconnected CSV-like sheets, when relationships
between tabs matter.
- Prefer real Excel tables, filters, validations, conditional formats, and
charts when the workbook is meant to be used repeatedly.
- Keep formulas editable, audit formulas before delivery, and write cached
values for supported formulas when possible. Supported audit functions include
common arithmetic, comparisons, `SUM`, `AVERAGE`, `MIN`, `MAX`, `COUNT`,
`MEDIAN`, `ROUND`, `ABS`, and simple `IF`.
- When patching an existing workbook, preserve unrelated package parts and rerun
`inspect_xlsx.py` plus `formula_audit.py`; use `recalculate_xlsx.py` when the
formula surface exceeds the bundled evaluator.
- If preview rendering fails because LibreOffice or a PDF-to-PNG renderer is
missing, state exactly which verification passed; do not imply visual QA
passed.>
Use when the user asks to draft, polish, translate, or reply to an email. Produces a clean draft with subject line, greeting, body, and sign-off, plus a pre-send self-check.
Use when the user mentions 飞书 / Feishu / Lark workspace operations: docx (云文档) read/write, bitable (多维表格) records / views / dashboards, drive (云盘) upload/download, wiki (知识库) link resolution, approval (审批) instance create/cancel/query, calendar (日历) event create/list/update + attendees, contact (联系人) user/department lookup, hire (招聘) job/talent/application listing. Trigger on phrases like 'OKR 周报', '把这份文档发到飞书云盘', '给团队拉个评审会议', '查 [姓名] 的联系方式', '撤销那条审批', '/wiki 链接', or any request that mentions a feishu / lark URL / token (doxcn.../bascn.../wikcn.../boxcn.../om_...).
Hope Agent browser automation — the standard `status → tabs → snapshot → act` loop, stale-ref recovery rules, and what to do when login / 2FA / captcha / camera-prompt / dialog blocks progress. Load this skill whenever you reach for the `browser` tool. Trigger on: user asks the agent to open / control / click / scrape / log into / verify something in a web app ('open X and click Y', '打开 X 然后点击 Y', 'log into my Gmail', 'scrape this page', 'fill out the form on X'); user reports a flow that requires real browser context (cookies, JS-rendered content, OAuth).
Discover and install third-party skills from external registries when the user needs a capability that no currently-active skill covers. Trigger when: (1) the user explicitly asks 'find a skill for X', 'is there a skill that does X', 'install a skill to X', (2) the user requests a well-known integration (Slack, Notion, Trello, GitHub, Hue, Sonos, iMessage, weather, TTS, transcription …) that isn't in the active skill catalog, (3) you are about to hand-write ad-hoc shell / API code for a domain that almost certainly has a published skill. Do NOT trigger if an active skill already covers the need — scan the visible skill catalog first.
Self-service diagnostics — query Hope Agent's local SQLite databases (logs / sessions / async jobs) directly via the `exec` tool to investigate problems, analyze usage, and locate root causes. Trigger on: user reports something broken / failing / slow / stuck / not responding ('X 不工作', 'X 报错', 'X 卡住', '为什么 X 失败', 'why did X fail', 'show me the logs', 'check what happened'); ad-hoc data analysis ('this week's token usage', '最近调用最多的工具', 'how many subagent runs failed', 'tool error rate', 'find sessions where X happened'); verifying a fix ('did the error stop after I changed Y'). Use BEFORE asking the user to paste log snippets — the data is on disk, query it directly. Read-only — SELECT only, never UPDATE/DELETE/INSERT/DROP.
Hope Agent native macOS desktop control — the standard `mac_control` status / diagnostics / apps / dock / spaces / snapshot / visual / windows / menu / clipboard / dialog loop, target-first action rules, no-blind-coordinate policy, and recovery for stale AX/window/menu/dialog state. Load whenever using `mac_control`, or when the user asks to control local Mac apps, Dock, Spaces, click/type/menu/window/dialog/clipboard, automate Finder/TextEdit/System Settings, visually locate UI, or says 控制 Mac, macOS 自动化, 点按钮, 打开应用, Dock, Space, 关闭窗口, 菜单点击, 视觉定位.
Self-understanding and issue reporting for Hope Agent itself. Use when the user asks how Hope Agent works internally, asks about its own source code/docs/runtime behavior, reports a bug/failure/slowness/crash, asks to diagnose logs, or asks to create/submit a GitHub issue for a bug, feature request, or improvement (including when there is no bug). Chinese triggers: 自查, 了解自己, 自我诊断, 排查 Hope Agent, 提交 issue, 需求 issue, 功能改进.