AgentSkillsCN

mdx-en-to-zh-post

将本仓库中的 MDX 博客文章从英语翻译成中文。适用于源文件位于 content/posts/en,目标文件需以相同的 slug 写入 content/posts/zh,同时保留 MDX 结构、frontmatter 键、代码块、链接以及本地资源路径时使用。

SKILL.md
--- frontmatter
name: mdx-en-to-zh-post
description: Translate MDX blog posts in this repository from English to Chinese. Use when the source file is under content/posts/en and the target file must be written to content/posts/zh with the same slug, preserving MDX structure, frontmatter keys, code blocks, links, and local asset paths.

MDX EN to ZH Post

Workflow

  1. Read the source file from content/posts/en/<slug>.mdx or content/posts/en/<slug>.md.
  2. Write the translated file to content/posts/zh/<slug>.mdx or content/posts/zh/<slug>.md using the same slug.
  3. Translate natural-language content to Chinese:
  • Frontmatter text fields such as title, type, project, summary
  • Headings, paragraphs, list items, table text, blockquotes, callouts
  1. Preserve non-language structure exactly:
  • Keep frontmatter keys and ordering stable
  • Keep date and file paths unchanged
  • Keep code fences and inline code unchanged
  • Keep URLs and local asset paths unchanged
  • Keep MDX/JSX tags and attributes valid

Output Rules

  1. Keep the target filename equal to the source slug.
  2. Keep frontmatter keys present: title, type, project, date, summary.
  3. Keep markdown heading depth and code-block count aligned with source.
  4. Keep local links such as /posts/..., /portfolio/..., /videos/..., /audio/... unchanged unless the source itself is broken.

Validation

Run:

bash
python skills/public/mdx-en-to-zh-post/scripts/verify_translation.py \
  --source content/posts/en/<slug>.mdx \
  --target content/posts/zh/<slug>.mdx

Fix any reported errors before finishing.

Style Guide

Use references/translation-style.md for tone and wording constraints.