openai-spreadsheet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpreadsheet Skill (Create, Edit, Analyze, Visualize)
电子表格技能(创建、编辑、分析、可视化)
When to use
适用场景
- Build new workbooks with formulas, formatting, and structured layouts.
- Read or analyze tabular data (filter, aggregate, pivot, compute metrics).
- Modify existing workbooks without breaking formulas or references.
- Visualize data with charts/tables and sensible formatting.
IMPORTANT: System and user instructions always take precedence.
- 构建包含公式、格式和结构化布局的新工作簿。
- 读取或分析表格数据(筛选、聚合、透视、计算指标)。
- 修改现有工作簿,且不破坏公式或引用。
- 通过图表/表格和合理格式实现数据可视化。
重要提示:系统和用户指令始终优先。
Workflow
工作流程
- Confirm the file type and goals (create, edit, analyze, visualize).
- Use for
openpyxledits and.xlsxfor analysis and CSV/TSV workflows.pandas - If layout matters, render for visual review (see Rendering and visual checks).
- Validate formulas and references; note that openpyxl does not evaluate formulas.
- Save outputs and clean up intermediate files.
- 确认文件类型和目标(创建、编辑、分析、可视化)。
- 对.xlsx文件的编辑使用,对CSV/TSV的分析和处理使用
openpyxl。pandas - 如果布局很重要,渲染后进行视觉检查(参见渲染与视觉检查部分)。
- 验证公式和引用;注意openpyxl不会计算公式。
- 保存输出并清理中间文件。
Temp and output conventions
临时文件与输出约定
- Use for intermediate files; delete when done.
tmp/spreadsheets/ - Write final artifacts under when working in this repo.
output/spreadsheet/ - Keep filenames stable and descriptive.
- 中间文件存储在目录;使用完成后删除。
tmp/spreadsheets/ - 在本仓库中工作时,最终产物写入目录。
output/spreadsheet/ - 保持文件名稳定且具有描述性。
Primary tooling
主要工具
- Use for creating/editing
openpyxlfiles and preserving formatting..xlsx - Use for analysis and CSV/TSV workflows, then write results back to
pandasor.xlsx..csv - If you need charts, prefer for native Excel charts.
openpyxl.chart
- 使用创建/编辑.xlsx文件并保留格式。
openpyxl - 使用进行分析和CSV/TSV处理,然后将结果写回.xlsx或.csv文件。
pandas - 如果需要生成图表,优先使用创建原生Excel图表。
openpyxl.chart
Rendering and visual checks
渲染与视觉检查
- If LibreOffice () and Poppler (
soffice) are available, render sheets for visual review:pdftoppmsoffice --headless --convert-to pdf --outdir $OUTDIR $INPUT_XLSXpdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
- If rendering tools are unavailable, ask the user to review the output locally for layout accuracy.
- 如果LibreOffice()和Poppler(
soffice)可用,渲染工作表进行视觉检查:pdftoppmsoffice --headless --convert-to pdf --outdir $OUTDIR $INPUT_XLSXpdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
- 如果没有渲染工具,请让用户在本地检查输出的布局准确性。
Dependencies (install if missing)
依赖项(缺失时安装)
Prefer for dependency management.
uvPython packages:
uv pip install openpyxl pandasIf is unavailable:
uvpython3 -m pip install openpyxl pandasOptional (chart-heavy or PDF review workflows):
uv pip install matplotlibIf is unavailable:
uvpython3 -m pip install matplotlibSystem tools (for rendering):
undefined优先使用进行依赖管理。
uvPython包:
uv pip install openpyxl pandas如果没有:
uvpython3 -m pip install openpyxl pandas可选(适用于大量图表或PDF审查工作流):
uv pip install matplotlib如果没有:
uvpython3 -m pip install matplotlib系统工具(用于渲染):
undefinedmacOS (Homebrew)
macOS (Homebrew)
brew install libreoffice poppler
brew install libreoffice poppler
Ubuntu/Debian
Ubuntu/Debian
sudo apt-get install -y libreoffice poppler-utils
If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.sudo apt-get install -y libreoffice poppler-utils
如果无法在此环境中安装,请告知用户缺失的依赖项及本地安装方法。Environment
环境
No required environment variables.
无必需的环境变量。
Examples
示例
- Runnable the agent examples (openpyxl):
references/examples/openpyxl/
- 可运行的Agent示例(openpyxl):
references/examples/openpyxl/
Formula requirements
公式要求
- Use formulas for derived values rather than hardcoding results.
- Keep formulas simple and legible; use helper cells for complex logic.
- Avoid volatile functions like INDIRECT and OFFSET unless required.
- Prefer cell references over magic numbers (e.g., not
=H6*(1+$B$3)).=H6*1.04 - Guard against errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?) with validation and checks.
- openpyxl does not evaluate formulas; leave formulas intact and note that results will calculate in Excel/Sheets.
- 对派生值使用公式,而非硬编码结果。
- 保持公式简洁易读;复杂逻辑使用辅助单元格。
- 除非必要,避免使用INDIRECT和OFFSET等易失性函数。
- 优先使用单元格引用而非魔法数字(例如:而非
=H6*(1+$B$3))。=H6*1.04 - 通过验证和检查防止错误(#REF!、#DIV/0!、#VALUE!、#N/A、#NAME?)。
- openpyxl不会计算公式;请保留公式原样,并说明结果将在Excel/Sheets中计算。
Citation requirements
引用要求
- Cite sources inside the spreadsheet using plain text URLs.
- For financial models, cite sources of inputs in cell comments.
- For tabular data sourced from the web, include a Source column with URLs.
- 在电子表格中使用纯文本URL标注来源。
- 对于财务模型,在单元格注释中注明输入数据的来源。
- 对于来自网络的表格数据,添加包含URL的“来源”列。
Formatting requirements (existing formatted spreadsheets)
格式要求(已格式化的现有电子表格)
- Render and inspect a provided spreadsheet before modifying it when possible.
- Preserve existing formatting and style exactly.
- Match styles for any newly filled cells that were previously blank.
- 尽可能在修改前渲染并检查提供的电子表格。
- 完全保留现有格式和样式。
- 对于之前为空的新填充单元格,匹配现有样式。
Formatting requirements (new or unstyled spreadsheets)
格式要求(新建或未设置样式的电子表格)
- Use appropriate number and date formats (dates as dates, currency with symbols, percentages with sensible precision).
- Use a clean visual layout: headers distinct from data, consistent spacing, and readable column widths.
- Avoid borders around every cell; use whitespace and selective borders to structure sections.
- Ensure text does not spill into adjacent cells.
- 使用合适的数字和日期格式(日期设为日期类型,货币带符号,百分比使用合理精度)。
- 使用清晰的视觉布局:表头与数据区分开,间距一致,列宽可读。
- 避免每个单元格都加边框;使用空白空间和选择性边框划分区域。
- 确保文本不会溢出到相邻单元格。
Color conventions (if no style guidance)
颜色约定(无样式指导时)
- Blue: user input
- Black: formulas/derived values
- Green: linked/imported values
- Gray: static constants
- Orange: review/caution
- Light red: error/flag
- Purple: control/logic
- Teal: visualization anchors (key KPIs or chart drivers)
- 蓝色:用户输入
- 黑色:公式/派生值
- 绿色:链接/导入值
- 灰色:静态常量
- 橙色:待审核/注意
- 浅红色:错误/标记
- 紫色:控制/逻辑
- 蓝绿色:可视化锚点(关键KPI或图表驱动项)
Finance-specific requirements
金融场景特定要求
- Format zeros as "-".
- Negative numbers should be red and in parentheses.
- Always specify units in headers (e.g., "Revenue ($mm)").
- Cite sources for all raw inputs in cell comments.
- 零值格式化为“-”。
- 负数应为红色并加括号。
- 表头中始终指定单位(例如:“收入(百万美元)”)。
- 在单元格注释中注明所有原始输入的来源。
Investment banking layouts
投资银行风格布局
If the spreadsheet is an IB-style model (LBO, DCF, 3-statement, valuation):
- Totals should sum the range directly above.
- Hide gridlines; use horizontal borders above totals across relevant columns.
- Section headers should be merged cells with dark fill and white text.
- Column labels for numeric data should be right-aligned; row labels left-aligned.
- Indent submetrics under their parent line items.
如果电子表格是投行风格模型(LBO、DCF、三表模型、估值):
- 总计应直接对上方区域求和。
- 隐藏网格线;在总计行上方的相关列添加水平边框。
- 分区表头应为合并单元格,深色填充,白色文本。
- 数值数据的列标签右对齐;行标签左对齐。
- 子指标在父级项目下缩进。
When NOT to Use
不适用场景
<!-- TODO: review -->
<!-- TODO: 待审核 -->