DEV Community

weiwuji
weiwuji

Posted on

The One-Person Editorial Department: An Automated Content Factory for Solo Builders

The One-Person Editorial Department: An Automated Content Factory for Solo Builders

The Pain — You registered your platform account, published three articles, and then went silent for two months. It isn't a willpower problem. Content production is a hard requirement for any OPC (one-person company) founder, but one person's energy is finite: daytime goes to writing code, evenings go to client calls, weekends go to product iteration. Where is the time for consistent output? And without output there is no traffic, without traffic there are no customers, and without customers there is no revenue — the death loop every solo founder has stepped into.

What You'll Learn:

  • The 4-layer architecture of an automated content factory: topic planning → content generation → review & publish → data feedback
  • Runnable Python for every layer — a topic collector, an AI topic scorer, a multi-Agent generation pipeline, a quality gate, and a feedback loop
  • Why multi-Agent collaboration beats a single giant prompt
  • Why physical quality gates and closed data loops are the difference between automation and gambling

In the previous article of this series — The Complete Architecture of a One-Person Company: the 4-Layer Design of the OPC Automation OS — I laid out the core challenge: once you design a 4-layer operating system for your one-person company, how do you actually implement its content layer? Today I'm going to open that layer up and show you exactly what's inside.

I walked this road myself. I kept producing for a while, then the energy ran out — until I built myself an automated content factory. It is not a replacement for my writing; it is my "AI editorial department." During the day I write core code; at night it drafts articles, suggests images, formats them, and gets them ready to publish. Everything below is runnable. Follow along and you can run an editorial department with one pair of hands.

1. The Overall Architecture: A 4-Layer Automated Content Pipeline

An automated content factory is not a "click a button and get an article" magic tool. It is a complete pipeline covering the whole chain, from topic selection to publishing to the data loop that feeds back into selection.

Before you build anything, see the whole structure first:

┌─────────────────────────────────────┐
│ Layer 1 · Topic Planning            │
│ RSS + API collection                │
│ AI scoring -> ranked queue          │
└──────────────────┬──────────────────┘
                   ▼                   
┌─────────────────────────────────────┐
│ Layer 2 · Content Generation        │
│ Multi-Agent in parallel             │
│ Outline -> Writing -> Review        │
└──────────────────┬──────────────────┘
                   ▼                   
┌─────────────────────────────────────┐
│ Layer 3 · Review & Publish          │
│ Quality gate (hard checks)          │
│ Draft box + scheduled push          │
└──────────────────┬──────────────────┘
                   ▼                   
┌─────────────────────────────────────┐
│ Layer 4 · Data Feedback             │
│ Reads / shares / completion         │
│ Topic strategy tuning (loop)        │
└─────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

The pipeline has 4 layers:

Layer Function Key Components
1 Topic planning RSS collection + AI topic scoring + queue management
2 Content generation Parallel multi-Agents (outline / writing / images / review)
3 Review & publish Quality gating + draft-box management + scheduled push
4 Data feedback Read analytics → topic-strategy adjustment → closed loop

The automated content factory: 4 layers, one closed loop — topic planning → content generation → review & publish → data feedback
The automated content factory: 4 layers, one closed loop — topic planning → content generation → review & publish → data feedback

This is not a theoretical architecture — every piece of code below is the prototype implementation of this pipeline.

2. Layer 1: Automated Topic Planning — Let AI Watch the Trends for You

For most people, the content struggle starts at topic selection. Spending 30 minutes a day scrolling trending lists, reading competitors, racking your brain — that is the most efficient way to waste energy.

The core idea of automated topic planning: let machines do the information gathering, let humans make the decisions.

2.1 Build the Topic Collector

Start with a simple Python script that collects industry hot topics from RSS feeds and APIs:

# topic_collector.py — collect candidate topics from RSS feeds and APIs
import feedparser
import json
import requests
from datetime import datetime, timedelta


class TopicCollector:
    """Collect hot topics from multiple sources"""

    def __init__(self, config: dict):
        self.sources = config.get("rss_sources", [])
        self.api_endpoints = config.get("api_endpoints", [])

    def collect_from_rss(self) -> list[dict]:
        topics = []
        for url in self.sources:
            feed = feedparser.parse(url)
            for entry in feed.entries[:5]:
                topics.append({
                    "title": entry.title,
                    "source": url,
                    "published": entry.get("published", ""),
                    "collected_at": datetime.now().isoformat(),
                })
        return topics

    def collect_from_apis(self) -> list[dict]:
        topics = []
        for ep in self.api_endpoints:
            try:
                resp = requests.get(ep, timeout=10)
                data = resp.json()
                # assume the API returns {items: [{title, url, ...}]}
                for item in data.get("items", [])[:5]:
                    topics.append({
                        "title": item["title"],
                        "source": ep,
                        "collected_at": datetime.now().isoformat(),
                    })
            except Exception as e:
                print(f"collect error [{ep}]: {e}")
        return topics

    def collect_all(self) -> list[dict]:
        raw = self.collect_from_rss() + self.collect_from_apis()
        # deduplicate by title prefix
        seen = set()
        unique = []
        for t in raw:
            key = t["title"][:30]
            if key not in seen:
                seen.add(key)
                unique.append(t)
        return unique
Enter fullscreen mode Exit fullscreen mode

Under 50 lines, and it covers both RSS and API sources. You only need to configure the RSS feeds relevant to your industry (for example, tech media and open-source community feeds), and it will automatically grab the day's hot topics.

2.2 AI Topic Scoring

Raw topics are too many — you need AI to filter for the ones worth writing about. Here we call the LLM API to score each topic:

# topic_scorer.py — score candidate topics with AI
import json
from openai import OpenAI


class TopicScorer:
    """Use AI to evaluate topic quality against a fixed set of criteria"""

    CRITERIA = [
        "与目标受众的相关度(0-10)",
        "技术爆点的强度(0-10)",
        "可操作的保姆级程度(0-10)",
        "竞品覆盖度(低=机会大,0-10反向)",
    ]

    def __init__(self, api_key: str, model: str = "gpt-4o-mini"):
        self.client = OpenAI(api_key=api_key)
        self.model = model

    def score_topic(self, topic: dict) -> dict:
        prompt = f"""你是OPC科技媒体的选题编辑。 请对以下选题评分(每项0-10),并给出简短理由。  选题: {topic['title']} 来源: {topic['source']}  评分维度: {chr(10).join(f'- {c}' for c in self.CRITERIA)}  输出格式: JSON {{"scores": {{"relevance": 8, "tech_punch": 7, ...}}, "reason": "..."}}"""

        resp = self.client.chat.completions.create(
            model=self.model,
            messages=[{"role": "user", "content": prompt}],
            response_format={"type": "json_object"},
        )
        result = json.loads(resp.choices[0].message.content)
        result["total"] = sum(result.get("scores", {}).values())
        result["topic"] = topic
        return result

    def rank_topics(self, topics: list[dict], top_n: int = 5) -> list[dict]:
        scored = [self.score_topic(t) for t in topics]
        scored.sort(key=lambda x: x["total"], reverse=True)
        return scored[:top_n]
Enter fullscreen mode Exit fullscreen mode

The key insight is not the scoring itself — it's using machines to replace the time you spend scrolling feeds every day. Run this script once each morning, and five minutes of browsing the top 5 topics is all you need.

3. Layer 2: Multi-Agent Parallel Generation — From Topic to Draft, Fully Automatic

Once a topic is collected and confirmed (you do the confirming), the next step is letting AI generate the article. This is not about throwing one prompt at the LLM — it's about decomposing the job into multiple collaborating Agents:

Multi-Agent generation flow: outline Agent → writing Agent → review Agent, with an issues loop back to rewriting
Multi-Agent generation flow: outline Agent → writing Agent → review Agent, with an issues loop back to rewriting

3.1 The Article Generation Pipeline

# content_pipeline.py — multi-Agent content generation pipeline
import json, time
from openai import OpenAI


class ContentPipeline:
    """Multi-Agent collaboration: outline Agent -> writing Agent -> review Agent"""

    def __init__(self, client: OpenAI):
        self.client = client

    def outline_agent(self, topic: str, style: str = "保姆级教程") -> str:
        """Generate the article outline"""
        prompt = f"""为主题「{topic}」生成一篇{style}文章的大纲。 要求: - 开篇200字抓人:一个反常识场景/数据/坑 - 正文分3-4个步骤,每步骤有代码示例 - 结尾240字总结+行动号召 - 字数目标3000字左右  输出格式: Markdown 大纲,每节标注字数目标"""

        resp = self.client.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": prompt}],
        )
        return resp.choices[0].message.content

    def writing_agent(self, outline: str, topic: str) -> str:
        """Write the full article from the outline"""
        prompt = f"""你是一位科技OPC博主,根据以下大纲为主题「{topic}」写一篇完整文章。  要求: - 每一节代码必须可运行,有完整的import和调用示例 - 用真实的技术框架(Python/FastAPI/Next.js等) - 每段话都要让读者「看完就能用」 - 全文2500-4000字  大纲: {outline}  注意:这是个人实战经验分享,不是学术论文。用第一人称但不要编造数据。"""

        resp = self.client.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": prompt}],
            max_tokens=4000,
        )
        return resp.choices[0].message.content

    def review_agent(self, article: str) -> list[str]:
        """Check the article for quality issues"""
        prompt = f"""请审查以下文章,找出所有可能的问题。 只输出问题列表,不要修改原文。  检查维度: 1. 代码是否可以独立运行(import是否完整) 2. 是否有模糊表述(「随意修改」「临时决定」等) 3. 是否有杜撰数据(「每天发布XX篇」「月赚XX」等) 4. 是否有占位符(「未完成任务」「待办标记」等) 5. 下一页预告是否清晰  文章: {article[:3000]}  输出格式: 每行一个「❌ 问题描述」或「✅ 通过」"""

        resp = self.client.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": prompt}],
        )
        issues = resp.choices[0].message.content
        return [l.strip() for l in issues.split("\n") if l.strip()]

    def generate(self, topic: str) -> dict:
        """Run the full pipeline end to end"""
        print(f"📋 生成大纲: {topic}")
        outline = self.outline_agent(topic)

        print(f"📝 撰写正文: {topic}")
        article = self.writing_agent(outline, topic)

        print(f"🔍 审核文章: {topic}")
        issues = self.review_agent(article)

        return {"topic": topic, "outline": outline, "article": article, "issues": issues}
Enter fullscreen mode Exit fullscreen mode

Look at the execution flow — three Agents relay the work: outline first, then the body, then a self-review. Each step has a single, independent responsibility. This is the essence of "Agent decomposition" in Loop Engineering.

3.2 Running the Pipeline

pip install openai feedparser requests
Enter fullscreen mode Exit fullscreen mode
# generate a draft (requires OPENAI_API_KEY to be set first)
import os
from openai import OpenAI
from content_pipeline import ContentPipeline

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
pipeline = ContentPipeline(client)
result = pipeline.generate("自动化内容工厂搭建")
print(result["article"][:200])
print(f"\n发现 {len([i for i in result['issues'] if '' in i])} 个问题")
Enter fullscreen mode Exit fullscreen mode

This is my daily routine: run collection and scoring in the morning, pick the topic, let the pipeline produce a first draft, then spend 30 minutes at noon rewriting it in my own voice. Output efficiency went up 4×.

4. Layer 3: Quality Gating and Automated Publishing

What is the scariest thing about automated generation? Nobody is minding the gate, and the quality of what goes out spirals out of control. You need a physical gate.

4.1 The Quality Verification Script

Quality-gate decision flow: only articles that pass every check reach the draft box
Quality-gate decision flow: only articles that pass every check reach the draft box

# auto_quality_gate.py — automated quality gate before publishing
import re, json, sys
from pathlib import Path


class QualityGate:
    """Run automated checks before publishing; block the publish if any check fails"""

    def __init__(self, article_path: str):
        self.content = Path(article_path).read_text()
        self.errors = []

    def check_length(self):
        body = re.sub(r'^---.*?---\s*', '', self.content, flags=re.DOTALL)  # strip frontmatter
        text = re.sub(r'!\[.*?\]\(.*?\)', '', body, flags=re.DOTALL)        # strip image embeds
        clean = re.sub(r'[#>*\[\]()|\s]', '', text)                         # strip markdown symbols
        count = len(clean)
        if count < 2500:
            self.errors.append(f"字数不足: {count}字 < 2500")
        elif count > 9000:
            self.errors.append(f"字数超限: {count}字 > 9000")

    def check_code_blocks(self):
        fence = chr(96) * 3  # triple-backtick fence
        blocks = re.findall(rf"^{fence}", self.content, re.MULTILINE)
        count = len(blocks) // 2
        if count < 2:
            self.errors.append(f"代码块不足: {count}个 < 2")

    def check_no_placeholders(self):
        patterns = ['未完成', '待办标记', '待填充', '以后填充']
        for p in patterns:
            if p in self.content:
                self.errors.append(f"存在占位符: {p}")

    def check_bash_commands(self):
        count = len(re.findall(r'^(bash|sh|shell|python)\b', self.content, re.MULTILINE))
        if count < 1:
            self.errors.append("缺少可运行命令块")

    def run_all(self):
        self.check_length()
        self.check_code_blocks()
        self.check_no_placeholders()
        self.check_bash_commands()
        return {
            "pass": len(self.errors) == 0,
            "errors": self.errors,
        }


# usage example
gate = QualityGate("article-16.md")
result = gate.run_all()
if result["pass"]:
    print("✅ 质量门控通过,可以发布")
else:
    print("❌ 质量问题:", result["errors"])
    sys.exit(1)
Enter fullscreen mode Exit fullscreen mode

4.2 One-Click Publishing to the Draft Box

Once quality passes, publish the article to the platform's draft box via the platform's official API:

# after the quality gate passes, publish via the platform's official API:
# upload to draft box -> review once in the backend -> schedule the push
Enter fullscreen mode Exit fullscreen mode

For an OPC founder this step matters a lot: publishing is itself a pipeline stage. Manually copying into the backend editor, uploading a cover image, filling in the summary — that repetitive work costs 15 minutes every single time. Automated, you just check the draft once in the backend and click "send."

5. Layer 4: The Data Feedback Loop — Content That Keeps Getting Better

A one-way pipeline is just a tool; a closed-loop pipeline is a system.

The logic of the data feedback loop is simple: after every article is published, collect its performance data (reads, share rate, completion rate) and feed it back to the topic-selection stage, so the AI picks more popular topics next time.

Data feedback loop: every article's metrics tune the next round of topic selection
Data feedback loop: every article's metrics tune the next round of topic selection

# feedback_loop.py — data-driven topic optimization
import json
from datetime import datetime, timedelta


class FeedbackLoop:
    """Learn from reading data and optimize the topic strategy"""

    def __init__(self, history_file: str = "article_history.json"):
        self.history_file = history_file
        self.data = self._load()

    def _load(self) -> list:
        try:
            with open(self.history_file) as f:
                return json.load(f)
        except (FileNotFoundError, json.JSONDecodeError):
            return []

    def record_article(self, title: str, topic: str, publish_date: str):
        self.data.append({
            "title": title,
            "topic": topic,
            "publish_date": publish_date,
            "metrics": {},  # filled in after publishing
        })
        self._save()

    def update_metrics(self, title: str, metrics: dict):
        for article in self.data:
            if article["title"] == title:
                article["metrics"] = metrics
                break
        self._save()

    def get_best_topics(self, min_samples: int = 3) -> list[str]:
        """Return the topic directions with the highest average reads"""
        scored = []
        for article in self.data:
            m = article.get("metrics", {})
            reads = m.get("reads", 0)
            if reads > 0:
                scored.append((article["topic"], reads))

        # aggregate by topic prefix
        from collections import defaultdict
        topics = defaultdict(list)
        for topic, reads in scored:
            topics[topic[:10]].append(reads)

        avg = {k: sum(v) / len(v) for k, v in topics.items() if len(v) >= min_samples}
        return sorted(avg, key=avg.get, reverse=True)

    def _save(self):
        with open(self.history_file, "w") as f:
            json.dump(self.data, f, ensure_ascii=False, indent=2)
Enter fullscreen mode Exit fullscreen mode

Add this code to your publishing flow and a month later you'll see clearly: which topic directions perform best, and which should be dropped. That is OPC's "data-driven content strategy."

6. Going Further: 3 Design Principles for an Automated Content Factory

Principle 1: Human-AI Collaboration, Not Replacement

An automated content factory never chases 100% unmanned operation. My actual workflow:

  • AI does: information collection, first-draft generation, image suggestions, quality checks
  • Humans do: topic confirmation, voice adjustment, fact-checking, final publish

The division of labor is clear: machines handle volume, humans handle quality.

Principle 2: Gating Is the Bottom Line of Automation

The most dangerous thing about automation is not making mistakes — it's making mistakes that nobody notices. So every layer needs a physical gate:

  • Generation layer: the review Agent checks automatically
  • Publish layer: the quality-gate script blocks hard
  • Final gate: the publish script triggers the gate checks before anything goes out

Automation without gates is gambling.

Principle 3: Closed Loops Compound

One-way content production is linear — one article in, one article out. Closed-loop production is exponential — every article's data serves the next one. Three months in, your topic strategy will be more accurate than any human editor's gut feeling.

Practical Advice: Where to Start

If you only have two hands right now, don't try to build all 4 layers at once. Start with Layer 2 (the content generation pipeline) and get the "generate a first draft" stage working. Use the ContentPipeline code above to generate drafts for the articles you need to write this week. Once that runs, add Layer 1 (topic collection), and finally Layer 4 (the data feedback loop). Build step by step — every step produces something usable on its own.

7. Summary and What's Next

Today you saw the complete architecture of an automated content factory: topic collection → AI generation → quality gating → data feedback. The whole thing is under 200 lines of code, but its real value is building the infrastructure of a one-person editorial department.

Key takeaways:

  • 4-layer architecture: topics → generation → publish → feedback
  • Multi-Agent collaboration: decompose the writing process so each Agent focuses on one job
  • Physical gating: automation never means losing control; gates are the bottom line
  • Data closed loop: upgrade from linear production to compounding optimization

Next up: Customer Service as Code — an AI Agent that handles 95% of user inquiries automatically.

Content is flowing, traffic is arriving, and user inquiries are exploding. Next time we'll build a customer-service Agent that handles 95% of the repetitive inquiries for you, so your energy goes only to paying customers.

About the author: Wu Ji (无记) — AI & digitalization practitioner focused on Agent engineering, Loop Engineering, and digital transformation. Practical, hands-on tutorials — follow along and it just works.

Top comments (0)