Official agent skill

Meridian MMM Model Building

by google in google/meridian

Takes a user through building a Meridian marketing mix model, from loading CSV data and mapping columns to running EDA, fitting and saving the model.

OfficialApache-2.0Auto-check passedData & Analytics

Install Meridian MMM Model Building

skills CLI
$ npx skills add google/meridian --skill meridian-model-building -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google/meridian meridian-model-building --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google/meridian.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/meridian_model_building .claude/skills/meridian-model-building && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
meridian-model-building
GitHub stars
1.6k
Token cost
~2.5k tokens
SKILL.md length
1,067 words
Files
5 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Takes a user through building a Meridian marketing mix model, from loading CSV data and mapping columns to running EDA, fitting and saving the model.

  • Works in 8 steps: Initial Setup → Add Data Loading & Column Mapping Code → Add Model Configuration Code → …
  • Setting up a Meridian MMM model from a CSV of marketing spend and outcomes
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Mapping CSV columns to Meridian's input data builder

What it does

The agent builds up a Python script step by step while guiding you through creating a Meridian Marketing Mix Modeling model. It asks for the input CSV path, where the script should go, where the EDA HTML report should be written and where to save the model, which defaults to `meridian_model.binpb`. If you give no output paths, everything goes in `model_build/` in the project or beside the input data.

It adds data loading and column-mapping code with `meridian.data.data_frame_input_data_builder` after checking the CSV format against the documentation, then configures ModelSpec, runs exploratory data analysis, fits the model and saves it. The workflow has mandatory interactive checkpoints: at each one the agent presents the proposed configuration or paths, asks a multiple-choice approval question and waits, even if the original request said to run autonomously. A generic approval such as proceed accepts the proposed defaults. Visualizing results and building a scenario planner are out of scope, and reference files give a CSV format guide and templates.

When your agent uses it

  • Setting up a Meridian MMM model from a CSV of marketing spend and outcomes
  • Mapping CSV columns to Meridian's input data builder
  • Configuring ModelSpec and running EDA before fitting
  • Saving a fitted Meridian model to a file

Example prompts

  • “Build a Meridian model from data/marketing_weekly.csv and generate the script in model_build.”
  • “Help me map my geo-level CSV columns for Meridian and configure ModelSpec.”
  • “Run EDA on my campaign data with Meridian and write the HTML report.”
  • “Fit the Meridian model and save it as meridian_model.binpb.”

Requirements

  • Python with the Meridian library
  • A CSV of marketing data in the format Meridian expects

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Initial Setup
  2. Add Data Loading & Column Mapping Code
  3. Add Model Configuration Code
  4. Add Exploratory Data Analysis (EDA) Code
  5. Add Model Fitting Code
  6. Add Model Saving Code
  7. Execution & Script Setup
  8. Conclusion

What it can do on your machine

Read from SKILL.md and the folder at commit 5feea86. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Meridian MMM Model Building loads about 2.5k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 77 tokens; SKILL.md has 1,067 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from google/meridian at commit 5feea86, republished under its Apache-2.0 licence (© google). 1,067 words, ~2,498 tokens.

Download SKILL.mdSave it as .claude/skills/meridian-model-building/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
meridian-model-building
description
Guides users through building a Meridian Marketing Mix Modeling (MMM) model. Use when a user wants to load data, map columns, configure ModelSpec, run Exploratory Data Analysis (EDA), fit a model, and save the model. Don't use for visualizing results or creating a scenario planner.

Meridian Model Building Skill

This skill guides the user through the process of creating a Meridian model, accumulating the code into a Python script.

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, parameters, mappings, script path, 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 input CSV file path, the desired path for the generated Python script, the EDA HTML report output path, and the saved model path (meridian_model.binpb by default). If the user does not specify output paths, default to model_build/ in the active project directory (or relative to the input data directory) for the script and all outputs (meridian_model.binpb, eda.html).
  • CRITICAL INTERACTIVE CHECKPOINT: Present the gathered paths to the user and obtain confirmation before proceeding to data loading.
2. Add Data Loading & Column Mapping Code
  • Target Module: meridian.data.data_frame_input_data_builder
  • Action:
    • Check CSV Format: Before loading data, verify if the CSV data is in the right format. Consult the meridian-doc-consultant skill or check the documentation map in skills/meridian_doc_consultant/references/documentation_map.md under "Data Preparation & Loading" to find specific guides (like load-geo-data-without-rf.md, load-geo-data-with-organic-and-non-media.md based on the columns observed in the data) to understand the expected columns and data types. Consult references/csv_format_reference.md for details on expected row/column structure and data quality guardrails. If the format is incorrect or missing required columns, attempt to autonomously convert the dataset to the expected format for the user (e.g., renaming columns, restructuring) unless you are uncertain and need user input.
    • Read the header row of the provided CSV using Python to get the column names.
    • Propose heuristic mappings based on column keywords (e.g., 'sales' -> kpi_col, 'spend' -> media_spend_cols) and infer the kpi_type ('revenue' or 'non_revenue') based on the columns (e.g., 'revenue' or 'sales' implying 'revenue', and 'conversions' or 'leads' implying 'non_revenue').
    • Robust Mapping: If the user prompt specifies mapping a column name that does not exist in the CSV, do not assume it is a literal name if it looks like a description (e.g., 'media_impressions' vs 'ChannelX_impression'). Use heuristics to find matching columns and proceed.
    • Present the proposed mapping to the user.
    • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed column mappings to the user and obtain approval before continuing to model configuration.
    • Accumulate the data loading code using meridian.data.data_frame_input_data_builder.DataFrameInputDataBuilder and its with_* methods (e.g. with_kpi, with_media). See data_builder_template.md.
3. Add Model Configuration Code
  • Target Modules: meridian.model.spec, meridian.model.model
  • Action:
    • Read the ModelSpec and PriorDistribution definitions in meridian.model.spec.
    • Guide the user through configuration, prompting for relevant values while explaining their purpose based on the source code docstrings.
    • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed model specification parameters to the user and obtain approval before continuing.
    • Accumulate the code to initialize meridian.model.spec.ModelSpec and meridian.model.model.Meridian. See model_spec_template.md.
    • Accumulate code: mmm.sample_prior()
4. Add Exploratory Data Analysis (EDA) Code
  • Target Module: meridian.model.eda.meridian_eda
  • Action:
    • Read meridian_eda.py or module docstrings to confirm the generate_and_save_report method.
    • Accumulate code to initialize meridian_eda.MeridianEDA and call generate_and_save_report(filepath) using the user's specified path.
    • CRITICAL INTERACTIVE CHECKPOINT: Present the EDA output path configuration and obtain approval before proceeding to the model fitting step.
5. Add Model Fitting Code
  • Target Module: meridian.model.model
  • Action:
    • Read the sample_posterior method in meridian.model.model to understand its parameters.
    • Prompt the user for MCMC parameters: n_chains, n_adapt, n_burnin, n_keep.
    • CRITICAL INTERACTIVE CHECKPOINT: Present the MCMC parameters to the user and obtain approval before proceeding to compile the model fitting code.
    • Accumulate code: mmm.sample_posterior(...)
Show full SKILL.md (407 more words)Show less
6. Add Model Saving Code
  • Target Module: meridian.schema.serde.meridian_serde
  • Action:
    • Generate code to save the model using meridian_serde.save_meridian() to the user-specified path (or the default). See script_template.md.
    • Default Filename: The default filename for the saved model is meridian_model.binpb (in the model_build/ directory). Use this filename if the user does not specify a model filename, even if the script file is named differently.
    • Skip Sampling Handling: If the user requests to skip fitting or posterior sampling, still include the model saving step (meridian_serde.save_meridian(mmm, save_path)) using the initialized Meridian model object so the output model file is always created.
    • WARNING: Do NOT use the deprecated meridian.model.model.save_mmm function. Use meridian_serde.save_meridian exclusively.
    • CRITICAL INTERACTIVE CHECKPOINT: Present the model save path and filename to the user and obtain approval before proceeding to script execution.
7. Execution & Script Setup
  • Action:
    • Write the accumulated Python script to the user-specified path. When writing the file using write_to_file, explicitly set ArtifactMetadata.RequestFeedback=false to avoid pausing execution.
    • CRITICAL INTERACTIVE CHECKPOINT: Ask the user for final confirmation to execute the model building script now.
    • Artifact Preservation: When completing a task that requires generating outputs (like scripts, models, or reports), do NOT delete these generated artifacts at the end of your turn. They are the deliverables requested by the user. Only clean up truly temporary scratch files if necessary.
      • Path Handling for Outputs: In generated scripts, construct output file paths using os.environ.get("BUILD_WORKSPACE_DIRECTORY", ".") so files land in the source workspace during script execution and in the current directory during standalone OSS Python execution.
    • Execute the Script:
      • Always run the script from the workspace root directory (keep Cwd as the workspace root, do not set Cwd to a subdirectory).
      • Use Python: prefer the active virtual environment if available (e.g. .venv/bin/python3 or /tmp/meridian_eval_cache/bin/python3, otherwise python3).
      • Example command: /tmp/meridian_eval_cache/bin/python3 model_build/my_model.py
    • Handling Long Runs: If the command is sent to the background due to execution time, wait for the background task to complete and check the final output to catch runtime errors.
    • Differentiated Error Handling:
      • If it's a Syntax Error or Import Error, read the relevant source code to understand the correct usage or interface.
      • If it's a ValueError or parameter constraint violation (e.g., knots too large), check the docstring of the class/function or consult the meridian-doc-consultant skill to find valid values in the documentation.
      • Autonomy: If a fix requires changing configuration, prompt the user for confirmation. If the user response grants autonomy, proceed to fix it.
8. Conclusion
  • Action:
    • Confirm execution success and artifact generation.

© google, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/meridian_model_building of google/meridian.

  • SKILL.md
  • references/csv_format_reference.md
  • references/data_builder_template.md
  • references/model_spec_template.md
  • references/script_template.md

Open the folder on GitHubat commit 5feea86

Compare with similar skills

Meridian MMM Model Building next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Meridian MMM Model Building compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Meridian MMM Model Building this skillgoogle/meridian1.6k—~2.5kAutomated safety check: PassApache-2.0
MatlabzLanqing/codex-claude-academic-skills4.7k8 repos~2.3kAutomated safety check: NotesGPL-3.0
Statistical Data Analysislingzhi227/agent-research-skills386—~886Automated safety check: PassNone
Code EngineeropenJiuwen-ai/sciencediscovery156—~2.8kAutomated safety check: PassApache-2.0
Q-EDA Exploratory AnalysisTyrealQ/q-skills108—~1.1kAutomated safety check: PassMIT
PyMC Bayesian Modelingdavila7/claude-code-templates32k11 repos~3.9kAutomated safety check: PassMIT

Similar skills

  • Matlab

    zLanqing/codex-claude-academic-skills

    MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing.

    4.7k GitHub starsUsed in 8 repos~2.3k tokens
    Data & AnalyticsAuto-check: notes
  • Statistical Data Analysis

    lingzhi227/agent-research-skills

    Writes statistical analysis code for experimental data, runs it through a four-round review, and reports effect sizes, p-values and confidence intervals.

    386 GitHub stars~886 tokensUpdated 7 mo ago
    Data & AnalyticsAuto-check passed
  • Code Engineer

    openJiuwen-ai/sciencediscovery

    A skill your agent uses when you need to write and execute Python/R code to process, transform, and analyze data, delivering reproducible computational results with complete code-level methodology…

    156 GitHub stars~2.8k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Runs exploratory data analysis on tabular data after you confirm each column's measurement level, then writes CSV tables and a narrative summary.

    108 GitHub stars~1.1k tokensUpdated 15 days ago
    Data & AnalyticsAuto-check passed
  • PyMC Bayesian Modeling

    davila7/claude-code-templates

    Builds, fits, checks and compares Bayesian models in PyMC, from priors and NUTS sampling to variational inference, LOO and WAIC comparison, and diagnostics.

    32k GitHub starsUsed in 11 repos~3.9k tokens
    Data & AnalyticsAuto-check passed
  • Scientific Toolkit Skill

    zLanqing/codex-claude-academic-skills

    Research computing toolkit for optoelectronic information science and engineering, MATLAB/Octave, Python scientific analysis, signal processing, image processing, statistics, simulation…

    4.7k GitHub stars~1.2k tokensUpdated 4 mo ago
    Data & AnalyticsAuto-check passed

More from google/meridian

  • Official

    Reopens a fitted Meridian MMM from a saved file and runs budget allocation scenarios, producing an HTML report and a Python script that repeats the run.

    1.6k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Official

    Finds and reads the right Meridian marketing-mix-modeling documentation file to answer a concept or parameter question, instead of guessing.

    1.6k GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Official

    Loads a saved Meridian MMM model and produces an HTML results summary, with optional health checks and approval checkpoints at each step.

    1.6k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Official

    Generates Scenario Planner data from a fitted Meridian marketing mix model and prepares it for a Looker Studio dashboard through a Colab handoff.

    1.6k GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Works with

Questions about Meridian MMM Model Building

What does Meridian MMM Model Building do?

Takes a user through building a Meridian marketing mix model, from loading CSV data and mapping columns to running EDA, fitting and saving the model. The agent builds up a Python script step by step while guiding you through creating a Meridian Marketing Mix Modeling model.binpb`.

When should I use Meridian MMM Model Building?

Meridian MMM Model Building fits situations like: setting up a Meridian MMM model from a CSV of marketing spend and outcomes; mapping CSV columns to Meridian's input data builder; configuring ModelSpec and running EDA before fitting; saving a fitted Meridian model to a file.

How do I install Meridian MMM Model Building in Claude Code?

Run `npx skills add google/meridian --skill meridian-model-building -a claude-code`. Or copy the skill folder (skills/meridian_model_building in google/meridian) into .claude/skills/meridian-model-building in your project. Claude Code loads it when a task matches its description.

How do I install Meridian MMM Model Building in Codex?

Run `npx skills add google/meridian --skill meridian-model-building -a codex`. Or copy the skill folder (skills/meridian_model_building in google/meridian) into .agents/skills/meridian-model-building in your project. Codex loads it when a task matches its description.

Can I use Meridian MMM Model Building in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/meridian --skill meridian-model-building -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/meridian-model-building, .gemini/skills/meridian-model-building, .github/skills/meridian-model-building and .opencode/skills/meridian-model-building in your project.

What does Meridian MMM Model Building need to run?

SKILL.md names no scripts, command-line tools or credentials: Meridian MMM Model Building is instructions for the agent only. Our summary lists: Python with the Meridian library; A CSV of marketing data in the format Meridian expects.

Does Meridian MMM Model Building access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Meridian MMM Model Building safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Meridian MMM Model Building use?

Meridian MMM Model Building is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Meridian MMM Model Building use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Meridian MMM Model Building?

Skills that share tags, products or a category with Meridian MMM Model Building: Matlab (zLanqing/codex-claude-academic-skills, 4.7k stars), Statistical Data Analysis (lingzhi227/agent-research-skills, 386 stars), Code Engineer (openJiuwen-ai/sciencediscovery, 156 stars) and Q-EDA Exploratory Analysis (TyrealQ/q-skills, 108 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Meridian MMM Model Building?

google (a GitHub organization, an official publisher) maintains it in google/meridian, which has 1,561 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 9, 2026.

Source: google/meridian on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.