translate-doc¶
ℹ️ Uses a custom skill bundled in this example dir (
./translate_doc/skill.md). Drop intoreyn/local/translate_doc/to make it globally available, or keep it scoped to this example.
Translate an English document into Japanese, preserving structure
(headings, code fences, lists). No stdlib translate skill ships in v1 —
this recipe defines a small one under reyn/local/.
What this shows¶
- The minimum scaffolding for a single-phase skill.
- Using
--output-language jais not the right move for whole-doc translation: it sets the output language meta-instruction but doesn't guarantee structural preservation. A dedicated phase with explicit rules is more reliable.
Setup¶
Copy the skill into your local skill area:
Run¶
Pass the document text on stdin (cleanest for multi-line):
Or inline for a short snippet:
Expected output¶
A translated_document artifact:
{
"language": "ja",
"text": "こんにちは、世界。これは翻訳する短い段落です。",
"structural_notes": [
"preserved 0 code blocks",
"preserved 0 headings"
]
}
Files¶
translate_doc/skill.md— single-phase skill,entry: translate.translate_doc/phases/translate.md— phase instructions (preserve structure, do not translate code).translate_doc/artifacts/translated_document.yaml— output schema.
Notes¶
- The phase instructions deliberately avoid enumerating output fields
(P8) — the OS injects
candidate_outputsfrom the schema. - Want bidirectional? Make a
directionfield on the input artifact ("en→ja" or "ja→en") and branch in the phase prompt — no graph change needed.