mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 08:30:42 +08:00
feat: skills i18n 改造(schemaVersion 1.1,零向后兼容) (#1)
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容
把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。
## 关键变更
### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
i18n.<locale>
### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)
### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)
### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude
### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落
## 验证
- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(i18n): 修复 PR #1 review 反馈的 6 项问题
- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
与 zh-CN 版本对齐
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: 电子表格处理
|
||||
name: xlsx
|
||||
description: >-
|
||||
Use this skill any time a spreadsheet file is the primary input or output.
|
||||
This means any task where the user wants to: open, read, edit, or fix an
|
||||
@@ -28,6 +28,29 @@ tags:
|
||||
metadata:
|
||||
author: anthropic
|
||||
updated_at: '2026-04-13'
|
||||
i18n:
|
||||
default_locale: en-US
|
||||
source_locale: zh-CN
|
||||
locales:
|
||||
- zh-CN
|
||||
- en-US
|
||||
zh-CN:
|
||||
name: 电子表格处理
|
||||
short_desc: 创建、编辑和处理 Excel 电子表格(.xlsx)
|
||||
description: >-
|
||||
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. Use when 用户提到 Excel、 电子表格、xlsx、表格处理、公式计算、数据清洗、图表、CSV导入导出。
|
||||
body: ./SKILL.zh-CN.md
|
||||
source_hash: sha256:de1660781d23798b
|
||||
translated_by: human
|
||||
en-US:
|
||||
name: Spreadsheet Processing
|
||||
short_desc: Create, edit, and process Excel spreadsheets (.xlsx)
|
||||
description: >-
|
||||
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. Use when the user mentions Excel, spreadsheets, xlsx, table processing, formula computation, data cleaning, charts, or CSV import/export.
|
||||
body: ./SKILL.md
|
||||
source_hash: sha256:de1660781d23798b
|
||||
translated_by: ai:claude-opus-4-7
|
||||
translated_at: '2026-05-03'
|
||||
market:
|
||||
icon: >-
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
|
||||
@@ -42,7 +65,6 @@ market:
|
||||
r="3" fill="#34C759" fill-opacity="0.9"/><path d="M18 18.5l1 1.5 2-2.5"
|
||||
stroke="white" stroke-width="1.2" stroke-linecap="round"
|
||||
stroke-linejoin="round"/></svg>
|
||||
short_desc: 创建、编辑和处理 Excel 电子表格(.xlsx)
|
||||
category: productivity
|
||||
maintainer:
|
||||
name: DesireCore Official
|
||||
@@ -50,66 +72,66 @@ market:
|
||||
channel: latest
|
||||
---
|
||||
|
||||
# xlsx 技能
|
||||
# xlsx Skill
|
||||
|
||||
## L0:一句话摘要
|
||||
## L0: One-line Summary
|
||||
|
||||
创建、编辑和分析 Excel 电子表格(.xlsx),支持公式、格式、数据分析和可视化。
|
||||
Create, edit, and analyze Excel spreadsheets (.xlsx), with support for formulas, formatting, data analysis, and visualization.
|
||||
|
||||
## L1:概述与使用场景
|
||||
## L1: Overview and Use Cases
|
||||
|
||||
### 能力描述
|
||||
### Capability
|
||||
|
||||
xlsx 是一个**流程型技能(Procedural Skill)**,提供 Excel 电子表格的完整处理能力。基于 Python 库(openpyxl、pandas),支持创建新表格、编辑现有文件、数据分析、公式计算、格式设置和图表生成,并通过 LibreOffice 实现公式重算和错误检测。
|
||||
xlsx is a **Procedural Skill** that provides full processing capabilities for Excel spreadsheets. Built on Python libraries (openpyxl, pandas), it supports creating new spreadsheets, editing existing files, data analysis, formula calculation, formatting, and chart generation, and uses LibreOffice for formula recalculation and error detection.
|
||||
|
||||
### 使用场景
|
||||
### Use Cases
|
||||
|
||||
- 用户需要创建新的 Excel 电子表格(财务模型、数据报告等)
|
||||
- 用户需要编辑或修改现有 .xlsx 文件
|
||||
- 用户需要进行数据分析、清洗或格式转换(CSV/TSV → XLSX)
|
||||
- 用户需要添加公式、图表或格式化现有表格
|
||||
- The user needs to create a new Excel spreadsheet (financial models, data reports, etc.)
|
||||
- The user needs to edit or modify an existing .xlsx file
|
||||
- The user needs to perform data analysis, cleaning, or format conversion (CSV/TSV → XLSX)
|
||||
- The user needs to add formulas, charts, or formatting to an existing spreadsheet
|
||||
|
||||
## L2:详细规范
|
||||
## L2: Detailed Specification
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Python 3(必需)
|
||||
### Python 3 (required)
|
||||
|
||||
在执行任何 Python 操作之前,先检测 Python 是否可用:
|
||||
Before performing any Python operation, first check whether Python is available:
|
||||
|
||||
```bash
|
||||
python3 --version 2>/dev/null || python --version 2>/dev/null
|
||||
```
|
||||
|
||||
如果命令失败(Python 不可用),**必须停止并告知用户安装 Python 3**:
|
||||
If the command fails (Python is unavailable), **you must stop and instruct the user to install Python 3**:
|
||||
|
||||
- **macOS**: `brew install python3` 或从 https://www.python.org/downloads/ 下载
|
||||
- **Windows**: `winget install Python.Python.3` 或从 python.org 下载(安装时勾选 "Add Python to PATH")
|
||||
- **macOS**: `brew install python3` or download from https://www.python.org/downloads/
|
||||
- **Windows**: `winget install Python.Python.3` or download from python.org (check "Add Python to PATH" during installation)
|
||||
- **Linux (Debian/Ubuntu)**: `sudo apt install python3 python3-pip`
|
||||
- **Linux (Fedora/RHEL)**: `sudo dnf install python3 python3-pip`
|
||||
|
||||
如需更详细的环境配置帮助:Python 相关问题加载 `python-runtime` 技能;
|
||||
其他(LibreOffice / 容器 / WSL)加载 `dev-environment-setup` 技能。
|
||||
For more detailed environment setup help: for Python-related issues load the `python-runtime` Skill;
|
||||
for everything else (LibreOffice / containers / WSL), load the `dev-environment-setup` Skill.
|
||||
|
||||
### Python 包依赖
|
||||
### Python Package Dependencies
|
||||
|
||||
本技能依赖以下 Python 包(按需检测):
|
||||
This Skill depends on the following Python packages (checked on demand):
|
||||
|
||||
- `openpyxl` — Excel 文件创建和编辑(公式、格式)
|
||||
- `pandas` — 数据分析和读写
|
||||
- `openpyxl` — Excel file creation and editing (formulas, formatting)
|
||||
- `pandas` — data analysis and read/write
|
||||
|
||||
检测方法:
|
||||
Detection method:
|
||||
```bash
|
||||
python3 -c "import openpyxl; import pandas" 2>/dev/null || echo "MISSING"
|
||||
```
|
||||
|
||||
缺失时告知用户安装:`pip install openpyxl pandas`
|
||||
If missing, instruct the user to install: `pip install openpyxl pandas`
|
||||
|
||||
# Requirements for Outputs
|
||||
|
||||
## Output Rule
|
||||
|
||||
When you create or modify a .xlsx file, you **MUST** tell the user the absolute path of the output file in your response. Example: "文件已保存到:`/path/to/output.xlsx`"
|
||||
When you create or modify a .xlsx file, you **MUST** tell the user the absolute path of the output file in your response. Example: "File saved to: `/path/to/output.xlsx`"
|
||||
|
||||
## All Excel files
|
||||
|
||||
@@ -394,4 +416,4 @@ The script returns JSON with error details:
|
||||
**For Excel files themselves**:
|
||||
- Add comments to cells with complex formulas or important assumptions
|
||||
- Document data sources for hardcoded values
|
||||
- Include notes for key calculations and model sections
|
||||
- Include notes for key calculations and model sections
|
||||
|
||||
Reference in New Issue
Block a user