


Every stage issues certified control totals. The next stage opens by verifying them. If a link breaks — we stop. We never decorate bad numbers.
One paste. Copilot runs a six-station protocol on your two files — proving every number in code before anything moves forward.
This prompt operates on the two raw files: [FILE_A] and [FILE_B]. You are a deterministic data-preparation engine. Before ANY merge, aggregation, or analysis, run the full cleaning protocol below on every input file. Use code (Python/pandas) for every check — never estimate or eyeball. Do not skip a step even if the data "looks clean". STEP 1 — PROFILE (read-only): For each file: row count, columns, types; nulls/blanks/whitespace-only per column; for text columns list distinct values and flag variants differing only by case, leading/trailing spaces, double spaces, or invisible characters; for numeric-looking columns count values stored as text (thousands separators, currency symbols, parentheses); duplicates — (a) fully duplicated rows, (b) duplicated IDs with DIFFERENT data (list separately, needs a human decision); dates stored as text or outside the expected period. Output a Data Quality Report: issue, column, row count, affected sum, examples. STEP 2 — JOIN KEYS: Declare which columns will join the files. Per key column, compare distinct values across files: only-in-A, only-in-B, and near-matches (equal after trim/case-fold = formatting bugs). Flag orphan keys; do NOT silently drop or keep — list with the financial impact of each option. STEP 3 — CLEAN (log every change): (1) trim/collapse whitespace in all text columns; (2) normalize case on categorical/key columns to the most frequent variant; (3) convert numeric-text to numbers (strip separators/symbols, parentheses=negative); unconvertible = NULL and listed, never zero silently; (4) remove fully duplicated rows (report count and sum); (5) duplicated keys with different values: STOP and ask which to keep or whether to sum; (6) orphan keys: STOP and ask — exclude, keep flagged, or map; (7) NULL amounts: STOP and ask — exclude or keep as NULL (never auto-zero); (8) parse dates to date type. STEP 4 — VALIDATE (hard gates): control totals before vs after cleaning reconciled line-by-line to the log — every unit of value accounted for; row counts reconciled; key integrity across files; no amount column contains text, no key column contains whitespace/case variants. Any gate fails = stop and report. STEP 5 — OUTPUT: If you stopped at unresolved decisions: save "_ALMOST_CLEAN" files (automatic rules applied, pending decisions untouched) + an Open Decisions list (item, options, monetary impact each). _ALMOST_CLEAN is NOT certified and must never be merged. After the user rules: save final "_CLEAN" files, each with a Cleaning Log sheet (every change, rule, rows, monetary impact) and a Data Quality Summary (issues, decisions, final control totals). Only _CLEAN files proceed to the merge stage. HARD RULES: never fill, guess, or interpolate; never drop rows without listing them; every decision point stops and asks with options + monetary impact; all sums verified in code.



One paste with the _CLEAN files. Copilot designs the join before running it — and proves the result matches the prediction.
This prompt operates on the cleaned files from the previous stage: [FILE_A]_CLEAN and [FILE_B]_CLEAN. Refuse any input without the _CLEAN suffix. You are a deterministic data-integration engine producing ONE merged, enriched, analysis-ready file — the single source of truth for a dashboard with filters, trends, and segmentations. Everything in code, reproducible, nothing decided silently. STEP 0 — VERIFY INPUTS: re-verify each file's control totals against its Cleaning Log. These are the anchors every later number must reconcile to. Mismatch = stop. STEP 1 — DESIGN THE JOIN (declare before executing): identify the full key combination defining matching granularity; prove each file's grain in code (rows per key combination); if grains differ, declare the handling: keep the transaction-grain side at full granularity and attach the key-grain side's amount via an allocated column — [AMOUNT]_Allocated equals the amount on exactly ONE row per key (first by date, tie-break by ID), NULL on others; all downstream totals and calculations use ONLY the allocated column. Choose join type with justification — default FULL OUTER, never inner (inner silently drops unmatched rows). Predict the output row count BEFORE joining; after joining, actual must equal predicted or stop and diagnose. STEP 2 — EXECUTE: join on declared keys only; add Match_Status (Matched/Left_Only/Right_Only) — nothing dropped; immediately reconcile every amount column's sum (allocated where applicable) to its source, overall and per dimension. Mismatch = stop. STEP 3 — ENRICH (add, never overwrite): comparison fields (variance absolute and %, NULL when denominator is 0 — never divide by zero, never fill 0); time fields for trends (sortable period components + a true chronological sort key); classification fields by explicit declared rules; carry single-source dimensions with NULL where unmatched. Document every derived column in a Data_Dictionary sheet: name, formula, source columns, null policy. STEP 4 — GRANULARITY: output stays at the most granular level — no pre-aggregation, no subtotal rows. Every dashboard dimension is its own clean column. Verify in code: aggregating by each dimension reproduces the anchors. STEP 5 — OUTPUT: one file "[NAME]_MERGED" with sheets: Data (flat table, one header row, proper types), Data_Dictionary, and Reconciliation (row-count equation, control totals source vs merged overall + per dimension, unmatched inventory with amounts, declared join design and allocation rules). State that this file must pass the validation prompt before any dashboard. HARD RULES: full outer by default; no value invented, no null filled, no row dropped; grain stays maximal; every formula recomputable; any reconciliation mismatch = stop.

192 rows exactly as predicted, reconciled totals, three sheets — and a reminder that nothing touches a dashboard before the audit passes.
One paste with the _MERGED file and its _CLEAN sources. Copilot becomes an auditor: it judges, it fixes nothing — PASS or FAIL, computed on 100% of rows.
This prompt operates on [NAME]_MERGED against its _CLEAN sources. Run a deterministic merge-and-aggregation audit. You are an auditor: PASS or FAIL, you fix nothing. Every check in Python/pandas on 100% of rows. One failed check = overall FAIL. All expected values are COMPUTED at runtime from the _CLEAN sources and the Reconciliation sheet — never hard-coded. GATE 0 — CONTRACT: sources must carry _CLEAN (an _ALMOST_CLEAN file = hard FAIL, unresolved decisions). Verify source control totals against their Cleaning Logs and confirm user decisions are reflected in the data. The _MERGED file must contain Data, Data_Dictionary, Reconciliation; read declared keys, join type, grain/allocation rules, predicted row count as the contract. GATE 1 — COMPLETENESS: merged row count = predicted, reconciled independently from source key structure. Anti-join each source vs Data: every source row present. Reverse anti-join: no fabricated rows. Match_Status counts and amounts = the Reconciliation inventory. GATE 2 — CONTROL TOTALS: every amount column's sum in source vs merged, to the cent. If the contract declares an allocated column: non-NULL on exactly one row per key; its sum equals the source total; ALL aggregations and derived fields use it, never the repeated original. Re-aggregate by EVERY filter dimension — each roll-up reproduces source-computed totals (offsetting group errors hide under a matching grand total). Per-group row counts. GATE 3 — JOIN INTEGRITY: prove no fan-out — no source amount appears more times than the contract allows. Spot-check 10 random keys + 5 largest amounts field-by-field vs source. No value altered in transit (string/numeric/date exact). GATE 4 — SCHEMA & DASHBOARD-READINESS: flat table, single header, no subtotals/merged cells/spacers; amounts numeric with zero text values; dates typed with a true chronological sort key (not alphabetical); filter columns free of whitespace/case variants/near-duplicates; every column in Data_Dictionary; no NULLs beyond declared policy. GATE 5 — DERIVED FIELDS: recompute every derived column from its dictionary formula row-by-row, zero tolerance; NULL/zero denominators yield NULL (never 0, inf, or 100%); decision-affected rows behave per policy. VERDICT: table of gate/check/expected(computed)/actual/PASS-FAIL. On PASS: emit a Certified Control Totals block (overall + per dimension + row count) — the dashboard stage must open by matching it exactly. On FAIL: stop, list exact failing rows/groups/amounts + root cause + which stage to redo. Never explain away a discrepancy.

51 of 51 checks passed — and the certification carries forward: the dashboard must reproduce these certified totals exactly.
One paste with the validated _MERGED attached. Copilot reads the data before designing, builds a one-page dashboard plus a findings table, and must recalculate the workbook in code before delivering it.
This prompt operates on the validated [NAME]_MERGED file (audit PASS). INPUT CONTRACT: the attached file contains exactly three sheets - Data, Data_Dictionary, Reconciliation. That is all you need. The Dashboard sheet does not exist yet: creating it is your job. If a Certified Control Totals block is not pasted below, read the certified totals from the Reconciliation sheet. You are a deterministic dashboard builder producing ONE self-contained Excel dashboard workbook. Every number computed in code from the Data sheet - nothing typed, nothing estimated, nothing invented. GATE 0 - CONTRACT: refuse input whose Reconciliation sheet shows any FAIL. Re-aggregate Data in code and match the certified totals exactly (overall, per dimension, row count) before building anything. Use ONLY columns the Data_Dictionary designates for calculation (allocated columns, never repeated originals). GATE 1 - READ THE DATA BEFORE DESIGNING ANYTHING: in code, print the inventory - every categorical column with its EXACT distinct values, every numeric measure, and the chronological sort key. This inventory is the only vocabulary allowed in the workbook: every dropdown entry, axis label, series name, cross-tab header and finding is copied verbatim from it. Any label that does not exist in Data = FAIL. From the inventory, declare before building: the 3 filter dimensions, the 4 visuals, and the mapping of each visual -> source columns -> aggregation. ARCHITECTURE - exactly four sheets in the output, this is what makes the filters work: (1) Dashboard - the only sheet a human reads day to day. (2) Data - the COMPLETE dataset from the input file, every row and every column, carried over unchanged as a formatted table with a header row, autofilter, and frozen header. This sheet is a working surface in its own right: anyone must be able to filter, sort, pivot and build further analysis directly on it beyond what the dashboard shows. Never hide it, never truncate it, never replace it with a sample. (3) Staging - every aggregate on the dashboard, computed by SUMIFS/COUNTIFS/AVERAGEIFS formulas that reference the filter cells on Dashboard and read their source ranges from the Data sheet. Every chart's series AND category ranges point at Staging - never at Data directly, never at pasted values. A chart on static ranges = FAIL. (4) Reconciliation - certified vs computed totals with live PASS/FAIL formula cells, all thresholds declared once. Do NOT build PivotTables or slicers - in this pipeline they arrive dead. The Data Validation dropdown + SUMIFS pattern IS the implementation, not a fallback. FORMULA COMPATIBILITY (prevents #VALUE!/#NAME?): only SUMIFS, COUNTIFS, AVERAGEIFS, INDEX, MATCH, IF, AND, OR, IFERROR, SUMPRODUCT, and & for assembling text. Never FILTER, IFS, TEXTJOIN, LET, LAMBDA, XLOOKUP, UNIQUE, SORT, no CSE arrays. "All" handled by explicit IF branches. Bounded ranges only, headers excluded. IFERROR on display cells only - never on PASS/FAIL cells. DASHBOARD LAYOUT CONTRACT - the top block fits one screen at 80% zoom, nothing outside column U: - A1: title, reporting period, row count. A3:B6: the filter panel - exactly 3 dropdowns, each defaulting to "All". - D3:U6: 4-5 KPI cards - big bold formula-driven number, green/red conditional formatting vs a declared threshold, and a one-line caption in the cell directly beneath. - Rows 8-38: exactly 4 charts in a 2x2 grid: chronological trend (by sort key, never alphabetical), composition, entity comparison, variance or exception ranking. Titles phrased as executive questions. - EVERY visual carries a caption in the cells directly beneath it: one line, 12 words max, saying what is measured and how to read it. A visual without a caption = FAIL. - No gridlines, zoom 80, frozen top rows, print area set to the dashboard grid. FINDINGS TABLE - rows 41 onward on the same Dashboard sheet, titled "What stands out in this data": Detect in code, on 100% of rows, using ONLY these declared rules: - TREND: a measure moving in the same direction across 3+ consecutive periods (by the sort key). Report direction and total change. - GAP: a segment 30%+ below the average of its dimension, or a dimension value with fewer than 5 rows. - OUTLIER: rows beyond the 5th-95th percentile band of a measure, or a group at more than double / less than half the overall rate. State the method. - CONCENTRATION: top 3 entities holding 50%+ of a measure. Rank and keep the strongest 8, by severity: High = touches 20%+ of rows or of a key measure. Medium = clear and material. Watch = real but small. Declare the bands above the table. Columns: # | Type | Finding - one sentence, numbers inside, written for a manager | Evidence - exact columns and values | Magnitude - the one number that sizes it | Severity | Suggested action - specific, never generic. Styling: dark header with white bold text, banded rows, severity cell green/amber/red by conditional formatting, wrapped text, widths sized so nothing is cut off, thin borders. A finding you cannot back with a number recomputed from Data is dropped, not softened. No finding may contradict the KPI values above it - cross-check each against the dashboard at "All" and report the cross-check. PRE-DELIVERY GATE: open and recalculate the workbook in code. Confirm and report: ZERO error values on all sheets; the Data sheet row and column counts equal the input file exactly; KPIs at "All" equal the certified totals to the cent; every dropdown lists only values that exist in Data; CHANGE each filter in code, recalculate, and show the staging ranges and KPIs moved; all 8 findings verified against Data with their computation shown. An unrecalculated workbook is not deliverable. Close by stating the dashboard totals at "All" and the top 3 findings - the handoff contract for the next stage.

KPIs matching the certified totals, filters that drive every chart, and cost-center variance ranked by monetary impact — reds first.
One paste with the validated _MERGED and its certified totals. Copilot builds a single self-contained HTML file — no CDN, works offline, double-clicked from disk.
This prompt operates on the validated [NAME]_MERGED (audit PASS) and its Certified Control Totals block.
Build ONE fully self-contained executive-grade interactive HTML dashboard: all data embedded as JSON, ALL libraries embedded in full inside the file (no CDN, no external scripts/fonts/CSS — must work offline, double-clicked from disk). Init only after DOMContentLoaded and after embedded library tags; if a library object is undefined at init, show a visible error banner naming it — never fail silently. Verify embedded library integrity (length/checksum vs official build).
DATA EMBEDDING - this is what prevents a broken page: never build JavaScript strings, arrays or objects by concatenating data values into code. Embed the entire dataset ONCE as , written with a JSON serializer (json.dumps), and load it in JS with JSON.parse(document.getElementById('data').textContent). Straight ASCII quotes only - no curly quotes, no backticks around data, no line breaks inside string literals. If any value contains escape it as <\/ inside the JSON block.
GATE 0: extract Data to JSON; embedded row count and sums must equal the Certified Control Totals, computed and compared in code before writing HTML. Use only Data_Dictionary calculation columns (allocated, never repeated originals). Render a live Data Integrity badge in the footer: certified vs browser-computed totals, recalculated by JS on load; divergence turns it red with the delta.
DESIGN — MORNING COCKPIT: big picture first, details on demand: (1) KPI strip, (2) trend + composition, (3) segment explorer, (4) anomalies & actions, (5) granular table. Restrained premium aesthetic: one accent color + semantic red/green, neutral background, card layout, consistent typography, tooltips everywhere, responsive, RTL-safe for Hebrew labels. Executive number formatting (separators, compact 1.2M, signed colored variance). Every chart carries a one-line data-computed "so what" caption. Target flow: read KPIs in ten seconds, spot the reds, reach evidence rows within two clicks.
SECTIONS: KPI cards (value, context vs budget/prior, sparkline, status color, click scrolls to detail); chronological trend chart (sort key, never alphabetical) with absolute/change toggle; composition donut + stacked bars over time, slices click-to-filter; variance ranking; GLOBAL FILTER BAR pinned on top — multi-select per dictionary filter dimension, All default, one-click reset, active filters as removable chips; EVERYTHING recomputes AND re-renders on filter change — charts visibly redraw via chart.data + chart.update() (never recreate instances leaving stale listeners — causes handleEvent TypeErrors; if recreation is needed, destroy() first); segment explorer — user-picked row/column dimensions, heatmap cross-tab, cell click drills to underlying rows, breadcrumb, CSV export; anomalies — the same computed rules and thresholds as the Excel stage, severity chips, click-through filters the table to evidence rows; action items derived strictly from flags; granular table — sortable, searchable, filter-aware, paginated, exportable.
USABILITY: feature-detect every capability at load — if Blob downloads are blocked, exports fall back to a modal with selectable content + copy-to-clipboard; if that fails too, HIDE the button. A visible dead button is a bug. All thresholds in one visible config block.
PRE-DELIVERY GATE: first verify in code that the embedded JSON block parses with a strict JSON parser and the file has zero unescaped quotes inside