The Content Scaling Problem

Every SaaS founder hears the same advice: "Start a blog for SEO." But writing 3-4 high-quality, SEO-optimized blog posts per week is a full-time job—one that most early-stage startups can't afford. AIKit's Auto-Blog-SEO plugin solves this by combining **LLM-powered content generation** with **Cloudflare Workers sandbox architecture** to produce publishable blog content automatically.

Architecture Overview

The Auto-Blog-SEO plugin runs inside EmDash's plugin sandbox—a V8 Isolate on Cloudflare Workers. Here's the flow:

```

[Cron Trigger] → [Plugin Sandbox] → [OpenRouter API] → [D1 Database] → [Live Blog]

```

The plugin registers a cron handler that fires on a configurable schedule (default: daily at 6 AM). When triggered:

1. **It checks the bulk queue** — a list of pre-defined topics stored in KV

2. **For each topic**, it constructs a structured prompt to the LLM (via OpenRouter)

3. **The LLM returns** a complete blog post with title, slug, body, excerpt, and SEO metadata

4. **The plugin validates** the output, converts it to Portable Text format

5. **It inserts** the post into the `ec_posts` table in D1

6. **The post goes live** instantly—no build step, no redeploy

The LLM Prompt Engineering

The secret sauce is the prompt structure. The plugin doesn't just ask "write a blog post." It uses a multi-stage prompt:

Stage 1: Topic & Keyword Analysis

The plugin takes a raw topic and enriches it with:

- Target keyword frequency analysis

- Competitor headline patterns (extracted from the last 10 published posts)

- Category assignment (Tutorials, Growth, Product Updates, Case Studies)

Stage 2: Structured Content Generation

The actual generation prompt includes:

```json

{

"task": "write_seo_blog_post",

"topic": "{user_topic}",

"tone": "technical but accessible",

"target_audience": "developers and technical founders",

"min_words": 1000,

"require_headings": true,

"require_code_blocks": true,

"output_format": "markdown"

}

```

Stage 3: SEO Metadata Extraction

After generating the body, the plugin asks the LLM to:

- Generate an SEO title (50-60 chars)

- Write a meta description (150-160 chars)

- Suggest 3-5 tags

- Recommend an excerpt (1-2 sentences)

The Hybrid Dev+Marketing Advantage

Here's what makes the Auto-Blog-SEO plugin uniquely effective—it blurs the line between **development** and **marketing**:

**From the developer side:** The plugin is built entirely in ES5 (EmDash sandbox constraint) using the same patterns as any other EmDash plugin. It hooks into `cron:schedule`, `storage:kv`, and `network:fetch` capabilities. The sandbox architecture means zero security worries—no SQL injection risk, no unauthorized access.

**From the marketing side:** The plugin generates real, publishable content. Not thin AI slop—properly structured articles with headings, code blocks, tables, and actionable advice. The monthly limit of 10 bulk-generated posts ensures quality over quantity.

Monthly Bulk Queue System

The plugin has a smart rate-limiting system:

- **10 posts per month** from the bulk auto-generator

- **Unlimited** manually triggered posts via the admin UI

- **Smart scheduling**: posts can be scheduled for future publication

- **Reset logic**: the counter resets at month rollover (checked via simple date comparison)

This prevents content spam while ensuring consistent output. The 10-post limit forces careful topic selection—each post needs to count.

Performance & Cost

Because everything runs on Cloudflare Workers:

- **Zero cold starts** for the cron trigger (Workers are always warm for cron)

- **D1 read-after-write** is eventually consistent, but the blog page queries the same D1 database—posts appear within seconds

- **Cost**: roughly $0.30-0.50 per generated post in LLM API costs (OpenRouter, GPT-4o mini)

- **No server to maintain**: no WordPress, no VPS, no database admin

Real World Results

Since deploying the Auto-Blog-SEO plugin on AIKit:

- **98 published posts** in under 6 weeks

- **Blog grows by 3-4 posts per week** automatically

- **Sitemap auto-updates** — the dynamic sitemap endpoint queries D1 directly (no redeploy needed)

- **Related Posts** section auto-links content by keyword overlap

- **Reading time** and **Table of Contents** are generated from content structure

The blog went from zero to nearly 100 posts without any manual writing effort. That's the Hybrid Dev+Marketing model in action.

Key Takeaways

| Aspect | Impact |

|--------|--------|

| Development cost | ~2 days to build the plugin |

| Content output | 10-15 posts/month automated |

| Cost per post | ~$0.40 in LLM API fees |

| Maintenance | Zero (serverless) |

| SEO benefit | Growing domain authority with fresh content |

The Auto-Blog-SEO plugin proves that the best marketing tools are the ones you build yourself. By treating content generation as an engineering problem—pipelines, rate limits, validation, structured output—AIKit achieves what most startups need a full-time content marketer to do.