An operating system for a digital marketer in Kenya
# Marketing Operations System — Foundation Layer
> Built for **Brianna** (Solo Digital Marketer) | Designed by **Daniel** (Full-Stack Engineer/Founder)
> **Core Purpose:** Absorb repetitive marketing plumbing (content prep, publishing, metrics fetching, inquiry lead routing, reporting) so Brianna can focus on creative strategy, high-value customer relationships, and brand voice.
---
## 🏛️ Core Design Principles
1. **Narrow, Single-Purpose Agents over Monoliths:** Every automated task is an isolated unit with clean input/output schemas and visible failure states.
2. **Human-in-the-Loop as a First-Class Feature:** Strategic decisions, content approvals, and pricing are never blindly automated. All agent-drafted copy lands in `pending_approval` for Brianna's one-click sign-off or rejection notes.
3. **Skill Vault as Source of Truth:** Agents must read Brianna's markdown SOP files before drafting or summarizing, preventing generic AI output.
4. **Connectors Before Intelligence:** Platform data pipelines and webhooks must be resilient, observable, and typed before generative layers are attached.
5. **Vertical Slices:** Deliver fully functioning, inspectable features end-to-end.
6. **Boring, Debuggable Tech:** Postgres tables, explicit state machines, and typed `Result ` over silent exceptions.
---
## 📦 System Modules & Failure Modes
### 1. Database Schema (`/supabase/migrations/`)
- **Tables:** `platforms`, `content_items`, `leads`, `metrics_daily`, `skill_files`, `agent_runs`, `raw_inbox_events`.
- **Purpose:** Strict state transitions (`draft` -> `pending_approval` -> `approved` -> `scheduled` -> `published`), non-secret credential references, and automated SLA tracking for inbound leads.
- **Failure Mode & Recovery:** Unhandled database disconnections or schema mismatches are trapped at the repository layer. The UI includes an interactive SQL schema viewer and a one-click seed reset utility for local testing.
### 2. Connector Skeletons (`/src/connectors/`)
- * …