← WorkMagicCONTENT HISTORY

Update to WorkMagic

Snapshot Nov 17, 2026 · 06:14 UTC · version 1.0.2

Collection source: downloaded plugin package.

WHAT CHANGED

First saved snapshot

No earlier snapshot is available to establish a change.

Save WorkMagic and check future changes in Following.

Up to 3 plugins free · no card required.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Handle attribution queries sliced by a business label (\"by audience\" / \"by region\" / \"by brand\") that is not a native field — it lives in campaign names and only becomes queryable once a Naming Convention (NC) rule is configured.",
  "included_files": [
    {
      "relative_path": "examples/example-A-audience-state-c.md",
      "size_in_bytes": 3906
    },
    {
      "relative_path": "references/edge-cases.md",
      "size_in_bytes": 1841
    },
    {
      "relative_path": "references/failure-modes.md",
      "size_in_bytes": 2063
    },
    {
      "relative_path": "references/output-template.md",
      "size_in_bytes": 1074
    },
    {
      "relative_path": "references/state-routing.md",
      "size_in_bytes": 1920
    },
    {
      "relative_path": "templates/01-sample-campaign-names.txt",
      "size_in_bytes": 593
    },
    {
      "relative_path": "templates/02-nc-sanity-check.txt",
      "size_in_bytes": 566
    },
    {
      "relative_path": "templates/proposal-message.md",
      "size_in_bytes": 1300
    }
  ],
  "name": "attribution-custom-dimension",
  "skill_md_contents": "---\nname: attribution-custom-dimension\ndescription: Handle attribution queries sliced by a business label (\"by audience\" / \"by region\" / \"by brand\") that is not a native field — it lives in campaign names and only becomes queryable once a Naming Convention (NC) rule is configured.\nmetadata:\n  category: attribution\n  risk: R1\n  version: 1.2.1\n  last-updated: 2026-09-28\n  references:\n  - references/state-routing.md\n  - references/output-template.md\n  - references/edge-cases.md\n  - references/failure-modes.md\n  templates:\n  - templates/01-sample-campaign-names.txt\n  - templates/02-nc-sanity-check.txt\n  - templates/proposal-message.md\n  examples:\n  - examples/example-A-audience-state-c.md\n---\n\n## 1. Purpose\n\nHandle 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.\n\nThis 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.**\n\n> **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 <label>\" breakdown is report-shaped and comes back as a live **artifact**, not a wall of table. Sales-platform scope + attribution model are canonical in `attribution-data-query` (`references/attribution-model.md`, `references/sales-platform-scope.md`); don't re-derive them here.\n\n## 2. When to trigger\n\nTrigger when the user asks for data **\"by <business term>\"** where the term isn't a built-in WM dimension.\n\n**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.\n\n**Do NOT trigger**:\n\n- Dimension is already a built-in field (`ads_platform`, `campaign_name`, `tactic_name`, etc.) → `attribution-data-query`\n- Dimension is already an NC-derived property the tenant has configured → `attribution-data-query` (just use the propertyName as returned)\n- User is asking about NC configuration in general (\"how does NC work?\") → answer from `database-query-ask` without entering this skill\n\n## 3. Inputs\n\n| **Field** | **Required?** | **Notes** |\n|-|-|-|\n| `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. |\n| `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`. |\n| `tenantId` | Required for tool calls | Pass to `dashboard-metrics-list` for tenant-specific NC propertyNames. Pass to `naming-convention-list` to read existing rules. |\n| `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. |\n\n## 4. SOP\n\n**Step 1: Detect NC state** — two parallel calls:\n\n1. `dashboard-metrics-list` with `tenantId` → list of available propertyNames (built-in + NC-derived)\n2. `naming-convention-list` with `tenantId` → existing NC rules (separators, position, property mappings)\n\nCombine both to classify the tenant state:\n\n| **State** | **How to detect** | **Next step** |\n|-|-|-|\n| **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. |\n| **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 |\n| **C. Not configured at all** | `naming-convention-list` returns empty | Step 3 — set up NC from scratch |\n\nDetailed branch handling → `references/state-routing.md`\n\n**Step 2 [State B]: Add one rule to existing NC**\n\n<callout emoji=\"🛑\">\n**HARD RULE — read real campaign names first; never fabricate examples**\nBefore 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.**\n</callout>\n\n1. **Look at real ad names** via `templates/01-sample-campaign-names.txt`\n2. **Identify the candidate location**: separator-delimited tokens (`BRAND_REGION_AUDIENCE_DATE`), prefix tags (`[US] Meta Prospecting`), suffix tags (`... | audience: VIP`)\n3. **Recommend method in business language**: copy `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.\n4. **Apply via `naming-convention-create`** after explicit user confirmation (R1 write at system level + audit log)\n5. **Continue the original query** — hand off to `attribution-data-query` with the new propertyName, without asking the user to repeat their original ask\n\n**Step 3 [State C]: Set up NC from scratch**\n\n1. **Explain in business language** (max 2 sentences): \"Your campaign names contain a lot of information — region, audience, product — but WorkMagic doesn't know how to read them yet. I'll set up a one-time rule so you can slice data by any of those tags.\"\n2. **Look at real ad names** (same as Step 2)\n3. **Detect separators** via `naming-convention-separators-get` (often `_`, `|`, `-`). Surface this in the confirmation.\n4. **Propose the first property ONLY** — don't try to set up all properties at once; focus on the term the user just asked about. \"Other properties can be added later when you ask for them.\"\n5. **One confirmation question**\n6. **Apply via `naming-convention-create`**\n7. **Continue the original query**\n\n**Step 4: Sanity-check after applying**\n\n<callout emoji=\"💡\">\n**Don't take the bait — never hand off without sanity-checking the new property**\nIf 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.\n</callout>\n\n## 5. Tools used\n\n| **Tool** | **Required?** | **Purpose** |\n|-|-|-|\n| `database-query-ask` | Required (first) | NC schema patterns + Cube.dev syntax + `ctx` timestamp for any SQL (sample pull + sanity check) |\n| `dashboard-metrics-list` | Required | List propertyNames for this tenant (built-in + NC). |\n| `naming-convention-list` | Required | Read existing NC rules to determine State A / B / C |\n| `naming-convention-separators-get` | Conditional (State C) | Detect what separators the tenant's campaign names use, before proposing a rule |\n| `naming-convention-create` | Conditional (B + C) | Create NC rule after user confirmation. |\n| `naming-convention-update-or-delete` | Conditional (State B) | Update existing NC ruleset to add the new property |\n| `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` |\n\n## 6. Output format\n\n1-2 conversational turns + a final data answer.\n\n- **State A (silent path)**: no NC interaction visible to user — just answer the original query\n- **State B / C (configuration path)**: one structured proposal message → user confirms → data answer\n\nProposal message template (copy this) → `templates/proposal-message.md`\n\n### Output rules\n\n- **Show real campaign names**, not invented examples — user must trust the rule applies to their data\n- **Show the proposed value** for each example, not just the position rule\n- **One confirmation question max**; never ask multi-question forms\n- **Promise the follow-through** (\"I'll pull the audience-level ROAS you asked for\") so user doesn't worry about losing context\n- **Use the user's term** as the property name unless their NC already has a different name for it\n\n## 7. CRITICAL rules (top 8 — full list in references/failure-modes.md)\n\n1. **Always pull real campaign names** via `templates/01-sample-campaign-names.txt` before proposing a rule — fabricated examples destroy trust\n2. **Always sanity-check after applying** — if most rows are NULL, surface and adjust; never silently hand off bad data\n3. **Never silently substitute a nearby property** — if user asked for \"audience\" and tenant only has \"segment\", don't query \"segment\" without telling them\n4. **Never send user to UI to configure NC themselves** — the skill exists precisely so they don't have to\n5. **Never ask 3+ technical questions at once** (\"what separator? what position? what name?\") — lead with one proposal, one confirmation\n6. **Never hard-code propertyNames** — tenant-specific + case-sensitive; always pass `tenantId` to `dashboard-metrics-list` and use returned string verbatim\n7. **Never apply `naming-convention-create` without explicit confirmation** — R1 system-level write; skill-level requires one explicit confirm\n8. **Never lose the original query during configuration** — user wanted ROAS by audience; after config they should get ROAS by audience without restating\n\n## 8. Edge cases\n\nFull edge case & routing catalog → `references/edge-cases.md`\n\n## 9. Related skills\n\n- **Downstream (always)**: `attribution-data-query` — handoff after configuration completes, or directly when State A\n- **Upstream**: `attribution-intent-clarification` (when the business term itself is ambiguous, e.g., \"by region\" could mean campaign tag vs sales region)\n- **Sibling**: `attribution-anomaly-diagnosis` (after slicing by NC property, user may ask \"why is this segment down?\")\n- **Out of scope**: `attribution-edge-routing` — if the term genuinely can't be derived from campaign names (e.g., needs CRM enrichment, customer demographics)\n"
}

SHA-256 of public snapshot: 5aed399d6af5a16f4ea3f9422943c6c2d177b84fc232003955a57a3dea38b2b6