
post-writer
by zengxishenggmail
SKILL.md
name: post-writer description: "Convert markdown article drafts to MDX blog posts with bilingual support (Chinese and English). Use when user provides a markdown article and wants to publish it as a blog post on the website. Handles frontmatter generation, MDX syntax validation, and full translation."
Post Writer Skill
Convert markdown article drafts into website-ready MDX blog posts with bilingual support.
Workflow Overview
- Gather inputs from user
- Read reference blog to learn format
- Read article draft and analyze content
- Clarify requirements via AskUserQuestion if needed
- Create Chinese version (.zh.mdx) - preserve original content
- Apply layout optimization - make article visually appealing
- Create English version (.mdx) - full translation with same layout
- Insert showcase images at article end (figure + scene)
- Validate MDX syntax and fix issues
- Save to content/posts/
Required Inputs
Ask user for these if not provided:
| Input | Description | Example |
|---|---|---|
| Article draft path | Location of the markdown source file | to-be-released-post/article.md |
| Reference blog path | Existing blog post for format reference | content/posts/about-keyao-company.zh.mdx |
| Cover image path | Blog post cover image location | public/imgs/post-imgs/20260112/cover.png |
| Figure image path | Performance metrics/data visualization image | public/imgs/post-imgs/20260112/figures.png |
| Scene image path | Project scene/environment photo | public/imgs/post-imgs/20260112/scene.png |
| Post date | Publication date | 2026-01-12 |
| Post filename | Base name for the MDX files | my-article |
Step-by-Step Process
Step 1: Read Reference Blog
Read the reference blog post to learn:
- Frontmatter structure (title, description, created_at, author_name, author_image, image)
- Content formatting conventions
- File naming patterns
Step 2: Read and Analyze Article Draft
Read the source markdown file completely. Identify:
- Article title and main topic
- Key sections and structure
- Potential MDX syntax issues (see mdx-syntax-guide.md)
- Contact information that may need formatting
Step 3: Clarify Requirements
Use AskUserQuestion to clarify:
- Filename: Suggest a kebab-case filename based on content
- Phone numbers: If special characters are used, ask whether to convert to digits
- Date: Confirm the publication date
- Author info: Confirm author name if not obvious
Step 4: Create Frontmatter
Generate SEO-optimized frontmatter:
---
title: "Article Title Here"
description: "Compelling description for SEO (150-200 chars)"
created_at: YYYY-MM-DD
author_name: Author Name
author_image: /logo.png
image: /imgs/post-imgs/YYYYMMDD/cover.jpg
---
Critical: Always quote title and description if they contain special characters (colon, question mark, exclamation mark, quotes, etc.)
Step 5: Create Chinese Version
File: content/posts/{filename}.zh.mdx
- Preserve original article content completely
- Add frontmatter with Chinese title/description
- Fix MDX syntax issues (see validation checklist)
- Apply layout optimization (see Step 5.5)
Step 5.5: Layout Optimization (IMPORTANT)
Apply these formatting techniques to make articles visually appealing and easy to read.
Simple & Clean Design System
This project uses a simple, text-focused design for blog posts. The design emphasizes readability, comfortable line spacing, and minimal styling. Avoid overly complex layouts that look "AI-generated".
Design Principles
- Text-Focused - Content is king, minimal decorative elements
- Comfortable Reading - Relaxed line spacing, no visual pressure
- Brand Color Accent - Use
#8bbc40sparingly for emphasis - Dark Mode Support - All styled elements include
dark:variants - Natural Feel - Avoid looking too "AI-generated" or overly designed
Brand Color
#8bbc40 (Green)
Use this color only for key accents like H3 left borders.
Article Structure
Wrap entire article content in a relaxed line-height container:
<div className="leading-relaxed">
# Article Title
Article content here...
</div>
Table of Contents (TOC) Compatibility (CRITICAL)
⚠️ JSX heading tags (<h2>, <h3>) will NOT appear in the sidebar Table of Contents!
The MDX TOC generator only recognizes standard Markdown heading syntax (##, ###). If you use JSX heading tags, even if the build succeeds, those headings will be invisible in the TOC sidebar, making navigation impossible for readers.
Problem:
<h2 className="styled-heading">Section Title</h2> → ❌ NOT in TOC
<h3 className="styled-heading">Subsection</h3> → ❌ NOT in TOC
Solution:
## Section Title → ✅ Appears in TOC
### Subsection → ✅ Appears in TOC
Why this matters:
- Blog posts rely on TOC for navigation
- Readers expect to see all sections in the sidebar
- Missing TOC entries make long articles hard to navigate
- This is a silent failure - build succeeds but TOC is broken
H2 Styling
⚠️ CRITICAL: Use standard Markdown ## for H2 headers, NOT JSX <h2> tags!
JSX <h2> tags with Tailwind className (like px-4, py-2, rounded-lg) will cause MDX compilation errors. The MDX parser misinterprets numeric values in class names.
❌ DO NOT USE (will break build):
<h2 className="bg-slate-100 dark:bg-slate-800 px-4 py-2 rounded-lg">Title</h2>
✅ USE THIS INSTEAD:
## Section Title
Styling H2 via CSS: If custom H2 styling is needed, configure it globally in the theme's CSS/MDX components rather than inline JSX.
H3 Styling
⚠️ CRITICAL: Use standard Markdown ### for H3 headers, NOT JSX <h3> tags!
JSX <h3> tags with Tailwind className (like px-3, py-1.5, text-[#8bbc40]) will cause MDX compilation errors. The MDX parser misinterprets numeric values in class names (e.g., -3 in px-3) as invalid JSX expressions.
❌ DO NOT USE (will break build):
<h3 className="bg-slate-50 dark:bg-slate-900 px-3 py-1.5 rounded-md text-[#8bbc40]">Title</h3>
✅ USE THIS INSTEAD:
### Subsection Title
Why this happens:
- MDX parser sees
px-3and interprets-3as part of a JSX expression - Error message:
Unexpected character '3' before name - This is a known MDX limitation with complex className values
Styling H3 via CSS: If custom H3 styling is needed, configure it globally in the theme's CSS/MDX components rather than inline JSX.
Basic Formatting (Preferred)
Use standard Markdown for most content to maintain a natural, readable feel.
Blockquotes for Customer Quotes
> "Customer quote or important statement..."
>
> — Customer Name
Section Dividers
---
Tables for Data/Specifications
| Parameter | Value |
|-----------|-------|
| Temperature | ≤±0.5°C |
| Humidity | ≤±5%RH |
Bullet Lists
- Point one
- Point two
- Point three
Bold for Emphasis
**Important text here**
Images with Alt Text

What to Avoid
- ❌ Too many gradient backgrounds
- ❌ Complex card layouts with multiple colors
- ❌ Excessive use of colored text
- ❌ Over-styled statistics blocks
- ❌ Designs that look "AI-generated"
- ❌ Too many block-level styled elements
What to Use
- ✅ Standard Markdown formatting
- ✅ Simple H2/H3 with subtle backgrounds
- ✅ Blockquotes for quotes
- ✅ Tables for structured data
- ✅ Bullet lists for features/points
- ✅ Bold text for emphasis
- ✅ Section dividers (
---) between major sections
Step 6: Create English Version
File: content/posts/{filename}.mdx
- Translate entire article to English
- Maintain same structure and formatting
- Translate frontmatter title/description
- Fix MDX syntax issues
- Apply same layout optimization as Chinese version
Step 7: Insert Showcase Images
Add a "Project Results Showcase" section at the end of the article (before company signature):
Chinese version:
## 📊 项目成果展示


English version:
## 📊 Project Results Showcase


Placement: Insert after contact information section, before the final --- separator and company signature.
Step 8: MDX Syntax Validation
Before saving, check and fix these issues:
CRITICAL CHECKS:
-
<symbols → Replace with<or add spaces:< 100V→< 100V -
{<combinations → Never allow, will break MDX -
>in content → Usually OK, but escape if inside JSX context -
{and}→ Escape or avoid in regular text - Frontmatter colons → Quote values containing
:
See references/mdx-syntax-guide.md for complete guide.
Step 9: Save and Verify
- Write both files to
content/posts/ - Verify files were created successfully
- Run grep to confirm no remaining syntax issues
Step 10: Pre-Push Mandatory Validation (CRITICAL)
⚠️ NEVER git push without completing this step!
Before committing and pushing, you MUST run local build validation to catch MDX syntax errors:
# Clear cache and run build
rm -rf .next && pnpm build
If build fails, check for these common issues:
-
Bare
<followed by numbers (MOST COMMON ERROR):# Error example: 湿度<35% → MDX thinks <35% is a JSX tag 电阻<4Ω → MDX thinks <4Ω is a JSX tag # Fix: Use < entity 湿度 < 35% 电阻 < 4Ω -
JSX tags with Tailwind className containing numbers:
# Error example: <h2 className="px-4 py-2"> → Numbers in className break MDX # Fix: Use standard Markdown ## Title
Quick validation commands:
# Find bare < followed by numbers (potential issues)
grep -n "<[0-9]" content/posts/your-file.mdx
# Find JSX tags with className
grep -n "className=" content/posts/your-file.mdx
Only proceed with git push after build succeeds!
Output Files
content/posts/
├── {filename}.zh.mdx # Chinese version
└── {filename}.mdx # English version
Quality Checklist
- Frontmatter complete and properly quoted
- Cover image path correct
- Figure image inserted at article end
- Scene image inserted at article end
- Date format: YYYY-MM-DD
- Chinese version preserves original content
- English version is complete translation
- All MDX syntax issues resolved
- No
{<or bare<symbols in content - All headings use standard Markdown (
##,###), NOT JSX tags (for TOC compatibility) - Tables render correctly
- Emoji preserved
- Contact info formatted correctly
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です