Index of every page on this site: llms.txt
All skills
google avatar

/meridianscenarioplanner

@71777a2
by googlegoogle/meridian1.6k stars
314
Run it yourself

Generates Scenario Planner data from a fitted Meridian model and exports it for Looker Studio dashboard creation via Colab handoff. Use when the user wants to generate scenario planning data, budget grids, or Looker Studio dashboards from a saved model. Don't use for visualizing model results (use meridian-result-visualization) or running standard budget optimization (use meridian-budget-optimization).

  • 2 files
  • 10.2 KB
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/google/meridian/meridianscenarioplanner

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈108 tokens for metadata: the name and description. ≈1.4k when used: this file. ≈1k more on demand in 1 file.

Description uses 5.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈433 characters, or 5.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Meridian Scenario Planner Generation

This skill guides the agent to generate Scenario Planner data, serialize it as a proto file for Colab handoff (zero GCP setup required), and provide the link to the Meridian Looker Studio Scenario Planner Colab notebook.

Prerequisites

  • The agent must have access to a fitted Meridian model (serialized as meridian_model.binpb).
  • [!IMPORTANT] meridian_model.binpb is a binary file. Do NOT try to read its content directly using file viewing tools or grep, as this will produce invalid UTF-8 errors. Always use meridian_serde.load_meridian() in a Python script to load it.

Core Workflow

Interactivity Checkpoint Rule

Throughout this workflow, you will encounter CRITICAL INTERACTIVE CHECKPOINTs. At each checkpoint, you MUST:

  1. Present the current proposed configurations, paths, or status to the user for approval.
  2. Ask the user if they are ready to proceed using the available user-interaction tool (e.g., ask_question), structured as a multiple-choice question. Do NOT use raw chat text.
  3. Wait for their response before proceeding.
    • MANDATORY: You MUST pause at every checkpoint regardless of the initial prompt instructions (even if the user request contains phrases like "run autonomously", "execute directly", "fix autonomously", etc.). The initial request does NOT bypass these interactive checkpoints.
    • Note: If the user replies to a checkpoint with a generic approval (e.g., "proceed", "do what you think is best"), proceed with the proposed defaults.

1. Initial Setup

  • Prompt the user for the path to the serialized model file (meridian_model.binpb by default).
  • Prompt the user for the output proto path (default: model_build/scenario_planner_data.binpb).
  • Prompt the user for the desired path for the generated Python script. If unspecified, default to model_build/run_scenario_planner.py (or relative to the model directory).
  • CRITICAL INTERACTIVE CHECKPOINT: Present the gathered paths to the user and obtain confirmation before configuring spec parameters.

2. Configure Scenario Planner Spec & Interactive Checkpoint

  • Prompt the user for the following Scenario Planner spec configurations (or confirm defaults):
    • optimization_name (String, e.g., "Scenario Planner")
    • include_non_paid_channels (Boolean, default: True)
    • Time breakdown: yearly (default: False), quarterly (default: True), monthly (default: False)
    • min_spend_shift_ratio (Float 0-1, default: 1.0)
    • max_spend_shift_ratio (Float > 0, default: 1.0)
    • use_optimal_frequency (Boolean, default: True)
    • max_frequency (Float > 0, default: 10.0)
  • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed Scenario Planner spec configurations to the user and obtain approval before continuing to load the model.

3. Add Model Loading Code

  • Use meridian_serde.load_meridian() to load the model.
  • See script_template.md for code template.
  • CRITICAL INTERACTIVE CHECKPOINT: Present the model load path configuration and proposed Python code snippet to the user, and obtain approval before continuing to data generation.

4. Add Scenario Planner Data Generation & Colab Handoff Code

  • Create specs for ModelFitSpec, MarketingAnalysisSpec, and BudgetOptimizationSpec using the user-provided configurations.
  • Use mmm_ui_gen.create_mmm_ui_data_proto() to create the proto, including the requested time breakdown generators.
  • Serialize and save the proto to disk (e.g. model_build/scenario_planner_data.binpb).
  • Instruct the user to upload the saved file to the Meridian Scenario Planner Colab notebook: https://colab.research.google.com/github/google/meridian/blob/main/demo/Meridian_Scenario_Planner_Beta.ipynb
  • See script_template.md for code template.
  • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed scenario planner spec configuration and export code snippet to the user, and obtain approval before continuing to execution.

5. Pre-execution Checkpoint

  • CRITICAL INTERACTIVE CHECKPOINT: Ask the user for final confirmation to execute the scenario planner generation script now.

6. Execution & Script Setup

  • Write the accumulated Python script to the user-specified path. If your file-writing tool can ask the user to review the written file, don't request that review: the pre-execution checkpoint already asks for approval, and an extra prompt pauses the workflow.
  • You can use the full script template in script_template.md as a guide.
  • Execute the script with the Python interpreter of the environment where google-meridian is installed: the one the user named; else python3 if a virtual environment is already active (VIRTUAL_ENV or CONDA_PREFIX is set); else the project directory's virtual environment (.venv/ or venv/, e.g., .venv/bin/python3) if there is one; else python3. If import meridian fails, ask the user which environment to use instead of searching the machine or installing packages unprompted.
  • If the script keeps running in the background, wait for it to finish and check its final output before reporting results.
  • CRITICAL: Do NOT delete the generated script, output proto files, or deliverables at the end of the task. These are the deliverables requested by the user and must be preserved.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 71777a2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month

README badge

README badge for google/meridian/meridianscenarioplanner