meta-ads-social-scheduler
Skill4 starsChanged 6 months agoMITView on GitHub
End-to-end workflow for building a Meta Ads performance dashboard and automated weekly social media content scheduler integrated with VanX Funnels (GoHighLevel). Use when: (1) building or updating a live Meta Ads monitoring dashboard with multi-account support, spend alerts, CPL targets, and creative fatigue detection; (2) scheduling weekly social content (feed posts, stories, reels, carousels) to all connected VanX/GHL social accounts automatically; (3) setting up or updating the weekly content automation script that generates AI copy, images, dynamic reel topics, and carousel posts from live research and posts them without manual involvement.
- Reads credentials
In this repository30 other files it gives its agents.
- ad-copywriterSkill
- automated-video-editorSkill
- canva-mcpSkill
- challenge-campaign-operatorSkill
- creative-strategistSkill
- daily-growth-operatorSkill
- funnel-junkies-video-publisherSkill
- funnel-message-match-auditorSkill
- ghl-funnel-inspectorSkill
- gws-best-practicesSkill
- landing-page-cro-analystSkill
- manus-apiSkill
- meta-ads-analyzerSkill
- meta-ads-campaign-auditorSkill
- meta-ads-performance-analystSkill
- meta-live-campaign-launch-operatorSkill
- meta-paid-ads-challenge-operatorSkill
- meta-safe-campaign-builderSkill
- music-prompterSkill
- performance-reportingSkill
- persistent-computingSkill
- qualified-lead-scoringSkill
- skill-creatorSkill
- social-media-content-dashboardSkill
- split-test-evaluatorSkill
- vanx-meta-purchase-repairSkill
- vanx-social-plannerSkill
- video-generatorSkill
- weekly-content-operatorSkill
- workshop-workbook-builderSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 131
NEVER use "Comment [WORD]" — bot triggers only work if the bot exists
- Distinctive: line 132
NEVER use "Join our WhatsApp group"
- Distinctive: line 133
ALWAYS use natural CTAs: "link in bio", "follow for more", "save this", "share with someone who needs this"
- Distinctive: line 158
All required env vars (GHL key, location ID, OpenAI key)
- Distinctive: line 168
After setup, trigger a manual run to verify:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Meta Ads + Social Scheduler
Overview
This skill covers three integrated systems:
- Meta Ads Dashboard — Live campaign monitoring across multiple ad accounts with AI diagnostics
- Weekly Content Automation — Fully automated weekly content generation and scheduling to all social channels
- Scheduled Task — Sunday automation that runs the full pipeline without manual involvement
The canonical implementation lives in the fj-content-dashboard webdev project. Use this skill when building the same system for a new client or extending the existing one.
Workflow
1. Set up credentials (Meta token + VanX API key)
2. Discover account IDs (Meta ad accounts + GHL social accounts)
3. Build or update the Meta Ads dashboard
4. Build or update the weekly automation script
5. Schedule the automation (Sunday 08:00 UTC / 10:00 SAST)
6. Run a manual test pass to verify end-to-endStep 1 — Credentials
Two secrets are required:
| Secret | Where to get it | Notes |
META_ACCESS_TOKEN | Meta Business Suite → Graph API Explorer | Must be 60-day extended token with ads_read, read_insights |
VANX_API_KEY | VanX → Settings → API Keys | Format: pit-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
Also note: LOCATION_ID (GHL sub-account ID) — found in VanX URL or Settings.
Token refresh: Meta tokens expire in 60 days. Set a calendar reminder at 55 days. See references/meta-graph-api.md for the exchange endpoint.
Step 2 — Discover Account IDs
Meta ad account IDs:
GET https://graph.facebook.com/v19.0/me/adaccounts?fields=id,name,currency&access_token={TOKEN}Returns act_XXXXXXXXX format IDs. Note the currency field — accounts billed in USD need ZAR conversion.
GHL social account IDs:
GET https://services.leadconnectorhq.com/social-media-posting/oauth/{LOCATION_ID}/accounts
Authorization: Bearer {VANX_API_KEY}
Version: 2021-07-28Returns all connected social profiles with id, name, type (facebook/instagram/tiktok/etc.).
Save both sets of IDs to a config dict in the automation script. See references/vanx-channel-matrix.md for the full channel routing matrix.
Step 3 — Meta Ads Dashboard
The dashboard is a tRPC-based React page. Key components:
Layout: Three account overview cards side-by-side at the top → campaign tables grouped per account below → strategic AI panel at the bottom.
Per-account overview card shows: Spend, Campaigns, Reach, Impressions, Clicks, Leads, Purchases, Avg CTR, Avg CPM, Avg Frequency, Overall CPL, Fatigued count.
Campaign table columns: Campaign name + fatigue badge, Spend, Reach, Impressions, Frequency, CPM, CTR, CPC, Leads, CPL (colour-coded), Purchases, Tools (Sets / AI / Hooks buttons).
Key features to implement:
- Currency conversion — Fetch account currency; convert USD→ZAR using live rate from
open.er-api.com. Display conversion rate on card. - Spend alert — Configurable daily threshold per account stored in
content_settingstable. Show red banner when daily average exceeds threshold. - CPL target — Configurable target per account. CPL cells: green ≤ target, yellow ≤ 2× target, red > 2×. See
references/dashboard-schema.md. - Fatigue badge — Red 🔥 Fatigue badge on any campaign with frequency > 2.5.
- Hooks button — ⚡ Hooks button on fatigued campaigns. Fires
getAiSuggestionswith a fatigue-specific context string asking for pattern-interrupt replacement hooks. - AI suggestions — Sparkles button on any campaign opens an AI panel with hooks, headlines, diagnosis, and priority action.
- Strategic recommendations — Bottom panel runs a cross-account LLM analysis covering ad performance, creative refresh ideas, and organic content recommendations.
For procedure signatures and DB schema, see references/dashboard-schema.md.
Step 4 — Weekly Automation Script
The script lives at skills/weekly-content-operator/scripts/weekly_automation.py. It runs every Sunday and produces a full week of content.
What it generates per run:
| Content | Count | Channels |
| B2C feed posts | 20 | FJ Facebook + Experiences Matter + Twitter + Pinterest |
| B2C stories | 6 | FJ Facebook stories + ecomm_adventures IG stories |
| B2B feed posts | 20 | Van Studios Facebook + Twitter + Pinterest + LinkedIn |
| IG brand posts | 3 | ecomm_adventures Instagram feed |
| IG stories | 5 | ecomm_adventures Instagram |
| Carousels | 2 (Tue + Thu) | FJ Facebook + Van Studios Facebook + ecomm_adventures IG + Pinterest |
| Reels | 10 (1/day Mon–Fri) | TikTok + IG Reels + FJ Facebook + Van Studios Facebook + YouTube Shorts |
Script structure:
1. fetch_trending_topics() — RSS + Reddit → 10 unique reel topics
2. generate_b2c_posts() — 20 posts via LLM
3. generate_b2b_posts() — 20 posts via LLM
4. generate_ig_posts() — 3 brand posts via LLM
5. generate_reel_scripts() — 10 scripts from dynamic topics
6. generate_carousels() — 2 carousels (AI news + tips)
7. generate_images() — AI images for all content
8. upload_images_to_ghl() — Upload to GHL media library
9. schedule_all_posts() — POST to GHL Social Planner API
10. save_to_drive() — Archive to Google Drive
11. log_results() — Write run_log.jsonCTA rules (enforced in LLM prompts):
- NEVER use "Comment [WORD]" — bot triggers only work if the bot exists
- NEVER use "Join our WhatsApp group"
- ALWAYS use natural CTAs: "link in bio", "follow for more", "save this", "share with someone who needs this"
See references/content-strategy.md for full copy guidelines, brand voice, and image prompt templates.
Dynamic reel topics: Topics are generated fresh each week from live RSS + Reddit data. Do NOT use a fixed topic list. See references/content-strategy.md for the research sources and topic angle frameworks.
Carousel structure: 5 content slides + 1 CTA/follow slide. Schedule as a multi-image post — GHL renders it as a swipeable carousel. See references/vanx-channel-matrix.md for the carousel API pattern.
Platform limitations:
- TikTok and YouTube Shorts require video files — text/image posts are rejected. Schedule reel covers as placeholders and note that video upload is manual or requires a video generation tool (e.g., Runway, Kling).
- LinkedIn token may expire independently — wrap in try/except and skip gracefully.
Step 5 — Scheduled Task
Schedule using the schedule tool with a cron expression:
cron: "0 0 8 * * 0" # Every Sunday at 08:00 UTC (10:00 SAST)
repeat: trueThe scheduled task prompt must include:
- The full path to the automation script
- All required env vars (GHL key, location ID, OpenAI key)
- Instructions to POST results to the site's
/api/scheduled/content-logendpoint if the site is deployed - A summary of what to do if a step fails (skip and continue, log the error)
Important: The scheduled task runs in an isolated sandbox with no access to the current session. All credentials and instructions must be self-contained in the prompt.
Step 6 — Manual Test Pass
After setup, trigger a manual run to verify:
- Meta API returns data for all accounts
- Currency conversion is correct (check the rate displayed on each card)
- GHL social accounts are fetched correctly
- At least one post is scheduled successfully in VanX Social Planner → Calendar view
- At least one image is generated and attached to a post
- Google Drive folder is created and files are saved
run_log.jsonshows no errors
Reference Files
| File | When to read |
references/meta-graph-api.md | Setting up Meta API calls, token refresh, currency handling, error codes |
references/vanx-channel-matrix.md | GHL Social Planner API, channel routing, image upload, carousel/story posting |
references/content-strategy.md | Brand voice, CTA rules, post structure, dynamic topic research, image prompts |
references/dashboard-schema.md | tRPC procedure signatures, DB schema, CPL colour logic, fatigue thresholds |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

