Optimize local Markdown files to make articles more suitable for reading on WeChat Official Accounts.
Workflow
1. Receive user requests
The user provides:
- Markdown file path (required)
- Specific optimization requirements (optional)
2. Read and analyze the file
Run the script to read the file content:
node "<skill目录>/scripts/optimize.js" <markdown文件路径> --config "<skill目录>/config.json"
The script will output the file content for you to analyze and optimize.
3. Multi-dimensional content optimization
Based on the optimization guide in references/optimization-guide.md, optimize from the following dimensions:
| Dimension | Optimization points |
|---|---|
| Opening appeal | Capture readers in the first 3 seconds, using pain points/suspense/data/scenarios as the entry point |
| Paragraph order | Adjust paragraph positions, put important content first, and make the logic smoother |
| Paragraph rhythm | Short paragraphs (no more than 4 lines on mobile), more whitespace, easy to scan |
| Language expression | Colloquial, friendly, use "you" to address readers, and make abstract concepts concrete |
| Subheadings | Use questions/numbers/contrasts/benefit-driven wording to guide reading |
| Ending conversion | Summary/interaction/action/benefits/memorable quotes, giving readers a reason to act |
| Formatting | Bold key points, use appropriate quotes, present with lists, and keep clear hierarchy |
3.1 Markdown syntax optimization
- Try to use standard Markdown syntax.
- The Markdown renderer I wrote supports most Obsidian Markdown syntax, such as
**加粗**、*斜体*、==高亮==etc. Because I use Obsidian's Markdown syntax when writing articles. - Obsidian is a note-taking software based on local files. All data is stored on my computer as plain text .md (Markdown) files.
4. Save the optimized file
Write the optimized content to a new file:
- Must be saved as a new file:
<原文件名>.optimized.md
5. Report the optimization results
Explain to the user:
- The optimized file path
- Which aspects were mainly optimized
- The reasons for the optimization and the expected effects
Optimization principles
Target audience
- Age: Chinese users aged 16-50
- Device: Mainly mobile reading
- Scenario: Fragmented time
- Attention: Extremely short, the first 3 seconds determine whether they continue
Language style
- Friendly, easy to understand, with internet flair but still professional
- Write as if chatting with a friend
- Use "you" more, and use "users" and "readers" less
- Split long sentences into short ones, with each sentence no more than 25 characters
- Sense of story: Use specific examples instead of empty theories
- Have an attitude: Express opinions and do not muddle through
- Simplify complexity: Make good use of analogies to make difficult things simple
Writing points
1. Use stories instead of preaching
❌ "Risk management is very important, and an emergency plan should be formulated"
✅ "Last year, my startup team almost collapsed because there was no backup plan; when one core employee resigned, we were nearly ruined. Since then, I have learned to reserve a backup for every position."
2. Make good use of analogies
❌ "Distributed systems are very complex"
✅ "A distributed system is like a chain restaurant. Each branch must cooperate with the others while also operating independently. If even one link is not coordinated well, the whole experience collapses."
3. State your point directly
❌ "Some people believe... while others believe... each has its own reasoning"
✅ "Honestly, I think the XX approach is wrong, because..."
Formatting guidelines
- Each paragraph 3-4 lines (mobile screen)
- Leave one blank line between paragraphs
- Subheadings must be added to guide the reading rhythm
- Key contentBoldHighlight
Detailed optimization guide
Reference file: references/optimization-guide.md
Read this file when needed to obtain:
- Detailed optimization techniques for each dimension
- Key optimization points for common content types
- Before-and-after optimization examples
- Advanced writing frameworks (SCQA, AIDA)
Configuration instructions
Configuration file: config.json
{
"options": {
"optimizeStructure": true, // 优化文章结构
"optimizeLanguage": true, // 优化语言表达
"optimizeFormatting": true, // 优化排版格式
"addEmojis": false, // 是否添加 emoji
"optimizeHeadings": true, // 优化小标题
"optimizeOrder": true // 优化段落顺序
},
"audience": {
"ageRange": "16-50岁",
"style": "亲切、易懂、有网感但不失专业",
"readingDevice": "mobile"
},
"output": {
"backup": true, // 是否备份原文件
"overwrite": false, // 是否覆盖原文件
"suffix": ".optimized" // 新文件后缀
}
}
Usage examples
Example 1: Basic optimization
User: Help me optimize this article F:/docs/article.md
Execution:
- Run the script to read the file
- Analyze the content structure
- Optimize according to 6 dimensions
- Save as article.optimized.md
- Report the key optimization points
Example 2: Optimization for specific needs
User: The beginning of this article is too dull. Help me make it more engaging. The file is F:/blog/post.md
Execution:
- Focus on optimizing the beginning
- Keep the rest of the content unchanged
- Provide 2-3 opening versions to choose from
Example 3: Conversational rewriting
User: This article reads too formally. Help me make it more conversational, like chatting
Execution:
- Identify formal/stiff expressions
- Replace them with conversational expressions
- Add interjections and transitional sentences
- Adjust sentence length
Notes
- Preserve the core information of the original text: Optimize the expression without altering the original meaning
- Respect the user's style: Adjust the degree of optimization according to the user's requirements
- Technical content must be accurate: Ensure accuracy after optimizing professional terminology
- Keep code blocks: Keep the code in technical articles unchanged
- Keep links and images: Do not modify the original text's links and image references
Expected optimization results
The optimized article should:
- Capture the reader's attention in the first 3 seconds
- Have short paragraphs, with no pressure when reading on mobile
- Use friendly language, like a friend's recommendation
- Have a clear structure, with subheadings guiding the reading
- Have a clear call to action at the end