- 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"}]