/workmagic:attribution-custom-dimensionfrom WorkMagic
Handles attribution queries sliced by business labels (e.g., 'by audience', 'by region') that live inside campaign names and require Naming Convention configuration. Detects NC state and guides setup in business language.
Ships in WorkMagic. 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.
Handle queries that slice attribution data by a business label (e.g., "by region", "by audience", "by brand", "by product line") where the label isn't a native field — it lives inside campaign names and only becomes a real dimension once a Naming Convention (NC) rule is configured for the tenant.
This skill detects NC state, guides configuration when needed in business language, and continues the original query after configuration. The user should rarely (ideally never) have to leave the chat to set up NC themselves.
Shared conventions + output mode: the final data answer is produced by
attribution-data-query(handoff), so it inherits that skill's conventions and output threshold — a "by " breakdown is report-shaped and comes back as a live artifact, not a wall of table. Sales-platform scope + attribution model are canonical inattribution-data-query(references/attribution-model.md,references/sales-platform-scope.md); don't re-derive them here.
Trigger when the user asks for data "by " where the term isn't a built-in WM dimension.
Detection rule: after dashboard-metrics-list with the tenant's tenantId, if the requested dimension term isn't in the returned property list (built-in or NC-derived), this skill takes over.
Do NOT trigger:
ads_platform, campaign_name, tactic_name, etc.) → attribution-data-queryattribution-data-query (just use the propertyName as returned)database-query-ask without entering this skill| Field | Required? | Notes |
|---|---|---|
business_term | Required | User's natural-language label (e.g., "audience", "region", "brand"). Preserve as candidate propertyName — rephrase later if the tenant already has a slightly different name. |
nc_state | Detected, not asked | One of: A) configured + property exists, B) configured + property missing, C) not configured at all. Determined by naming-convention-list + dashboard-metrics-list. |
tenantId | Required for tool calls | Pass to dashboard-metrics-list for tenant-specific NC propertyNames. Pass to naming-convention-list to read existing rules. |
original_query | Required | The full attribution-data-query intent the user came in with (metric, time range, filters). Preserve so we can pick it up after NC config completes. |
Step 1: Detect NC state — two parallel calls:
dashboard-metrics-list with tenantId → list of available propertyNames (built-in + NC-derived)naming-convention-list with tenantId → existing NC rules (separators, position, property mappings)Combine both to classify the tenant state:
| State | How to detect | Next step |
|---|---|---|
| A. Configured + property exists | Requested term (fuzzy match, case-insensitive) appears in dashboard-metrics-list propertyNames | Use the propertyName exactly as returned (case-sensitive) and route to attribution-data-query. Stop here — no NC interaction visible to user. |
| B. Configured + property missing | naming-convention-list has existing rules, but the requested term doesn't appear in the propertyName set | Step 2 — add one rule to the existing NC |
| C. Not configured at all | naming-convention-list returns empty | Step 3 — set up NC from scratch |
Detailed branch handling → references/state-routing.md
Step 2 [State B]: Add one rule to existing NC
**HARD RULE — read real campaign names first; never fabricate examples** Before proposing any extraction rule, copy `templates/01-sample-campaign-names.txt` to pull 5–10 real `campaign_name` / `ad_name` values from `database-query-run`. Then propose a rule that matches the observed pattern. **Fabricated examples destroy user trust the moment they don't match the user's actual campaigns.**templates/01-sample-campaign-names.txtBRAND_REGION_AUDIENCE_DATE), prefix tags ([US] Meta Prospecting), suffix tags (... | audience: VIP)templates/proposal-message.md. Show 2-3 example campaigns mapped to the proposed value. One confirmation question max — never ask "what separator?" + "what position?" + "case-sensitive?" in the same message.naming-convention-create after explicit user confirmation (R1 write at system level + audit log)attribution-data-query with the new propertyName, without asking the user to repeat their original askStep 3 [State C]: Set up NC from scratch
naming-convention-separators-get (often _, |, -). Surface this in the confirmation.naming-convention-createStep 4: Sanity-check after applying
**Don't take the bait — never hand off without sanity-checking the new property** If most rows resolve to NULL, the rule is wrong and the user will get an empty dashboard. Copy `templates/02-nc-sanity-check.txt` and confirm the new propertyName resolves to non-empty values for > 70% of rows. If lower, surface the failure: *"The rule I tried only caught X% of your campaigns. Here are the ones it missed — want me to adjust?"* Offer 1-2 alternative interpretations; do NOT silently hand off bad data.| Tool | Required? | Purpose |
|---|---|---|
database-query-ask | Required (first) | NC schema patterns + Cube.dev syntax + ctx timestamp for any SQL (sample pull + sanity check) |
dashboard-metrics-list | Required | List propertyNames for this tenant (built-in + NC). |
naming-convention-list | Required | Read existing NC rules to determine State A / B / C |
naming-convention-separators-get | Conditional (State C) | Detect what separators the tenant's campaign names use, before proposing a rule |
naming-convention-create | Conditional (B + C) | Create NC rule after user confirmation. |
naming-convention-update-or-delete | Conditional (State B) | Update existing NC ruleset to add the new property |
database-query-run | Required | (a) Pull sample real campaign names; (b) sanity-check the new propertyName resolves; (c) execute the original query at the end via attribution-data-query |
1-2 conversational turns + a final data answer.
Proposal message template (copy this) → templates/proposal-message.md
templates/01-sample-campaign-names.txt before proposing a rule — fabricated examples destroy trusttenantId to dashboard-metrics-list and use returned string verbatimnaming-convention-create without explicit confirmation — R1 system-level write; skill-level requires one explicit confirmFull edge case & routing catalog → references/edge-cases.md
attribution-data-query — handoff after configuration completes, or directly when State Aattribution-intent-clarification (when the business term itself is ambiguous, e.g., "by region" could mean campaign tag vs sales region)attribution-anomaly-diagnosis (after slicing by NC property, user may ask "why is this segment down?")attribution-edge-routing — if the term genuinely can't be derived from campaign names (e.g., needs CRM enrichment, customer demographics)examples/example-A-audience-state-c.md (opens in a new tab)references/edge-cases.md (opens in a new tab)references/failure-modes.md (opens in a new tab)references/output-template.md (opens in a new tab)references/state-routing.md (opens in a new tab)templates/01-sample-campaign-names.txt (opens in a new tab)templates/02-nc-sanity-check.txt (opens in a new tab)templates/proposal-message.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub workmagicio/workmagic-agent-plugin --plugin workmagic9 skills in this plugin
/attribution-anomaly-diagnosisDiagnose "why" questions about attribution anomalies — attribution=0 (no attributed orders), and sudden drops, spikes or retroactive changes in attributed numbers. Do NOT use for "show me numbers" — that's attribution-data-query./attribution-data-queryTranslate explicit data requests into Cube.dev SQL and return results. Default skill for query-type asks in the Attribution domain. No estimation, no fabrication, no proactive dashboards./attribution-edge-routingRecognize when a user request falls outside attribution's capability boundary and route it gracefully — to another WM product (MBO / Lift Test / Creative Magic / Ads Magic / Audience Magic), to a human (CSM / DS / Eng), or to a clean decline that bridges back to what attribution can answer.Other plugins' skills for the same job