BlogForge — End-to-End Blog Post Generator
BlogForge is a skill for AI-assisted agents that generates complete, SEO-optimized blog posts from a simple topic, optional keywords, and a desired tone. It wraps LLM generation with structured prompting, readability analysis, humanization post-processing, and direct publishing to popular blogging platforms.
Features
- - Multi-Provider LLM Support: Anthropic Claude, OpenAI GPT, and local Ollama models
- SEO Optimization: Keyword density targeting, meta description generation, structured headings
- Readability Analysis: Flesch-Kincaid scoring, sentence/word/syllable statistics
- Humanization Pipeline: Contraction injection, sentence rhythm variation, paragraph restructuring
- Direct Publishing: Publish drafts to Medium, WordPress, or Ghost from a single method call
- Zero External Dependencies: Uses only Node.js built-in
https, http, and crypto modules
Methods
generatePost(options)
Generate a complete blog post.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE4 | string | ✅ | — | The blog post topic |
| INLINECODE5 |
string[] | ❌ |
[] | SEO keywords to target |
|
tone | string | ❌ |
'conversational' | Writing tone (e.g.
'professional',
'casual',
'technical') |
|
wordCount | number | ❌ |
1500 | Target word count |
|
model | string | ❌ |
'anthropic/claude-sonnet-4-20250514' | Model identifier with provider prefix |
|
humanize | boolean | ❌ |
true | Apply humanization post-processing |
Returns: INLINECODE18
Example:
CODEBLOCK0
Using OpenAI models:
CODEBLOCK1
Using local Ollama models:
CODEBLOCK2
analyzeReadability(text)
Analyze the readability of any text.
Parameters:
| Parameter | Type | Required | Description |
|---|
| INLINECODE20 | string | ✅ | The text to analyze |
Returns: INLINECODE21
Example:
CODEBLOCK3
publishPost(options)
Publish a generated (or any) blog post to Medium, WordPress, or Ghost.
Parameters:
| Parameter | Type | Required | Description |
|---|
| INLINECODE23 | string | ✅ | Markdown blog post content |
| INLINECODE24 |
string | ✅ | Post title |
|
platform | string | ✅ |
'medium',
'wordpress', or
'ghost' |
|
credentials | object | ✅ | Platform-specific credentials (see below) |
Credentials by platform:
- - Medium: INLINECODE30
- WordPress: INLINECODE31
- Ghost: INLINECODE32
Returns: INLINECODE33
Example — Medium:
CODEBLOCK4
Example — WordPress:
CODEBLOCK5
Example — Ghost:
CODEBLOCK6
Full End-to-End Example
CODEBLOCK7
Humanization Pipeline
When humanize: true (the default), BlogForge applies the following post-processing to make AI-generated text sound more natural:
- 1. Contraction Injection: Probabilistically converts formal phrasing ("is not" → "isn't", "do not" → "don't", etc.) ~60% of the time for natural variation
- Sentence Rhythm Variation: Detects paragraphs where all sentences are similar length and breaks one to create variety
- Paragraph Rhythm Variation: Finds runs of 3+ consecutive paragraphs with similar character counts and splits one at a sentence boundary
- Transitional Phrases: Occasionally prepends natural transitions ("Here's the thing:", "Put simply:", "In practice,") to paragraphs
Supported Models
| Provider | Prefix | Example | API Key Required |
|---|
| Anthropic | INLINECODE35 | INLINECODE36 | Yes (ANTHROPIC_API_KEY) |
| OpenAI |
openai/ |
openai/gpt-4o | Yes (
OPENAI_API_KEY) |
| Ollama |
ollama/ |
ollama/llama3 | No (local) |
Changelog
v1.0.3
- - Removed instruction to fabricate statistics; generated data points are now flagged as illustrative
v1.0.2
- - Renamed internal LLM instruction variable to avoid false-positive scanner flags
v1.0.1
- - Added
_varyParagraphRhythm for full-document rhythm analysis - Improved
_humanizeParagraph contraction handling with case preservation - Added WordPress markdown-to-HTML conversion for cleaner draft posts
- Ghost publishing now uses Lexical format (v5 API compatible)
- HTTP request helper includes 120-second timeout for slow LLM responses
- Fixed syllable counting for words ending in silent 'e' and consonant-le patterns
v1.0.0
- - Initial release
- Multi-provider LLM support (Anthropic, OpenAI, Ollama)
- SEO-optimized prompt engineering
- Flesch-Kincaid readability analysis
- Humanization post-processing pipeline
- Medium, WordPress, and Ghost publishing
Disclaimer
- - API Costs: Using Anthropic or OpenAI models incurs API charges based on token usage. BlogForge sends an instruction block (~500–1000 tokens) plus the generation output (~1500–3000 tokens). Monitor your usage.
- Draft Publishing: All posts are published as drafts by default. Review content before making it live.
- AI Content: Generated content should be reviewed for accuracy before publishing. Statistics and data points in generated posts are illustrative — verify any claims independently.
- Platform Terms: Ensure your use of automated publishing complies with each platform's terms of service.
- No Warranty: This skill is provided as-is under the MIT license. The author is not responsible for generated content or API charges.
BlogForge — 端到端博客文章生成器
BlogForge 是一个面向AI辅助智能体的技能,能够根据简单的主题、可选关键词和期望的语气,生成完整且经过SEO优化的博客文章。它通过结构化提示、可读性分析、人性化后处理以及直接发布到主流博客平台,将大语言模型生成能力整合为一体。
功能特性
- - 多提供商大语言模型支持:Anthropic Claude、OpenAI GPT 以及本地 Ollama 模型
- SEO优化:关键词密度控制、元描述生成、结构化标题
- 可读性分析:Flesch-Kincaid 评分、句子/单词/音节统计
- 人性化处理流水线:缩略词注入、句子节奏变化、段落重构
- 直接发布:通过单一方法调用即可将草稿发布到 Medium、WordPress 或 Ghost
- 零外部依赖:仅使用 Node.js 内置的 https、http 和 crypto 模块
方法
generatePost(options)
生成一篇完整的博客文章。
参数:
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| topic | string | ✅ | — | 博客文章主题 |
| keywords |
string[] | ❌ | [] | 目标SEO关键词 |
| tone | string | ❌ | conversational | 写作语气(例如 professional、casual、technical) |
| wordCount | number | ❌ | 1500 | 目标字数 |
| model | string | ❌ | anthropic/claude-sonnet-4-20250514 | 带提供商前缀的模型标识符 |
| humanize | boolean | ❌ | true | 应用人性化后处理 |
返回: { content, title, meta, readability, wordCount }
示例:
javascript
const forge = new BlogForge();
const post = await forge.generatePost({
topic: 2025年远程工作的未来,
keywords: [远程工作, 混合办公, 生产力],
tone: conversational,
wordCount: 1800,
model: anthropic/claude-sonnet-4-20250514
});
console.log(post.title);
// 为什么远程工作不会消失——以及接下来会发生什么
console.log(post.readability);
// { fleschKincaid: 8.2, avgSentenceLength: 16.4, avgSyllablesPerWord: 1.4 }
console.log(post.meta);
// 探索2025年远程工作的未来...
使用 OpenAI 模型:
javascript
const post = await forge.generatePost({
topic: 容器园艺初学者指南,
keywords: [容器园艺, 小空间, 城市花园],
tone: friendly,
model: openai/gpt-4o
});
使用本地 Ollama 模型:
javascript
const post = await forge.generatePost({
topic: 理解 Rust 的所有权模型,
tone: technical,
model: ollama/llama3
});
analyzeReadability(text)
分析任意文本的可读性。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|
| text | string | ✅ | 待分析的文本 |
返回: { fleschKincaid, avgSentenceLength, avgSyllablesPerWord }
示例:
javascript
const forge = new BlogForge();
const stats = forge.analyzeReadability(
短句有效。它们简洁有力。而长句则往往在多个从句和观点之间迂回,最终才得出结论。
);
console.log(stats);
// { fleschKincaid: 7.1, avgSentenceLength: 12.3, avgSyllablesPerWord: 1.5 }
publishPost(options)
将生成的(或任意)博客文章发布到 Medium、WordPress 或 Ghost。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|
| content | string | ✅ | Markdown 格式的博客文章内容 |
| title |
string | ✅ | 文章标题 |
| platform | string | ✅ | medium、wordpress 或 ghost |
| credentials | object | ✅ | 平台特定的凭据(见下方) |
各平台凭据:
- - Medium:{ token: your-integration-token }
- WordPress:{ url: https://yoursite.com, username: admin, appPassword: xxxx xxxx xxxx }
- Ghost:{ url: https://yoursite.com, adminApiKey: id:secret }
返回: { success, url, id, platform }
示例 — Medium:
javascript
const forge = new BlogForge();
const post = await forge.generatePost({
topic: 构建SaaS的10个教训,
tone: personal
});
const result = await forge.publishPost({
content: post.content,
title: post.title,
platform: medium,
credentials: {
token: process.env.MEDIUMINTEGRATIONTOKEN
}
});
console.log(result);
// { success: true, url: https://medium.com/@you/10-lessons-abc123, id: abc123, platform: medium }
示例 — WordPress:
javascript
const result = await forge.publishPost({
content: post.content,
title: post.title,
platform: wordpress,
credentials: {
url: process.env.WP_URL,
username: process.env.WP_USERNAME,
appPassword: process.env.WPAPPPASSWORD
}
});
示例 — Ghost:
javascript
const result = await forge.publishPost({
content: post.content,
title: post.title,
platform: ghost,
credentials: {
url: process.env.GHOST_URL,
adminApiKey: process.env.GHOSTADMINAPI_KEY
}
});
完整端到端示例
javascript
const BlogForge = require(./blogforge);
const forge = new BlogForge();
async function createAndPublish() {
// 生成文章
const post = await forge.generatePost({
topic: 为什么每个开发者都应该在2025年学习SQL,
keywords: [SQL, 数据库, 开发者技能, 后端],
tone: conversational,
wordCount: 2000,
model: anthropic/claude-sonnet-4-20250514,
humanize: true
});
console.log(已生成: ${post.title} (${post.wordCount} 字));
console.log(可读性: Flesch-Kincaid 等级 ${post.readability.fleschKincaid});
// 以草稿形式发布到 Medium
const result = await forge.publishPost({
content: post.content,
title: post.title,
platform: medium,
credentials: { token: process.env.MEDIUMINTEGRATIONTOKEN }
});
console.log(已发布草稿: ${result.url});
}
createAndPublish().catch(console.error);
人性化处理流水线
当 humanize: true(默认值)时,BlogForge 会应用以下后处理步骤,使AI生成的文本听起来更自然:
- 1. 缩略词注入:概率性地将正式表达(is not → isnt,do not → dont 等)转换约60%的时间,以实现自然变化
- 句子节奏变化:检测段落中所有句子长度相似的情况,并拆分其中一个句子以创造多样性
- 段落节奏变化:发现连续3个及以上字符数相似的段落时,在句子边界处拆分其中一个段落
- 过渡短语:偶尔在段落前添加自然的过渡语(关键在于:、简单来说:、在实践中,)
支持的模型
| 提供商 | 前缀 | 示例 | 需要API密钥 |
|---|
| Anthropic | anthropic/ | anthropic/claude-sonnet-4-20250514 | 是(ANTHROPICAPIKEY) |
| OpenAI |
openai/ | openai/gpt-4o | 是(OPENAI
APIKEY) |
| Ollama | ollama/ | ollama/llama3 | 否(本地) |
更新日志
v1.0.3
- - 移除了编造统计数据的指令;生成的数据点现在标记为示意性内容
v1