Skip to content

SEO Machine Explained: The B2B SaaS Content Pipeline

Inside TheCraigHewitt/seomachine: how 7,400+ stars Claude Code workspace turns GSC telemetry and context files into revenue-generating B2B SaaS articles.

Hoang Yell
Hoang Yell
13 min read
Tiếng Việt
SEO Machine Explained: The B2B SaaS Content Pipeline

In the modern agentic era, software engineers often fall into a predictable trap: spending months building distributed architectures, only to launch to an empty room. Code without distribution is a digital ghost town.

When technical founders attempt to bridge the gap with AI-assisted blogging, the outcome is usually disappointing. They prompt a language model to “write an article about database replication,” receiving a wall of generic text that fails to mention their product’s unique value, ignores customer pain points, and ranks nowhere on search engines.

The problem is not the model’s vocabulary; it is the total absence of business telemetry and product context. An isolated model knows nothing about your product features, your high-intent search keywords, or your customer conversion paths.

Enter TheCraigHewitt/seomachine: a specialized Claude Code workspace created by Craig Hewitt (founder of Castos podcast hosting). With over 7,400 GitHub stars, this open-source framework transforms Claude Code into a revenue-driven content engine that unifies Google Search Console metrics, DataForSEO intelligence, modular business context, and automated WordPress publishing.

TL;DR

Quick Answer Box (Google Search Featured Snippet):

  • What is SEO Machine? SEO Machine (TheCraigHewitt/seomachine) is an open-source Claude Code workspace designed for B2B SaaS teams to research, draft, analyze, and publish high-converting, long-form technical content.
  • Why it matters: It solves the generic AI writing problem by injecting structured business context (brand-voice.md, features.md, internal-links-map.md) and connecting directly to real-time search telemetry (Google Search Console, Google Analytics 4, DataForSEO).
  • Core Architecture: Slash command orchestration (/research, /write, /cluster, /publish-draft), post-writing agent swarm (SEO Optimizer, Meta Creator, Internal Linker, Keyword Mapper), and an 8-factor Opportunity Scorer.
  • Official Repository: TheCraigHewitt/seomachine on GitHub · MIT License · 7,430+ Stars.

Repository: TheCraigHewitt/seomachine

Before exploring the Python analysis modules, observe how raw AI blogging operates in isolation. The diagram below illustrates the disconnect: prompt-based generation lacks product grounding and search telemetry, producing vanity content that never converts.

The next diagram reveals the telemetry-driven pipeline built by seomachine: business context cartridges and live search data feed the drafting loop, followed by an automated agent swarm that refines metadata, internal links, and publishing targets.

Remember this fundamental difference: raw prompting treats LLMs as creative novelists; seomachine treats LLMs as precision copywriters bounded by business telemetry.


Beginner Map: Vanity Traffic vs. BOFU Revenue Content

To understand why seomachine structures its workflow around bottom-of-the-funnel intent, map content generation into four distinct quadrants:

  1. Top-of-Funnel (TOFU) Vanity: Broad queries (“What is a podcast?”) that generate millions of impressions but virtually zero product signups.
  2. Bottom-of-the-Funnel (BOFU) Intent: High-intent comparative queries (“Castos vs Libsyn pricing”, “private podcast hosting for corporate teams”) that attract buyers ready to swipe credit cards.
  3. The Context Injection Layer: A structured directory of Markdown files telling the agent exactly what features exist, which pages to link internally, and what tone of voice to maintain.
  4. The Post-Draft Swarm: Automated review agents auditing keyword density, generating three meta title variants, and enforcing call-to-action placement before publication.

First Practical Exercise

Take five minutes to review your latest three blog articles. Draw four columns: Target Keyword, Product Feature Mentioned, Internal Link Target, and Concrete Call to Action. If your posts discuss high-level concepts without ever connecting them to your software’s features or pricing page, your content is leaking revenue every day.

Part 1: Foundations - the mental model

The foundational philosophy behind seomachine reflects Craig Hewitt’s background as a SaaS operator: content is an organic sales representative that never sleeps.

Most engineering teams approach SEO backwards. They pick broad keywords with high search volume, write a summary, and wonder why 50,000 monthly visitors generate three free trial signups. seomachine grounds every post in two core architectural concepts:

1. The Context Cartridge Architecture

Rather than relying on fine-tuning or ephemeral chat history, seomachine stores company knowledge in modular Markdown files inside the context/ directory:

  • brand-voice.md: Tone, audience profile, and messaging pillars.
  • features.md: Comprehensive product feature lists, use cases, and differentiation points.
  • internal-links-map.md: Canonical URLs and exact anchor text mappings for core product pages.
  • competitor-analysis.md: Known competitor weaknesses and feature comparison grids.
  • target-keywords.md: Seed keywords mapped to search volume and commercial intent.
  • cro-best-practices.md: Conversion rate optimization guidelines and button placements.

When a command like /write executes, Claude Code inspects this directory and automatically grounds its draft in these real-world constraints. The generated copy doesn’t say “use good hosting”; it specifically explains how your product’s automatic transcriptions save creators three hours per episode.

2. Answer-First Search Architecture

Search answer engines (Google AI Overviews, Perplexity, ChatGPT Search) scan the first 150 words of a page to extract direct answers. seomachine enforces an Answer-First opening followed by the APP formula:

  • Agree: Validate an existing frustration the reader experiences.
  • Promise: Clearly state what actionable solution the article delivers.
  • Preview: Provide a scannable outline before diving into technical depth.

Directly below the introduction, the system injects a structured Key Takeaways block (3 to 5 bullet points with concrete metrics), ensuring AI citation engines can parse the core findings without hallucination.

Part 2: The Investigation - what actually happens?

When you run /write "private podcast hosting for enterprises", seomachine coordinates a multi-stage assembly line combining Python analytics and specialized Claude Code subagents.

Phase 1: Research and Opportunity Scoring

Before drafting, the research pipeline analyzes competitive viability. The Python script data_sources/modules/opportunity_scorer.py evaluates keywords across eight weighted factors:

# Opportunity Scoring Weights in seomachine
SCORING_WEIGHTS = {
    'volume_score': 0.25,      # Search demand and monthly volume
    'position_score': 0.20,    # Distance from target page 1 ranking
    'intent_score': 0.20,      # Commercial and transactional value
    'competition_score': 0.15, # Domain authority and SERP difficulty
    'cluster_score': 0.10,     # Topic cluster relevance and support
    'ctr_score': 0.05,         # Expected click-through potential
    'freshness_score': 0.05,   # Content decay status
    'trend_score': 0.05        # Historical velocity (rising vs falling)
}

The script categorizes target keywords into actionable buckets:

  • QUICK_WIN: Keywords currently ranking on positions 11 to 20 that can reach page 1 with minor optimization.
  • UNDERPERFORMER: Articles ranking on page 1 with click-through rates below the industry expected baseline (e.g. position 1 expected CTR of 31.6%).
  • NEW_CONTENT: Untapped competitor gaps where search intent is high but your domain has zero footprint.

Phase 2: Long-Form Drafting with Embedded Mini-Stories

The writer agent produces an extensive draft (2,000 to 3,000+ words) following strict structural constraints:

  • Mini-Stories (2 to 3 per article): Human readers retain information 22 times better when framed as narrative. Every article includes concrete mini-scenarios featuring named characters, specific metrics, and real business outcomes.
  • Contextual CTAs (2 to 3 per article): Instead of a lonely button at the bottom of the page, the system places a soft CTA after the first value delivery section, a medium CTA after the competitive comparison, and a strong conversion CTA at the conclusion.

Phase 3: The 4-Agent Optimization Swarm

Once the draft file is written to drafts/, the orchestrator immediately dispatches four automated subagents:

  1. SEO Optimizer (.claude/agents/seo-optimizer.md): Audits heading hierarchy, verifies primary keyword placement in the title and first 100 words, and ensures keyword density stays within a healthy 1% to 2% band.
  2. Meta Creator (.claude/agents/meta-creator.md): Generates three high-CTR meta title and description pairs formatted for 60-character SERP boundaries.
  3. Internal Linker (.claude/agents/internal-linker.md): Matches target phrases in the draft against context/internal-links-map.md and inserts contextual hyperlinks back to core product landing pages.
  4. Keyword Mapper (.claude/agents/keyword-mapper.md): Checks semantic keyword variations (LSI terms) to ensure natural topic coverage across all H2 and H3 sections.

Phase 4: Direct Publishing to WordPress via REST API

For teams managing WordPress publications, data_sources/modules/wordpress_publisher.py connects to the WordPress REST API using Application Passwords.

It parses the Markdown frontmatter, maps metadata to Yoast SEO fields (_yoast_wpseo_title, _yoast_wpseo_metadesc, _yoast_wpseo_focuskw), and uploads the post as a native draft ready for editorial sign-off.

# wordpress_publisher.py metadata handling snippet
yoast_meta = {
    '_yoast_wpseo_title': draft_data.get('meta_title', ''),
    '_yoast_wpseo_metadesc': draft_data.get('meta_description', ''),
    '_yoast_wpseo_focuskw': draft_data.get('target_keyword', '')
}

Part 3: The Diagnosis - terms that cause confusion

Understanding the vocabulary of modern AI content marketing is essential to avoid costly strategic mistakes:

1. BOFU (Bottom-of-the-Funnel) vs. High-Volume Vanity Queries

Many founders celebrate reaching 100,000 impressions on a blog post explaining “what is artificial intelligence.” Yet that traffic rarely converts because the searchers are curious students, not buyers.

BOFU queries have lower absolute search volume (often only 100 to 500 searches per month), but the commercial intent is immense. A buyer searching for “SOC2 compliant podcast hosting” has an urgent corporate budget. Ranking #1 for three BOFU terms often drives more recurring revenue than ranking #1 for twenty generic informational terms.

seomachine’s seo_bofu_rankings.py specifically filters your search console data to prioritize high-intent transactional queries over vanity keywords.

2. Workspace Repository vs. Packaged Agent Skill

It is important to distinguish between different architectural forms in the Claude Code ecosystem:

  • Agent Skill Plugin (like claude-blog): Packaged into ~/.claude/skills/ as a portable utility. You install it globally and run it across any repository.
  • Workspace Repository (like seomachine): A dedicated project workspace containing your company’s proprietary data, environment files, research folders, and specialized command markdown files. You clone the repository, run Claude Code directly inside it, and treat it as a centralized content control room.

3. Context Cartridges vs. Model Fine-Tuning

Engineering teams often ask if they need to fine-tune an LLM on their past blog posts to capture their brand voice.

Fine-tuning is expensive, slow to update, and prone to catastrophic forgetting. seomachine uses context cartridges: plain text Markdown files that can be edited in seconds. When you launch a new feature or change your pricing model, you simply update context/features.md, and every subsequent article reflects the changes immediately.

Part 4: The Resolution - tradeoffs and when to use it

While seomachine provides an exceptional content marketing engine for SaaS companies, it introduces distinct operational tradeoffs.

Decision Matrix: When to Adopt vs. Skip

Team & Tech Stack Raw LLM Prompting AgriciDaniel/claude-blog TheCraigHewitt/seomachine
Target Audience General drafting Systems engineers & devs B2B SaaS & Growth teams
Primary Goal Fast text output Verified clean code & zero slop Search ranking & MRR conversion
Search Telemetry None Ad-hoc / Google API scripts Native GSC, GA4, DataForSEO
Publishing Target Copy-paste Static MD/HTML/PDF Direct WordPress / Yoast REST
External API Costs Token only Token only Paid DataForSEO subscription
Visual QA Gates None Headless Patchright (3 viewports) Manual review recommended

The Rough Edges (Honest Engineering Tradeoffs)

Before deploying seomachine into your production marketing workflow, account for these four practical limitations:

  1. Paid DataForSEO Dependency: Many of the advanced Python scripts (research_serp_analysis.py, research_quick_wins.py) require active DataForSEO API credentials. DataForSEO requires a paid account ($50 minimum initial deposit). Without an active balance, live search volume and competitor SERP metrics will fail or fall back to empty mocks.
  2. WordPress REST API Coupling: The automated publishing pipeline is tightly coupled to WordPress and its Yoast SEO plugin. If your company blog runs on modern static web architectures like Astro, Next.js MDX, or Hugo, the WordPress publishing script is irrelevant. You will need to write custom export scripts to commit Markdown files directly to your Git repository.
  3. Prompt Context Saturation: Executing /write loads five to eight separate Markdown files from context/ into prompt memory. For detailed SaaS documentation, this context injection can consume 20,000 to 40,000 tokens before drafting even begins, increasing API costs for long articles.
  4. Advisory Rather Than Blocking Review: Unlike systems with hard delivery contracts, seomachine’s optimization agents run advisory checks. If keyword density is slightly off or an internal link cannot be resolved, the agent prints a recommendation in chat, but it does not physically block file generation or force automated repair loops.

Technical FAQ

Can I use seomachine without a paid DataForSEO account?

Yes. You can still run /write, /optimize, and the post-writing agent swarm using your local context/ files. However, automated SERP competitor scraping and real-time search volume queries in the Python research scripts will be disabled, requiring you to supply keyword metrics manually.

How does seomachine prevent keyword stuffing?

The keyword_analyzer.py module parses the draft text and calculates exact keyword density. If the primary keyword exceeds 2.5% density, or if secondary variations cluster unnaturally in a single section, the seo-optimizer agent flags the repetition and suggests natural synonyms.

Is seomachine suitable for personal developer blogs?

It can be used, but it is heavily optimized for commercial conversion funnels. If your goal is publishing personal engineering retrospectives, tutorials, or open-source announcements, a lighter static workflow without B2B features and commercial CTAs is typically more appropriate.

How does the system handle AI search citation readiness?

Through the /research-ai-citations [topic] command and the Answer-First formatting rules in .claude/commands/write.md. The prompt forces a 40 to 55 word direct answer in the opening two sentences, followed by an explicit Key Takeaways bulleted block designed for retrieval engines like Google AI Overviews and Perplexity.

Final Take

Content marketing for technology products is not about publishing endless generic words; it is about building a disciplined pipeline that connects technical features to customer conversion paths through verified search telemetry.

Student First Assignment

Clone the repository and inspect the Castos real-world example:

git clone --depth 1 https://github.com/TheCraigHewitt/seomachine.git /tmp/seomachine-audit
cd /tmp/seomachine-audit
cat examples/castos/context/features.md
cat examples/castos/context/internal-links-map.md

Study how Craig Hewitt mapped technical podcasting features (dynamic ad insertion, private RSS feeds) into structured context cartridges. Applying this exact context architecture to your own product will instantly transform your AI drafting from generic prose into persuasive engineering copy.


Repository: TheCraigHewitt/seomachine · MIT License · 7,430+ Stars.

Related posts