AI Content Factory v2.0 — Self-learning content engine with real-time dashboard, multi-agent support, token management, and Content Mastery framework (StoryBrand, Cialdini, SUCCESs, STEPPS, Hook Model, JTBD, CRO, Grand Slam Offers). Interactive onboarding → auto-research → generate → audit → deploy. Config-driven, niche-agnostic, self-improving.
From cmnpx claudepluginhub tody-agent/codymaster --plugin cmThis skill uses the workspace's default tool permissions.
AGENTS.mdCLAUDE.mdCURSOR.mdContent Factory.zipcfconfig.schema.jsondashboard/app.jsdashboard/index.htmldashboard/style.cssexamples/01-real-estate.config.jsonexamples/02-personal-finance.config.jsonexamples/03-health-wellness.config.jsonexamples/04-saas-software.config.jsonexamples/05-legal-services.config.jsonexamples/06-insurance.config.jsonexamples/07-ecommerce-dropship.config.jsonexamples/08-online-education.config.jsonexamples/09-crypto-defi.config.jsonexamples/10-beauty-skincare.config.jsonexamples/11-home-services.config.jsonProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Generates incident runbook templates for service outages, database issues, and escalations with triage steps, mitigation procedures, severity levels, and communication plans.
Config-driven, self-improving content factory with real-time dashboard, multi-agent independence, and token management. Gets smarter with use through memory + reward system.
┌─────────────────────────────────────────────┐
│ 🌐 DASHBOARD (localhost:5050) │
│ Pipeline │ Tasks │ Tokens │ Logs │ Landing │
└───────────┬─────────────────────────────────┘
│ SSE / Polling
┌───────────┴─────────────────────────────────┐
│ 🏭 PIPELINE ENGINE │
│ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
│ │ State │ │ Token │ │ Agent │ │
│ │ Manager │ │ Manager │ │ Dispatcher │ │
│ └──────────┘ └──────────┘ └────────────┘ │
│ │ │
│ EXTRACT → PLAN → WRITE → AUDIT → SEO → PUB│
│ │ │ │
│ 📊 SCOREBOARD (reward/penalty) │
│ │ │
│ 🧠 MEMORY (3-layer learning) │
└─────────────────────────────────────────────┘
Config file: content-factory.config.json at project root. Schema: config.schema.json.
# New project (interactive wizard)
python3 scripts/wizard.py
# Full pipeline WITH dashboard
python3 scripts/pipeline.py --dashboard
# Pipeline with budget limit
python3 scripts/pipeline.py --dashboard --budget 5.0
# Dashboard only (standalone)
python3 scripts/dashboard_server.py
AI MUST ask 5 question groups in order:
| # | Group | Key Questions |
|---|---|---|
| Q1 | Niche Info | Industry, brand, address, phone, USP |
| Q2 | Reference & Avoid | Reference websites, styles to avoid, tone |
| Q3 | Data Sources | Existing files, URLs to extract, images |
| Q4 | Content Goals | Number of articles, keywords, language, region |
| Q5 | Deploy | Cloudflare account, domain, milestone |
Display summary table → WAIT for user OK → then proceed.
| Mode | Script | Purpose |
|---|---|---|
| 📦 EXTRACT | extract.py | Source docs → JSON knowledge-base |
| 📋 PLAN | plan.py | Knowledge → topic queue |
| ✍️ WRITE | write.py | AI content generation (batch/single) |
| 🔍 AUDIT | audit.py | Quality check + auto-fix |
| 🔎 SEO | seo.py | Metadata optimization |
| 🚀 PUBLISH | publish.py | Build + deploy |
| 🧠 LEARN | scoreboard.py + memory.py | Extract patterns from feedback |
| 🔬 RESEARCH | research.py | Auto-research new topics |
| 💰 REVIEW | monetize.py | Monetization scoring |
| 🏭 PIPELINE | pipeline.py | Full automated A→Z |
| 📊 DASHBOARD | dashboard_server.py | Real-time web dashboard |
| 🎯 LANDING | landing_generator.py | Persona-based landing pages |
All scripts: python3 scripts/<script> --config content-factory.config.json
Real-time web dashboard at http://localhost:5050:
# Auto-start with pipeline
python3 scripts/pipeline.py --dashboard --dashboard-port 5050
# Standalone
python3 scripts/dashboard_server.py --port 5050
Multiple agents can work independently on the same pipeline via file-based task queue.
from agent_dispatcher import AgentDispatcher
d = AgentDispatcher()
# Enqueue tasks
d.enqueue("write-article-1", "write", {"topic": "SEO Tips"}, priority=3)
d.enqueue_batch([{"id": "w-2", "type": "write"}, {"id": "w-3", "type": "write"}])
# Agent claims next task
task = d.claim_next("gemini-agent-1")
d.heartbeat("gemini-agent-1", task["id"]) # Keep alive
# Complete or fail
d.complete(task["id"], "gemini-agent-1", {"result": "ok"})
d.fail(task["id"], "gemini-agent-1", "API timeout") # Auto-retry up to 3x
Features: priority ordering, stale lock detection (10min), auto-retry (3x), heartbeat.
Track token usage, costs, rate limits, and budget across all providers.
from token_manager import TokenManager
tm = TokenManager(budget_usd=5.0)
# Record usage
tm.record_usage("gemini", input_tokens=1000, output_tokens=500, task_id="w-1")
# Check budget
if not tm.check_budget():
print("Budget exceeded!")
# Rate limiting
tm.wait_if_rate_limited("gemini")
# Circuit breaker (auto-stop after 5 consecutive failures)
if tm.is_circuit_open("gemini"):
print("Provider down, switching...")
python3 scripts/token_manager.py status
Generate persona-based landing pages using Content Mastery SB7 framework.
Add personas array to config:
{
"personas": [{
"name": "Economic Buyer",
"headline": "Save 50% on Marketing Costs",
"subheadline": "AI creates professional content, 10x faster",
"pain_points": ["High marketing costs", "Lack of content staff"],
"benefits": [{"title": "Cost Savings", "description": "Reduce costs by 50%"}],
"social_proof": [{"number": "2,347", "label": "Businesses trust us"}],
"steps": [{"title": "Configure", "description": "Enter your business information"}],
"cta_text": "Try It Free"
}]
}
python3 scripts/landing_generator.py --config content-factory.config.json
python3 scripts/landing_generator.py --config content-factory.config.json --list
1. INIT → wizard.py + scaffold.py → Astro project + config
2. RESEARCH → pipeline:research → 30+ topics
3. EXPAND → expand-topics.py → 30 → target (100/200/...)
4. WRITE → pipeline:write → 3 workers, 8s sleep, ~3 articles/min
5. MILESTONE → audit → build → deploy (at 50%/100%)
6. SHIP → Final audit → deploy → notify user
public/_headers, cache immutable for /_astro/*robots.txt → sitemap, proper meta tags| Layer | Path | Purpose |
|---|---|---|
| Semantic | memory/semantic/ | Long-term patterns, style, SEO rules |
| Episodic | memory/episodic/ | Per-session experiences + outcomes |
| Working | memory/working/ | Current session context |
| Event | Points |
|---|---|
| User praise | +10 |
| Engagement (share/bookmark) | +5 |
| Article passes audit first try | +3 |
| User edits article | -5 |
| User deletes article | -10 |
| Audit fail | -3 |
| Script | Purpose |
|---|---|
pipeline.py | Master orchestrator (6-phase) + dashboard integration |
extract.py | Source extraction |
plan.py | Topic planning |
write.py | AI content writer |
audit.py | Quality audit + fixer |
seo.py | SEO optimization |
validate.py | Content validation |
publish.py | Build + deploy |
deploy.py | Multi-platform deploy |
| Script | Purpose |
|---|---|
state_manager.py | Central state management (JSON + JSONL events) |
token_manager.py | Token tracking, cost, rate limits, circuit breaker |
dashboard_server.py | HTTP server + SSE for dashboard |
agent_dispatcher.py | Multi-agent task queue with file locking |
landing_generator.py | Persona → Landing page generator |
| Script | Purpose |
|---|---|
memory.py | 3-layer memory engine |
scoreboard.py | Reward/penalty system |
research.py | Auto-research engine |
monetize.py | Monetization scoring |
| Script | Purpose |
|---|---|
wizard.py | Interactive project setup |
scaffold.py | Website scaffolding (Astro) |
--dashboardUnified content writing system. Synthesized from 8+ frameworks: StoryBrand (SB7), SUCCESs, Cialdini (7 Principles), STEPPS, Hook Model, JTBD, CRO, Grand Slam Offers.
Core Principle: Excellent content is not art — it is systematic science. Every word guides the reader: "unaware" → "interested" → "desire" → "action".
User Persona Canvas (complete BEFORE writing):
| Dimension | Questions |
|---|---|
| Demographics | Age, gender, occupation, income |
| Pain Points | 3-5 most urgent problems |
| Goals & Dreams | Dream Outcome — in their own language |
| Fears & Objections | What concerns do they have when buying? |
| Decision Triggers | What makes them BUY NOW? |
| Language | Voice of Customer — words they use to describe problems |
Buyer Persona: Economic (ROI) | User (UX) | Technical (specs) | Coach (case studies)
Job Statement (JTBD): When [situation], I want [outcome], so that [end result]
| # | Hook Type | Formula |
|---|---|---|
| 1 | Contrarian | "[What everyone believes] is actually wrong..." |
| 2 | Curiosity Gap | "How [person/competitor] [achieved result] without [surprise]" |
| 3 | Data Shock | "[Shocking statistic] — here's what you need to know" |
| 4 | Before/After | "Before: [pain]. After: [dream]. In [timeframe]" |
| 5 | Question | "[Question that hits deepest pain point]?" |
| 6 | Story Open | "At [moment], [character] discovered..." |
| 7 | Authority | "[Credential] + [surprising insight]" |
| 8 | FOMO | "[X people] have [achieved result]. Are you missing out?" |
| 9 | Pain Agitation | "If you're experiencing [specific pain], keep reading..." |
| 10 | Promise | "You'll [result] in [timeframe], even if [obstacle]" |
| 11 | Villain | "[Enemy] is [doing harm] — here's how to fight back" |
| 12 | Insider Secret | "What [experts] don't want you to know..." |
Rule: 1 hook = 1 message. Test 3-5 hooks for each important piece of content.
1. Hero (Customer) → has ONE desire
2. Problem → Villain + External + Internal + Philosophical
3. Guide (You) → Empathy + Authority
4. Plan → 3 simple steps
5. CTA → Direct + Transitional
6. Failure → consequences of inaction
7. Success → the picture of success
Golden Rule: Customer = HERO. You = GUIDE. Never make the brand the main character.
| Principle | Application | Copy Pattern |
|---|---|---|
| Reciprocity | Free guide/trial/tool | "Here's a gift for you..." |
| Commitment | Quiz, micro-actions | "You've completed step 1!" |
| Social Proof | Testimonials, logos | "2,347 businesses trust us..." |
| Authority | Credentials, data | "Research from Harvard..." |
| Liking | Friendly brand voice | "We've been there too..." |
| Scarcity/FOMO | Limited spots, deadline | "Only 5 spots remaining..." |
| Unity | Shared identity | "For those who are building..." |
FOMO 5 layers: Time Scarcity → Quantity Scarcity → Exclusive Access → Social FOMO → Opportunity Cost
Ethical boundary: FOMO must be BASED ON TRUTH. Fake countdowns = permanent brand destruction.
SUCCESs (Made to Stick) — ≥4/6: Simple, Unexpected, Concrete, Credible, Emotional, Stories
STEPPS (Viral Check): Social Currency, Triggers, Emotion (high-arousal), Public, Practical Value, Stories
Grand Slam Offer: Perceived Value = (Dream Outcome × Likelihood) / (Time Delay × Effort)
| CTA Type | When to Use | Example |
|---|---|---|
| Direct | Primary conversion | "Sign Up Now — Free" |
| Transitional | Not ready to buy | "Download Free Checklist" |
| Urgency | Real scarcity | "Only 3 Spots Left — Before 23:59" |
O/CO (Objection/Counter-Objection): Trust → Testimonials. Price → ROI calc. Fit → Case study. Timing → Deadline. Effort → "Done-for-you".
63-70: Exceptional | 49-62: Strong | 35-48: Average | <35: Fail — rewrite
| Type | Hook Focus | Persuasion | CTA |
|---|---|---|---|
| Landing Page | Contrarian/Data Shock | Social Proof + Scarcity | Direct |
| Blog Post | Curiosity Gap/Question | Authority + Value | Transitional |
| Pain Agitation/Story | Reciprocity + Commitment | Direct | |
| Social Media | Insider Secret/FOMO | Social Currency + Emotion | Mixed |
| Ad Copy | Villain/Question | Scarcity + Emotion | Direct |
Final test: "Would you be willing to apply this technique to your own family?"