--- name: cm-content-factory description: "Self-learning SEO content pipeline: dashboard, multi-agent queue, token budgets, research → write → audit → publish. StoryBrand/Cialdini/JTBD-style frameworks; config-driven. Use for content factory, batch articles, or scaled publishing." --- # CM Content Factory v2.0 — AI Content Machine Platform Config-driven, **self-improving** content factory with **real-time dashboard**, **multi-agent independence**, and **token management**. Gets smarter with use through memory + reward system. ## Architecture ``` ┌─────────────────────────────────────────────┐ │ 🌐 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`. --- ## 🚀 Quick Start ```bash # 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 ``` ### Phase 0: Discovery (MANDATORY) 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 | ### Phase 0.5: Confirm Display summary table → **WAIT for user OK** → then proceed. --- ## Operating Modes (12) | 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/