spreadsheets
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpreadsheets
电子表格处理
Handle tabular data with exact values, minimal diffs, local privacy, atomic writes, and structural validation.
处理表格数据时保证值精确、差异最小化、本地隐私性、原子写入及结构验证。
Invariants
核心准则
- Keep precision-sensitive amounts as strings and compute with or DuckDB
decimal.Decimal, never binary floats.DECIMAL(38, 18) - Touch only requested rows, columns, formulas, and formatting. Existing file conventions override house defaults.
- For newly authored text tables, prefer TSV, UTF-8 without BOM, LF, one trailing newline, lowercase headers, ISO dates,
snake_casedecimals, and.nulls.- - Read unknown text tables with BOM-tolerant UTF-8; never write a BOM.
- Write in place atomically through a sibling temporary file, validate it, then replace the target.
- Escape external cells beginning with ,
=, or+; a bare@null is exempt. Formula-prefix cells in trusted authored data are observations, not proof of injection.- - Keep transaction, bank, exchange, and tax data local. Redact samples unless raw rows were explicitly requested.
- 对精度敏感的数值保留为字符串,使用或DuckDB
decimal.Decimal进行计算,绝不要使用二进制浮点数。DECIMAL(38, 18) - 仅修改指定的行、列、公式和格式。现有文件的约定优先于内部默认规则。
- 对于新建的文本表格,优先使用TSV格式、无BOM的UTF-8编码、LF换行符、末尾一个换行、小写表头、ISO日期格式、
snake_case作为小数点、.表示空值。- - 读取未知文本表格时使用兼容BOM的UTF-8编码;写入时绝不添加BOM。
- 通过同级临时文件实现原子性原地写入,验证临时文件后再替换目标文件。
- 对以、
=或+开头的外部单元格进行转义;单独的@空值无需转义。可信创作数据中带有公式前缀的单元格属于正常数据,并非注入风险。- - 交易、银行、汇率和税务数据需保留在本地。除非明确要求原始行数据,否则需对示例数据进行脱敏。
Factual Profiling
事实分析
Resolve helper paths from this . Profile unknown data before choosing a transformation tool:
SKILL.mdsh
uv run "<skill-dir>/scripts/profile.py" <file> --redact-samplesThe JSON output has . It reports structural facts, header quality, cardinality/statistics when qsv is
available, frequency facts, formula-prefix cells, workbook metadata, and local tool availability. It contains no tool
recommendations and does not infer identifiers from uniqueness. Choose the tool from the requested transformation,
provenance, output format, and preservation requirements.
schema_version: 2Use only when the cells came from an external or otherwise untrusted source and will be written to a
formula-capable consumer. With that flag, formula-prefix cells affect ; without it, legitimate formulas such as
remain factual observations and do not fail the profile.
--external-datastatus=SUM(...)从本解析辅助路径。在选择转换工具前,先对未知数据进行分析:
SKILL.mdsh
uv run "<skill-dir>/scripts/profile.py" <file> --redact-samples输出的JSON包含,会报告结构信息、表头质量、qsv可用时的基数/统计数据、频率信息、带公式前缀的单元格、工作簿元数据以及本地工具可用性。输出中不包含工具推荐,也不会从唯一性推断标识符。需根据需求的转换操作、来源、输出格式和保留要求选择工具。
schema_version: 2仅当单元格来自外部或不可信来源且将写入支持公式的应用时,才使用参数。使用该参数时,带公式前缀的单元格会影响;不使用该参数时,合法公式如会被视为正常数据,不会导致分析失败。
--external-datastatus=SUM(...)Tool Routing
工具选择指南
| Need | Tool |
|---|---|
| Fast structural preview/validation | |
| Factual local quality profile | |
| Counts, stats, frequencies, select, dedupe | |
| Joins, pivots, aggregation, conversion | DuckDB with |
| Exact custom transforms | |
Any | Read |
| Exact transformation/validation recipes | Read |
Prefer where supported. When qsv stdout must remain TSV, use ; stdout otherwise
defaults to CSV.
qsv --cache-threshold 0-o out.tsv| 需求 | 工具 |
|---|---|
| 快速结构预览/验证 | |
| 本地数据质量事实分析 | |
| 计数、统计、频率、筛选、去重 | |
| 关联、透视、聚合、格式转换 | 启用 |
| 精确自定义转换 | |
任何 | 先阅读 |
| 精确转换/验证方案 | 仅在需要时阅读 |
在支持的情况下优先使用。当qsv的标准输出需保持TSV格式时,使用;否则标准输出默认为CSV格式。
qsv --cache-threshold 0-o out.tsvWorkflow
工作流程
- Inspect with ; add
peek.py --redact-sampleswhen cardinality, formula prefixes, metadata, or available tooling matters. For a no-shape-change edit, save the peek JSON. For intentional row/schema changes, record the expected width and invariants.profile.py - Decide whether formula-prefix cells are dangerous from provenance and output context. Decide the smallest tool that preserves values and formatting. Avoid pandas unless necessary; if used, load every column as strings.
- Apply the transformation atomically. For idempotent appends with legitimate duplicate rows, use multiset difference rather than set deduplication.
- Validate:
- unchanged shape: ;
peek.py --strict --expect-like <before-report> - changed shape: plus task-specific counts/keys;
peek.py --strict --expect-columns <n> - authored house TSV: add ;
--house - formulas: and require success.
uv run scripts/recalc.py <file.xlsx>
- unchanged shape:
- Report paths, row/column effects, validation, and any workbook features that could not be preserved.
For human output, lead with only after the write and required validation pass, or
for read-only work. On required validation failure, use
. Do not paste private profile JSON or decorate cells, headers, formulas,
paths, commands, or diagnostics.
### 📊 Spreadsheet — ✅ updated### 📊 Spreadsheet — 🔎 inspected, no files written### 📊 Spreadsheet — ⛔ not deliverable- 使用检查数据;当基数、公式前缀、元数据或可用工具相关信息重要时,补充使用
peek.py --redact-samples。对于无结构变化的编辑,保存peek输出的JSON。对于有意修改行/ schema的操作,记录预期的宽度和核心准则。profile.py - 根据数据来源和输出场景判断带公式前缀的单元格是否存在风险。选择能保留值和格式的最小工具。除非必要,避免使用pandas;若必须使用,需将所有列加载为字符串。
- 以原子方式应用转换操作。对于幂等追加且允许重复行的场景,使用多重集差集而非集合去重。
- 验证:
- 无结构变化:;
peek.py --strict --expect-like <before-report> - 有结构变化:加上任务特定的计数/键;
peek.py --strict --expect-columns <n> - 符合内部规范的TSV:添加参数;
--house - 公式:运行并确保执行成功。
uv run scripts/recalc.py <file.xlsx>
- 无结构变化:
- 报告文件路径、行/列影响、验证结果以及所有无法保留的工作簿特性。
对于面向人类的输出,仅在写入操作和必要验证通过后,以开头;对于只读操作,使用。若必要验证失败,使用。请勿粘贴隐私性的分析JSON,也不要对单元格、表头、公式、路径、命令或诊断信息进行装饰。
### 📊 电子表格 — ✅ 更新完成### 📊 电子表格 — 🔎 已检查,未写入任何文件### 📊 电子表格 — ⛔ 无法交付prb-finance
prb-finance
Never hand-edit generated , , or Markdown reports. After source edits, run ,
then . Cap private output to counts and file references unless raw rows were requested.
.pool.tsv.annual.tsvjust tsv-checkjust cli::write-changedCompletion requires the requested artifact, an intentional diff, atomic replacement where applicable, and structural
plus domain validation evidence.
绝不要手动编辑生成的、或Markdown报告。源文件编辑完成后,运行,再执行。除非明确要求原始行数据,否则私有输出仅包含计数和文件引用。
.pool.tsv.annual.tsvjust tsv-checkjust cli::write-changed任务完成需包含请求的产物、明确的差异、适用场景下的原子替换,以及结构和领域验证的证据。