I Built an AI Marketing Agent in My Terminal

How a developer who doesn't understand marketing built a 49-command AI marketing system with Claude Code. Real architecture, real data, real results.

Lukas, Founder
Lukas, Founder
14 min read

An AI marketing agent is what happens when a developer who doesn't understand marketing decides to engineer their way out of it. Instead of learning funnels, keyword difficulty, and content calendars, I built a system in my terminal that handles all of it — and makes better marketing decisions than I ever could.

Key takeaway: You don't need to understand marketing to do marketing well. You need a system that understands it for you.

I run 6 SaaS projects. I'm a developer with 15 years of experience writing code. But I couldn't tell you what TOFU means if my revenue depended on it. (It did. The AI taught me it means top-of-funnel.)

This article shows exactly how I built a 49-command marketing system in Claude Code — the architecture, the data integrations, the command specifications, and the honest results after the first month. Not theory. Real config files you can read.

The Problem Every Developer-Founder Faces

You can build the product. You can deploy it, scale it, monitor it. But then comes the question you've been avoiding:

How do people find it?

The standard advice is:

  • "Learn SEO" — that's 200 hours of study before you write one post
  • "Hire a marketer" — that's $3K-5K/month per project
  • "Use AI tools" — that's 15 different dashboards you'll abandon in a week

None of these work for a solo developer running multiple projects. I needed option 4: build a system that does marketing the way I do engineering — with config files, commands, and automated pipelines.

Marketing as Code

Here's the core idea. In engineering, we have:

  • Config files that define behavior
  • CI/CD pipelines that automate workflows
  • Test suites that enforce quality
  • Version control that tracks every change

Marketing has none of this. Strategy lives in someone's head. Content goes through Slack and Google Docs. Nobody tracks which keywords are done, which are in progress, or which were tried and failed.

What if marketing ran like a codebase?

marketing-os/
├── config/
│   ├── strategy.md              # 90-day plan (version-controlled)
│   ├── product-context.md       # Brand voice, audience, positioning
│   ├── content-inventory.json   # Every keyword, every post, every status
│   └── brand-voice-examples.md  # Real writing patterns (not guidelines)
├── .claude/
│   ├── commands/                # 49 marketing workflows as specifications
│   ├── knowledge/               # SEO, GEO, conversion expertise
│   └── guides/                  # Step-by-step processes
├── content/
│   ├── drafts/                  # Content pipeline
│   └── published/               # Archive
├── data/
│   ├── keywords/                # Ahrefs research (cached, 7-day TTL)
│   ├── rankings/                # Google Search Console positions
│   └── competitors/             # Competitive analysis
└── outreach/
    ├── templates/               # Email templates
    └── campaigns/               # Campaign tracking

Everything is a file. Everything is tracked. Every marketing decision is a git commit.

The Architecture

The system has four layers:

Layer 1: Context (Who We Are)

Before the AI writes a single word, it loads three files:

product-context.md — The source of truth for every piece of content. Written once during setup, reviewed by a human:

## What We Are
AI-powered kits that transform Claude Code into specialized
domain experts for solo founders.

## What We Are NOT
- NOT a boilerplate/template marketplace
- NOT a replacement for Claude Code
- NOT for non-developers

## Phrases We NEVER Use
- "Revolutionary" / "Game-changer"
- "Leverage synergies"
- "AI-powered" as empty buzzword

brand-voice-examples.md — Not vague guidelines like "be professional." Actual writing samples extracted from my existing content:

## Headlines We Write
- "Solo founder? Not anymore."
- "Meet your marketing team in Claude Code"
- Short, punchy. Under 10 words. Problem-first.

## How We Start Paragraphs
- Address the reader directly ("you", "your")
- Acknowledge what's good, then show what's better
- Concrete over abstract

content-inventory.json — The brain of the system. Tracks every keyword across three funnel stages:

{
  "keywords": {
    "claude-code-vs-cursor": {
      "keyword": "claude code vs cursor",
      "volume": 3300,
      "difficulty": 2,
      "winnability": 92,
      "status": "published",
      "serpInsight": "DR 17 blog at #3. Very beatable."
    }
  },
  "progress": {
    "TOFU": { "done": 3, "total": 8 },
    "MOFU": { "done": 2, "total": 6 },
    "BOFU": { "done": 0, "total": 0 }
  }
}

14 keywords tracked. Each validated with Ahrefs data. Each assigned to a funnel stage. Each with a winnability score based on our domain's competitive position.

Layer 2: Intelligence (What Data We Have)

The AI isn't guessing. It's working with real data from four sources:

SourceCostWhat It Provides
Ahrefs$99-199/moKeyword volume, difficulty, competitor backlinks, SERP analysis
Google Search ConsoleFreeReal ranking positions, click data, indexing status
ForumScout~$30/moReddit, HN, Twitter monitoring for engagement opportunities
Firecrawl$9/moJavaScript-heavy page scraping (fallback)

When I type /keywords "ai coding", the system:

  1. Pulls volume and difficulty from Ahrefs
  2. Checks my domain's competitive position (DR 0 — brand new)
  3. Filters for keywords where low-DR sites already rank (beatable SERPs)
  4. Calculates a winnability score
  5. Caches the results for 7 days (saves Ahrefs credits)

Real data beats intuition. "Claude code vs cursor" has 3,300 monthly searches and a keyword difficulty of 2. A DR 17 blog sits at position #3. That's a keyword I can win. The system found it. I didn't.

Layer 3: Commands (What It Does)

This is the core. 49 slash commands that each define a complete marketing workflow.

The big ones:

/setup — A 1,850-line specification that walks through a marketing interview: analyzes your product, interviews you about your audience, extracts your brand voice from existing content, researches keywords with Ahrefs, and generates a 90-day strategy. Takes about 30 minutes. Replaces a marketing consultant.

/draft — A 12-step content pipeline. This single command handles keyword research, search intent analysis, source verification, SEO optimization, GEO optimization (for AI chatbot citations), link verification, and inventory updates. The specification is 950 lines. The output is publish-ready content.

/listen — Scans Reddit, Hacker News, and Twitter for conversations where people discuss problems my product solves. Scores each opportunity by relevance and timing. I still post manually (authenticity), but finding conversations and drafting responses is automated.

/outreach — Finds link-building opportunities: guest post targets, resource pages, broken links I can replace. Generates personalized email templates based on each target's recent content.

/report — Shows progress across all funnel stages with real data:

Marketing Progress Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Mode: BALANCED

Keywords: 14 tracked (Ahrefs-validated)
Posts:    7 (5 published, 2 drafts)

├── BOFU: 0/0
├── MOFU: 2/6 published (33%)
└── TOFU: 3/8 published (38%)

Next: "claude code CLAUDE.md" (300/mo, winnability 80)

I don't decide what to write next. The system tells me, based on funnel balance, keyword winnability, and publishing velocity.

The complete list by marketing role:

Traditional RoleCommandsWhat They Do
SEO Specialist/keywords, /rankings, /opportunities, /indexing, /seo-auditKeyword research, rank tracking, quick wins, technical SEO
Content Writer/draft, /approve, /surfer-gate, /geo-checkContent pipeline from research to publish
Content Strategist/setup, /mode, /report, /nextStrategy creation, funnel management, prioritization
Social Media/listen, /respond, /socialSocial monitoring, engagement, post generation
Outreach Manager/outreach, /cold-outreach, /cold-campaignLink building, cold email, prospect research
Product Marketing/positioning, /launch, /changelog, /battle-cardsMessaging, launches, competitive docs
Email Marketing/emails, /referral, /reviewsLifecycle sequences, referral programs, review collection
Marketing Analyst/report, /domain-rating, /backlinks, /link-gapsPerformance tracking, competitor monitoring

49 commands. Each one is a markdown file in .claude/commands/ that specifies exactly what the AI should do, what data to load, what questions to ask, and what guardrails to enforce.

Layer 4: Guardrails (What It Can't Break)

The system has hard limits that block publishing if violated:

SEO Validation Gate
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Title: ≤60 characters     (Google truncates longer)
Description: ≤160 characters (Google truncates longer)
Internal links: ≥2 per post  (orphan pages hurt authority)

If a draft has a 63-character title, it doesn't get saved. Period. The AI rewrites it shorter before proceeding.

Beyond SEO, the system also:

  • Verifies every link exists before saving (prevents hallucinated URLs from reaching Google Search Console as 404 errors)
  • Checks for duplicate content against the content inventory
  • Monitors authority balance — if I'm publishing content but not doing outreach, it nudges me to build backlinks
  • Enforces brand voice — checks against the "phrases we never use" list in product context

What My Actual Workflow Looks Like

Monday morning. I open Warp with three terminal panes. I use Wispr Flow for voice input — I don't type prompts, I speak them.

Pane 1: Marketing OS

"What's my next action?"

> /next

Publish "SEO for Developers" draft.
Reason: 600/mo keyword, draft is ready, 5 days since last post.

> /approve seo-for-developers

✓ Created PR to product repo
✓ Inventory updated: TOFU 3/8 → 4/8

"Draft the next post."

> /draft

Recommended: "claude code CLAUDE.md" (300/mo, winnability 80)
Loading product context... ✓
Checking for duplicates... ✓ No existing content
Outline ready — approve?

I review the outline, say "write it," and switch to another pane while the AI works.

Pane 2: Product development — Claude Code building features in a completely separate project.

Pane 3: Code review — Reviewing diffs from both sessions.

I write maybe 10-20 lines of code per day by hand. The rest is review, approve, redirect. My role is architect, not typist.

What the AI Can't Do (Honest Assessment)

I want to be precise about this. The AI handles 85% of the work. The 15% it can't do is the most important 15%.

Creative judgment. The AI writes good content. Not great content. The line between "solid SEO article" and "people will actually share this" is taste — knowing which examples resonate, which analogies land, which opening hooks are tired vs. fresh. I catch this in review.

Relationship building. /outreach finds targets and writes emails. But real link building is relationship building — the follow-up DMs, the genuine engagement with someone's work, the "I saw your talk and wanted to share..." messages. I do these manually. Always will.

Novel strategy. The system executes established playbooks brilliantly. Target keyword → research → draft → optimize → publish → track. But inventing a new go-to-market approach? Spotting a cultural moment to capitalize on? Deciding to pivot from SEO to community-led growth? That's still human.

Knowing when rules should break. Sometimes the best title is 65 characters. Sometimes an article doesn't need internal links because it's a standalone manifesto. The AI follows rules. Knowing when to override them is judgment.

The honest ratio: AI does the work. I do the thinking. The thinking takes 15% of the time but produces 85% of the value.

The Data Integration That Makes It Work

Most "AI marketing" articles describe using ChatGPT with good prompts. That's not what this is.

The system works because it has real data flowing through every decision:

  1. Keyword selection is driven by Ahrefs volume, difficulty, and SERP analysis — not guesses
  2. Content strategy is based on funnel analysis of your actual keyword inventory — not a template
  3. Ranking tracking uses Google Search Console's real position data — not estimates
  4. Outreach targeting uses competitor backlink analysis from Ahrefs — not cold guessing
  5. Social listening uses ForumScout to find real conversations — not keyword alerts

Remove the data integrations and you have a glorified prompt template. With them, you have a system that makes informed decisions.

The cost adds up to roughly $250-440/month depending on your Ahrefs plan. Compare that to a part-time marketing hire at $3K-5K/month — and the AI works across all 6 of my projects simultaneously.

How I Built This (And How You Can Start)

The full system took months to build. But the core of it — the part that handles 60% of the value — took one afternoon.

Start here (30 minutes):

1. Write a CLAUDE.md file with your product, audience, and voice. This is the foundation of everything. I wrote a complete guide with examples — tip #1 covers exactly what to include.

2. Create one custom command: /draft — a markdown file in .claude/commands/draft.md that tells Claude Code how to write content for your project. Start simple:

# .claude/commands/draft.md

Write a blog post for [project name].

Before writing:
1. Read config/product-context.md for brand voice
2. Check config/content-inventory.json for existing content

Writing rules:
- Title must be under 60 characters
- Include at least 2 internal links
- Add an FAQ section with 4-5 questions
- Match the tone in our brand voice examples

After writing:
- Save to content/drafts/[slug].mdx
- Update content-inventory.json

3. Track what you write in a content-inventory.json file. Even a simple JSON with keyword, status, and date will prevent duplicate content and help you see progress.

That's it. Three files. The rest — Ahrefs integration, social listening, outreach automation — you add as you need it.

The automation layer:

Once the basics work, add Claude Code hooks to automate the boring parts. Hooks are shell commands that run before or after Claude Code actions — auto-formatting, auto-linting, auto-validation.

The compound effect of CLAUDE.md + custom commands + hooks + data integrations is what transforms Claude Code from a chatbot into a marketing department.

Results After Month One

Honest numbers from a brand-new domain (DR 0, age 2 months):

  • 14 keywords researched and validated with Ahrefs
  • 7 posts created (5 published, 2 in draft)
  • ~12,000 words of SEO-optimized content
  • Time spent: ~2 hours/week on marketing (review + approve)
  • Google rankings: Too early — new domains take 3-6 months
  • Backlinks: Building through DEV.to cross-posts (DR 90) and outreach

The AI didn't produce magic overnight results. No system does for a new domain. But it produced volume and quality at a pace I could never sustain manually — and it will compound as the domain ages and backlinks accumulate.

The real win isn't this month's traffic. It's that I have a system I can run across 6 projects with 2 hours/week each. That's 12 hours/week total for marketing across an entire portfolio. A human marketing team for 6 projects would cost $18K-30K/month.

The Philosophy Behind It

Marketing isn't mysterious. It's a system:

  1. Research what people search for
  2. Create content that answers their questions
  3. Optimize so search engines can find it
  4. Distribute through channels your audience uses
  5. Track what works and do more of it

Every step is automatable. Not in the "ChatGPT writes your blog posts" sense — in the "a well-configured system with real data pipelines makes better decisions than a junior marketer" sense.

The philosophical shift is treating marketing like engineering:

EngineeringMarketing as Code
package.json defines dependenciesproduct-context.md defines brand
CI/CD automates deployment/draft automates content pipeline
Test suites enforce qualitySEO hard limits enforce standards
git log tracks changescontent-inventory.json tracks progress
Linters catch mistakesLink verification catches hallucinated URLs

If you can write a CLAUDE.md file, you can do marketing. The AI handles the expertise. You handle the judgment.

Marketing OS: 49 commands for solo founders

Turn Claude Code into your marketing team. SEO, content, outreach, social listening, and analytics — all from your terminal.

See Marketing OS

Frequently Asked Questions

What is an AI marketing agent?
An AI marketing agent is a system that autonomously handles marketing tasks — keyword research, content creation, SEO optimization, outreach, and analytics — with minimal human oversight. Unlike marketing tools that assist humans, a marketing agent makes decisions and executes strategies.
Can Claude Code really replace a marketing team?
Claude Code can handle about 85% of the work a marketing team does — keyword research, content drafting, SEO optimization, social listening, outreach emails, and analytics reporting. The remaining 15% — creative judgment, relationship building, and strategic taste — still requires a human.
How much does an AI marketing system cost?
A basic setup with Claude Code Max ($200/month) costs nothing extra beyond the subscription. Adding Ahrefs for SEO data ($99-199/month), ForumScout for social listening ($30/month), and Firecrawl for scraping ($9/month) brings the total to roughly $250-440/month — versus $3,000-5,000/month for a part-time marketing hire.
Do I need to understand marketing to use this approach?
No. That's the point. The system encodes marketing expertise in configuration files and command specifications. When you type /draft, it handles keyword research, funnel classification, SEO optimization, and GEO preparation automatically. You review the output, not the strategy.
What results can I expect from AI marketing?
Results depend on your domain age and competition. With a new domain (DR 0), expect 3-6 months before organic traffic grows meaningfully. The AI accelerates content production and quality, but domain authority takes time. Focus on low-competition keywords first and build backlinks simultaneously.
Is this the same as using ChatGPT for marketing?
No. ChatGPT is a general-purpose chatbot. An AI marketing agent is a complete system with data integrations (Ahrefs, Google Search Console), persistent project context (CLAUDE.md), automated workflows (49 commands), and guardrails (SEO limits, link verification, deduplication). It's the difference between asking a friend for advice and having a dedicated marketing department.