/sparkx-ai-mcp:sparkx-ai-managed-auditfrom sparkx-ai-mcp
Audits AI-managed advertising groups against a user-defined success standard, grading each managed campaign (excellent/good/fair/poor/bad) by objective, identifying poor performers, and recommending configuration changes such as group splitting, objective, target ACOS, AI personality, action space, and review cadence.
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 existing read tools, each already covered by its own skill:
get_entity_metadata → sparkx-query-entity-metadataget_ads_perf → sparkx-query-ads-performanceget_operation_log → sparkx-query-operation-log — optional, used only as the tier-3 fallback for exclusion B3 (see scoring.md)Dependency — install these two base skills alongside this one:
sparkx-query-entity-metadata,sparkx-query-ads-performance. Addsparkx-query-operation-logif you want the tier-3 fallback for exclusion B3; without it the skill still runs and degrades to the group-level date with a disclosure. 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 supported-agents table), which is exactly what the../query-.../…links in this document resolve against. If a base skill is not installed there, those links will not resolve and this skill cannot run.
Read the base 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). This document only covers logic specific
to the audit; it does not repeat what the base skills already document.
Not "are the ads performing well" — "is the customer using AI management correctly".
The output is a change to a managed group's configuration: is the group coherent enough for one target ACOS to fit all its campaigns, is the objective still the right one, is the action space too narrow or too wide. A group holding 30 campaigns whose actual ACOS spans 32 percentage points, mixing auto exploration with brand defence, will underperform no matter how well the AI optimises — that is a grouping mistake, not an AI failure, and finding it is this skill's job.
Bid-level and keyword-level recommendations are explicitly out of scope. So is applying anything.
The worked examples and output templates in this skill's references 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 output in whatever language the user asked in.
When calling get_ads_perf, also set the language parameter (zh/en/ja) to match.
get_entity_metadata has no language parameter — localize its enum values using the returned
{field}Text companion fields, or sparkx-query-entity-metadata's own
enum-i18n.md.
Grade labels (卓越/优秀/良好/一般/差) come from the criteria file and are data, not prose. Keep them verbatim even in an English answer, with a gloss on first use, so a customer can match them to their own standard document.
Trigger phrases: AI 托管组诊断, AI 托管诊断, AI 托管审核, 托管评级, POP 评分, 托管组有没有做好, 按成功标准评级, AI managed group audit, grade my managed campaigns
User roles: CSM, ads ops leads, account managers reviewing AI-managed performance with a customer
Not for:
sparkx-weekly-ads-report / sparkx-monthly-ads-reportsparkx-ads-structure-analysissparkx-product-diagnosissparkx-edit-ai-group (group config) / sparkx-edit-ads (campaign level)| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
profileIds | array[long] | No | — | Resolved the same way as in the base skills |
dateStart / dateEnd | string (YYYY-MM-DD) | No | Previous full calendar month | The current period |
compareStart / compareEnd | string | No | Equal-length period immediately before | The comparison period |
criteria | string | No | — | Built-in template name, or a path to a customer YAML (which may extends a template and carry only its deltas). No default — see below |
aiGroupIds | array[long] | No | all | Restrict the audit to specific groups |
scope | enum | No | poorOnly | poorOnly (full recommendations for 差 groups and for any group not earning its spend back) | all (every group; the rest get a one-line row) |
mode | enum | No | chat | chat | excel (Mode A) | recap (Mode B) — see Step 5 |
criteria deliberately has no default. Resolution order, the three built-in templates, and how
to convert a customer's own standard are in references/criteria-schema.md.
If nothing resolves, ask — do not grade against an assumed standard.
Per references/criteria-schema.md. Name the resolved standard in
the output. Stop here and ask if resolution fails.
A customer's first audit is the expensive one, and it goes one of two ways:
criteria-schema.md, derive a draft, then calibrate it by showing
them the 差 list from a period they know and working backwards from the disagreements.Either way, save the result as <customer-slug>.yaml outside this skill directory — in the
customer's own repo or working directory — with the reasoning behind each overridden threshold in
the comments. Every later audit for that customer skips this step.
Never under references/criteria/. That directory ships with the skill to a public repository,
so a customer file placed there publishes their thresholds and their profile ids. See "Where
customer standards live" in references/criteria-schema.md.
Per references/data-sources.md. MCP by default; the Excel fallback
only under the conditions listed there. Pull only the fields the audit uses — about 20, not the
104 a full export carries.
Grading needs only get_ads_perf. That tool carries the managed-group configuration the grade
depends on — objective, target ACOS, AI status, personality, lifecycle dates, action-space switches,
campaign serving status — as selectable dimensions, so two calls (current period, compare period)
cover steps 3 and most of step 4. get_entity_metadata supplies the four things the performance
dimensions lack: AI-vs-Rule mode, group size, group budget, bid range.
How many groups to pull metadata for follows scope:
scope | Metadata pull |
|---|---|
| default | Only groups that turned out to have a 差 campaign |
all | Every group in range. scope=all promises a recommendation for every group, and bid-cap and low-spend findings need bid_range and group budget — without them those groups get a recommendation with a silent hole in it |
scope decides breadth, not whether a losing group is examined. Under either value, a group
whose disposition is 停投 or 收紧目标 gets metadata pulled and a full six-section recommendation
even with no 差 campaign — the ROAS split is computed before the grade and independently of it, so
a slack target can leave a group attaining its target while losing money. output-templates.md
carries the presentation table.
get_operation_log is optional and read-only. B3 tier 3 falls back to it when neither date
field resolves. If the tool is unavailable or unauthorized, skip that tier and say so in the
disclosures — do not treat its absence as a reason to stop.
There are no growth-rate fields. get_ads_perf returns neither deltas nor period comparisons —
you join the two periods yourself and derive every rate, with explicit zero-denominator handling. The
formula and the traps are in scoring.md step A; the full entity-alignment procedure is in
sparkx-query-ads-performance's example-period-comparison-top-movers.md.
Per references/scoring.md, which is normative.
This step is deterministic and must not be done by reasoning. Apply the rules as code, not as
judgement: references/reference-implementation.md is a
working implementation of every rule in scoring.md — run it, port it, or write your own against
it. A grade you arrived at by thinking about a campaign is a defect, because the next run will think
differently about the same campaign.
A criteria file is required — there is no default standard. Validate it by hand first, per
references/criteria-schema.md; nothing validates it for you, and
the account binding in particular is what keeps one customer's standard off another's account.
Check your output before reporting anything. run_cases(crit) in the reference implementation
re-runs 13 executable cases — six of them real rows checked against the grades a customer's own
workbook computed for itself — and raises on any mismatch. The case table at the end of scoring.md
states a further 83 behaviours the logic must show; they are written as assertions, not as runnable
fixtures, so they are checked by reading. An output that contradicts either is wrong.
Try to execute it before concluding you cannot. This skill is distributed through Skill Hub and run by whatever agent fetched it — Claude, Codex and the like carry a code-execution tool, others may not. Write the reference implementation to a scratch file and run it. Degrade only after an actual attempt fails, never on the assumption that execution is unavailable: assuming it is costs the customer the whole scorecard layer for no reason.
If execution genuinely is not available, say so in the report and switch to the degraded mode rather than reasoning your way to grades:
本次未执行确定性评级(运行环境不支持)。以下为只读审计证据与待核项,不含评级结论。
In degraded mode, report the facts the MCP returned — exclusions and why, target vs actual ACOS per group, AI state mix, configuration gaps — and raise them as items to check, not as grades. Do not produce 卓越/优秀/良好/一般/差 labels by hand-applying the tables. The whole point of the grade is that two runs of the same period agree; a reasoned grade cannot promise that, and labelling it "graded by hand" in a footnote does not repair it. Never mix the two in one report.
What survives, and what has to be replaced. Almost every recommendation keys off facts, not off
the grade — target vs actual ACOS and whether the target was met, target re-anchoring, disposition
by ROAS, the three split signals, bid cap versus realised CPC, low-spend attribution, AI vs manual,
exploration. Those run unchanged. What breaks is ordering: output-templates.md sorts groups by
poor_count and gives the worst five a full recommendation, and without grades there is no such
key. Substitute a fact-based one:
Order groups by 目标缺口 × 花费 — how far off target, times how much money is involved.
Both are facts (ai_target_gap and spend_current, no grading needed), and the ranking answers the
question a customer actually asks first — 先救哪块钱 — rather than counting labels. State in the
report which ordering was used, so a later full run can be compared against it.
Also absent in this mode, and say so rather than leaving a gap: the 评级分布 table, the 差级/参评 column, Excel sheets 1–2's grade columns and rubric page, and the 优秀案例 section.
Persist the graded rows as scored.json. Step 5 and any later file request read it instead of
re-querying and re-grading. A second answer that re-derives its numbers from the chat transcript
will drift from the first one.
Roll campaigns up to their managed group (step E of scoring.md), then generate recommendations
per references/recommendation-rules.md.
Splitting is judged on eligibility plus at least one inconsistency signal (actual-ACOS spread, targeting-function mixing, lifecycle mixing). Eligibility is three-way — group size, a 100% poor rate, or a spread twice the threshold — over a hard floor of two rated campaigns. Eligibility alone never justifies a split; the recommendation must name which signal fired and with what number.
Three rules matter most:
Per references/output-templates.md. All three read the same
scored.json, so two deliverables from one audit can never disagree.
| Mode | Trigger | Produces |
|---|---|---|
| Default | any audit request | the chat answer |
| Mode A | 出 Excel / 要表格 / export | the three-sheet workbook, nothing else |
| Mode B | 出复盘文档 / 分析共性问题 | the recap document, nothing else |
One audit, one answer. Steps 1-4 are a single pass: the metadata pull in step 2 happens after grading because it is scoped to the groups that turned out to need a recommendation — it is not a second round the reader is asked to wait for. Never hand over a grading-only answer and follow it with the configuration findings later. A reader who gets the grades first will act on them, and the configuration layer routinely changes what the top recommendation is: on a live run it demoted "bid ceiling too low" to a non-issue and promoted "harvest off on 106 groups" to first place. If a metadata call fails, say so in the disclosures and ship the one answer anyway.
Chat answer by default; files only when asked, offered in one closing line. Mode A and Mode B
are separate deliverables — asking for the Excel does not also produce the recap. Mode A ships only
after its acceptance checks pass; Mode B reads scored.json and never re-queries or re-grades.
| Failure | Why it happens | Guard |
|---|---|---|
| ACOS compared against target on different scales | get_ads_perf returns 40.55, an Excel export returns 0.4055 | Normalize both to pp in step A before subtracting |
| Group ACOS computed as the mean of campaign ACOS | Averaging looks right and is easy | Spend-weighted sum(spend)/sum(sales); same for every ratio metric |
| Every campaign looks unmanaged | Export ids carry a prefix, so the join matches nothing | Strip zero-width spaces before joining |
| The performance call fails outright | Orders was requested; no such metric exists | Request Conversions, rename to orders_* only in the standardized input |
A campaign with no ai_group_id shows up under a phantom group | It was rolled up under a null key | Unmanaged rows are reported separately and never grouped |
| A campaign with unknown AI-on duration gets graded | A MISSING value passed the B3 test | MISSING excludes the row with its own reason; it never passes silently |
Ungradable rows inflate rated_count and the group ACOS | They were neither excluded nor graded | The rollup admits only rows carrying a grade of 1-5 |
A filter on campaignAiFirstOnDate returns nothing | It is a placeholder field with no settled type; filtering on it yields an empty result, not an error | Read it, never filter on it; apply exclusion B3 in post |
| An absent action-space switch reported as a config error | aiActionSettings is a projection of what is currently effective | Absent means "not in effect", not "unset" |
| A growth rate computed as 0 or infinity when the prior period was 0 | There is no growth field; an agent divides anyway | Zero denominator yields MISSING; current-0 vs nonzero-compare is -100% |
| A recommendation to enable an action space the ad type does not have | The action-space table was applied uniformly | Gate every row by campaignType; SD has only 2 of the 13, SB lacks 4 |
| Grades drift between two runs of the same period | Grading was reasoned rather than computed | Apply the rules as code, persist scored.json |
| A recommendation to enable dayparting for every weak group | It looks like an easy win | Row 6 of the action-space table: no hour/placement evidence, no recommendation |
| One customer graded against another's standard | A saved criteria file matched loosely | Exact slug match only; otherwise ask |
| A split recommended because the group is merely large | Eligibility was treated as sufficient | Eligibility only buys a hearing; at least one inconsistency signal must also fire |
| A structurally broken small group never flagged | Size was the only way in | Eligibility is three-way: size, 100% poor rate, or spread >= 2x threshold |
| A confident split built on mis-bucketed campaign names | function_markers was guessed rather than elicited | Leave it out unless the customer confirmed the convention; the auto/manual fallback is never wrong |
| A single account-level "优秀占比" reported across both objective lines | It reads like an obvious summary number | The lines have different band structures; report per line only |
| Exclusions silently shrink the denominator | Excluded campaigns just disappear | Report excluded count and reasons in every answer |
The growth line's score-4 threshold (units_growth_rate >= 0.2) is not evidence-based. The
source standard had no 4 band on that line at all; default-balanced adds one so the two
objective lines are comparable, and picks 20% to mirror the efficiency line's excellent_delta.
That is an internal-consistency argument, not outcome data. One number in the criteria file.
See scoring.md section D2.
campaignAiStudyDate_ is undefined. It is listed as an "AI managed lifecycle date" with no
further documentation anywhere in the base skills. If it marks an AI learning period, a
campaign still inside that window arguably should not be graded at all — a materially different
exclusion from B3. The skill does not use it. Ask the MCP owner what it means.
预算活跃时间均值(过去7天) is being retired from the platform, together with
预计错过的销售 / 点击 / 展示(过去7天). This skill reads none of them any more, and the first
was never in either tool's field reference. budget_constrained comes from
campaign.campaignServingStatus_, which is coarser; the sharper replacement is
budgetUsage.outOfBudgetMinutes over the audit window, from a get_entity_metadata
entity: campaign pull — see sparkx-query-entity-metadata's budget-usage.md. Wire it in if
the audit starts pulling campaign metadata for another reason.
The split decision's S3 signal is weakly observable. Lifecycle mixing is computed over rated campaigns, but the newest members of a group are usually excluded by B3 — so S3 catches "assembled in two waves" and not "a campaign joined last week", and cannot fire at all when B3 fell through to group-level dates. Treat a zero spread as "not measured", never as "uniform".
function_markers depends on the customer's naming discipline. With it, the split decision
distinguishes brand defence from broad exploration; without it, it falls back to auto vs
manual, which is always correct but coarse. A half-right marker map is worse than none.
The action-space support matrix is borrowed from the write path.
sparkx-edit-ai-group's action-space-matrix.md documents SP/SB/SD support for writes; this
skill reuses its UI/platform-level column to decide which recommendations are even possible.
That is the right column to use, but it is a second-hand source — re-check it if that file moves.
The comparison period's length and placement change grades, and nothing says which is right.
The default is the equal-length window immediately before. Measured 2026-11-30 on one live
store: swapping it for the window before that flipped the atomic condition acos_down on
80 of 314 comparable groups (25%). acos_down is a term at every band of the growth line,
so a quarter of those groups can change grade on the comparison window alone. "Same window last
year" is the obvious alternative and was not testable -- that store's history begins
2026-04-08, about seven months, well short of the documented 15-month lookback. Expect the same
on any recently onboarded account. Until this is settled, say in the report which comparison
window was used, and treat acos_down on a seasonal account as the weakest term in the grade.
Targets move inside the audited window, and the audit reads only today's value.
aiGroup.targetAcos_ is a current snapshot. The operation log for one live store carried
360 target-ACOS changes across 224 groups in 90 days (changeField acos), 63 of them inside
the 30-day audited window, touching 62 of that store's 344 groups -- 18%. Objective changes
are far rarer by comparison (18 in 90 days, 16 in-window), so the objective is not the main
exposure here; the target value is. Every one of those groups has ai_target_met -- the first
term of every band on both lines -- and target_slack_max evaluated against a number that was
not in force while the performance was earned. The log supplies previousValue/newValue and
a timestamp per change, so this is joinable rather than unknowable; the skill does not join it
yet. Until it does, say in the report that attainment is measured against the current target.
When joining it, drop the rows where previousValue == newValue -- 53 of 490 on that store
were no-op writes.
The three criteria templates are parameter variants of one real customer standard, not researched
industry benchmarks. Present them as starting points. The verbatim customer standard lives in
criteria/samples/ as a regression fixture and must never be applied to another account.
| File | Contents |
|---|---|
references/scoring.md | Normative. Normalize, exclude, atomic conditions, grade tables, group rollup |
references/criteria-schema.md | Criteria YAML schema, resolution order, converting a customer standard |
references/criteria/ | The three built-in templates (均衡 / 控本 / 放量), plus a de-identified samples/ fixture. Customer standards live outside the skill and extends one of these |
references/recommendation-rules.md | Six-section template, action-space decision table, split rule |
references/ai-vs-manual.md | Optional module. Whether AI management beat manual, per store, with a symmetric sample gate |
references/data-sources.md | MCP field mapping and the Excel fallback mapping |
references/output-templates.md | Chat template, sizing, mandatory disclosures, Excel sheet layout |
references/reference-implementation.md | Working implementation of the grading rules, in one code block |
references/platform-notes.md | Shared platform behaviour (auth, errors, pagination, currency) |
references/ai-vs-manual.md (opens in a new tab)references/criteria-schema.md (opens in a new tab)references/criteria/default-balanced.yaml (opens in a new tab)references/criteria/growth-aggressive.yaml (opens in a new tab)references/criteria/profit-strict.yaml (opens in a new tab)references/criteria/samples/source-standard-v1.yaml (opens in a new tab)references/data-sources.md (opens in a new tab)references/output-templates.md (opens in a new tab)references/platform-notes.md (opens in a new tab)references/recommendation-rules.md (opens in a new tab)references/reference-implementation.md (opens in a new tab)references/scoring.md (opens in a new tab)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-asin-deep-diveDiagnose one named ASIN or parent ASIN: why sales fell or ACOS rose, where traffic comes from, whether its ad structure is fragmented, and which variants deserve budget. Combine account ad data with SQP / ABA demand and share, limited competitorProduct data and brand peer benchmarks; use the customer's SellerSprite for organic rank and broader category comparisons when available. Use for "这个 ASIN 为什么销售下滑 / ACOS 为什么高" or "哪个子体该留". Read-only recommendations. To find which products need diagnosis first, use sparkx-product-diagnosis; for search-term negatives or harvest decisions use sparkx-search-term-diagnosis. For store-, category- or brand-level SQP analysis use sparkx-sqp-insight.npx claudepluginhub sparkxai/sparkxai-mcp --plugin sparkx-ai-mcpOther plugins' skills for the same job