/sparkx-ai-mcp:sparkx-weekly-ads-reportfrom sparkx-ai-mcp
Generates a weekly ad performance recap report for ads ops and customer-facing teams. Includes KPI card with week-over-week comparison, 7-day trend, anomaly summary, top-mover lists, and next-week action recommendations. Activated by phrases like "出个周报", "周复盘", "上周表现如何", or "weekly report".
Ships in sparkx-ai-mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill does not map to a single MCP tool of its own — it orchestrates three existing read tools, each already covered by its own skill:
get_ads_perf → sparkx-query-ads-performanceget_operation_log → sparkx-query-operation-logget_entity_metadata → sparkx-query-entity-metadataDependency — install these three base skills alongside this one:
sparkx-query-ads-performance,sparkx-query-entity-metadata,sparkx-query-operation-log. Skills install as sibling directories under your current agent's skills root (.claude/skills/<name>/for Claude Code; the equivalent root for other agents — see the installation notes in README), which is exactly what the../query-.../…links above (and elsewhere in this doc) resolve against — if a base skill isn't installed there, those links won't resolve and this skill can't run. Install all three first.
Read those three SKILL.md files first (parameter formats, field-naming rules, the Ratio Metric Display Rule) plus references/platform-notes.md (auth flow, error handling, pagination, date-range limits, currency rules — shared by all three underlying tools). This document only covers logic specific to the weekly-report use case; it doesn't repeat what the three base skills already document.
The worked examples and output templates below are written in Chinese (matching this product's primary customer base), but they are structural illustrations, not literal text to copy verbatim. Generate the actual report in whatever language the user asked in — section headers, KPI labels, the one-line summary, everything. A customer who asks in English should get an English report with English headers ("Weekly KPI Overview", not "本周 KPI 概览"); a customer who asks in Japanese should get one in Japanese. Do not assume the audience is Chinese-speaking just because this skill's own documentation and templates are.
When calling get_ads_perf, also set the language parameter (zh/en/ja) to match the customer's language — this controls the human-readable enum companion text the tool returns (e.g. campaignTypeText, targetMatchTypeText), so a customer reading an English report doesn't see a Chinese enum label embedded in an otherwise-English table. get_entity_metadata has no language parameter — it's not in that tool's documented parameter list. Localize its enum values using the returned {field}Text companion fields, or sparkx-query-entity-metadata's own enum-i18n.md if a given enum has no Text companion — don't pass language to get_entity_metadata expecting it to have the same effect as on get_ads_perf.
Trigger phrases: 周报, 周复盘, 上周表现, weekly report, recap last week, 周会材料
User roles: ads ops, customer-facing AM/CSM
Core question: what happened last week, what to do this week
Not for:
sparkx-monthly-ads-report / quarterly-ads-report (not yet built)sparkx-ads-structure-analysis| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
profileIds | array[long] | No | — | Target profile IDs. See "Resolving profileIds" below for the exact selection rules — don't default to "all stores" without checking those rules first |
weekEnding | date (YYYY-MM-DD) | No | Last Sunday (local timezone) | The end date (Sunday) of the week this report covers |
compareBaseline | enum | No | wow | wow | wow+4w_avg (the latter also compares against the trailing-4-week average) |
outputFormat | enum | No | markdown | markdown | structured_report |
includeAiSection | bool | "auto" | No | auto | Whether to include an AI-managed summary section (auto = include if the store has AI management enabled) |
profileIdsAlways call get_user_authorized_context first to get the authorized profiles list, then apply exactly one of these cases:
profileIds.profiles list and ask them to pick one, several, or explicitly confirm "all stores" before proceeding.Case 4's threshold exists because this is a customer-facing report, not an internal dashboard: a silent multi-store aggregate can hide a single store's problem behind a healthy-looking blended number, and it forces an unannounced USD conversion (see "Multi-Store and Currency" below) the customer didn't ask for.
Determining includeAiSection=auto: call get_entity_metadata (entity: aiGroup, filtered to the relevant profileIds; add filters: {"aiStatus": 1}, or fully paginate — default page size is 100, so an account with more managed groups than one page could otherwise have its only running group sitting past page 1 and be missed). If any returned row has aiStatus: 1 (running), include the full AI-managed summary section. If none are currently running but Step 2f's change summary still shows managed-group (AI) activity for the week (a group may have been toggled off partway through), include a brief one-line mention instead of a full section — the activity is still worth surfacing, just not as prominently as an actively-running group.
These rules match sparkx-search-term-diagnosis and sparkx-promo-reset, so the same store
gets the same numbers whichever skill answers. Those two skills are separate installs: mention
them as "if installed", and when the user doesn't have them, say what to look at instead -
never promise to run a skill that may not be there.
targetAcos as thresholds -
one store can have dozens, from single digits to over 200%, and rank-push or launch groups set
it high on purpose.T, where T = average order value x target
ACOS = (Sales / Conversions) x target ACOS over the report's scope and period (target ACOS as
a fraction: get_ads_perf's ACOS value 35 is 0.35). T is one order's allowed spend -
the entity already spent what an order may cost and got none. It works in every currency and
price range, so there is no fixed money floor. No orders or no sales in the period -> T
can't be derived; say so instead of flagging.campaign.aiGroupId_ in get_ads_perf (or aiGroupId on get_entity_metadata's campaign
entity; an unmanaged campaign has 0); the group's aiStatus comes from
get_entity_metadata (entity: aiGroup). The AI sets those campaigns' bids and budgets, so a
manual bid or budget change gets overwritten: recommend the group's levers instead (target
ACOS, group budget, an action-space switch) or say the AI is handling it. No bid advice with
numbers anywhere; for an unmanaged campaign give at most a direction ("consider lowering
bids on ..."). Keyword-level actions (pausing a zero-order exact keyword, negatives) need
keyword and search-term data - point to sparkx-search-term-diagnosis (if installed).changeBy and classify
changedBy client-side: an email or Manual is a person. Amazon Console says where a change came from, not who made it - Amazon's side. Report it as an Amazon-side change, not as a person. Everything else
(AI, Automation, AI-Custom Rule, Budget Management, Lock Ranking, API, Labels,
System) is a machine. changeBy=manual is rejected by the server (case-insensitive, in IN, NOT_IN or mixed) — it was a UI category, not an operator, and never covered changes recorded under a user's email. Inside
managed groups the AI moves currentBudget every hour and those rows are also
Budget Increased - leave them out of counts and "what changed" lists (a person's budget
change is on dailyBudget). Group setting changes (target ACOS, personality, switches) are
aiGroup rows, not campaign rows; their timestamps are UTC, while campaign rows are
store-local when one profile is queried - label the clock.sparkx-promo-reset (if installed) restores them.[weekEnding − 6d, weekEnding] (7 days inclusive)[weekEnding − 13d, weekEnding − 7d]compareBaseline=wow+4w_avg): trailing weekly average over [weekEnding − 34d, weekEnding − 7d] (28 days = 4 weeks) — see Step 2g and Step 3 for why this must be a weekly figure, not a daily oneThese three windows are 7 / 7 / 28 days respectively — all comfortably within get_ads_perf/get_operation_log's 90-day single-call cap, so no window-splitting is needed.
⚠️ Data-maturity check (matters especially because this report is meant to run every Monday): there are two different effects and only one of them is about the last day or two.
weekEnding is in the past in the store's timezone. Only the current store-local day is still accumulating.What to do: state once, near the top, that Sales / Conversions / ACOS / ROAS / CVR for the reported week are provisional and will move as attribution completes, and that ACOS will tend to fall and ROAS to rise as sales backfill. Be especially careful with WoW: if the prior week's window has matured and the reported week's has not, part of any "decline" is the window, not performance — say so instead of reporting it as a finding. See get_ads_perf's field reference → "The attribution window is not the same for every ad type" for the per-type figures.
The calls below are independent and can be issued in parallel. Every call needs userContext (non-empty string, ≤100 chars). None of them add a campaign.campaignState_ filter — the WoW comparison needs to see a campaign that was running last week but paused this week (see Step 5); adding a state filter would make that campaign disappear from both periods instead of showing up as a real finding.
a. This week, daily granularity (account-level trend)
{
"profileIds": [4404871489220462],
"factEntity": "campaign",
"dateStart": "{this Monday}",
"dateEnd": "{weekEnding}",
"select": ["date"],
"metrics": ["Impressions", "Clicks", "Spend", "Sales", "Conversions", "ACOS", "ROAS", "CTR", "CVR"],
"orderBy": [{"field": "date", "direction": "ASC"}],
"pageSize": 500,
"userContext": "Weekly report - this week's daily trend"
}
No campaign dimension in select — just ["date"] — gives account-level daily totals across all campaigns, blended across every profile in profileIds.
⚠️ Overall trend vs. per-store trend — don't blend these two shapes. The call above (select: ["date"]) is for the single blended trend line covered by "## 2. 7-Day Trend" below. If the customer instead wants to see each store's trend separately (not one blended line), that's a different call: add profile.profileId_/profile.profileName_ to select alongside date — but doing so changes the row granularity from one row per day to one row per day × per profile. Don't apply the "Multi-Store and Currency" section's advice to add profile.profileId_ to this call by reflex when you actually want the single blended trend — that advice is for the campaign-level calls (c/d) where per-store attribution is the point; here it would silently fragment the trend into N per-store lines instead of the one overall line the KPI section expects. If you need both, issue both shapes as separate calls rather than trying to compute one from the other after the fact.
b. Last week, daily granularity — identical shape, dateStart/dateEnd shifted back to last week's window.
c. This week, campaign-level (feeds Top Movers)
{
"profileIds": [4404871489220462],
"factEntity": "campaign",
"dateStart": "{this Monday}",
"dateEnd": "{weekEnding}",
"select": ["profile.profileId_", "campaign.campaignId_", "campaign.campaignName_", "campaign.aiGroupId_"],
"metrics": ["Impressions", "Clicks", "Spend", "Sales", "Conversions"],
"orderBy": [{"field": "profile.profileId_", "direction": "ASC"}, {"field": "campaign.campaignId_", "direction": "ASC"}],
"pageSize": 500,
"userContext": "Weekly report - this week's campaign performance for WoW comparison"
}
select must include campaign.campaignId_ (not just the name) — Step 5 joins by ID, not name. campaign.aiGroupId_ tells Step 6 which campaigns sit in a managed group. Response keys drop the prefix and the trailing _ (campaign.campaignId_ comes back as campaignId) - normalize with key.rsplit('.', 1)[-1].rstrip('_') before joining.
orderBy is not optional here. A store with more than one page of campaigns pages unsorted without it, so campaigns are repeated or dropped - and a dropped campaign does not merely go missing, Step 5 reads it as launched or stopped. The sort is the pair profile.profileId_ then campaign.campaignId_, both already in select, so several stores in one call stay apart; use the same pair when matching the two weeks.
d. Last week, campaign-level — same shape as c, dateStart/dateEnd shifted back a week; everything else (select/metrics/orderBy/filters) must match c exactly, or the two periods aren't comparable.
e. This week, Top 10 ASINs
{
"profileIds": [4404871489220462],
"factEntity": "asin",
"dateStart": "{this Monday}",
"dateEnd": "{weekEnding}",
"select": ["asin.asin_", "asin.asinTitle_"],
"metrics": ["TotalSalesAmount", "OrderCount", "TACOS"],
"orderBy": [{"field": "TotalSalesAmount", "direction": "DESC"}],
"pageSize": 10,
"userContext": "Weekly report - top 10 ASINs by sales"
}
⚠️ TACOS here is an ASIN-grain TACOS: its numerator is SP + SD spend only. SB has no ASIN to attribute to, so the spend is short a whole ad type while TotalSalesAmount still counts every sale. It understates by roughly the brand's SB share and is not comparable with a store-level TACOS or target. Say which grain the figure is, and give the store-level TACOS alongside when the question is about total ad cost. Details and a worked measurement: sparkx-query-ads-performance field reference.
When profileIds spans more than one store, decide which of two different questions you're actually answering — the same call doesn't serve both:
profile.profileId_ to select — same as the single-store call above, factEntity: asin with select: ["asin.asin_", "asin.asinTitle_"] already aggregates TotalSalesAmount across every profile in profileIds per ASIN, and orderBy+pageSize:10 gives you the correct blended top 10 directly.profile.profileId_/profile.profileName_ to select. This changes the grouping to ASIN × profile, and orderBy+pageSize:10 at that point returns the top 10 ASIN×profile combinations overall (by global rank across every store's ASINs mixed together) — it does not give you 10 rows for each store. To get a genuine per-store Top 10, either issue one call per profileId, or raise pageSize enough to pull the full set and then group by profile.profileId_ client-side, sorting and truncating to 10 within each group.Don't reach for profile.profileId_ by default "for attribution" here — decide which of the two questions above the customer actually asked first.
f. This week's change summary (using get_operation_log, which is real — not a subscription alert feed)
{
"profileIds": [4404871489220462],
"dateStart": "{weekEnding − 20d}",
"dateEnd": "{weekEnding}",
"pageSize": 200,
"userContext": "Weekly report - changes this week, last week and the week before"
}
The window covers this week, last week (the baseline) and 7 days before it, so a promotion
signal in the baseline or its lead-in is visible. The change summary in Step 4b shows this
week's rows only; the earlier rows are used only for the promotion signal.
No changeBy: classify changedBy client-side into people and machines, and drop the AI's hourly currentBudget rows, per "Shared Rules" above. Check truncated: if true, the queried operation-log window (21 days) had more than 200 ops — follow sparkx-query-operation-log's "Getting a Complete Count" procedure (split into non-overlapping sub-windows and recurse) before summing; don't treat this one page as the full window.
Step 2f as a whole is best-effort, not a hard dependency for the rest of the report. If splitting into sub-windows is still timing out, or the call keeps erroring, don't let it block Steps 3/5/6 (KPI overview, Top Changes, action recommendations) from completing. Produce the rest of the report normally and mark this section explicitly as "change history incomplete for the queried window" (or similar, in the report's own language) rather than failing the entire report over one section.
g. 4-week average baseline (only when compareBaseline=wow+4w_avg)
{
"profileIds": [4404871489220462],
"factEntity": "campaign",
"dateStart": "{weekEnding − 34d}",
"dateEnd": "{weekEnding − 7d}",
"select": ["date"],
"metrics": ["Impressions", "Clicks", "Spend", "Sales", "Conversions"],
"orderBy": [{"field": "date", "direction": "ASC"}],
"pageSize": 500,
"userContext": "Weekly report - trailing 4-week average baseline"
}
Same shape as call (a) (account-level, date-only select), just a 28-day window instead of 7.
Only these 5 base metrics are requested — deliberately no ACOS/ROAS/CTR/CVR in this call. Sum each across the 28 days, then divide by 4 (not 28) to get a trailing-4-week weekly average. Dividing by 28 would give a daily average, which is not directly comparable to "this week"'s 7-day total (that mismatch would make a perfectly flat week look like a several-hundred-percent spike) — both figures compared in Step 3 must be on the same "per week" scale.
Then recompute the ratio metrics from those summed base metrics using the standard formulas — ACOS = Spend/Sales×100, ROAS = Sales/Spend, CTR = Clicks/Impressions×100, CVR = Conversions/Clicks×100. Ratio metrics were left out of metrics above specifically so there's no 28-daily-values version of them lying around to be misused — summing or averaging 28 individual days' ACOS/ROAS/CTR/CVR is never valid (same principle as never averaging pre-computed ratios across a split window — see the aggregation-over-time example in sparkx-query-ads-performance), so don't request them here in the first place. Whether you apply the formulas to the raw 28-day sums or to the ÷4 weekly averages makes no difference to the result (the formulas are scale-invariant).
Skip this call entirely when compareBaseline=wow (the default) — don't issue it if the report doesn't need it.
Total KPIs (8): Spend, Sales, ACOS, ROAS, Impressions, Clicks, CTR, CVR
For each: this-week value, last-week value, WoW % ((this week − last week) / last week × 100; undefined when last week is 0 — show "N/A (no prior baseline)", never a large number or "+∞%"), direction arrow (↑↓ + color in a rendering context that supports them; in a plain-text-only context — e.g. a CLI that won't reliably render emoji or color — spell it out as "up"/"down"/"flat" instead)
When compareBaseline=wow+4w_avg: additionally include the trailing-4-week weekly average from Step 2g and a vs. 4-week avg % computed the same way as WoW ((this week − 4-week avg) / 4-week avg × 100, same zero-denominator handling). Per Step 2g: the 5 base metrics use 28-day sum ÷ 4 (not ÷ 28, which would be a daily figure not comparable to this week's 7-day total); the ratio metrics (ACOS/ROAS/CTR/CVR) are not divided by anything directly — they're recomputed from those summed base metrics via their standard formulas. Add the baseline as a third column alongside This Week / Last Week in both output templates below — don't compute this baseline without displaying it, and don't display the column without actually computing it.
Ratio-metric display rule (same rule shared across the three base skills): confirmed percentage metrics such as ACOS, CTR, CVR, TACOS, and the derived *Rate metrics explicitly listed in Platform Notes are pre-scaled ×100 (the tool returns 17.61 meaning 17.61%) — append % directly, do not multiply/divide by 100 again. Do not infer an unlisted field's scale from its name alone; ROAS/CPC/CPA are not percentages, they're plain ratios/unit-costs — no %.
Top Changes candidates (Step 5): there is no percentage pre-screen - every campaign that passes the floor below is a candidate, and Step 5's ranking decides what makes the lists. Tested on 16 accounts in 2026-11, any fixed spend or ACOS % cut still flagged 33-86% of campaigns in accounts whose campaigns move unevenly, so it filtered nothing. Page both weeks' campaign pulls sorted on the campaign ID (platform-notes, Pagination) - unsorted pages overlap and silently drop campaigns.
There is no independent alert/subscription data source — get_operation_log is a change-history query tool, not a subscription-based alerting system; there is no log_type=alert parameter. Anomaly identification is entirely built from these two pieces:
a. Built-in rule scan over this week's campaign data (using Step 2c's result):
Conversions = 0 and Spend >= T (one order's allowed spend - see "Shared Rules"; T comes from this week's account totals and the target ACOS). No fixed money floor.This week's ACOS > last week's ACOS × 1.5 AND this week's ACOS > 30% → ACOS spike. Step 2c/2d's metrics list doesn't include ACOS directly — compute it per campaign as Spend/Sales×100 from each period's own Spend/Sales. When a campaign's Sales = 0, its ACOS is undefined (division by zero), not "infinite" — exclude that campaign from the ACOS-spike rule entirely rather than computing a fabricated huge number (a zero-Sales, nonzero-Spend campaign is already caught by the high-spend/zero-orders rule above, so it isn't silently missed).This week's Impressions < last week's Impressions × 0.5 → impression collapseb. Step 2f's change summary, in two parts: people - every human change on budgets, bids, status and managed-group settings this week (these are what Step 6 correlates with); machines - the top 3 action categories (actionType/operationType, hourly currentBudget rows excluded) + the top 3 highest-spend-impact records (cross-reference that campaign's spend from Step 2c). This is a change record, not an anomaly verdict — present it as "what changed this week," not conflated with "anomaly detected."
If neither part turns up anything notable, write "no significant anomalies this week."
Must follow sparkx-query-ads-performance's Period-over-Period and Top Movers example in full — don't simplify by intuition. This is the section most prone to error and most likely to be challenged by a customer:
campaign.campaignId_, never by name — names can be duplicated or renamed between periods. With several stores in one report, join on profile.profileId_ + campaign.campaignId_ and keep the same pair through Step 2's sort, so the store dimension cannot be dropped between pulling and matching.% change (division by zero) — don't force them into a percentage leaderboard.max(this week's spend, last week's spend) — not just this week's value alone — so a campaign that shrank from big to small isn't missed just because its current number looks small.Sales = 0 for a campaign, its ACOS is undefined for that period — exclude it from this ranking rather than computing against a zero denominator; a campaign with zero Sales and nonzero Spend belongs in the high-spend/zero-orders anomaly (Step 4) instead, not the ACOS worsening list.profileIds spans dozens of stores and paging both periods to hasNextPage: false would take many round-trips), you may fall back to a spend-ranked sample: pull only the top N campaigns by Spend per period (via orderBy + a capped pageSize) instead of the full population. This fallback must be disclosed explicitly in the report — label the Top Changes section as based on a top-spend sample, not the full population (in whichever language the report is written), and state concretely what was actually covered (how many profiles, how many pages, and whether the underlying calls reported hasNextPage: true when you stopped) — never silently present a sampled result as if it were the complete Top Movers analysis.Top 10 ASINs this week: use Step 2e's result directly, no WoW comparison needed (if the customer wants one, pull the same-shape ASIN data for last week and join by ID the same way).
Auto-derive "what to do" from the data above, e.g.:
T = Z, both in the store currency); if it is an auto / broad / phrase campaign, recommend running sparkx-search-term-diagnosis (if installed) to find the terms to negate. In a running managed group → name the group and its lever (target ACOS, negative-targeting switch) insteadFollow "Shared Rules" for managed groups: no bid advice with numbers, group-level levers for managed campaigns.
Every recommendation must have: action + target (specific campaign/ASIN name) + evidence (data). Correlation, not causation — if a recommendation is based on something like "ACOS rose + there was a bid change in the same window," say explicitly that it's a correlation, not "caused by," unless get_operation_log has pinpointed the exact change and the timing lines up precisely.
When profileIds spans multiple stores:
get_ads_perf auto-aggregate to USD — any dollar amount in the report should be explicitly labeled "(USD)" so the customer doesn't assume local currency.profile.profileId_ (usually also profile.profileName_) added to select, or multi-store rows can't be attributed to a specific store. Steps 2a/2b (the blended daily trend) and 2g (the blended 4-week baseline) deliberately do not get profile fields added — see the warning under Step 2a for why adding them there would change the trend's row granularity instead of just attributing it. Step 2e (Top 10 ASINs) is conditional on which question is being asked — see the two cases spelled out under Step 2e; don't add profile.profileId_ there by default.asin.asinPrice_ (if used) stays in local currency and is not affected by the USD-aggregation rule above — this report doesn't currently use that field, but note the exception if the report is later extended to include it.Nobody reading this report knows an internal id, and the ids get_ads_perf returns are
Amazon's anyway. So:
campaignName, adGroupName,
asinTitle. A Campaign column holds a campaign name, never a number.get_ads_perf already gives you.structured_report mode the entity/target fields carry the name; when ids were
asked for, add a separate key for the Amazon id rather than gluing both into one string.Full convention, including the managed-group and product-ad exceptions:
references/platform-notes.md -> "Naming things in your
answer".
Remember: the section headers and labels below are structural placeholders (shown in English here) — always regenerate them in the user's own language, not copy the English (or any other) wording verbatim (see "Output Language" above).
Plain-text fallback: the 🔴/🟡 severity markers and ↑/↓ direction arrows below are for rendering contexts that support them (chat UIs, rendered markdown). In a plain-text-only output context, replace them with words instead — e.g. "High:"/"Medium:" for severity, "up"/"down"/"flat" for direction — rather than relying on a glyph or color the target surface might not render.
# Weekly Ads Report · {profile_name}
**Period**: {week_start} ~ {weekEnding}
**Baseline**: {last week / last week + 4-week average}
{If conversion figures for the reported week are still maturing, add a note here}
## 1. This Week's KPI Overview
{If compareBaseline=wow (default), omit the "4-Week Avg" column entirely — only include it when compareBaseline=wow+4w_avg}
| Metric | This Week | Last Week | WoW | 4-Week Avg | vs. 4-Week Avg |
|---|---|---|---|---|---|
| Spend | ${spend} | ${prev_spend} | {wow%} {arrow} | ${avg4w_spend} | {vs4w%} {arrow} |
| Ad Sales | ${sales} | ${prev_sales} | {wow%} {arrow} | ${avg4w_sales} | {vs4w%} {arrow} |
| ACOS | {acos}% | {prev_acos}% | {wow%} {arrow} | {avg4w_acos}% | {vs4w%} {arrow} |
| ROAS | {roas} | {prev_roas} | {wow%} {arrow} | {avg4w_roas} | {vs4w%} {arrow} |
| Impressions | {imp} | {prev_imp} | {wow%} {arrow} | {avg4w_imp} | {vs4w%} {arrow} |
| Clicks / CTR / CVR | {clk} / {ctr}% / {cvr}% | ... | ... | ... | ... |
**One-line summary**: {a qualitative read auto-generated from the KPI changes, e.g. "Spend up 15% this week, ACOS held steady — healthy growth"}
## 2. 7-Day Trend
{Embed a trend chart or describe key inflection points in text}
**Key inflection points**:
- {date}: {what changed and a possible reason — label as correlation, not confirmed cause, unless verified via get_operation_log}
## 3. This Week's Anomalies / AI-Automation Activity
{If none, write "no significant anomalies this week"}
- 🔴 **{event type}**: {target} - {specific evidence}
- 🟡 **{event type}**: ...
Changes this week: people {M} ({brief list}); AI/automation {N}, hourly budget adjustments excluded ({brief breakdown by actionType})
## 4. Top Changes
### Spend Increase Top5
| Campaign | This Week's Spend | Last Week's Spend | Change |
|---|---|---|---|
| ... | ... | ... | ... |
### ACOS Worsening Top5
{same format as above}
### Sales Increase Top5
{same format as above}
### New / Disappeared Campaigns
{listed separately — not mixed into the three percentage leaderboards above}
### Top 10 ASINs This Week
{table}
## 5. Next Week's Action Recommendations
1. **{action}** {target}
- Evidence: {data}
2. ...
---
_Generated: {timestamp} · Data source: SparkX AI MCP · Skill: sparkx-weekly-ads-report v{version}_
Output JSON schema:
{
"period": {"start": "...", "end": "..."},
"dataFreshnessWarning": null,
"kpiCards": [{"metric": "spend", "current": ..., "previous": ..., "wowPct": ..., "fourWeekAvg": null, "vsFourWeekAvgPct": null}],
"trend": {"daily": [{"date": "...", "spend": ..., "sales": ...}]},
"anomalies": [{"severity": "...", "type": "...", "entity": "...", "evidence": "..."}],
"aiAutomationSummary": {"totalOps": ..., "byActionType": {...}},
"topChanges": {
"spendUp": [...],
"acosWorse": [...],
"salesUp": [...],
"new": [...],
"disappeared": [...]
},
"topAsins": [...],
"actions": [{"priority": 1, "action": "...", "target": "...", "evidence": "..."}]
}
kpiCards[].fourWeekAvg/vsFourWeekAvgPct are only populated when compareBaseline=wow+4w_avg; leave them null for the default wow baseline.
sparkx-ads-structure-analysis's jobdailyBudget/currentBudget are configuration values, not a live spend ledger, and today's Spend is still accumulating through the day. The platform's own figure, budgetUsage.remainingBudget on get_entity_metadata(entity='campaign'), is the one to use when available. If a customer asks this in the weekly-report context, say plainly it can't be computed reliably — don't present a subtraction as if it were precise.get_entity_metadata has no historical-snapshot capability — if this report needs to show "this week's config vs last week's config" (as opposed to performance data), that can only come from get_operation_log's change records, not from querying get_entity_metadata for a past point in time.User input:
Give Demo US a report for last week
Skill flow:
get_user_authorized_context → find Demo US's profileIdweekEnding = last Sunday; apply the data-maturity caveat (always, not conditionally)Follows the shared error envelope used by all three underlying tools (isError/errorType, see references/platform-notes.md). Specific handling for the weekly-report use case:
| Situation | Handling |
|---|---|
profileIds is empty | Follow "Resolving profileIds" above — call get_user_authorized_context first, then apply those rules; ask the user to pick only when those rules actually require it (not automatically) |
Any call returns isError: true | Handle per errorType (invalid_params is usually a construction bug in this skill's own call — check parameter names and date ranges first; rate_limited → wait retryAfterSeconds before retrying, don't retry immediately) — don't treat a tool error as "no data for this period" |
effectiveProfileIds doesn't match the requested profileIds | Explain that the actual scope differs from expected — check the token's authorized scope first, don't just treat it as "this store has no data" |
| A time window is genuinely missing data (not an error) | State clearly "data for X-Y is missing," and still produce the report with what's available |
get_operation_log returns truncated: true | Follow its "Getting a Complete Count" procedure (split into sub-windows) rather than treating one page as the full queried window; note in the report that the change history for the queried window is incomplete (counts are lower bounds) |
| All KPIs show WoW change < 10% (measured 2026-11: at < 5% no account-week ever qualified) | Change the one-line summary to "stable week, no significant swings"; merge the Top Changes section into a brief note |
Don't do these in the weekly report — point the user to the corresponding capability instead. Where a dedicated skill exists, name it; the rest still require manually combining the three base tools:
sparkx-query-ads-performance's ACOS root-cause investigation examplesparkx-product-diagnosissparkx-ads-structure-analysissparkx-search-term-diagnosis (if installed)sparkx-promo-reset (if installed)What SKILL.md sets; muted values are Claude Code's defaults
23 skills in this plugin
/sparkx-ads-structure-analysisAnalyze how ad spend and efficiency break down across a structural dimension — campaign type (SP/SB/SD), marketplace/site, portfolio, weekday-vs-weekend, hour-of-day, or campaign size tiers (head vs long tail) — and diagnose where spend share and efficiency don't match (over-invested underperformers, under-invested strong performers). Optional sub-scenarios: SP deep-dive (manual vs auto targeting), SB new-to-brand focus. Use when the user asks "我 SP/SB/SD 结构合理吗", "各站点谁强", "SB 新客到底行不行", "工作日和周末哪个好", "structure analysis", "campaign type breakdown". Not for a single-entity trend/anomaly check (use sparkx-weekly-ads-report / sparkx-monthly-ads-report / a lighter ad-hoc analysis skill), product-level diagnosis (use sparkx-product-diagnosis), or search-term diagnosis (use sparkx-search-term-diagnosis)./sparkx-ai-managed-auditAudit AI managed groups (托管组) against a stated success standard: grade every managed campaign 卓越/优秀/良好/一般/差 by the group's objective, pull out the 差 ones, and recommend what to change in the group's configuration — split the group, objective, target ACOS, AI personality, action space, review cadence. Use when the user asks "AI 托管到底有没有效果", "哪些托管组没做好", "给我出份 AI 托管组诊断/评级/审核/POP 报告", "按我们的成功标准给广告活动评级", "AI managed group audit", "grade my managed campaigns". Not for descriptive performance recaps without a grading standard (use sparkx-weekly-ads-report / sparkx-monthly-ads-report), not for ASIN-level or keyword-level diagnosis (use sparkx-product-diagnosis), and never for applying changes (use sparkx-edit-ai-group / sparkx-edit-ads).npx claudepluginhub sparkxai/sparkxai-mcp --plugin sparkx-ai-mcpOther plugins' skills for the same job