{
 "schema": "aiblocks-page/1",
 "id": "two-pass-meta-ads-agent-builder",
 "type": "skill",
 "name": "Two-pass Meta Ads agent builder",
 "summary": "Plan a Meta Ads agent that checks the numbers first, then asks a stronger AI only about hard cases. Get a build plan, cost caps and tests.",
 "headline": "Two-pass Meta Ads agent builder",
 "subhead": "Tell it about your project, the Meta ad account to review and your spend limits. It plans an agent that reads the numbers first, then sends only the unclear findings to a stronger AI. You get a file plan, a report layout, cost caps and tests. Nothing is built or run.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "medium",
 "tested": true,
 "updated": "2026-10-28",
 "first_published": "2026-10-25",
 "inputs": [
  {
   "type": "codebase",
   "required": true,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  }
 ],
 "outputs": [
  {
   "type": "plan",
   "required": true,
   "label": "Plan",
   "what": "a dated plan: what to do, in what order, with a decision rule for each step"
  },
  {
   "type": "code_change",
   "required": false,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "Your project's code, or a note on its language, where jobs run and how it calls an AI model",
  "The Meta ad account to review (an ID with part hidden is fine) and the date range",
  "Your currency, attribution window, target cost per purchase or return on ad spend, and monthly budget cap",
  "The cheap and the strong AI model you plan to use, and the most you will spend per run and per account",
  "What the agent may do. Read only is the default",
  "Your metric definitions or past reports (optional)"
 ],
 "you_get": [
  "A file-by-file plan for the two passes, with the gaps in your project named",
  "A findings record with dates, currency, attribution window, source numbers, missing fields and an evidence ID",
  "Rules for which findings go to the second pass, with call, time and cost caps for each run",
  "A report layout with findings and evidence IDs, proposed changes, open questions and checks not run",
  "Tests on made-up data, and a list of what is still missing"
 ],
 "use_when": [
  "You want an agent that reviews a Meta ad account on a schedule and writes findings with proof.",
  "Your agent sends every number to one costly AI model and the bill keeps rising.",
  "Your reports contain figures nobody can trace back to the ad account.",
  "You run ads for several clients and must keep each account's data apart."
 ],
 "skip_when": [
  "You want a one-time check of an ad account's results. Use the Meta Ads 30-check account auditor.",
  "You want a report app that compares dated results, not an agent. Use the Meta Ads reporting app planner.",
  "You want the agent to pause ads or change budgets. This plan only proposes changes. A person approves each one.",
  "You have no Meta read access yet. Start with the Meta developer app setup planner.",
  "Your ads run on Google. Use the Google Ads agent development planner."
 ],
 "output_sample": {
  "input": [
   "Your project's code, or a note on how it runs jobs and calls an AI model",
   "The Meta ad account, date range, currency and targets",
   "The two AI models and your cost caps",
   "What the agent may do, with read only as the default"
  ],
  "prerequisites": [
   "Read access to the Meta ad account, through your own Meta developer app (optional until you run it for real)",
   "An AI that can read your code, or code pasted into the chat"
  ],
  "output": [
   {
    "name": "Status",
    "contains": "A plain note that this is a plan and draft code, nothing was run, and what was read."
   },
   {
    "name": "What exists and what is missing",
    "contains": "Your data fetchers, job handlers, metric definitions, model access and cost controls, each marked present or missing."
   },
   {
    "name": "Findings record",
    "contains": "The fields every finding carries, including dates, currency, attribution window and an evidence ID."
   },
   {
    "name": "Pass one and pass two",
    "contains": "What the code checks first, which findings go to the stronger model, and the caps on calls, time and cost."
   },
   {
    "name": "Report layout",
    "contains": "Findings with evidence IDs, proposed changes, open questions and checks not run."
   },
   {
    "name": "Tests to run",
    "contains": "Cases such as thin data, conflicting signals, the wrong account, a budget stop and a model failure."
   },
   {
    "name": "Assumptions, missing and next step",
    "contains": "Starting values to confirm, inputs still missing, and the one smallest step to take first."
   }
  ]
 },
 "output_shape": "STATUS\n<plan and draft code only; nothing run; what was read>\n\nWHAT EXISTS AND WHAT IS MISSING\n<data fetchers, job handlers, metric definitions, model access, cost controls: present | missing>\n\nFINDINGS RECORD (draft)\n<fields: dates, currency, attribution window, source metrics, missing fields, derived values, evidence ID>\n\nPASS ONE: TRIAGE\n<what the code checks, against which targets, how findings are ranked>\n\nPASS TWO: HARD CASES\n<which findings go on, the question for each, call, time and cost caps>\n\nREPORT LAYOUT\nFindings with evidence IDs | Proposed changes | Open questions | Checks not run\n\nCHECKS BEFORE THE REPORT IS SHOWN\n<numbers supported, right account, no secrets, no clashing advice>\n\nTESTS TO RUN\n<number> | <case> | <expected result>\n\nASSUMPTIONS\n<each starting value and what to check it against>\n\nMISSING\n<each missing input and what it stops>\n\nNEXT STEP\n<the smallest useful step>",
 "how_to_use": [
  "Open the skill in your AI. Claude Code or Codex can read your project. In a chat AI, paste the code that fetches data and calls AI models.",
  "Give the account, date range, currency and targets. Never paste a token or key. Name the setting that holds it.",
  "Say which AI models you use and your cost caps. Mark any number you are guessing.",
  "Read the part on what you have and what is missing first. Check that each point is true for your project.",
  "Ask for draft code only after you accept the plan. Run it on made-up data before any real account.",
  "Before a real run, fill every line under MISSING. Meta read access comes first. The Meta developer app setup planner covers it."
 ],
 "checks": [],
 "next": [],
 "source": null,
 "credits": [],
 "files": [
  "references/worked-example.md"
 ],
 "links": {
  "page": "https://useaiblocks.com/skills/two-pass-meta-ads-agent-builder",
  "markdown": "https://useaiblocks.com/skills/two-pass-meta-ads-agent-builder.md",
  "json": "https://useaiblocks.com/skills/two-pass-meta-ads-agent-builder.json",
  "instructions": "https://useaiblocks.com/skills/two-pass-meta-ads-agent-builder/SKILL.md",
  "download": "https://useaiblocks.com/skills/two-pass-meta-ads-agent-builder.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/two-pass-meta-ads-agent-builder",
  "api_document": "https://useaiblocks.com/api/v1/documents/skill/two-pass-meta-ads-agent-builder",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
