360 Secure SkillHub
360 安全技能中心

blog-polish-zhcn

读取指定 Markdown 草稿,修正语法并整理为 4-5 节,再翻译为简体中文并保留代码块与 openclaw、skill、cli 等技术术语,按时间戳加标题 slug 命名写入输出目录,并返回输出文件路径。

j3ffyang
j3ffyang
热度 59.01
最近更新 2026-08-08 14:15:25
分类:创作依赖:读写文件 / 内部调用大模型 / 代码执行应用场景:博客写作 / 翻译 / 校对润色

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add blog-polish-zhcn
Metadata
name
blog-polish-zhcn
description
Polish and translate a technical blog draft into a 1200–1400 word, 4-5 section Markdown article in Simplified Chinese (zh-CN), preserving technical terms and code blocks.
author
Jeff Yang
version
1.0.13
tags
["openclaw","clawhub","blog","polish","translate","zh-cn","markdown"]
metadata
{"openclaw":{"schema_version":"1.1","type":"skill","requires":["jq"],"platforms":["linux","darwin"]},"entrypoint":"skill"}
inputSchema
{"type":"object","properties":{"draftPath":{"type":"string","description":"Path to the draft markdown file.","default":"~/.openclaw/workspace/contentDraft/latestDraft.md"},"outputDir":{"type":"string","description":"Directory where polished file is saved.","default":"~/.openclaw/workspace/contentPolished/"}},"required":["draftPath","outputDir"]}
outputSchema
{"type":"object","properties":{"outputPath":{"type":"string","description":"Path to the final polished markdown file."}},"required":["outputPath"]}
workflow
[{"name":"init","description":"Set defaults and create timestamp","run":"draftPath=${draftPath:-~/.openclaw/workspace/contentDraft/latestDraft.md}\noutputDir=${outputDir:-~/.openclaw/workspace/contentPolished/}\nts=$(date +\"%y%m%d%H%M\")\nsave_state ts \"$ts\"\nsave_state draftPath \"$draftPath\"\nsave_state outputDir \"$outputDir\"\n"},{"name":"verify_input","description":"Check if draftPath exists","run":"draftPath=$(load_state draftPath)\nif [ ! -f \"$draftPath\" ]; then\n echo \"Error: Draft not found at $draftPath\" >&2\n exit 1\nfi\n"},{"name":"read_draft","description":"Load draft file content into memory","run":"draftPath=$(load_state draftPath)\ndraftText=$(cat \"$draftPath\")\nsave_state draftText \"$draftText\"\n"},{"name":"polish_and_translate","description":"LLM: Polish grammar → Translate zh-CN → Produce title slug + content","inputs":["draftText"],"outputs":["titleSlug","polishedText"],"llm":true},{"name":"prepare_output","description":"Define output filename with timestamp and title slug","run":"ts=$(load_state ts)\noutputDir=$(load_state outputDir)\ntitleSlug=$(load_state titleSlug)\nif [ -z \"$titleSlug\" ]; then\n titleSlug=\"article\"\nfi\noutputPath=\"${outputDir}/${ts}_${titleSlug}.md\"\nsave_state outputPath \"$outputPath\"\n"},{"name":"write_file","description":"Save polished markdown to disk","run":"outputPath=$(load_state outputPath)\npolishedText=$(load_state polishedText)\nmkdir -p \"$(dirname \"$outputPath\")\"\nprintf '%s\\n' \"$polishedText\" > \"$outputPath\"\n"},{"name":"finalize","description":"Emit polished path only","run":"outputPath=$(load_state outputPath)\njq -nc --arg outputPath \"$outputPath\" '{ outputPath: $outputPath }'\n"}]

Blog Polish (zh-CN)

This skill polishes a technical blog draft and translates it to Simplified Chinese while preserving technical accuracy.

When to Use

Use when the user asks to polish/translate a technical blog draft to zh-CN without images. Triggers: "polish my draft", "translate blog to Chinese", "enhance latestDraft.md".

Defaults

  • draftPath: ~/.openclaw/workspace/contentDraft/latestDraft.md
  • outputDir: ~/.openclaw/workspace/contentPolished/
  • Output filename: ${ts}_${titleSlug}.md

Workflow Summary

  1. Resolve paths + create timestamp (date +"%y%m%d%H%M")
  2. Read draft from draftPath
  3. Polish English: Fix grammar/spelling, improve clarity, structure into 4-5 sections, target 1000-1200 words
  4. Translate to zh-CN: Preserve code blocks, inline code, technical terms (openclaw, skill, cli)
  5. Save polished markdown to ${outputDir}/${ts}_${titleSlug}.md
  6. Return: { outputPath: "/full/path/to/file.md" }

Output

The skill returns a JSON object with a single property:

  • outputPath: path to the generated polished article.

Example

Input: ~/.openclaw/workspace/contentDraft/latestDraft.md
Example Output

{ "outputPath": "~/.openclaw/workspace/contentPolished/2603142134-openclawSkills.md" }