
seo-agent-kit
SEO Agent Kit: a self-improving SEO agent for Claude Code. Writes, fact-checks and publishes WordPress posts via Creator OS, learns from PostHog signups and…
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up seo-agent-kit (git-clone project) into my current project. Found on https://claudeers.com/seo-agent-kit Repo: https://github.com/kevinbadi/seo-agent-kit Homepage/docs: — Detected install method: git-clone → git clone https://github.com/kevinbadi/seo-agent-kit Category: data. Platforms: cli, api, web. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: unknown; community-verified: false. Confirm the source before running anything.
git clone https://github.com/kevinbadi/seo-agent-kit
// compatibility
| Platforms | cli, api, web |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | MIT |
| Pricing | open-source |
| Language | JavaScript |
SEO Agent Kit
A self-improving SEO agent for Claude Code, from Creator OS (the marketing system behind KevBuildsApps). It writes blog posts that rank on Google and get cited by ChatGPT, Claude and Perplexity, reads PostHog to see which posts bring signups, and writes more like the winners. Fully open source.
What you need
Three connections:
- Creator OS API connected to a WordPress site. This is where the agent publishes. Sign up at creatoros.ca, connect WordPress (self-hosted or WordPress.com), copy the API key.
- PostHog API. A personal key (
phx_) with Query: Read, and PostHog installed on your site. - Google Search Console API. A service account added as an Owner of your property.
Plus the basics any agent needs: a Postgres database (Supabase, Neon, Railway, local) and a model key (Claude, or any OpenAI-compatible API). Then follow Setup below.
What's inside
-
The SEO agent (
.claude/skills/seo-engine,wordpress-blog,ai-search-files). See The SEO agent below. -
The PostHog analytics kit the agent learns from:
-
A twice-daily snapshot job that pulls from PostHog (HogQL Query API) into Postgres:
- visitors, pageviews and sessions per day
- your signup / onboarding / activation funnel events
- where each session came from (referrer or UTM)
-
A live "today" top-up that keeps today's numbers current between snapshots.
-
Traffic-source grouping of raw referrers into families: YouTube, Google, Threads, Instagram, X, LinkedIn, TikTok, ChatGPT, Claude, Perplexity, Gemini, Copilot, other search, internal and direct.
-
Dashboard cards (React + Tailwind):
- Web chart: visitors with signups and subscribers layered on top, same bar width, so the height shows conversion
- Web funnel
- Traffic sources, with Today / Yesterday / 7 days / 30 days tabs
Every day is an America/New_York day, never UTC. That stops evening visits from landing on tomorrow's date. Change America/New_York everywhere if you want another zone.
Why snapshots?
Charts read from your own Postgres, not from PostHog on every page load. That makes pages fast and costs no PostHog query credits. You also keep history even if you change PostHog projects.
Setup (5 minutes)
-
Install PostHog on your site. Also capture your funnel events. Rename them in the queries if yours differ.
posthog.capture("user_signed_up") posthog.capture("onboarding_completed") posthog.capture("api_key_copied") // your "activated" moment -
Create a personal API key in PostHog (Settings > Personal API keys) with Query: Read.
-
Configure and run:
cp .env.example .env # fill DATABASE_URL, POSTHOG_API_KEY, POSTHOG_PROJECT_ID npm install npm run backfill # last 90 days npm run snapshot # then schedule this at 9 AM + 9 PMYou can schedule it with any cron: Railway cron, GitHub Actions, crontab, or Vercel cron hitting a route that runs it.
The tables are created on first run.
sql/schema.sqlhas them if you'd rather create them yourself.
Using the dashboard pieces (Next.js App Router)
Copy lib/ and components/ into your app. You need pg, recharts and Tailwind.
// app/dashboard/page.tsx (server component)
import { getWebVisitorsDaily } from "@/lib/posthog-client";
import { getWebSourcePeriods } from "@/lib/posthog-sources";
import { WebTrafficChart } from "@/components/WebTrafficChart";
import { WebFunnel } from "@/components/WebFunnel";
import { TrafficSources } from "@/components/TrafficSources";
export default async function Page() {
const days = await getWebVisitorsDaily("default", process.env.POSTHOG_PROJECT_ID!, process.env.POSTHOG_HOST ?? "https://us.posthog.com", 30);
const periods = await getWebSourcePeriods("default");
const sum = (k: keyof (typeof days)[number]) => days.reduce((a, d) => a + Number(d[k]), 0);
return (
<>
<WebTrafficChart
variant="web"
data={days.map((d) => ({ date: d.date, count: d.signups }))}
traffic={days.map((d) => ({ date: d.date, count: d.visitors }))}
signups={days.map((d) => ({ date: d.date, count: d.signups }))}
subscribers={[] /* paid subs per day from Stripe / RevenueCat, if you have them */}
/>
<WebFunnel steps={[
{ label: "Visitors", value: sum("visitors"), color: "#64748b" },
{ label: "Signed up", value: sum("signups"), color: "#8b5cf6" },
{ label: "Onboarded", value: sum("onboarded"), color: "#06b6d4" },
{ label: "Activated", value: sum("apiKeys"), color: "#10b981" },
]} />
<TrafficSources periods={periods} />
</>
);
}
The components use a few utility classes from the original design system: card, card-title, num and eyebrow. Define them in your global CSS, or swap them for your own.
Tracked links (bonus pattern)
To see which post drove a visit, send links through UTM-tagged URLs, e.g. https://yoursite.com/?utm_source=threads&utm_campaign=post-123. UTM sources win over the referrer in the source grouping. ChatGPT, for example, sends utm_source=chatgpt.com with no referrer.
The SEO agent (blog engine)
The same PostHog data drives a self-improving SEO loop for a WordPress blog. It writes posts that
rank, reads PostHog to see which posts bring signups, and writes more like the winners. It is three
Claude Code skills in .claude/skills/:
| Skill | What it does |
|---|---|
seo-engine | The loop. scout queues topics from 5 feeds (spin-offs of posts that convert, Search Console queries you don't rank for, news RSS, your releases, a seed backlog). publish writes one post per run, runs a fact gate against your facts.json (up to 2 rewrites, else rejected), publishes to WordPress and pings IndexNow. measure (nightly) attributes PostHog sessions, signups and AI-engine visits to the post they entered on, adds Search Console clicks, and re-weights topic clusters by signups per post. |
wordpress-blog | Connect a WordPress site through Creator OS and write, edit, publish or delete articles from Claude (MCP tools), the REST API or the CLI. Workflows for one-off articles, turning a winning social post into an article, and refreshing old posts. |
ai-search-files | Next.js templates so the blog is readable by Google and AI answer engines: auto-generated llms.txt / llms-full.txt, sitemap, robots rules for AI crawlers, BlogPosting + FAQPage JSON-LD, IndexNow. |
FEEDS PIPELINE (publish, 1 post per run) LEARN (measure, nightly)
spin-offs ─┐
GSC gaps ─┤ scout brief -> write -> fact gate -> publish -> IndexNow PostHog entry visitors,
news RSS ─┼──────> (2 rewrites max, else rejected with a reason) signups, AI referrals
releases ─┤ queue + Search Console clicks
seeds ─┘ ^ |
└──────── cluster weights (signups per post, 0.5x to 3x) <─────────┘
Setup
- Connect your WordPress site in Creator OS and put that workspace's
API key in
.envasCREATOROS_API_KEY(see.claude/skills/wordpress-blog/SKILL.md). cp seo.config.example.json seo.config.jsonand fill in your site, brand, signup path and signup event.- In
.claude/skills/seo-engine/:cp facts.example.json facts.jsonandcp seeds.example.json seeds.json.facts.jsonis the product truth the writer may use. Keep it accurate; it is what stops invented features. - Set a model:
ANTHROPIC_API_KEY, orLLM_BASE_URL+LLM_API_KEY+LLM_MODELfor any OpenAI-compatible API. Optional:POSTHOG_AI_KEYlogs every generation to PostHog LLM analytics. - Optional: Search Console service account (
GSC_SA_JSON_B64) andINDEXNOW_KEY.
npm run seo:scout -- --dry-run # what would it queue?
npm run seo:publish -- --dry-run # write + fact-check one post to a temp file, publish nothing
npm run seo:scout && npm run seo:publish && npm run seo:measure
Schedule (ET): scout 7:30, publish hourly 8:00 to 17:00 (capped by daily_max), measure 22:00.
SEO_PUBLISH_AS_DRAFT=1 lands posts as drafts if you want to review first.
Full details, guard rails and debugging queries: .claude/skills/seo-engine/SKILL.md.
Use it with Claude Code
Everything in .claude/skills/ is a Claude Code skill: posthog-analytics, seo-engine, wordpress-blog and ai-search-files. Copy the folders into your project's .claude/skills/ and Claude will know how to set up, run, debug and extend each piece.
Files
| Path | What |
|---|---|
scripts/posthog-snapshot.mjs | The snapshot job: visitors/funnel per ET day + traffic sources, upserted |
lib/posthog-client.ts | getWebVisitorsDaily(): reads snapshots + live top-up for today |
lib/posthog-sources.ts | sourceFamily() grouping rules, getWebSources(), getWebSourcePeriods() |
lib/db.ts, lib/format.ts | Tiny pg + number-format helpers |
components/WebTrafficChart.tsx | Visitors / signups / subscribers layered bar chart (recharts) |
components/WebFunnel.tsx | Funnel bars with step-to-step conversion |
components/TrafficSources.tsx | Traffic-source table with period tabs |
sql/schema.sql | Table definitions |
.claude/skills/seo-engine/ | SEO loop: scripts/scout.mjs, publish.mjs, measure.mjs, llm.mjs, schema.sql, fact/seed templates |
.claude/skills/wordpress-blog/ | WordPress via Creator OS: connect, write, publish |
.claude/skills/ai-search-files/ | templates/ for llms.txt, sitemap, robots, JSON-LD (FAQPage) |
seo.config.example.json | SEO engine config |
Built by Kevin (KevBuildsApps on YouTube). Learn to build systems like this in Kev's No Code Academy.
MIT licensed.
// faq
What is seo-agent-kit?
SEO Agent Kit: a self-improving SEO agent for Claude Code. Writes, fact-checks and publishes WordPress posts via Creator OS, learns from PostHog signups and Google Search Console, gets cited by AI search.. It is open-source on GitHub.
Is seo-agent-kit free to use?
seo-agent-kit is open-source under the MIT license, so it is free to use.
What category does seo-agent-kit belong to?
seo-agent-kit is listed under data in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/seo-agent-kit)
// retro hit counter
[](https://claudeers.com/seo-agent-kit)
// reviews
// guestbook
// related in Data & Analytics
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 3.1 P…
Marketing skills for Claude Code and AI agents. CRO, copywriting, SEO, analytics, and growth engineering.
Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
CLI tool for configuring and monitoring Claude Code