AgentSkillsCN

write-tech-article

从 Markdown 源文件中生成全面的中文科技博客文章。适用于用户希望“撰写技术文章”、“生成博客”、“整理文章”、“写文章”、“生成博客文章”,或将 Markdown 内容转化为结构化的博客格式时使用。支持同时输入多个 Markdown 文件。输出自然流畅的中文文字,避免 AI 风格的语言表达。

SKILL.md
--- frontmatter
name: write-tech-article
description: Generate comprehensive Chinese tech blog articles from markdown source files. Use when user wants to "写技术文章", "生成博客", "整理文章", "write article", "generate blog post" or transform markdown content into structured blog format. Accepts multiple markdown files as input. Outputs natural Chinese writing without AI-style language.

Write Tech Article Skill

This skill transforms markdown source files (containing articles, HN discussions, documentation) into comprehensive, naturally-written Chinese blog posts following a specific structure.

Core Capabilities

  • Accept multiple markdown files as input sources
  • Analyze content types via frontmatter metadata (type field)
  • Generate structured blog articles with frontmatter metadata
  • Produce natural Chinese writing without AI-style language
  • Support multiple article structures and templates
  • Save to user-specified locations

Input Requirements

Source files must be markdown format generated by the html-to-markdown skill with:

File Structure

After using html-to-markdown on aggregate-news output, you'll have:

code
[slug]/
  ├── origin.json          # Original structured data
  ├── post.md             # Hacker News: article content
  ├── comment.md          # Hacker News: HN discussion
  ├── product.md          # Product Hunt: product page
  └── hunt.md             # Product Hunt: PH launch page

Source File Combinations

Hacker News:

  • Use post.md (required) - original article content
  • Use comment.md (optional) - HN discussion for community insights

Product Hunt:

  • Use product.md (required) - official product page
  • Use hunt.md (optional) - PH launch page for community feedback

For file handling details, see SOURCE_HANDLING.md

Workflow

Step 1: Gather Input

Ask the user for:

  1. Source directory or markdown files (required):
    • Option A: Directory path containing origin.json and markdown files (e.g., moltbook/)
    • Option B: Individual markdown files from the directory
      • Hacker News: post.md (required), comment.md (optional)
      • Product Hunt: product.md (required), hunt.md (optional)
  2. Additional context (optional): Any specific angles or topics to emphasize

Note: Source files must be prepared using the html-to-markdown skill first. The skill expects the new file structure: [slug]/origin.json and source-specific markdown files.

Step 2: Load Preferences

Check for preferences in this order:

  1. {SKILL_ROOT}/PREFERENCE.md (project-level)
  2. ~/.copilot/skills/write-tech-article/PREFERENCE.md (user-level)
  3. If neither exists, prompt user and create {SKILL_ROOT}/PREFERENCE.md

Required preferences:

  • output_directory: Where to save generated articles (e.g., ~/articles/published)
  • default_category: Default category tag (e.g., hacknews-daily)
  • author: Author name for metadata (optional)
  • language: Output language (default: zh-CN)
  • writing_style: Writing style/perspective (default: objective, options: objective, first-person)

See PREFERENCE_TEMPLATE.md for complete example.

Step 3: Read and Parse Source Files

Read all provided markdown files based on source type:

Hacker News:

  • Read post.md (required)
  • Read comment.md (optional)

Product Hunt:

  • Read product.md (required)
  • Read hunt.md (optional)

Parse frontmatter and extract markdown content from each file.

Step 4: Analyze and Structure

Analyze the markdown content from all source files:

  • Extract core topics and key insights
  • Identify technical details and examples
  • Gather community perspectives (if available)
  • Note real-world experiences and feedback

Apply article structure (see ARTICLE_STRUCTURE.md):

  1. Frontmatter (YAML metadata)
  2. Article summary (摘要)
  3. Background and problem (背景与问题)
  4. Core content analysis (核心内容解析)
  5. Deep analysis and reflection (深度分析与思考)
  6. Tech stack/tools (技术栈/工具清单)
  7. Related resources (相关资源)

Step 5: Generate Article

Critical: Writing Style Selection

Choose the appropriate writing style based on user preference or content type:

Objective Style (Default):

  • Use for formal, technical articles
  • Third-person perspective
  • Direct, clear statements without personal references
  • Follow WRITING_STYLE_OBJECTIVE.md

First-Person Style:

  • Use when user requests personal perspective
  • Include personal experiences and learning journey
  • Share mistakes and problem-solving process
  • Follow WRITING_STYLE_FIRST_PERSON.md

Ask the user which style they prefer if not specified in PREFERENCE.md.

Generation Process:

  1. Select appropriate writing style
  2. Extract key facts and technical details
  3. Organize into logical flow per ARTICLE_STRUCTURE.md
  4. Write each section with natural language
  5. Include code examples with proper formatting
  6. Add technical depth where relevant
  7. Cite sources and provide links

Step 6: Format and Save

  1. Generate filename from article title (slugified)
  2. Add YAML frontmatter with metadata:
    • title, date, tags, categories
    • description (50-200 words)
    • slug (URL-friendly identifier)
  3. Format markdown with proper headings, lists, code blocks
  4. Save to: {output_directory}/{YYYY-MM-DD}/{slug}.md

Example path: ~/articles/published/2026-01-30/claude-code-daily-benchmarks.md

Step 7: Verify and Report

  1. Verify file was created successfully
  2. Show user:
    • File location
    • Word count
    • Structure completeness checklist
  3. Ask if any revisions needed

Quality Checklist

Before finalizing, ensure the article has:

  • Clear, specific title (not generic)
  • Comprehensive 3-5 sentence summary
  • Well-defined problem/background section
  • At least 5-7 key insights
  • Technical examples or code where relevant
  • Practical application scenarios
  • Natural Chinese without AI clichés
  • Proper source attribution
  • Complete frontmatter metadata

Example Usage

Example 1: Hacker News Content (Directory Input)

code
User: 把 moltbook 这个文件夹里的内容整理成文章

Assistant Actions:
1. Check for PREFERENCE.md (finds user's output directory)
2. List directory contents:
   - origin.json (original structured data)
   - post.md (article content)
   - comment.md (HN discussion)
3. Read post.md: type=article, source=hacker_news
4. Read comment.md: type=hn_discussion, source=hacker_news
5. Apply SOURCE_HANDLING.md integration strategy:
   - Primary content (60-70%): Technical details from post.md
   - Enrichment (30-40%): Community insights from comment.md
6. Generate article with HN-specific sections
7. Apply WRITING_STYLE.md principles (natural Chinese)
8. Save to: `~/articles/published/2026-01-31/moltbook.md`
9. Report: "✓ Article generated: 4,200 words, saved to ~/articles/published/"

Example 2: Product Hunt Content (File Input)

code
User: 把 product.md 和 hunt.md 整理成一篇介绍文章

Assistant Actions:
1. Check for PREFERENCE.md (finds user's output directory)
2. Read product.md: type=product_page, source=product_hunt
3. Read hunt.md: type=product_hunt_page, source=product_hunt
4. Apply SOURCE_HANDLING.md integration strategy:
   - Primary: Product features from product.md
   - Enrichment: Community reception from hunt.md
5. Generate article with PH-specific sections
6. Include maker-community interaction insights
7. Save to: `~/articles/published/2026-01-31/new-ai-coding-tool.md`
8. Report: "✓ Product article generated: 3,800 words"

Example 3: Single File Without Discussion

code
User: 只有一个 post.md 文件,帮我写成文章

Assistant Actions:
1. Check for PREFERENCE.md
2. Read post.md: type=article, source=hacker_news
3. Note: No enrichment content available
4. Focus on deep analysis and critical evaluation
5. Add tech landscape context
6. Generate article with original insights
7. Save to: `~/articles/published/2026-01-31/article-title.md`
8. Report: "✓ Article generated: 3,500 words (single source)"

Important Notes

Writing Style is Critical

The most important aspect of this skill is producing natural Chinese writing in the appropriate style:

Objective Style (WRITING_STYLE_OBJECTIVE.md):

  • Direct, clear statements without personal references
  • Avoid AI-style clichés and formulaic phrases
  • Use concrete examples before abstract concepts
  • Vary sentence structure and length
  • Write as if explaining to a technical colleague

First-Person Style (WRITING_STYLE_FIRST_PERSON.md):

  • Share personal experiences and learning journey
  • Include problem-solving process and mistakes
  • Use conversational but professional tone
  • Balance personal narrative with technical accuracy

Source File Handling

When working with multiple source files:

  • Hacker News: Use post.md + comment.md (if available)
  • Product Hunt: Use product.md + hunt.md (if available)
  • Combine content from all files following ARTICLE_STRUCTURE.md
  • Attribute community perspectives clearly

For file combinations, see SOURCE_HANDLING.md

Content Quality

Generate comprehensive articles (3500-5500 words) with:

  • Original analysis, not just summarization
  • Technical depth with code examples
  • Practical applications and use cases
  • Critical perspective (pros AND cons)
  • Proper source attribution

Metadata Accuracy

Ensure frontmatter is accurate:

  • date: Use current date (YYYY-MM-DD)
  • title: Specific, not generic (15-25 Chinese chars)
  • tags: 5-8 relevant technical tags
  • description: Compelling 50-200 word summary
  • slug: URL-friendly identifier
  • categories: From user preferences

Troubleshooting

Issue: Can't find PREFERENCE.md Solution: Prompt user for output_directory and create file

Issue: Source files missing frontmatter Solution: Prompt user to use html-to-markdown skill first or manually add frontmatter

Issue: Content is too short Solution: Expand analysis sections, add more examples, include community insights

Issue: Writing sounds too "AI-like" Solution: Review appropriate writing style guide (WRITING_STYLE_OBJECTIVE.md or WRITING_STYLE_FIRST_PERSON.md), use more concrete examples, vary sentence structure

Issue: Missing technical details Solution: Re-read source files, extract code examples, add implementation specifics

Issue: Unclear which writing style to use Solution: Ask user for preference, check PREFERENCE.md for default style setting

Related Skills

  • html-to-markdown: Convert HTML sources to markdown before using this skill (required preprocessing)
  • aggregate-news: For collecting source material from HN/PH
  • post-to-blogs: For publishing generated articles
  • google-official-seo-guide: For optimizing article SEO