视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
prefix with thousands separators and no decimals for\n values ≥ $100 (`$1,240,000`); cents only when value \u003c $100 (`$45.20`).\n\n#### Null / missing data handling\n\nA KPI tile must reflect what the data view actually returned. The AI must\n**not** silently substitute a different metric or hide a tile to make the\nbriefing look cleaner.\n\n- **Both periods return 0 or NULL** for a metric in the resolved set: render\n the tile with `kpi-value` = `Data unavailable`, pill class `flat`, pill text\n `⚠ N/A`, and `prior` text = `Both periods returned no data — validate\n instrumentation`. The tile stays in the grid; do not omit it.\n- **One period returns valid data, the other 0 / NULL**: render the tile with\n the valid value as `kpi-value`, pill class `flat`, pill text `⚠ N/A`, and\n `prior` text = `Prior {period_noun}: no data`.\n- **Never** substitute a derived metric (e.g., adding \"Conversion Rate\"\n because Revenue came back $0). The visible KPI set MUST match the resolved\n metric IDs disclosed in the footer.\n- If a Revenue / monetary metric is unavailable, surface a `.callout.note`\n above the KPI grid explaining the gap. Do not invent a value.\n\n\n### Template variables\n\nPopulate every `{PLACEHOLDER}` in the HTML template below using these rules.\nThe briefing belongs to the customer — never substitute Adobe, CJA, or any\nvendor language into customer-visible fields.\n\n- **`{ORG_NAME}`** — The customer's business or brand name, derived from the\n data view context loaded in Phase 1.1. Strip technical/environment suffixes\n like ` — Prod`, ` - Demo`, ` Stage`, ` Test`, ` MCP`. If the data view name\n has no clean brand label, fall back to the data view display name with\n suffixes removed. Do **not** invent a name and do **not** substitute a\n vendor name.\n- **`{PERIOD_TYPE}`** — One of `Weekly`, `Monthly`, `Quarterly`, or\n `Performance` (default), chosen from the period inferred in Phase 1.2.\n- **`{LEDE_SENTENCE}`** — Use exactly this pattern, with no vendor names:\n `Leadership readout for the {period type lowercase} of {PERIOD_LABEL} compared to {COMPARISON_LABEL}.`\n Example: `Leadership readout for the week of May 12–18, 2026 compared to May 5–11, 2026.`\n- **`{DATA_VIEW}`** — Data view display name as returned by `findDataViews`.\n Suffixes are acceptable here — this row is the technical identifier line,\n not the title.\n- **`{PERIOD_LABEL}`** / **`{COMPARISON_LABEL}`** — Human-readable date ranges,\n e.g., `May 12–18, 2026`.\n- **`{GENERATED_DATE}`** — Today's date in the same human format,\n e.g., `May 23, 2026`.\n- **`{METRIC_LABEL}` / `{FORMATTED_VALUE}` / `{PCT_CHANGE}` / `{PRIOR_VALUE}`** —\n Per-KPI values from Phase 3. Use the metric's customer-facing display name,\n not its internal ID.\n\n### HTML Template\n\n```html\n\u003c!DOCTYPE html>\n\u003chtml lang=\"en\">\n\u003chead>\n\u003cmeta charset=\"UTF-8\">\n\u003ctitle>Performance Briefing — {ORG_NAME} — {PERIOD}\u003c/title>\n\u003clink rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n\u003clink rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n\u003clink href=\"https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@400;500;600;700&display=swap\" rel=\"stylesheet\">\n\u003cstyle>\n * { box-sizing: border-box; margin: 0; padding: 0; }\n :root {\n --bg: #f5f4f1;\n --surface: #ffffff;\n --ink: #1a1a1a;\n --ink-muted: #6b6b6b;\n --border: #e5e2dc;\n --header-bg: #0e0e10;\n --header-warm: #3a1010;\n --accent-red: #c8312f;\n --accent-red-bright: #ff6b68;\n --accent-red-soft: #fdecea;\n --accent-green: #1f7a4d;\n --accent-yellow: #d4a017;\n }\n body { font-family: \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n background: var(--bg); color: var(--ink); line-height: 1.5;\n -webkit-font-smoothing: antialiased; }\n\n /* === Header === */\n header { background: linear-gradient(120deg, var(--header-bg) 0%, #1a0d0d 55%, var(--header-warm) 100%);\n color: #fff; padding: 56px 56px 44px; position: relative; overflow: hidden; }\n header::after { content: \"\"; position: absolute; right: -140px; top: -140px;\n width: 460px; height: 460px;\n background: radial-gradient(circle, rgba(200,49,47,.35) 0%, transparent 70%);\n pointer-events: none; }\n .header-inner { max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }\n .eyebrow { display: inline-flex; align-items: center; gap: 8px;\n padding: 6px 14px; border: 1px solid rgba(255,107,104,.55);\n border-radius: 999px; color: var(--accent-red-bright);\n font-size: 11px; font-weight: 600; letter-spacing: 1.2px;\n text-transform: uppercase; margin-bottom: 24px;\n background: rgba(200,49,47,.10); }\n .eyebrow::before { content: \"\"; width: 6px; height: 6px;\n background: var(--accent-red-bright); border-radius: 50%; }\n header h1 { font-family: \"Playfair Display\", Georgia, serif;\n font-size: 56px; font-weight: 700; letter-spacing: -1.5px;\n line-height: 1.05; margin-bottom: 14px; }\n header .lede { font-size: 16px; max-width: 560px;\n color: rgba(255,255,255,.80); margin-bottom: 24px;\n line-height: 1.55; }\n header .meta { display: flex; flex-wrap: wrap; gap: 22px;\n font-size: 13px; color: rgba(255,255,255,.60); }\n header .meta span { display: inline-flex; align-items: center; gap: 6px; }\n header .meta .icon { opacity: .8; }\n\n /* === Tabs === */\n nav { background: var(--surface); border-bottom: 1px solid var(--border);\n padding: 0 56px; display: flex; gap: 28px;\n position: sticky; top: 0; z-index: 50; }\n nav a { display: block; padding: 16px 0; font-size: 14px;\n color: var(--ink); text-decoration: none;\n border-bottom: 2px solid transparent;\n transition: border-color .15s ease; }\n nav a:hover { border-bottom-color: var(--accent-red); }\n\n /* === Container === */\n .container { max-width: 1080px; margin: 0 auto; padding: 36px 56px 60px; }\n\n /* === Callout === */\n .callout { background: var(--accent-red-soft);\n border-left: 4px solid var(--accent-red);\n border-radius: 6px;\n padding: 18px 22px; margin-bottom: 32px;\n display: flex; gap: 14px; align-items: flex-start; }\n .callout .warn-icon { font-size: 22px; line-height: 1; flex-shrink: 0;\n color: var(--accent-yellow); }\n .callout-title { font-weight: 700; color: var(--accent-red);\n margin-bottom: 4px; font-size: 15px; }\n .callout-body { font-size: 14px; color: #4a2222; line-height: 1.55; }\n .callout.note { background: #fdf6e7; border-left-color: var(--accent-yellow); }\n .callout.note .callout-title { color: #8a5a08; }\n .callout.note .callout-body { color: #5a4108; }\n\n /* === Section label === */\n .section-label { font-size: 11px; font-weight: 700;\n text-transform: uppercase; letter-spacing: 1.4px;\n color: var(--ink-muted); margin-bottom: 14px;\n padding-bottom: 10px; border-bottom: 1px solid var(--border); }\n\n /* === KPI grid === */\n .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));\n gap: 14px; margin-bottom: 36px; }\n .kpi-tile { background: var(--surface); border-radius: 8px;\n padding: 22px 22px 20px;\n border-top: 3px solid #b9b6ae;\n box-shadow: 0 1px 3px rgba(0,0,0,.05); }\n .kpi-tile.down { border-top-color: var(--accent-red); }\n .kpi-tile.up { border-top-color: var(--accent-green); }\n .kpi-tile.flat { border-top-color: #b9b6ae; }\n .kpi-head { display: flex; justify-content: space-between;\n align-items: center; margin-bottom: 10px; }\n .kpi-label { font-size: 11px; font-weight: 700;\n text-transform: uppercase;\n color: var(--ink-muted); letter-spacing: 1px; }\n .kpi-value { font-family: \"Playfair Display\", Georgia, serif;\n font-weight: 700; font-size: 38px;\n line-height: 1; color: var(--ink);\n margin-bottom: 12px; }\n .pill { display: inline-flex; align-items: center; gap: 4px;\n padding: 3px 9px; border-radius: 4px;\n font-size: 12px; font-weight: 600; line-height: 1.4; }\n .pill.down { background: var(--accent-red-soft); color: var(--accent-red); }\n .pill.up { background: #ebf5ef; color: var(--accent-green); }\n .pill.flat { background: #f1efea; color: var(--ink-muted); }\n .prior { display: block; margin-top: 10px;\n font-size: 12px; color: var(--ink-muted); }\n\n /* === Narrative === */\n .narrative-card { background: var(--surface); border-radius: 8px;\n padding: 32px 36px;\n box-shadow: 0 1px 3px rgba(0,0,0,.04);\n margin-bottom: 24px; }\n .narrative-card h2 { font-family: \"Playfair Display\", Georgia, serif;\n font-size: 24px; font-weight: 700;\n margin-bottom: 18px;\n padding-bottom: 12px;\n border-bottom: 1px solid var(--border); }\n .bullet-list { list-style: none; }\n .bullet-list li { padding: 14px 0; font-size: 15px; line-height: 1.65;\n border-bottom: 1px solid #f1eeea; }\n .bullet-list li:last-child { border-bottom: none; }\n .bullet-list .signal { margin-right: 6px; }\n .bullet-list .metric-highlight { font-weight: 700; }\n .bullet-list .driver { color: var(--accent-red); font-style: italic; }\n\n /* === Sections (collapsible tables) === */\n .section { background: var(--surface); border-radius: 8px;\n box-shadow: 0 1px 3px rgba(0,0,0,.04);\n margin-bottom: 22px; overflow: hidden; }\n .section-header { padding: 18px 28px; border-bottom: 1px solid var(--border);\n display: flex; justify-content: space-between;\n align-items: center; cursor: pointer; }\n .section-header h2 { font-family: \"Playfair Display\", Georgia, serif;\n font-size: 18px; font-weight: 700; }\n table { width: 100%; border-collapse: collapse; font-size: 13px; }\n thead th { background: #faf8f4; padding: 12px 22px;\n text-align: left; font-weight: 600;\n text-transform: uppercase; letter-spacing: .6px;\n font-size: 11px; color: var(--ink-muted);\n border-bottom: 1px solid var(--border); }\n tbody td { padding: 12px 22px; border-bottom: 1px solid #f4f1eb; }\n tbody tr:last-child td { border-bottom: none; }\n\n .badge { display: inline-block; padding: 3px 9px; border-radius: 4px;\n font-size: 11px; font-weight: 600; }\n .badge.green { background: #ebf5ef; color: var(--accent-green); }\n .badge.red { background: var(--accent-red-soft); color: var(--accent-red); }\n .badge.yellow { background: #fef6e3; color: #b67a08; }\n .badge.grey { background: #f1efea; color: var(--ink-muted); }\n\n footer { text-align: center; padding: 32px 24px;\n font-size: 12px; color: var(--ink-muted); }\n\n /* === Print === */\n @media print {\n nav { display: none; position: static; }\n header { padding: 36px 32px 28px; }\n header h1 { font-size: 42px; }\n .section-header { cursor: default; }\n .kpi-row { page-break-inside: avoid; }\n .kpi-tile, .narrative-card, .section {\n box-shadow: none; border: 1px solid var(--border);\n }\n }\n\u003c/style>\n\u003c/head>\n\u003cbody>\n\n\u003cheader>\n \u003cdiv class=\"header-inner\">\n \u003cdiv class=\"eyebrow\">{PERIOD_TYPE} Performance Briefing\u003c/div>\n \u003ch1>{ORG_NAME} Performance\u003c/h1>\n \u003cp class=\"lede\">{LEDE_SENTENCE}\u003c/p>\n \u003cdiv class=\"meta\">\n \u003cspan>\u003cspan class=\"icon\">📅\u003c/span> {PERIOD_LABEL}\u003c/span>\n \u003cspan>\u003cspan class=\"icon\">📊\u003c/span> {DATA_VIEW}\u003c/span>\n \u003cspan>\u003cspan class=\"icon\">🕔\u003c/span> Prepared {GENERATED_DATE}\u003c/span>\n \u003c/div>\n \u003c/div>\n\u003c/header>\n\n\u003cnav>\n \u003ca href=\"#highlights\">Highlights\u003c/a>\n \u003ca href=\"#narrative\">Summary\u003c/a>\n \u003ca href=\"#data\">KPI Detail\u003c/a>\n \u003ca href=\"#drivers\">Drivers\u003c/a>\n\u003c/nav>\n\n\u003cdiv class=\"container\">\n\n \u003c!--\n Optional critical callout. Include ONLY when the data has a\n notable finding worth raising above the fold (e.g., a metric\n moved >25% week-over-week, or data is missing/anomalous).\n Use the .note variant (yellow) for non-critical context;\n omit entirely if there is nothing noteworthy.\n -->\n \u003c!--\n \u003cdiv class=\"callout\">\n \u003cspan class=\"warn-icon\">⚠\u003c/span>\n \u003cdiv>\n \u003cdiv class=\"callout-title\">Critical: {ONE_LINE_HEADLINE}\u003c/div>\n \u003cdiv class=\"callout-body\">{ONE_PARAGRAPH_CONTEXT}\u003c/div>\n \u003c/div>\n \u003c/div>\n -->\n\n \u003c!-- Headline KPI Tiles -->\n \u003cdiv class=\"section-label\">Key Performance Indicators\u003c/div>\n \u003cdiv id=\"highlights\" class=\"kpi-row\">\n \u003c!-- Repeat for each KPI (4-6 tiles), class = up | down | flat:\n \u003cdiv class=\"kpi-tile down\">\n \u003cdiv class=\"kpi-head\">\n \u003cdiv class=\"kpi-label\">{METRIC_LABEL}\u003c/div>\n \u003c/div>\n \u003cdiv class=\"kpi-value\">{FORMATTED_VALUE}\u003c/div>\n \u003cspan class=\"pill down\">▼ {PCT_CHANGE}%\u003c/span>\n \u003cspan class=\"prior\">Prior week: {PRIOR_VALUE}\u003c/span>\n \u003c/div>\n -->\n \u003c/div>\n\n \u003c!-- Executive Narrative -->\n \u003cdiv id=\"narrative\" class=\"narrative-card\">\n \u003ch2>Executive Summary\u003c/h2>\n \u003cul class=\"bullet-list\">\n \u003c!--\n \u003cli>\n \u003cspan class=\"signal\">{EMOJI}\u003c/span>\n \u003cspan class=\"metric-highlight\">{Metric}:\u003c/span> {value} ({delta} vs prior period) —\n \u003cspan class=\"driver\">{plain-English driver or context}\u003c/span>\n \u003c/li>\n -->\n \u003c/ul>\n \u003c/div>\n\n \u003c!-- Supporting Data Table -->\n \u003cdiv id=\"data\" class=\"section\">\n \u003cdiv class=\"section-header\" onclick=\"toggle('data-body')\">\n \u003ch2>Full KPI Detail\u003c/h2>\n \u003cspan id=\"data-body-icon\">▾\u003c/span>\n \u003c/div>\n \u003cdiv id=\"data-body\">\n \u003ctable>\n \u003cthead>\u003ctr>\n \u003cth>Metric\u003c/th>\n \u003cth>{PERIOD_LABEL}\u003c/th>\n \u003cth>{COMPARISON_LABEL}\u003c/th>\n \u003cth>Change\u003c/th>\n \u003cth>% Change\u003c/th>\n \u003cth>Signal\u003c/th>\n \u003c/tr>\u003c/thead>\n \u003ctbody>\n \u003c!-- One row per KPI with delta and badge -->\n \u003c/tbody>\n \u003c/table>\n \u003c/div>\n \u003c/div>\n\n \u003c!-- Key Drivers -->\n \u003cdiv id=\"drivers\" class=\"section\">\n \u003cdiv class=\"section-header\" onclick=\"toggle('drv-body')\">\n \u003ch2>What Drove the Movement\u003c/h2>\n \u003cspan id=\"drv-body-icon\">▾\u003c/span>\n \u003c/div>\n \u003cdiv id=\"drv-body\">\n \u003ctable>\n \u003cthead>\u003ctr>\n \u003cth>Metric\u003c/th>\n \u003cth>Top Driver\u003c/th>\n \u003cth>Value This Period\u003c/th>\n \u003cth>Value Prior Period\u003c/th>\n \u003cth>Contribution\u003c/th>\n \u003c/tr>\u003c/thead>\n \u003ctbody>\n \u003c!-- One row per metric with top dimension driver -->\n \u003c/tbody>\n \u003c/table>\n \u003c/div>\n \u003c/div>\n\n\u003c/div>\n\n\u003cfooter>\n Performance Briefing — {ORG_NAME} — Generated {GENERATED_DATE}\u003cbr>\n \u003cspan style=\"opacity:.7\">\n Methodology: {PERIOD_TYPE}\n · current {CURRENT_START_ISO}–{CURRENT_END_ISO}\n · comparison {COMPARISON_START_ISO}–{COMPARISON_END_ISO}\n · week starts {WEEK_START_DOW}\n · fiscal year starts {FISCAL_YEAR_START_MONTH}\n · tz {TIMEZONE}\n · calendar source: {CALENDAR_SOURCE}\n · metrics: {METRIC_IDS_CSV}\n \u003c/span>\n\u003c/footer>\n\n\u003cscript>\nfunction toggle(id) {\n var el = document.getElementById(id);\n var ic = document.getElementById(id + '-icon');\n if (el.style.display === 'none') { el.style.display=''; ic.textContent='\\u25be'; }\n else { el.style.display='none'; ic.textContent='\\u25b8'; }\n}\n\u003c/script>\n\u003c/body>\u003c/html>\n```\n\n---\n\n## Phase 7 — Deliver the Briefing\n\n1. Write the HTML to `/tmp/cja_executive_briefing_\u003cYYYY-MM-DD_HHMMSS>.html`\n2. Open with `open /tmp/cja_executive_briefing_\u003cYYYY-MM-DD_HHMMSS>.html`\n3. Output the narrative bullets directly in chat so the user can copy-paste\n them into an email or slide deck immediately — the HTML is the \"appendix.\"\n\nIn-chat format:\n```\nPerformance Briefing — Last Week vs Prior Week\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📈 Revenue: $1.24M (+8.2%) — Paid Search drove the majority of the gain.\n📉 Conversion Rate: 2.1% (−0.4pp) — Mobile checkout declined; desktop stable.\n➡ Sessions: 540K (+1.1%) — Essentially flat; organic offset email decline.\n📈 Orders: 11,340 (+6.7%) — Product page improvements appear to be contributing.\n⚠️ Bounce Rate: 43% (+2pp) — No clear driver identified; monitor next week.\n\nFull briefing document: /tmp/cja_executive_briefing_\u003cYYYY-MM-DD_HHMMSS>.html\n```\n\n---\n\n## Tone and Style Rules\n\n1. **Write outcomes, not activities.** \"Revenue grew\" not \"metrics/revenue increased.\"\n2. **Name the driver concisely.** \"Paid Search drove the gain\" not \"Marketing\n Channel = Paid Search had a higher value in period A vs period B.\"\n3. **One sentence per bullet.** Two at most. Executives skim.\n4. **Lead with the most important finding.** Do not build to a conclusion.\n5. **Be direct about bad news.** \"Conversion Rate declined\" not \"Conversion Rate\n saw some movement in a downward direction.\"\n6. **Quantify everything.** Every bullet must have a number. Opinions without\n data are not executive communication.\n7. **Avoid jargon.** No \"dimensions,\" \"metrics IDs,\" \"data view context,\" or\n \"MCP tool calls\" in the output.\n\n## Important Guardrails\n\n- **Read-only reporting.** Never modify metrics, segments, or projects.\n- **Use business language, not technical IDs.** Replace dimension IDs (e.g., `variables/evar5`) with their display names. Never expose internal IDs in the narrative.\n- **Always state the date range prominently.** Executives need context — \"last week\" is ambiguous; write \"April 7–13, 2026.\"\n- **Don't invent data.** If a KPI is unavailable or the report returns no data, say so explicitly rather than omitting or estimating.\n- **Cap the briefing to the most impactful findings.** 3–5 KPI tiles + 2–3 driver bullets is ideal; more than 8 KPIs dilutes the message.\n- **Note significant context.** Mention known external factors (campaigns, holidays, product releases) that affect the metrics when relevant.\n- **Validate numbers before presenting.** Cross-check KPI values against a second `runReport` call if they look anomalous.\n- **Customer-branded output, never vendor-branded.** The briefing is the customer's document about their own business. Never use \"Adobe\", \"CJA\", \"Customer Journey Analytics\", or any vendor/product name in the customer-visible briefing (title, lede, narrative, tables, footer, or in-chat output). The red/black header palette is the only Adobe-branded element allowed in the artifact.\n\n---\n\n## Example Interaction\n\n> \"Write me an executive briefing for last week's performance.\"\n\n1. **Setup:** Confirm data view with `findDataViews`. User selects their primary data view. Call `setDefaultSessionDataViewId`.\n2. **Scope:** Confirm reporting period (last 7 days, April 7–13, 2026) and key KPIs (Revenue, Conversion Rate, Sessions, AOV).\n3. **Data pull:** Run `runReport` for each KPI: current week vs. prior week and vs. same week last year.\n4. **Narrative draft:** Compose 3–4 executive bullets in business language: \"Revenue of $2.4M was up 8% week-over-week, driven by a 15% increase in Paid Search conversions. Conversion Rate dipped 2 points to 3.1%, consistent with the product page redesign rollout on April 9.\"\n5. **HTML report:** Generate the print-ready HTML briefing with KPI tiles, narrative section, and driver table. Open the file. Present a 2-sentence summary to the user and offer to adjust tone or scope.\n","licenseDocuments":[]}}
cja-executive-briefing【文档与办公】Generates a polished, leadership-ready performance briefing with KPI tiles, executive narrative bullets, and a driver analysis — all as a print-ready HTML document. Always use this skill when someone asks for an executive summary, performance briefing, leadership readout, stakeholder update, or business review — even if they don't say "executive" exp…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Produce a polished, leadership-ready performance document. Executives do not read data tables — they read narratives that answer "are we growing?", "what changed?", and "what do we do about it?"
This skill converts CJA data into a briefing that a VP or C-suite leader can read in under 3 minutes, with supporting data available for those who want to dig deeper.
Tone: business impact, not technical metrics. Write "Revenue grew 12% driven by a strong Paid Search week" not "metrics/revenue increased by 0.12 per metrics/sessions."
describeCja(DATAVIEW_CONTEXT_GUIDE) — understand the business context of the data viewlistComponentUsage — identify the north-star and supporting KPIsfindMetrics — resolve user-specified or discovered metric IDsfindCalculatedMetrics — include custom business KPIsrunReport — pull KPI values for current and comparison periodsearchDimensionItems — identify top driver dimension valuesfindDataViews to list available data views.setDefaultSessionDataViewId with the chosen ID.Call describeCja("DATAVIEW_CONTEXT_GUIDE") to understand:
WEEK_START_DOW — day of week each week starts on (Sunday, Monday, …).
Default: Monday (ISO 8601) if the context guide doesn't specify.FISCAL_YEAR_START_MONTH — month the fiscal year begins. Default:
January (calendar year) if the context guide doesn't specify.TIMEZONE — for example, America/Los_Angeles.CALENDAR_SOURCE — one of "context guide" (values came from describeCja),
"default fallback" (the context guide didn't expose them and you used the
defaults above), or "user override" (the user explicitly specified them).This context determines what counts as the "north-star metric" and what language to use in the narrative (e.g., "subscribers" vs "customers" vs "users").
Infer the period type from the user's request. Do not stop to ask — proceed immediately.
Two runs of this skill on the same data view, period type, and prompt MUST
produce identical current and comparison date ranges. Determinism comes
from (a) reading calendar conventions from 1.1 instead of improvising, and
(b) applying the alignment rule for the period type without taste calls.
Pick exactly one period type from the user's request:
| User request | PERIOD_TYPE | Current period | Comparison period |
|---|---|---|---|
| "last week" / unspecified | weekly | Most recent full week ending before today, aligned to WEEK_START_DOW (exactly 7 days) | The week immediately before, same alignment |
| "this month" / "MTD" | month-to-date | 1st of current month → today | 1st of prior month → same day-of-month as today |
| "last month" | monthly | Prior full calendar month (1st → last day) | The month before that |
| "this quarter" / "QTD" | quarter-to-date | Start of current fiscal quarter → today; fiscal quarters derived from FISCAL_YEAR_START_MONTH | Same days into the prior fiscal quarter |
| "last quarter" / "Q[N]" | quarterly | Prior full fiscal quarter | The fiscal quarter before that |
| Custom date range | custom | Use as specified | Equal-length window ending the day before current.startDate |
Before calling runReport, verify all six:
current.startDate < current.endDatecomparison.startDate < comparison.endDatecomparison.endDate < current.startDate (no overlap)comparison.endDate equals current.startDate (contiguous)current and comparison have the same length in daysPERIOD_TYPE is satisfied:
weekly: both startDates fall on WEEK_START_DOWmonthly: both startDates fall on the 1st of a monthmonth-to-date: both startDates fall on the 1st; both endDates have the same day-of-monthquarterly: both startDates fall on the first day of a fiscal quarterquarter-to-date: both startDates fall on a fiscal quarter start; both endDates are the same number of days into the quartercustom: lengths match; contiguity holdsIf ANY invariant fails, recompute the dates. Never paper over a mismatch by editing the footer.
These examples assume the data view's context guide returns WEEK_START_DOW = Sunday and FISCAL_YEAR_START_MONTH = January. Numbers change for other calendars — that's exactly the point.
| User request | PERIOD_TYPE | Current | Comparison |
|---|---|---|---|
| "last week" | weekly | May 17 (Sun) – May 23 (Sat) | May 10 (Sun) – May 16 (Sat) |
| "this month" / "MTD" | month-to-date | May 1 – May 26 | Apr 1 – Apr 26 |
| "last month" | monthly | Apr 1 – Apr 30 | Mar 1 – Mar 31 |
| "this quarter" / "QTD" | quarter-to-date | Apr 1 – May 26 | Jan 1 – Feb 24 |
| "last quarter" | quarterly | Jan 1 – Mar 31 | Oct 1 – Dec 31 (2025) |
| Custom: "May 15–22" | custom | May 15 – May 22 (8 days) | May 7 – May 14 (8 days) |
If WEEK_START_DOW = Monday instead, the weekly row becomes May 18 (Mon) – May 24 (Sun) vs May 11 (Mon) – May 17 (Sun). The other rows are unchanged.
The AI may "know" from training data that weeks are Mon–Sun (ISO 8601) or that
quarters are Q1=Jan–Mar (calendar). Silently overriding the context guide with
those defaults is exactly the determinism bug this section exists to prevent.
The footer's methodology line MUST accurately describe the dates you computed
— if footer says "weeks start Sunday" but current.startDate is a Monday,
that's a bug to fix in the dates, not in the footer.
Default to internal leadership (VPs, directors, senior managers). This means:
If the user says "external," "board," or "investors," shift to higher-level business outcomes, remove any internal channel naming that could be sensitive, and lead with the most positive finding.
Pull the most-used metrics to identify what the org actually tracks as success. Run both calls in parallel — this is fast and sets the foundation for every KPI decision downstream:
listComponentUsage(componentType: "metric")
listComponentUsage(componentType: "calculatedMetric")
The KPI set MUST be reproducible across runs for the same data view. Two runs of this skill on the same period must produce the same metric values, which requires selecting the same metric IDs every time. Follow this algorithm exactly:
listComponentUsage results into a single ranked list.usageCount descending. Break ties by metric ID alphabetically
(stable secondary sort).describeMetric or
describeCalculatedMetric.Do NOT cherry-pick by metric "type" (volume vs conversion vs revenue) and do NOT
swap in an alternative metric because its name reads better in a narrative.
Different runs picking metrics/orders vs metrics/orders_1_1 produce wildly
different numbers and break trust in the briefing.
If the user names metrics in their request ("give me a briefing on revenue,
orders, and conversion rate"), resolve each name to one specific metric ID
via findMetrics. If multiple metrics match a name (e.g., "Orders" matches both
metrics/orders and a calculated metric called "Orders"), pick the one with
the highest usageCount and document the choice.
Include a small "Metrics included" line in the briefing artifact's footer
listing the resolved metric IDs (e.g., metrics/orders_1_1, metrics/visits,
metrics/page_views). This makes the report auditable and lets the user
confirm a re-run is using the same metrics.
Cap at 6 KPIs. More is noise.
Run both reports in parallel — current period and comparison period — with all
selected metrics. Use a date dimension (e.g., variables/daterangeday) so the
report returns summary totals across the full period. The summaryData.totals
array in the response contains the aggregate values you need.
runReport(
startDate: "<current period start>T00:00:00",
endDate: "<current period end>T00:00:00",
dimensionIds: "variables/daterangeday",
metricIds: "metrics/visits,metrics/orders_1_1,metrics/revenue_1,...",
page: 0,
limit: 1
)
runReport(
startDate: "<prior period start>T00:00:00",
endDate: "<prior period end>T00:00:00",
dimensionIds: "variables/daterangeday",
metricIds: "metrics/visits,metrics/orders_1_1,metrics/revenue_1,...",
page: 0,
limit: 1
)
Read summaryData.filteredTotals from each response — the values correspond to
the metrics in the order they were specified in metricIds.
Compute for each KPI:
current valueprior valuedelta = current − priorpctChange = delta / prior × 100direction: up / down / flat (using ±3% threshold)polarity: positive if higher is better, negative if lower is bettersignal: green (favorable), red (unfavorable), yellow (mixed/flat)For the 2 KPIs with the largest absolute % change, find the top driver:
Run current and prior period breakdown reports in parallel:
runReport(
startDate: "<current period start>",
endDate: "<current period end>",
dimensionIds: "variables/marketing_channel",
metricIds: "<top-moved metric id>",
limit: 5
)
runReport(
startDate: "<prior period start>",
endDate: "<prior period end>",
dimensionIds: "variables/marketing_channel",
metricIds: "<top-moved metric id>",
limit: 5
)
Compare channel-level values between periods to find which dimension value's delta most closely mirrors the overall metric change. This becomes the "driven by" phrase in the narrative.
Only run dimension breakdowns for the 2 most-moved metrics (by absolute % change). This constraint exists because: (a) more breakdowns add latency without adding executive value, and (b) the two largest movers are what leadership will ask about first. The remaining KPIs get context from the narrative without needing attribution.
If variables/marketing_channel returns no useful breakdown (e.g., only one
channel has data), try variables/page_type or variables/product_category
as alternative driver dimensions.
Compose 3–5 bullet points as the narrative. Each bullet follows this structure:
[Signal emoji] [Metric]: [Value] ([+/-pctChange%] vs [prior period]) — [Plain-English context]
Guidelines:
Examples of well-written bullets:
Generate the briefing inline. Write to /tmp/cja_executive_briefing_<YYYY-MM-DD_HHMMSS>.html.
This document should look polished enough to share with leadership — not a
developer tool output.
Two runs of this skill on the same data view + period must render identically (modulo the generation timestamp). The rules below pin the formatting choices that the AI would otherwise drift on.
8,160, 77,584, 1,250,000). Do NOT use SI
suffixes like K or M, even for large values. Executives want exact
numbers, not abbreviations.−23.55% displays as
−23.6%, never −23.5%. Compute on full-precision values; round only at
display time.pp. Example: +0.40 pp.$ prefix with thousands separators and no decimals for
values ≥ $100 ($1,240,000); cents only when value < $100 ($45.20).A KPI tile must reflect what the data view actually returned. The AI must not silently substitute a different metric or hide a tile to make the briefing look cleaner.
kpi-value = Data unavailable, pill class flat, pill text
⚠ N/A, and prior text = Both periods returned no data — validate instrumentation. The tile stays in the grid; do not omit it.kpi-value, pill class flat, pill text ⚠ N/A, and
prior text = Prior {period_noun}: no data..callout.note
above the KPI grid explaining the gap. Do not invent a value.Populate every {PLACEHOLDER} in the HTML template below using these rules.
The briefing belongs to the customer — never substitute Adobe, CJA, or any
vendor language into customer-visible fields.
{ORG_NAME} — The customer's business or brand name, derived from the
data view context loaded in Phase 1.1. Strip technical/environment suffixes
like — Prod, - Demo, Stage, Test, MCP. If the data view name
has no clean brand label, fall back to the data view display name with
suffixes removed. Do not invent a name and do not substitute a
vendor name.{PERIOD_TYPE} — One of Weekly, Monthly, Quarterly, or
Performance (default), chosen from the period inferred in Phase 1.2.{LEDE_SENTENCE} — Use exactly this pattern, with no vendor names:
Leadership readout for the {period type lowercase} of {PERIOD_LABEL} compared to {COMPARISON_LABEL}.
Example: Leadership readout for the week of May 12–18, 2026 compared to May 5–11, 2026.{DATA_VIEW} — Data view display name as returned by findDataViews.
Suffixes are acceptable here — this row is the technical identifier line,
not the title.{PERIOD_LABEL} / {COMPARISON_LABEL} — Human-readable date ranges,
e.g., May 12–18, 2026.{GENERATED_DATE} — Today's date in the same human format,
e.g., May 23, 2026.{METRIC_LABEL} / {FORMATTED_VALUE} / {PCT_CHANGE} / {PRIOR_VALUE} —
Per-KPI values from Phase 3. Use the metric's customer-facing display name,
not its internal ID.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Performance Briefing — {ORG_NAME} — {PERIOD}</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #f5f4f1;
--surface: #ffffff;
--ink: #1a1a1a;
--ink-muted: #6b6b6b;
--border: #e5e2dc;
--header-bg: #0e0e10;
--header-warm: #3a1010;
--accent-red: #c8312f;
--accent-red-bright: #ff6b68;
--accent-red-soft: #fdecea;
--accent-green: #1f7a4d;
--accent-yellow: #d4a017;
}
body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: var(--bg); color: var(--ink); line-height: 1.5;
-webkit-font-smoothing: antialiased; }
/* === Header === */
header { background: linear-gradient(120deg, var(--header-bg) 0%, #1a0d0d 55%, var(--header-warm) 100%);
color: #fff; padding: 56px 56px 44px; position: relative; overflow: hidden; }
header::after { content: ""; position: absolute; right: -140px; top: -140px;
width: 460px; height: 460px;
background: radial-gradient(circle, rgba(200,49,47,.35) 0%, transparent 70%);
pointer-events: none; }
.header-inner { max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px;
padding: 6px 14px; border: 1px solid rgba(255,107,104,.55);
border-radius: 999px; color: var(--accent-red-bright);
font-size: 11px; font-weight: 600; letter-spacing: 1.2px;
text-transform: uppercase; margin-bottom: 24px;
background: rgba(200,49,47,.10); }
.eyebrow::before { content: ""; width: 6px; height: 6px;
background: var(--accent-red-bright); border-radius: 50%; }
header h1 { font-family: "Playfair Display", Georgia, serif;
font-size: 56px; font-weight: 700; letter-spacing: -1.5px;
line-height: 1.05; margin-bottom: 14px; }
header .lede { font-size: 16px; max-width: 560px;
color: rgba(255,255,255,.80); margin-bottom: 24px;
line-height: 1.55; }
header .meta { display: flex; flex-wrap: wrap; gap: 22px;
font-size: 13px; color: rgba(255,255,255,.60); }
header .meta span { display: inline-flex; align-items: center; gap: 6px; }
header .meta .icon { opacity: .8; }
/* === Tabs === */
nav { background: var(--surface); border-bottom: 1px solid var(--border);
padding: 0 56px; display: flex; gap: 28px;
position: sticky; top: 0; z-index: 50; }
nav a { display: block; padding: 16px 0; font-size: 14px;
color: var(--ink); text-decoration: none;
border-bottom: 2px solid transparent;
transition: border-color .15s ease; }
nav a:hover { border-bottom-color: var(--accent-red); }
/* === Container === */
.container { max-width: 1080px; margin: 0 auto; padding: 36px 56px 60px; }
/* === Callout === */
.callout { background: var(--accent-red-soft);
border-left: 4px solid var(--accent-red);
border-radius: 6px;
padding: 18px 22px; margin-bottom: 32px;
display: flex; gap: 14px; align-items: flex-start; }
.callout .warn-icon { font-size: 22px; line-height: 1; flex-shrink: 0;
color: var(--accent-yellow); }
.callout-title { font-weight: 700; color: var(--accent-red);
margin-bottom: 4px; font-size: 15px; }
.callout-body { font-size: 14px; color: #4a2222; line-height: 1.55; }
.callout.note { background: #fdf6e7; border-left-color: var(--accent-yellow); }
.callout.note .callout-title { color: #8a5a08; }
.callout.note .callout-body { color: #5a4108; }
/* === Section label === */
.section-label { font-size: 11px; font-weight: 700;
text-transform: uppercase; letter-spacing: 1.4px;
color: var(--ink-muted); margin-bottom: 14px;
padding-bottom: 10px; border-bottom: 1px solid var(--border); }
/* === KPI grid === */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 14px; margin-bottom: 36px; }
.kpi-tile { background: var(--surface); border-radius: 8px;
padding: 22px 22px 20px;
border-top: 3px solid #b9b6ae;
box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kpi-tile.down { border-top-color: var(--accent-red); }
.kpi-tile.up { border-top-color: var(--accent-green); }
.kpi-tile.flat { border-top-color: #b9b6ae; }
.kpi-head { display: flex; justify-content: space-between;
align-items: center; margin-bottom: 10px; }
.kpi-label { font-size: 11px; font-weight: 700;
text-transform: uppercase;
color: var(--ink-muted); letter-spacing: 1px; }
.kpi-value { font-family: "Playfair Display", Georgia, serif;
font-weight: 700; font-size: 38px;
line-height: 1; color: var(--ink);
margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px;
padding: 3px 9px; border-radius: 4px;
font-size: 12px; font-weight: 600; line-height: 1.4; }
.pill.down { background: var(--accent-red-soft); color: var(--accent-red); }
.pill.up { background: #ebf5ef; color: var(--accent-green); }
.pill.flat { background: #f1efea; color: var(--ink-muted); }
.prior { display: block; margin-top: 10px;
font-size: 12px; color: var(--ink-muted); }
/* === Narrative === */
.narrative-card { background: var(--surface); border-radius: 8px;
padding: 32px 36px;
box-shadow: 0 1px 3px rgba(0,0,0,.04);
margin-bottom: 24px; }
.narrative-card h2 { font-family: "Playfair Display", Georgia, serif;
font-size: 24px; font-weight: 700;
margin-bottom: 18px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border); }
.bullet-list { list-style: none; }
.bullet-list li { padding: 14px 0; font-size: 15px; line-height: 1.65;
border-bottom: 1px solid #f1eeea; }
.bullet-list li:last-child { border-bottom: none; }
.bullet-list .signal { margin-right: 6px; }
.bullet-list .metric-highlight { font-weight: 700; }
.bullet-list .driver { color: var(--accent-red); font-style: italic; }
/* === Sections (collapsible tables) === */
.section { background: var(--surface); border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,.04);
margin-bottom: 22px; overflow: hidden; }
.section-header { padding: 18px 28px; border-bottom: 1px solid var(--border);
display: flex; justify-content: space-between;
align-items: center; cursor: pointer; }
.section-header h2 { font-family: "Playfair Display", Georgia, serif;
font-size: 18px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #faf8f4; padding: 12px 22px;
text-align: left; font-weight: 600;
text-transform: uppercase; letter-spacing: .6px;
font-size: 11px; color: var(--ink-muted);
border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 22px; border-bottom: 1px solid #f4f1eb; }
tbody tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 4px;
font-size: 11px; font-weight: 600; }
.badge.green { background: #ebf5ef; color: var(--accent-green); }
.badge.red { background: var(--accent-red-soft); color: var(--accent-red); }
.badge.yellow { background: #fef6e3; color: #b67a08; }
.badge.grey { background: #f1efea; color: var(--ink-muted); }
footer { text-align: center; padding: 32px 24px;
font-size: 12px; color: var(--ink-muted); }
/* === Print === */
@media print {
nav { display: none; position: static; }
header { padding: 36px 32px 28px; }
header h1 { font-size: 42px; }
.section-header { cursor: default; }
.kpi-row { page-break-inside: avoid; }
.kpi-tile, .narrative-card, .section {
box-shadow: none; border: 1px solid var(--border);
}
}
</style>
</head>
<body>
<header>
<div class="header-inner">
<div class="eyebrow">{PERIOD_TYPE} Performance Briefing</div>
<h1>{ORG_NAME} Performance</h1>
<p class="lede">{LEDE_SENTENCE}</p>
<div class="meta">
<span><span class="icon">📅</span> {PERIOD_LABEL}</span>
<span><span class="icon">📊</span> {DATA_VIEW}</span>
<span><span class="icon">🕔</span> Prepared {GENERATED_DATE}</span>
</div>
</div>
</header>
<nav>
<a href="#highlights">Highlights</a>
<a href="#narrative">Summary</a>
<a href="#data">KPI Detail</a>
<a href="#drivers">Drivers</a>
</nav>
<div class="container">
<!--
Optional critical callout. Include ONLY when the data has a
notable finding worth raising above the fold (e.g., a metric
moved >25% week-over-week, or data is missing/anomalous).
Use the .note variant (yellow) for non-critical context;
omit entirely if there is nothing noteworthy.
-->
<!--
<div class="callout">
<span class="warn-icon">⚠</span>
<div>
<div class="callout-title">Critical: {ONE_LINE_HEADLINE}</div>
<div class="callout-body">{ONE_PARAGRAPH_CONTEXT}</div>
</div>
</div>
-->
<!-- Headline KPI Tiles -->
<div class="section-label">Key Performance Indicators</div>
<div id="highlights" class="kpi-row">
<!-- Repeat for each KPI (4-6 tiles), class = up | down | flat:
<div class="kpi-tile down">
<div class="kpi-head">
<div class="kpi-label">{METRIC_LABEL}</div>
</div>
<div class="kpi-value">{FORMATTED_VALUE}</div>
<span class="pill down">▼ {PCT_CHANGE}%</span>
<span class="prior">Prior week: {PRIOR_VALUE}</span>
</div>
-->
</div>
<!-- Executive Narrative -->
<div id="narrative" class="narrative-card">
<h2>Executive Summary</h2>
<ul class="bullet-list">
<!--
<li>
<span class="signal">{EMOJI}</span>
<span class="metric-highlight">{Metric}:</span> {value} ({delta} vs prior period) —
<span class="driver">{plain-English driver or context}</span>
</li>
-->
</ul>
</div>
<!-- Supporting Data Table -->
<div id="data" class="section">
<div class="section-header" onclick="toggle('data-body')">
<h2>Full KPI Detail</h2>
<span id="data-body-icon">▾</span>
</div>
<div id="data-body">
<table>
<thead><tr>
<th>Metric</th>
<th>{PERIOD_LABEL}</th>
<th>{COMPARISON_LABEL}</th>
<th>Change</th>
<th>% Change</th>
<th>Signal</th>
</tr></thead>
<tbody>
<!-- One row per KPI with delta and badge -->
</tbody>
</table>
</div>
</div>
<!-- Key Drivers -->
<div id="drivers" class="section">
<div class="section-header" onclick="toggle('drv-body')">
<h2>What Drove the Movement</h2>
<span id="drv-body-icon">▾</span>
</div>
<div id="drv-body">
<table>
<thead><tr>
<th>Metric</th>
<th>Top Driver</th>
<th>Value This Period</th>
<th>Value Prior Period</th>
<th>Contribution</th>
</tr></thead>
<tbody>
<!-- One row per metric with top dimension driver -->
</tbody>
</table>
</div>
</div>
</div>
<footer>
Performance Briefing — {ORG_NAME} — Generated {GENERATED_DATE}<br>
<span style="opacity:.7">
Methodology: {PERIOD_TYPE}
· current {CURRENT_START_ISO}–{CURRENT_END_ISO}
· comparison {COMPARISON_START_ISO}–{COMPARISON_END_ISO}
· week starts {WEEK_START_DOW}
· fiscal year starts {FISCAL_YEAR_START_MONTH}
· tz {TIMEZONE}
· calendar source: {CALENDAR_SOURCE}
· metrics: {METRIC_IDS_CSV}
</span>
</footer>
<script>
function toggle(id) {
var el = document.getElementById(id);
var ic = document.getElementById(id + '-icon');
if (el.style.display === 'none') { el.style.display=''; ic.textContent='\u25be'; }
else { el.style.display='none'; ic.textContent='\u25b8'; }
}
</script>
</body></html>
/tmp/cja_executive_briefing_<YYYY-MM-DD_HHMMSS>.htmlopen /tmp/cja_executive_briefing_<YYYY-MM-DD_HHMMSS>.htmlIn-chat format:
Performance Briefing — Last Week vs Prior Week
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Revenue: $1.24M (+8.2%) — Paid Search drove the majority of the gain.
📉 Conversion Rate: 2.1% (−0.4pp) — Mobile checkout declined; desktop stable.
➡ Sessions: 540K (+1.1%) — Essentially flat; organic offset email decline.
📈 Orders: 11,340 (+6.7%) — Product page improvements appear to be contributing.
⚠️ Bounce Rate: 43% (+2pp) — No clear driver identified; monitor next week.
Full briefing document: /tmp/cja_executive_briefing_<YYYY-MM-DD_HHMMSS>.html
variables/evar5) with their display names. Never expose internal IDs in the narrative.runReport call if they look anomalous."Write me an executive briefing for last week's performance."
findDataViews. User selects their primary data view. Call setDefaultSessionDataViewId.runReport for each KPI: current week vs. prior week and vs. same week last year.