agentleFS
Eugenevdm01Eugenevdm01/eugenes-meta-agent/skills/meta-ads-social-scheduler/SKILL.md

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

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
  1. Distinctive:

    NEVER use "Comment [WORD]" — bot triggers only work if the bot exists

    line 131
  2. Distinctive:

    NEVER use "Join our WhatsApp group"

    line 132
  3. Distinctive:

    ALWAYS use natural CTAs: "link in bio", "follow for more", "save this", "share with someone who needs this"

    line 133
  4. Distinctive:

    All required env vars (GHL key, location ID, OpenAI key)

    line 158
  5. Distinctive:

    After setup, trigger a manual run to verify:

    line 168

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Meta Ads + Social Scheduler

Overview

This skill covers three integrated systems:

  1. Meta Ads Dashboard — Live campaign monitoring across multiple ad accounts with AI diagnostics
  2. Weekly Content Automation — Fully automated weekly content generation and scheduling to all social channels
  3. 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-end

Step 1 — Credentials

Two secrets are required:

SecretWhere to get itNotes
META_ACCESS_TOKENMeta Business Suite → Graph API ExplorerMust be 60-day extended token with ads_read, read_insights
VANX_API_KEYVanX → Settings → API KeysFormat: 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-28

Returns 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:

  1. Currency conversion — Fetch account currency; convert USD→ZAR using live rate from open.er-api.com. Display conversion rate on card.
  2. Spend alert — Configurable daily threshold per account stored in content_settings table. Show red banner when daily average exceeds threshold.
  3. CPL target — Configurable target per account. CPL cells: green ≤ target, yellow ≤ 2× target, red > 2×. See references/dashboard-schema.md.
  4. Fatigue badge — Red 🔥 Fatigue badge on any campaign with frequency > 2.5.
  5. Hooks button — ⚡ Hooks button on fatigued campaigns. Fires getAiSuggestions with a fatigue-specific context string asking for pattern-interrupt replacement hooks.
  6. AI suggestions — Sparkles button on any campaign opens an AI panel with hooks, headlines, diagnosis, and priority action.
  7. 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:

ContentCountChannels
B2C feed posts20FJ Facebook + Experiences Matter + Twitter + Pinterest
B2C stories6FJ Facebook stories + ecomm_adventures IG stories
B2B feed posts20Van Studios Facebook + Twitter + Pinterest + LinkedIn
IG brand posts3ecomm_adventures Instagram feed
IG stories5ecomm_adventures Instagram
Carousels2 (Tue + Thu)FJ Facebook + Van Studios Facebook + ecomm_adventures IG + Pinterest
Reels10 (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.json

CTA 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: true

The 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-log endpoint 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:

  1. Meta API returns data for all accounts
  2. Currency conversion is correct (check the rate displayed on each card)
  3. GHL social accounts are fetched correctly
  4. At least one post is scheduled successfully in VanX Social Planner → Calendar view
  5. At least one image is generated and attached to a post
  6. Google Drive folder is created and files are saved
  7. run_log.json shows no errors

Reference Files

FileWhen to read
references/meta-graph-api.mdSetting up Meta API calls, token refresh, currency handling, error codes
references/vanx-channel-matrix.mdGHL Social Planner API, channel routing, image upload, carousel/story posting
references/content-strategy.mdBrand voice, CTA rules, post structure, dynamic topic research, image prompts
references/dashboard-schema.mdtRPC procedure signatures, DB schema, CPL colour logic, fatigue thresholds

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.