Your AI Marketing Team
Hermes acts as your AI CMO — you describe a marketing task in plain English, and it automatically routes to the right specialist agent running on the right model. Built on 40 battle-tested marketing skills, three CLI runtimes, and Cloudflare infrastructure that learns and improves every week.
┌──────────────────────────────────────────────────────────────────┐ │ HERMES (Your CMO) │ │ You talk to Hermes. Hermes runs the team. │ └──────────────┬───────────────────────────────────────────────────┘ │ reads CF KV routing weights ┌─────────┼──────────┐ ▼ ▼ ▼ CLAUDE CODE CODEX CLI PI AGENT Opus 4.7 GPT-5.5 Local / Any High-craft Volume Zero-cost Strategy Social Safety layer CRO / Copy Cold email Parallel runs Ad variants └─────────┬──────────┘ ▼ .agents/skills/ (40 skills · single source) ▼ Cloudflare D1 · KV · R2 · Queue · AI Gateway
How It Works
Hermes is a harness — a process manager that sits above all three CLIs. It doesn't live inside Claude Code. It decides which CLI to spin up, passes it the right skill, logs the result to Cloudflare, and gets smarter every week.
You: "Write 10 cold email variations for SaaS founders"
│
▼
hermes/router.ts
skill = 'cold-email'
check KV routing:weights:cold-email:gpt-5.5 → score 4.3
check KV routing:weights:cold-email:opus-4.7 → score 4.1
decision: { cli: 'codex', model: 'gpt-5.5' }
│
▼
hermes/dispatcher.ts
spawn: codex --model gpt-5.5
inject: .agents/product-marketing.md context
run: cold-email skill
│
▼
hermes/logger.ts
D1: INSERT agent_runs (skill, model, cli, tokens, cost_cents)
R2: PUT outputs/{run_id}/cold-emails.md
KV: UPDATE token:used:gpt-5.5:{today}
│
▼
Output returned to you
│
▼ (you rate it: approved / revised / rejected)
D1: feedback_events
│
▼ (Monday 9am)
Reflection Worker
Re-scores skill × model composites
Updates KV routing weights
Hermes now knows GPT-5.5 wins cold-email
Setup in 6 Steps
Everything you need to go from zero to a running marketing team. Run these commands in order. Total setup time is under 30 minutes.
Prerequisites
npm install -g @anthropic-ai/claude-code · Requires Node 18+npm install -g @openai/codexnpm install -g @badlogicgames/pinpm install -g wrangler then wrangler loginStep-by-Step
-
Clone the projectTERMINALgit clone https://github.com/organized-ai/brian-marketing-team
cd brian-marketing-team -
Install dependencies + marketing skillsTERMINALnpm install
npx skills add coreyhaines31/marketingskills
bash scripts/sync-agents.sh -
Set environment variables.envANTHROPIC_API_KEY=your_key
OPENAI_API_KEY=your_key
CLOUDFLARE_ACCOUNT_ID=your_cf_account_id
CLOUDFLARE_API_TOKEN=your_cf_token -
Provision Cloudflare resourcesWRANGLERwrangler d1 create marketing-brain
wrangler kv namespace create MARKETING_KV
wrangler r2 bucket create marketing-brain-outputs
wrangler queues create hermes-jobs
wrangler d1 migrations apply marketing-brain -
Fill in your product contextEDIT THIS FILE.agents/product-marketing.md
# Add: product name, ICP, positioning,
# competitors, marketing stack, goals -
Deploy Cloudflare workers + start HermesTERMINALwrangler deploy
npm run hermes
Your 6-Person Team
Each agent is a specialist with a defined set of skills. Hermes decides who handles each request. All agents automatically read your product-marketing.md context before working.
| Agent | Default CLI/Model | Skills | Best for |
|---|---|---|---|
| Content Agent | Claude Code / Opus 4.7 | copywriting, copy-editing, emails, social, cold-email, video, image | Brand voice, blog posts, email sequences |
| SEO Agent | Claude Code / Opus 4.7 | seo-audit, ai-seo, programmatic-seo, schema, site-architecture, competitors | Audits, keyword strategy, schema markup |
| CRO Agent | Claude Code / Opus 4.7 | cro, signup, onboarding, popups, paywalls, ab-testing | Landing page optimization, conversion flows |
| Paid Agent | Codex CLI / GPT-5.5 | ads, ad-creative, analytics, ab-testing | Ad copy variants, campaign briefs, reporting |
| Growth Agent | Codex CLI / GPT-5.5 | referrals, free-tools, churn-prevention, co-marketing, community, lead-magnets | Referral programs, retention, partnerships |
| Strategy Agent | Claude Code / Opus 4.7 | marketing-ideas, marketing-psychology, launch, pricing, revops, sales-enablement | Go-to-market, positioning, launch plans |
40 Skills · One Library
All skills come from coreyhaines31/marketingskills — Agent Skills spec v2.0. They live in .agents/skills/ and are symlinked into all three CLIs. One update propagates everywhere.
Pi Agent Extensions (disler/pi-vs-claude-code)
| Extension | What it unlocks |
|---|---|
cross-agent.ts | Auto-registers all .claude/ + .codex/ agents in Pi. Zero duplication. |
agent-team.ts | Live team grid dashboard — see which agent is running in real time. |
agent-chain.ts | Campaign pipelines as YAML — research → strategy → copy → review. |
damage-control.ts | Safety guardrails for autonomous CF writes and agent prompt updates. |
subagent-widget.ts | Parallel execution — SEO + CRO + Competitor audits simultaneously. |
tool-counter.ts | Per-tool token cost tracking → feeds D1 for cost-aware routing. |
pi-pi.ts | Meta-agent that builds new specialist agents on demand. |
The Brain in the Cloud
Five Cloudflare primitives work together to log every run, cache expensive prompts, queue parallel tasks, track token budgets, and store all outputs. The Reflection Worker reads this data every Monday and makes Hermes smarter.
CF AI GATEWAY All model API calls route through here (Anthropic + OpenAI endpoints) • Prompt cache: SHA-256 hash · saves tokens on repeated tasks • Cache TTL by skill: social=1800s · strategy=86400s · analytics=skip • Token tracking: input/output/cost per request • Model fallback: Opus 4.7 → Sonnet if unavailable • DLP guardrails: PII scan on prompts │ ▼ CF QUEUE (hermes-jobs) Hermes pushes { skill, model, cli, input, run_id } Queue Worker pulls → spawns CLI process • Parallel execution (SEO + CRO + Competitor simultaneously) • Auto-retry 3x on failure • Dead-letter → D1 failed_runs table │ ▼ D1 (marketing-brain) agent_runs — every invocation: model, cli, tokens, cost_cents, cache_hit feedback_events — your ratings (1-5 / approved / shipped / rejected) model_scores — skill × model composite scores (updated weekly) campaign_log — full campaign sequences with agent chains failed_runs — dead-letter queue for debugging KV (MARKETING_KV) routing:weights:{skill}:{model} — Hermes routing priors token:budget:{model} — daily spend cap per model token:used:{model}:{date} — running daily spend product-marketing:latest — current product context cache:output:{skill}:{hash} — R2 pointer for output cache R2 (marketing-brain-outputs) outputs/{run_id}/ — full agent outputs (md files) cache/{skill}/{hash}/ — output cache layer improvement/{date}/ — weekly Reflection Worker summaries product-marketing/v{n}.md — versioned product context history
Token Budget System
Before every dispatch, Hermes checks your daily budget in KV. If Opus 4.7 hits its daily cap, it automatically downgrades to Sonnet. Costs accumulate in KV throughout the day and reset at midnight.
// hermes/router.ts — budget check before every dispatch const used = await env.KV.get(`token:used:${model}:${today}`); const budget = await env.KV.get(`token:budget:${model}`); if (Number(used) >= Number(budget)) { model = FALLBACK_MODELS[model]; // opus-4.7 → claude-sonnet-4-6 } // After run — increment spend await env.KV.put( `token:used:${model}:${today}`, String(Number(used || 0) + cost_cents) );
How Hermes Learns
Every run is scored. Every Monday, the Reflection Worker reads the scores, computes which model wins each skill, and rewrites the routing weights. Hermes gets smarter without any manual tuning.
Reflection Worker (Cloudflare Cron — every Monday 9am) 1. Query D1 agent_runs + feedback_events (last 7 days) GROUP BY skill_used × model 2. Compute per (skill, model): avg_score · approval_rate · avg_cost_cents composite = (avg_score × approval_rate) / avg_cost_cents 3. Example after 4 weeks: routing:weights:copywriting:opus-4.7 → composite 1.82 (wins) routing:weights:copywriting:gpt-5.5 → composite 1.21 routing:weights:social:opus-4.7 → composite 0.71 routing:weights:social:gpt-5.5 → composite 1.43 (wins) 4. UPDATE D1 model_scores PUT KV routing:weights:* (new values) Write improvement/YYYY-MM-DD/summary.md → R2 5. Next request for "copywriting" → Hermes routes to Opus 4.7 Next request for "social" → Hermes routes to GPT-5.5 You never had to configure this. It learned from your feedback.
Talking to Your Team
You talk to Hermes in plain English. Hermes decides who handles it and which model fires. Use these commands to trigger specific workflows.
| Command | What it does | Example |
|---|---|---|
/campaign | Full campaign brief — routes through Strategy → Content → Paid agents | /campaign launch my new SaaS product to startup CTOs |
/copy | Direct to Content Agent — copywriting, emails, social | /copy write 5 cold email variations for B2B SaaS |
/audit | SEO + CRO parallel audit via Pi subagent-widget | /audit my-site.com |
/ads | Paid Agent — Google/Meta ad copy and creative briefs | /ads generate 10 Facebook ad variants for our trial offer |
/strategy | Strategy Agent — positioning, launch, pricing | /strategy help me position against HubSpot for SMBs |
/launch | Full launch chain — Strategy → Content → SEO → Paid in sequence | /launch Product Hunt launch plan |
/feedback | Rate last output — trains the routing weights | /feedback approved · 5 · great tone |
/weekly-report | Pull D1 data — what ran, what scored, cost summary | /weekly-report |
First Thing to Do
- Fill in
.agents/product-marketing.md— this is the shared context every agent reads first. The more detail you add, the better every output gets. - Run a quick test:
npm run hermesthen type/copy write a tweet about our product - Rate the output with
/feedback approvedor/feedback 3 · needs more urgency - After a week, run
/weekly-reportto see which model/skill combinations are winning
What's Under the Hood
| Layer | Technology | Role |
|---|---|---|
| Orchestrator | Hermes Harness (TypeScript) | Routes, dispatches, logs every task |
| CLI A | Claude Code + Opus 4.7 | High-craft, deep reasoning tasks |
| CLI B | Codex CLI + GPT-5.5 | Volume, speed, cost-efficient tasks |
| CLI C | Pi Agent + Ollama/Local | Zero-cost + safety + parallel execution |
| Skills | coreyhaines31/marketingskills v2.0 | 40 marketing skills, cross-CLI compatible |
| Pi Extensions | disler/pi-vs-claude-code | agent-chain, damage-control, subagent-widget, pi-pi |
| AI Gateway | Cloudflare AI Gateway | Prompt caching, token tracking, model fallback |
| Queue | Cloudflare Queues | Async parallel dispatch, retry, dead-letter |
| Database | Cloudflare D1 (SQLite) | Run logs, feedback, model scores |
| State | Cloudflare KV | Routing weights, token budgets, product context |
| Storage | Cloudflare R2 | Output artifacts, improvement summaries |
| Cron | Cloudflare Workers (cron) | Reflection Worker — weekly self-improvement |