Marketing Agency

Autonomous content marketing system for solo consultancy firms

Python FastAPI Claude Code Skills Jinja2 httpx

Project Overview & Problem Statement

Challenge: Solo consultancy firm owners know they need consistent content marketing to attract clients, but producing weekly blog posts, LinkedIn content, and lead follow-ups takes 4-6 hours per week. Most skip it entirely, losing the compounding effect of SEO and social presence.

Solution: Marketing Agency is an autonomous system that produces all weekly marketing content in one command. It writes and publishes a blog post, generates 4 LinkedIn post drafts (2 for the analytics practice, 2 for the AI solutions practice), tracks leads from 3 channels, and drafts personalized WhatsApp follow-up messages. Total weekly human involvement: 25 minutes.

Key Benefits

Application Features

Content Tab

Shows all LinkedIn drafts ready to paste, with pending count badge. Displays recent blog posts published, blog drafts in progress, and git commit activity for the past 7 days.

Pipeline Tab

Shows the next topic in the publish queue, case study inventory stats, Pau AI solution categories, publish history, and the coordinator's next-week recommendation.

Weekly Report Tab

Displays coordinator reports with full content — what was published, leads received, which content drove leads, action items, and next week's recommended topic.

Leads Tab

Reads from the Web Chat Lead Manager API. Shows total leads, leads by channel (Google Ads, Blog, Chat Widget), blog performance correlation, and lead status pipeline.

/run-content-week Skill

Chains 4 existing skills into one pipeline: picks topic, writes blog, publishes to GitHub Pages, writes LinkedIn teaser. Then generates 3 more LinkedIn posts (insight, solution showcase, use case spotlight).

/check-leads Skill

Reads all leads from the API, filters by status (New/Qualifying), sorts by urgency score, and drafts channel-specific WhatsApp follow-up messages with personalized openers.

AI Integration & Intelligence

Skill Chaining

The system chains 6 Claude Code skills in sequence: content-scheduler picks the topic, blog-write creates the draft, blog-publish deploys to GitHub Pages, linkedin-post-writer creates the teaser, then standalone insight and Pau AI posts are generated.

Brand Voice Enforcement

Every piece of content reads the brand voice guidelines before generation. Banned words, tone rules, and vocabulary preferences are applied automatically. No jargon, no corporate filler.

Lead Classification

The Web Chat Lead Manager uses Ollama (local LLM) to classify every lead: urgency score 1-5, category assignment, and a suggested WhatsApp opener. The check-leads skill uses this classification to prioritize follow-ups.

Feedback Loop

The coordinator reads which blog slugs appear in CH-B leads and recommends similar topics for the next week. Content gets smarter as lead data accumulates.

Technical Architecture & Implementation

Dashboard Stack

Python FastAPI Jinja2 httpx HTML/CSS

Skill System

Claude Code 6 Chained Skills Markdown-based Progressive Disclosure

Lead Management

FastAPI SQLite Ollama / Llama3 Gmail Alerts Railway

System Architecture

Development Setup & Installation Guide

Prerequisites

Quick Start Installation

# Clone the repository git clone https://github.com/lyven81/ai-project.git cd ai-project/projects/marketing-agency # Install dependencies pip install -r requirements.txt # Launch the dashboard python -m uvicorn app:app --host 0.0.0.0 --port 8100 --reload # Or simply double-click start.bat

Configuration

# config.py contains all paths # Update these if your repo locations differ: PAU_ANALYTICS_REPO = "path/to/your/website/repo" PAU_AI_TEMPLATE_DIR = "path/to/your/ai/templates" LEAD_MANAGER_URL = "http://localhost:8000"

Key Metrics

25 min
Weekly Human Involvement
5
Content Pieces Per Week
6
Skills Chained
4
Dashboard Tabs

Business Value