From cowrite
Formats articles, Markdown drafts, or longform posts into WeChat Official Account-ready HTML with a local preview, selectable styles, and a copy-to-clipboard button.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cowrite:space-wechat-layoutThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a local HTML preview page that renders a provided article as WeChat-compatible rich HTML and includes a “复制 HTML” button. Preserve the article's meaning and content; only make light structural adjustments for layout readability.
Create a local HTML preview page that renders a provided article as WeChat-compatible rich HTML and includes a “复制 HTML” button. Preserve the article's meaning and content; only make light structural adjustments for layout readability.
Collect the article
# heading or first strong title-like line. If unclear, ask for a title.Ask for style
Claude: warm off-white, calm editorial, restrained borders, generous whitespace.OpenAI: crisp white, black/gray, utilitarian documentation feel.Google: bright white, soft blue/green/yellow/red accents, modular cards.references/style-guide.md only when implementing the chosen style or when comparing styles.Prepare the content
Build the local preview
index.html when possible.复制 HTML button;max-width: 677px);Copy behavior
text/html and text/plain.document.execCommand("copy").复制 HTML or 复制到公众号.WeChat HTML constraints
border-radius: 8px or less unless the chosen style specifically needs smaller corners.section, h1, h2, h3, p, table, blockquote.max-height and overflow-y:auto; keep headings, score summaries, and conclusions outside the scroll window.Verify
Create or update files in the current project. For a plain static page, use:
wechat-layout-output/
├── index.html
└── assets/ # only if local images are needed
For an existing app, update the app's normal entry files and keep the server URL unchanged when feasible.
The preview page should include this behavior, adapted to the project:
async function copyArticleHtml(articleNode, statusNode) {
const html = articleNode.innerHTML;
const text = articleNode.innerText;
try {
await navigator.clipboard.write([
new ClipboardItem({
"text/html": new Blob([html], { type: "text/html" }),
"text/plain": new Blob([text], { type: "text/plain" }),
}),
]);
statusNode.textContent = "已复制 HTML,可以粘贴到公众号正文区域。";
} catch {
const range = document.createRange();
range.selectNode(articleNode);
const selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
document.execCommand("copy");
selection.removeAllRanges();
statusNode.textContent = "已用兼容模式复制当前预览内容。";
}
}
Tell the user:
npx claudepluginhub spacezephyr/cowrite --plugin cowriteConverts Markdown to WeChat Official Account HTML, manages drafts, generates images and titles, and writes/rewrites articles in specified styles.
Converts Markdown into HTML formatted for WeChat Official Account publishing, with 15 built-in styles. Automatically selects style based on content type or user preference.
Converts Markdown to WeChat Official Account HTML, inspects metadata and capabilities, generates cover images, and creates drafts. Also supports image posts (小绿书) and removing AI writing traces.