Transform any topic or material into an article in a specified style.
Core Capabilities
- 🎨 5 writing styles:qiaomu、xiaohongshu、dankoe、wechat、twitter
- 🧠 Claude intelligent decision-making: After reading the content, determine the type and select the appropriate style
- 📝 Pure Markdown output: Focus on writing, leave illustrations to
illustration-generator - ⚡ Style conversion: Long article → short article → tweet, one-click conversion
How to Use
# 指定风格写作
/document-writer "秦军消失之谜" --style wechat
# 从素材改写
/document-writer source.md --style qiaomu
Style Conversion
/document-writer convert article.md --to xiaohongshu
## 可用风格
| 风格 | 字数 | 特点 | 适用场景 |
|------|------|------|----------|
| `qiaomu` | 8000-10000 | 口语化、对话感、生活化类比 | 技术论文解读、深度科普 |
| `xiaohongshu` | 800-1200 | 情绪化、去爹味、emoji点缀 | 种草文、干货分享 |
| `dankoe` | 5000-8000 | 挑衅开场、反常识、长短句交替 | 深度思考、观点输出 |
| `wechat` | 3000-6000 | 短段落、重点加粗、结尾互动 | 公众号文章、行业分析 |
| `twitter` | 100-280 | 钩子开头、精炼有力 | Twitter帖子、知识卡片 |
---
## 工作流程(7步)
### Step 1: 读取输入
**Claude 执行:**
1. 识别用户输入类型:
- 主题文字 → 直接使用
- 文件路径 → 读取文件内容
2. 记录输入内容
### Step 2: 选择风格
**如果用户指定了 `--style`:**
- 直接使用指定风格
**如果用户未指定风格:**
- Claude 阅读内容,判断内容类型(历史/技术/生活/商业...)
- Claude 选择最合适的风格
- 告知用户选择结果和理由
**调用 shared-lib 获取可用风格:**
```python
import sys
sys.path.insert(0, str(Path.home() / '.claude' / 'skills' / 'shared-lib'))
from writing import list_styles
print(list_styles()) # ['qiaomu', 'xiaohongshu', 'dankoe', 'wechat', 'twitter']
Step 3: Get style specifications
Call shared-lib to get the style prompt:
from writing import get_style_prompt, get_style_info
# 获取风格详情
info = get_style_info('wechat')
print(f"风格: {info['display_name']}")
print(f"字数: {info['word_count']['min']}-{info['word_count']['max']}")
# 获取完整风格指南(给 Claude 用)
prompt = get_style_prompt('wechat')
print(prompt)
Step 4: Write the article
Claude writes according to the style specifications:
-
Read the following in the style guide:
- Core features
- Structural requirements
- Prohibited items
- Word count requirements
-
Write the article according to the specifications:
- Follow the structural requirements (opening → body → closing)
- Keep the word count within range
- Avoid prohibited items
-
Output the complete Markdown article
Step 5: Quality self-check
Claude performs a self-check according to the style:
qiaomu style check:
- Term explanations ≥ 15
- Everyday analogies ≥ 3
- Data tables ≥ 1
- Em dashes = 0
- Chinese punctuation 100%
wechat style check:
- Word count 3000-6000
- Each paragraph ≤ 5 lines
- Has subheadings for separation
- Key points in bold
- Ending has an interactive prompt
xiaohongshu style check:
- Word count 800-1200
- Each paragraph ≤ 3 lines
- Has emotional turns
- No condescending expressions
- Has interactive hooks
If issues are found → fix silently → continue
Step 6: Save the output
Create the output directory and file:
{output_dir}/
├── {title}.md # Markdown文章
└── metadata.json # 元数据
metadata.json format:
{
"title": "文章标题",
"style": "wechat",
"word_count": 3500,
"source": "source.md 或 null",
"created_at": "2026-01-26T10:00:00",
"generator": "document-writer"
}
Step 7: Output summary
✅ 文章生成完成!
📄 文件: {title}.md
📝 风格: 微信公众号风格 (wechat)
📊 字数: 3500字
✓ 质量检查: 通过
下一步建议:
- 调用 /illustration-generator 生成配图
- 调用 /wechat-article-formatter 格式化为微信HTML
Style Conversion
Convert an existing article into another style.
Usage:
/document-writer convert article.md --to xiaohongshu
Conversion process:
- Read the original article
- Call
get_conversion_guide(from_style, to_style)to get the conversion guide - Adjust according to the guide:
- Long article → short article: Extract the core points and compress them into key points
- Short article → long article: Expand the discussion and add cases and data
- Rewrite according to the target style specifications
- Quality self-check
- Save the output
Working with Other Skills
| Order | Skill | Function |
|---|---|---|
| 1 | document-writer | Generate a Markdown article |
| 2 | illustration-generator | Generate illustrations for the article |
| 3 | md-to-pdf | Convert to PDF |
| 4 | wechat-article-formatter | Format as WeChat HTML |
| 5 | wechat-publisher | Publish to WeChat Official Account |
shared-lib Interface Reference
Module path: ~/.claude/skills/shared-lib/writing/
| Function | Purpose |
|---|---|
list_styles() |
Return the list of available styles |
get_style_info(style) |
Return style details (word count, features, etc.) |
get_style_prompt(style) |
Return the complete style guide (for Claude to use) |
get_conversion_guide(from, to) |
Return the style conversion guide |
Note: Content type determination is done by Claude and does not rely on keyword matching.
Examples
Example 1: Writing a WeChat official account article
User:
/document-writer "客家新论:秦军消失之谜" --style wechat
Claude executes:
- Read the topic
- Use the wechat style
- Get the style specification
- Write a 3000-6000 word article according to the specification
- Self-check: short paragraphs, bold text, interactive ending
- Save
客家新论:秦军消失之谜.md - Output summary
Example 2: Rewriting from source material
User:
/document-writer source.md --style xiaohongshu
Claude executes:
- Read the content of source.md
- Use the xiaohongshu style
- Get the style specification
- Extract the core viewpoints and compress to 800-1200 words
- Self-check: emotional, no mansplaining tone, emoji
- Save the output
- Output summary
Example 3: Style conversion
User:
/document-writer convert long-article.md --to twitter
Claude executes:
- Read the long-form article
- Get the conversion guide (qiaomu → twitter)
- Extract 3-5 core key quotes
- 100-280 words each
- Save in Twitter thread format
- Output summary