spend-watch
Spend watch
A rule produces a check line and a ping. It never produces a change to an account.
The model
A rule is five things: a scope, a metric, a direction, a limit in the user's own
units, and a window. Each rule also carries a severity.
- Scope: account, campaign, or ad set. One named entity or all of them.
- Metric: spend, CPA, ROAS, conversions, CTR, CPC, CPM, or frequency where the export has it.
- Direction: above or below.
- Limit: the number the user chose. Never a number this bot picked.
- Window: today, last 3 days, last 7 days, or month to date.
- Severity: urgent, watch, or note. Urgent pings on its own, watch and note batch into the next
check.
Store one row per rule in /workspace/analytics/thresholds.md:
<scope> | <name> | <metric> | <direction> | <limit> | <window> | <severity>
Quiet floor
A rule does not fire on an entity with fewer than 100 clicks, fewer than 5 conversions, or under
50 in the user's currency of spend in that window. The floor exists because a two click campaign
produces a headline CPA that means nothing. The user can change all three numbers. A suppressed
crossing is still written to the check file as suppressed, with the counts that suppressed it, so
nothing goes silently missing.
Pacing math (only when a monthly budget or daily plan is on file)
- Daily plan is the monthly budget divided by the days in the month, unless the user saved a
different daily plan.
- Month to date pace is spend month to date divided by days elapsed.
- Projected month is the month to date pace times the days in the month.
- Days of budget left is the budget remaining divided by the trailing 7 day daily rate.
- Report pacing as three numbers together: spent so far, projected, and the budget. Never report
a percent without the two numbers under it.
- Without a budget on file, skip pacing and say it is skipped for that reason.
Fire path
Read thresholds.md and ledger.csv. Re-read them every run, never rely on remembered values.
Run ingest-exports. The signed-in platforms are read live first, which is what makes a today
or last 3 days window meaningful. If a platform's session has expired or its newest export is
older than the window a rule needs, the rule does not fire. Say which platform and how stale
the data is in one line, offer the sign in, and move on rather than firing on an old read.
Evaluate each rule in its window, after the quiet floor.
Write every crossing and every suppression to /workspace/analytics/checks/.md with the
numbers behind it, then append fired rules to /workspace/analytics/alerts.md.
Ping the user, one line per fired rule, in this format:
<scope name> | <rule name> | <metric> <direction> <limit>: <the number with its units> over <window> | live <platform> or export <file>, read <date> | <severity>
Under each urgent ping add one line of diagnosis with the number behind it, and one question
about what to do. Never an instruction, never an action.
Never fire the same rule twice for the same crossing. A rule rearms only after the entity comes
back inside the limit for a full window, or the user says to rearm it.
Cap 5 pings per run. More becomes one line: "N more crossings, say show them."
Never
Pause, enable, or edit a campaign, an ad set, a keyword, a bid, or a budget, inside a platform or
anywhere else, even when the signed-in account has admin access. Post an alert anywhere without a
saved destination and an explicit yes. Fire from a stale read without saying how stale. Fire from
a guess when a platform is signed out or an export is missing. Invent a cause for a crossing.
1---2name: marketing-analyst-spend-watch3description: "Use when setting, changing, or running the spend and performance thresholds the user chose. Holds the rule model, the quiet floor, the budget pacing math, the fire path, the ping format, and the rearm rule. Produces a ping and a draft, nev…"4version: 1.0.05platforms: [linux, macos, windows]6metadata:7 source: https://skillmd.com/skills/brokep/marketing-analyst-spend-watch8 hermes:9 tags: ["marketing-analyst", "grok-bot", "marketing"]10 related_skills: ["marketing-analyst--marketing-analyst-setup", "marketing-analyst--connect-accounts", "marketing-analyst--ingest-exports", "marketing-analyst--weekly-report", "marketing-analyst--monthly-report", "marketing-analyst--answer-a-reporting-ask"]11---1213# spend-watch1415# Spend watch1617A rule produces a check line and a ping. It never produces a change to an account.1819## The model20A rule is five things: a **scope**, a **metric**, a **direction**, a **limit** in the user's own21units, and a **window**. Each rule also carries a **severity**.2223- Scope: account, campaign, or ad set. One named entity or all of them.24- Metric: spend, CPA, ROAS, conversions, CTR, CPC, CPM, or frequency where the export has it.25- Direction: above or below.26- Limit: the number the user chose. Never a number this bot picked.27- Window: today, last 3 days, last 7 days, or month to date.28- Severity: urgent, watch, or note. Urgent pings on its own, watch and note batch into the next29 check.3031Store one row per rule in /workspace/analytics/thresholds.md:3233`<scope> | <name> | <metric> | <direction> | <limit> | <window> | <severity>`3435## Quiet floor36A rule does not fire on an entity with fewer than 100 clicks, fewer than 5 conversions, or under3750 in the user's currency of spend in that window. The floor exists because a two click campaign38produces a headline CPA that means nothing. The user can change all three numbers. A suppressed39crossing is still written to the check file as suppressed, with the counts that suppressed it, so40nothing goes silently missing.4142## Pacing math (only when a monthly budget or daily plan is on file)43- Daily plan is the monthly budget divided by the days in the month, unless the user saved a44 different daily plan.45- Month to date pace is spend month to date divided by days elapsed.46- Projected month is the month to date pace times the days in the month.47- Days of budget left is the budget remaining divided by the trailing 7 day daily rate.48- Report pacing as three numbers together: spent so far, projected, and the budget. Never report49 a percent without the two numbers under it.50- Without a budget on file, skip pacing and say it is skipped for that reason.5152## Fire path531. Read thresholds.md and ledger.csv. Re-read them every run, never rely on remembered values.542. Run ingest-exports. The signed-in platforms are read live first, which is what makes a today55 or last 3 days window meaningful. If a platform's session has expired or its newest export is56 older than the window a rule needs, the rule does not fire. Say which platform and how stale57 the data is in one line, offer the sign in, and move on rather than firing on an old read.583. Evaluate each rule in its window, after the quiet floor.594. Write every crossing and every suppression to /workspace/analytics/checks/<date>.md with the60 numbers behind it, then append fired rules to /workspace/analytics/alerts.md.615. Ping the user, one line per fired rule, in this format:6263 `<scope name> | <rule name> | <metric> <direction> <limit>: <the number with its units> over64 <window> | live <platform> or export <file>, read <date> | <severity>`65666. Under each urgent ping add one line of diagnosis with the number behind it, and one question67 about what to do. Never an instruction, never an action.687. Never fire the same rule twice for the same crossing. A rule rearms only after the entity comes69 back inside the limit for a full window, or the user says to rearm it.708. Cap 5 pings per run. More becomes one line: "N more crossings, say show them."7172## Never73Pause, enable, or edit a campaign, an ad set, a keyword, a bid, or a budget, inside a platform or74anywhere else, even when the signed-in account has admin access. Post an alert anywhere without a75saved destination and an explicit yes. Fire from a stale read without saying how stale. Fire from76a guess when a platform is signed out or an export is missing. Invent a cause for a crossing.