feat: export core Hermes skills
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
---
|
||||
name: legal-document-translation
|
||||
description: 法律文件翻译工作流程。重要法律文件必须用AI模型翻译(delegate_task),不用Google Translate/DeepL等机器翻译API。中德对照格式:中文写在德文下方(非表格),保持原文格式不变,中文用蓝色宋体小四区分,不加重复编号。不用Google Translate/DeepL等机器翻译API。支持中德、中英等对照文档制作。
|
||||
version: 1.0.0
|
||||
tags: [translation, legal, bilingual, docx]
|
||||
---
|
||||
|
||||
# 法律文件翻译
|
||||
|
||||
## 核心原则
|
||||
|
||||
1. **重要法律文件必须用AI模型翻译**(通过delegate_task派子代理),禁止使用Google Translate、DeepL等机器翻译API
|
||||
2. 机器翻译的问题:术语不一致(同一个词翻来翻去)、法律语境理解差、容易出偏差
|
||||
3. AI模型翻译的优势:理解上下文、术语全文统一、法律文书体表达准确
|
||||
|
||||
## 工作流程
|
||||
|
||||
### 1. 提取原文
|
||||
```
|
||||
读取docx → 提取段落文本+样式信息 → 保存为 /tmp/de_texts.txt(或对应语言)
|
||||
格式:|||段落INDEX|||原文文本
|
||||
```
|
||||
|
||||
### 2. 派子代理翻译(delegate_task)
|
||||
- 提供完整的合同背景说明(合同类型、双方当事人、主要内容)
|
||||
- **必须提供术语表**:列出所有关键法律术语的统一译法
|
||||
- 要求:法律文书体(应/应当、有权、不得)、保留原文编号、保留专有名词原文
|
||||
- 输出格式:|||INDEX|||译文
|
||||
|
||||
### 3. 组装对照文档
|
||||
- 双栏表格:左栏原文,右栏译文
|
||||
- 章节标题加粗+浅灰底色
|
||||
- 表头蓝色底色标注语言
|
||||
- 字体:原文用Arial,中文用等线,字号Pt(9)
|
||||
- A4页面,左右各2cm边距
|
||||
|
||||
## 术语表模板(德→中,示例)
|
||||
|
||||
给子代理的prompt中必须包含术语表,根据合同类型调整:
|
||||
|
||||
```
|
||||
- Lizenzgeber = 许可方
|
||||
- Lizenznehmer = 被许可方
|
||||
- Vertrag = 合同(不用"协议")
|
||||
- Kündigung = 解除/终止
|
||||
- ordentliche Kündigung = 普通解除
|
||||
- außerordentliche Kündigung = 特别解除
|
||||
- wichtiger Grund = 重大事由
|
||||
- Gewährleistung = 保证/担保
|
||||
- Schadenersatz = 损害赔偿
|
||||
- Vertragsstrafe = 违约金
|
||||
- Geheimhaltungspflicht = 保密义务
|
||||
- Schriftform = 书面形式
|
||||
- Salvatorische Klausel = 可分割性条款
|
||||
- Gerichtsstand = 管辖法院
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 每次翻译前根据合同具体内容**定制术语表**,不能用通用术语表套
|
||||
- 专有名词(公司名、地名、产品名)保留原文
|
||||
- 方括号 [ ] 内的占位内容翻译但保留方括号
|
||||
- 翻译完成后抽查前几段和关键条款,确认术语一致性
|
||||
|
||||
## DOCX双语合同翻译(保留格式/批注)
|
||||
|
||||
对于需要在docx文件中就地替换一种语言的场景(如德文→英文,保留中文),详见 [references/contract-translation-docx.md](references/contract-translation-docx.md)。
|
||||
核心要点:用python-docx按段落索引替换、分批delegate_task翻译、保留comments和formatting。
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: contract-translation-docx
|
||||
description: Translate bilingual contracts in docx format — replace one language with AI-translated target language while preserving formatting, comments, and the other language.
|
||||
tags: [legal, translation, docx, contract]
|
||||
---
|
||||
|
||||
# Contract Translation in DOCX
|
||||
|
||||
## When to Use
|
||||
- Translating bilingual contracts (e.g., German-Chinese → English-Chinese)
|
||||
- Need to preserve comments/annotations, formatting, and track changes
|
||||
- Need AI-quality legal translation (not Google Translate)
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Analyze Document Structure
|
||||
- Read docx with python-docx to understand paragraph layout (bilingual alternating pattern)
|
||||
- Count paragraphs per language, identify comments count
|
||||
- Map which paragraphs are source language vs. target language to keep
|
||||
|
||||
### 2. Extract Source Language Paragraphs
|
||||
- Identify source language paragraphs by content/pattern
|
||||
- Extract text with paragraph index mapping for replacement later
|
||||
- Count total characters to estimate batch sizes
|
||||
|
||||
### 3. AI Translation (delegate_task)
|
||||
- Use delegate_task to translate in batches (~100 paragraphs per batch)
|
||||
- Specify legal register and terminology requirements
|
||||
- For German→English legal: wichtiger Grund = good cause, außerordentliche Kündigung = extraordinary termination / termination for cause, Abrechnung = statements of account
|
||||
- Verify all paragraphs translated (count match)
|
||||
|
||||
### 4. Replace in DOCX
|
||||
- Use python-docx to replace source language paragraph text with translations
|
||||
- Preserve paragraph formatting (alignment, indentation, spacing)
|
||||
- Update font properties (e.g., Times New Roman 12pt for English)
|
||||
- Do NOT use python-docx save() on workflow-produced files (destroys XML) — only for translation-specific files
|
||||
|
||||
### 5. Verify
|
||||
- Count paragraphs by language to confirm zero source language residual
|
||||
- Verify all comments preserved (count match)
|
||||
- Verify target keep-language paragraphs untouched
|
||||
- OnlyOffice screenshot for visual check if possible
|
||||
|
||||
## Style Calibration
|
||||
When a reference document exists for style matching:
|
||||
- Extract terminology table from reference
|
||||
- Compare translation choices (shall→应, represents and warrants→声明和保证, etc.)
|
||||
- Unify font, size, and formatting to match reference
|
||||
- Re-delegate for corrections if needed
|
||||
|
||||
## Pitfalls
|
||||
- "accountings" is not idiomatic — use "statements of account"
|
||||
- "Manipulation" in German legal → "Falsification" in English legal
|
||||
- Keep defined terms capitalized (Licensed Know-how, Contracting Parties, this Agreement not this contract)
|
||||
- Don't use Google Translate for legal documents — always use AI model translation
|
||||
- Comments (annotations) are stored separately in docx XML — paragraph replacement won't affect them
|
||||
Reference in New Issue
Block a user