Official Account long-form AI writing engine — Generates a complete first draft from an outline or topic, supports rewriting, continuation, and polishing, with switchable multi-model.
Suite description · This skill belongs to
aws-wechat-article-*a one-stop suite (9 slugs in total, entryaws-wechat-article-main). Cross-skill relative references depend on the sameskills/directory, and it is recommended toclawhub installthe entire suite together. Source code:https://github.com/aiworkskills/wechat-article-skills
Capabilities disclosure (Capabilities)
This skill calls write.py to generate the article first draft,and will send the article content to the user-configured LLM endpoint:
- Credential reading: repository root
aws.envofWRITING_MODEL_API_KEY - Credential egress: this key is sent with the
Authorization: Bearer <key>headertoconfig.yaml.writing_model.base_urlthe configured external endpoint (DeepSeek / OpenAI / Anthropic and other Chat Completions compatible APIs).Please use a dedicated key and configure a trusted endpoint or internal proxy - Content egress: The Prompt contains this article's
article.yaml/topic-card.md/ merged configuration /--referencethe full text of the specified reference documents → POSTed as a whole to the above endpoint - File reading (inside repository):
.aws-article/config.yaml, this article'sarticle.yaml、topic-card.md、.aws-article/products/{产品名}/*.md - File reading (outside repository): inside repository
.aws-article/when missing, read from~/.aws-article/readswriting-spec.mdandpresets/(read-only preset, does not read credentials) - File writing: only under this article's directory
draft.md - shell: only
{python} {baseDir}/scripts/write.py
write.py prompt subcommandonly outputs prompt JSON without calling the LLM, written by the Agent — use this route when you don't want to send content to a third party.
Routing
Publishing from scratch, one-stop, complete workflow → aws-wechat-article-main. This skill's standalone trigger is limited tomodification of existing drafts(rewriting / polishing / continuation).
Configuration check ⛔
Before any operation, first follow First-time guidance · Detection order and proceed only after passing (or the user explicitly confirms in writing "skip check this time").
Writing model:writing_model(provider、base_url、model) at .aws-article/config.yaml;WRITING_MODEL_API_KEY at repository root aws.env. Key name mapping env.example.yaml。
When the environment check fails, only handle configuration options per first-time guidance,do notmix drafting, draft paths, or multi-draft selection into the same reply. Must comply with main'sAgent behavior constraints: when verification has not passed and the user has not explicitly granted a "this-time exception", you must not by default switch to the current Agent ghostwriting and pretend the process is complete.
Workflow
写稿进度:
- [ ] 第0步:⛔ 首次引导 · 检测顺序
- [ ] 第1步:⛔ 全局账号三键非空
- [ ] 第2步:⛔ 续旧稿还是新稿(不了解时须先问)
- [ ] 第3步:读取本篇约束与写作规范
- [ ] 第4步:发布方式(publish_method)
- [ ] 第5步:确定输入与写作方式
- [ ] 第6步:写作
- [ ] 第7步:跑 check 自检
- [ ] 第8步:⛔ 展示并等待用户确认
Step 1: Global account three keys ⛔
Open .aws-article/config.yaml, check article_category、target_reader、default_author whether all non-empty after trim. If any item is missing:ask the user item by item, and after obtaining an explicit answer for the current roundwrite back to that file. Consistent with main "2) Global account constraints" .
Must be completed before asking about continuing an old piece or starting a new one. Prohibitedfrom article.yaml, other drafts, or repository files;Prohibitedto only confirm in conversation without writing to disk.
Step 2: Continue an old draft or start a new one ⛔
UnclearWhen the user wants to continue writing a piece under drafts/ or start a new one:must first ask(candidate directories may be listed), then proceed only after selection. If the user has already specified a path or intent (directly providing drafts/…, or saying "start a new piece"), do not interrogate further.Prohibitedto call the writing script without confirmation, and prohibited to automatically select a certain drafts/… to run the script.
Directory naming: a new piece must be YYYYMMDD-标题slug(e.g. drafts/20260406-wechat-article-skills/)。Prohibited to omit the date prefix。
Step 3: Read this piece's constraints
write.py First read the global .aws-article/config.yaml, then read this piece's article.yaml, and overlay the keys from both sidesinto one tableto generate the writing prompt—when the same key exists in both places, this piece's article.yaml takes precedence. For field responsibilities, see articlescreening-schema.md。
- config.yaml: top-level fields for "what to write and how to write it" such as writing style, structural presets, prohibited words, word count,
embeds, etc., enter this table.writing_model/image_modelThe two sections are only for the script to connect to the API,do notput them entirely into the writing instructions. - article.yaml: this piece's title, author, summary,
publish_completed, etc.; duplicate keys override config.publish_completedWhen newly created, it must befalse, and after publishing ends, publish skill changes it totrue。
| Field | Purpose |
|---|---|
target_reader |
Reader profile → depth, wording, examples |
tone |
Tone → tone and sentence patterns |
writing_style |
Structure expression style (colloquial/written/story/methodology, etc.) |
⛔ Key fields must not run empty: before calling write.py(or having the Agent write on your behalf), confirm that the merged article_category、target_reader is non-empty, and that default_author or this piece's author is non-empty. If not satisfied, thenpause writing the draftand actually write to the file—do not only collect "readers" in a conversation table without writing to disk.
Additionally load .aws-article/writing-spec.md(if any).default_structure / default_closing_block In this piece's article.yaml , it must be asingle-element list [名] or []; if there are multiple candidates, or you need to understand preset loading priority, see branches.md "IV. Handling multiple candidates for structure / end-of-article presets"。
Business knowledge base: when this piece involves the user's own business (external introduction / tutorial / case study / self-promotion),mustfirst ls .aws-article/products/ and read the *.mdunder the relevant product root; if a document on the same topic already exists, prefer incremental rewriting. For how to use each of the two writing methods (Agent directly writing with paths vs. write.py --reference), and how to write back afterward, see branches.md "III. Two ways to use the business knowledge base". For topics unrelated to your own business, do not read and do not require it.
Step 4: Publishing intent
Confirm that .aws-article/config.yaml 's publish_method is one of draft(default) / published / none .When it is already a valid value, pass silently without repeated interrogation. For the meanings of the three and the questioning scope, see branches.md "V. Publishing Intent"。
Step 5: Determine the input and writing method
Input:topic-card.md / an outline or material provided by the user / a topic dictated by the user, with the business material library assessment already completed per Step 3.
Writing method (priority):
- Preferred: call a third-party model
write.py draft|rewrite|continue(for usage, see usage.md) - Automatic fallback: model not configured (exit code 2) →
write.py prompt <mode> <input>take the prompt JSON, and the Agent writes per thesame prompt,no need for"exception for this time" - Failure fallback: call failed (exit code 1) → see branches.md "I. Exit Code Handling"
You must tell the user which one is currently being used:
ℹ️ 使用 write.py 调用第三方模型({model})ℹ️ 写作模型未配置,本次由当前对话模型直接写稿(使用相同写作约束)ℹ️ 第三方 API 不可用,本次由当前对话模型代写(使用相同写作约束)+ reason
Step 6: Writing
Writing must follow the target_reader、tone、writing_styleread in Step 3: depth and wording fit the reader, tone fits the tonality, structure fits the article style.
image_source: user(user-provided image), do not output placeholder, use the real path instead—for details see branches.md "II. User-Provided Image Branch"。
Markdown syntax (mandatory)
The chain is "markdown syntax → output according to the syntax → renderer typesetting". Incorrectly written markup will not throw an error—rendering completes as usual,and readers will directly see in the body text __加粗__、###### 六级、[^1] symbols such as these。
| What is to be expressed | How to write it | Explanation |
|---|---|---|
| Subheading | ## 二级 ### 三级 |
There must be a space after the hash mark.Do not write # 一级—the article title is filled in separately in the WeChat official account backend |
| Bold | **加粗** |
The main means of emphasis in body text; see below for the rules |
| Italic | *斜体* |
Use with caution in Chinese; italic Chinese glyphs do not look good |
| Link | [文字](https://…) |
There must be clickable anchor text |
| Image |  |
The caption is written inside the quotation marks; if no quotation marks are written, there is no caption |
| Unordered list | - 一项 |
There must be a space after the minus sign |
| Ordered list | 1. 一项 |
Use only whenthere is a real sequence; for several parallel items use - |
| To-do list | - [ ] - [x] |
Use sparingly—use only for actual checklist items |
| Quote | > 引文 |
Every line must have > |
| Table | | a | b | + |---|---| |
The separator row cannot be omitted |
| Code | Inline `x`; for blocks use triple backtick fences |
Do notuse four-space indentation |
| Separator | --- on a line by itself |
Leave one blank line above and below |
Prohibited: outputting HTML tags (<br> <div>);::: and similar custom block syntax; four-space indented code blocks; Setext-style headings (==== / ----); bare URLs as body text.
Output quota (not optional)
The grammar-rule models all comply, but without a quota they produce nothing at all. Real-manuscript testing: golden-line cards 0/10 articles, bold text within body paragraphs 0/5 articles—the bold was all inside list tags, and readers scanning one mobile screen found no landing points at all. The following corresponds item by item to write.py the quota section in the system promptcorresponds item by item, and changing one place requires changing both places.
-
Summary — the first
##write a section of>quotation, 80–128 characters,and it must not be the same sentence asarticle.yamlthe summary field of(in testing, 7 articles were verbatim identical, so readers read the same paragraph twice). -
Bold = highlighting key points — readers do not have time to finish two thousand characters; the bold should let them know what you said just by reading these. Acceptance criterion: extract all the bold text in order and read it continuously; it should be an abbreviated version that can be understood independently. If it reads like a word cloud (“transparency / bottleneck / adoption”) or like rereading the paragraphs, the wrong things were chosen. Working backward from this:there should be one landing point about every 100 characters(about 4–5 lines on mobile),and 200 consecutive characters must not have none—that is a reader swiping through an entire screen and still not finding the key point. Each
##section should have at least one, and the closing paragraph should also have one; at most two per paragraph; each one mustbe understandable independently—a number together with its meaning (**省 88% Token**), a judgment together with its object (**打断不等于撤销**), a term together with its characterization (**按问题找证据**). Cover the key numbers as much as possible.Do notbold an entire sentence’s summary,do notbold every paragraph at the same position in the first sentence.Density is calculated by character count, not by paragraph count. Paragraphs are elastic units:
paragraph_preferencean account that writes “mainly short paragraphs” has paragraphs of 35 characters, while one that writes “mainly natural paragraphs” has paragraphs of 80 characters. The same “one every 2–3 paragraphs” lands in readers’ eyes as more than twice as different—in testing, both articles reported[OK], one with one every 40 characters and the other with one every 194 characters. What readers feel ishow many screens they swipe before hitting the next landing point。 -
Three or more items in parallel — write them as a
- **标签**:说明list, do not squeeze them into one long paragraph. Even if the paragraph preference requires “complete natural paragraphs,” that governs narrative paragraphs; enumerations still use lists. -
Exactly one golden line — the one sentence most worth screenshotting and sharing should be written as
> 金句。 —— 出处, and the layout will set it as a golden-line card. With two or more, the card degrades into a decorative bar; without attribution, it is just an ordinary quotation. -
---— use when an obvious transition is needed, on its own line, with a blank line above and below. The layout will change it into this template’s divider ornament. -
Paragraph spacing — leaveone blank linebetween paragraphs. Two blank lines or two spaces for a line break are not needed; paragraph spacing is controlled by the layout.
Image placeholder
image_source when not user , generate a placeholder according to image_density , format , each placeholderon its own line,Cover placeholder is placed before the title. For type names and detailed rules, see structure-template.md"Image marker".
The density words are invented by this kit; you cannot just throw the words at the model and let it guess (tested on five real drafts, the marker count was fewer than the ## number of sections in every draft):
image_density |
That is, |
|---|---|
| one image per section | Each ## section gets one image, no more, no less |
| images as needed | only add images where the text cannot explain clearly (process, comparison, data); no images otherwise |
| few images | the whole piece gets only the 1–2 most critical images |
| many images | one image every 2–3 natural paragraphs |
This is a hard quota, not a reference value, count it yourself after writing. The same table appears in write.py 's _DENSITY_RULES and image-method.md , with consistent wording. When not configured, the default isone image per section。
Step 7: Run check for self-inspection ⛔
draft.md After writingrun the script once, and if it fails, fix it before moving on. These are the most easily missed in practice, and when missed they do not report an error; a piece of the layout just quietly goes missing:
{python} {baseDir}/scripts/write.py check drafts/YYYYMMDD-slug/draft.md
It measures item by item against the output quota above, andextracts all bold text in the document and strings it into one linefor printing—the acceptance criterion iswhether this string reads like an outline, and if it cannot be strung together, that means the wrong things were picked, not that the quantity is insufficient. A non-zero exit code means some hard requirement was not met. The script only measures what can be counted;whether the bold selections are correct still requires reading that string yourself。
The two items the script cannot cover must be checked manually:
- image placeholder countand
image_densitywhether they are consistent and whether the format is valid; - prohibited words, paragraph length, opening hook strength, subtitle densityrough scan。
⛔ This stepdoes notreplace review skill: compliance, sensitive words, end-of-document embed, and stripping citation markers all belong to review; this step is forbidden from overstepping.
For intermediate artifact gates during continuation, see branches.md "Seven"。
Step 8: Display and wait for user confirmation ⛔
Show the user draft.md, and after confirmationhand off to review skill for content review。
⛔ Artifact boundary: this skill producesonly up to draft.md. During the writing stage it is forbidden to:
- write by yourself
article.md(that is the BLOCKING artifact of review step 5, and must include the end-of-document{embed:…}and have citation markers stripped) - strip by yourself
(资料路径:…)citation markers (done by review callingwrite.py strip-citations) - skip review and go directly to formatting
Branches and exceptions
Exit code four-way classification, user-provided images, business knowledge base details, preset multiple candidates, publishing intent criteria, confirmation round optimization, continuation gates → references/branches.md。
Process files
| read | produce |
|---|---|
topic-card.md、.aws-article/config.yaml, this piece's article.yaml |
draft.md(including image markers); may update publish_method; when creating/completing article.yaml keep publish_completed: false |