5.4 KiB
MPI Project Conventions
Skills
Skills in skills/. Loaded via ~/.hermes/config.yaml:
skills:
external_dirs:
- /home/user/documents/mpi/skills
{% hermes config set stringifies list values — edit config.yaml directly. %}
Available: terms-search, dharma-translation, translation-review, chinese-text-normalize, pptx-translate, pdf-to-docx-conversion.
Terms Database
- DB:
terms-search/termlib.duckdb - CLI:
terms-search/search.py <query> [limit](preferred over HTTP) - Module:
from search import search; search("空性", limit=5, loc="...", src="...")→ list of{zh, en, loc, source}dicts - Priority: DoT定稿 > 内部特色词 > 佛教术语 > 经论名
Directory Structure
translate-files/<topic>/<article>/
source.dj — Chinese original
target.dj — English translation (match source line count)
bilingual.dj — interleaved (source line, blank, target line, blank)
.docx output → /tmp/. Don't commit binaries.
Workflow A: Translation(翻译)
Translate Chinese source into English. The agent IS the model — no external APIs.
Input
Source text in .dj or .docx (Chinese only).
Deliverables
source.dj— extracted/cleaned Chinesetarget.dj— English translation, line count matches sourcebilingual.dj— interleaved (source line, target line adjacent, blank between pairs)edit-suggestions.dj— terminology/consistency issues flagged for review
Rules
- Load
dharma-translationandterms-searchskills before starting. - Search terms DB with
search.pyfor key Buddhist terms. - TOC: plain bullet lists, no link targets, no page numbers.
- Djot formatting:
- Emphasis:
*text*(single asterisks). Never**(Markdown bold). - Comments:
{% ... %} - Em dashes in English text:
---(three hyphens). Pandoc converts to proper em dash in docx output. - En dashes in English text:
--(two hyphens).
- Emphasis:
- Preserve source formatting — don't add/remove emphasis.
- Translate in-response — never call external translation APIs.
Review
After translating, run translation-review skill (Workflow B) to check:
- Terminology consistency against terms DB
- Grammar, fluency, calques
- Missing content (mid-paragraph truncation)
- Inconsistency (same term translated differently)
Workflow B: Proofread(校对)
Extract bilingual content from an existing DOCX manuscript and flag issues. The DOCX already contains BOTH Chinese and English — the English is the authoritative target, not something the agent creates.
Input
A .docx manuscript with Chinese and English in parallel (typically
paragraph-level alternation: Chinese, blank, English, blank).
Deliverables
bilingual.dj— extracted from DOCX (interleaved)edit-suggestions.dj— mechanical/issues found in the manuscript
Extraction
pandoc input.docx -f docx -t plain --wrap=noneto plain text- Script to extract CN/EN pairs. Write to
scripts/gen-bilingual-<name>-<hash>.py. Copy the approach from an existing script (e.g.gen-bilingual-buddhist-attitude.py). - Write
bilingual.dj.
What to flag (edit-suggestions.dj)
Only flag objective/manuscript-level issues:
- Garbled text — merged duplicate edits in source DOCX
- Double words —
the The,is is - Double punctuation —
warm or cold.. - Numbering mismatches — CN heading
三vs EN headingII, or body heading number doesn't match TOC - Translator notes —
(某某翻,某某审)left in headings - Missing content — paragraphs present in CN but missing in EN (or vice versa)
- Duplicate text — same name/phrase repeated (
岳麓书院岳麓书院) - Capitalization typos —
Philosopher Nietzsche→philosopher Nietzsche - Stray/unusual characters in either language
What NOT to flag
Do NOT flag translation quality issues — the English is authoritative manuscript text:
- Terminology choices (e.g. "delusional dreams" for 颠倒梦想)
- Translation style, calques, fluency preferences
- Djot formatting conventions (em-dashes, italics)
- Word order, added concepts, degree weakening
These belong to the translation workflow, not proofread.
Separate translation-quality findings
If the user explicitly asks for a translation review of a proofread article,
write findings to translation-findings.dj (separate from edit-suggestions.dj).
Load the translation-review skill and follow its Workflow B.
Djot
- Comments:
{% ... %} - Emphasis:
*text*(single asterisks) - Dashes in English:
---em,--en. Pandoc converts in docx output. - Preserve source formatting — don't add/remove emphasis
Scripts
Utility scripts in scripts/ (fish for CLI wrappers, Python for data processing).
Agents should write repetitive logic here and run via terminal rather than
regenerating the same Python in execute_code each turn.
scripts/docx2dj.fish <docx>— pandoc .docx → .dj alongside the originalscripts/split-bilingual.fish <combined.dj>— split into source.dj (CN) + target.dj (EN)scripts/dj2docx.fish <target.dj>— pandoc .dj → .docx in/tmp/scripts/proofread-pdf.py <docx> <pdf>— word-level diff between manuscript and typeset PDFscripts/gen-bilingual.fish <dir>— producebilingual.djfromsource.dj+target.djscripts/gen-bilingual-<name>-<hash>.py— article-specific extraction from DOCX