/agent-mmm:mmm-reportfrom agent-mmm
Generates stakeholder-specific reports (CMO, CFO, MOps, DS, or all) from the best MMM run, plus a visual report with PNG charts, interactive HTML, and markdown summary.
Ships in agent-mmm. Installing the plugin adds it to Claude Code.
Generate reports for one or all stakeholder personas.
/mmm-report [persona] where persona is cmo, cfo, mops, ds, or all (default: all).
Check ./mmm-workspace/spec.yaml exists.
Find the best run from leaderboard or latest run:
python3 -c "
import json, pathlib, sys
lb = pathlib.Path('./mmm-workspace/leaderboard.json')
if lb.exists():
data = json.load(open(lb))
print(data.get('best_run_id', ''))
else:
runs = sorted(pathlib.Path('./mmm-workspace/runs').iterdir()) if pathlib.Path('./mmm-workspace/runs').exists() else []
print(runs[-1].name if runs else '')
"
Load metrics and diagnostics from the selected run.
Run the appropriate report generators:
PY="${MMM_PYTHON:-.venv-mmm/bin/python}"
[ -x "$PY" ] || { echo "No MMM environment found. Run /mmm-setup first."; exit 1; }
"$PY" -P - "${CLAUDE_PLUGIN_ROOT:?agent-mmm plugin root is not set}" <<'EOF'
import sys, pathlib, json
sys.path.insert(0, str(pathlib.Path(sys.argv[1]) / "lib"))
from agent_mmm.spec import load_spec
from agent_mmm.reports import (
generate_cmo_report, generate_cfo_report,
generate_mops_report, generate_ds_report
)
spec = load_spec("./mmm-workspace/spec.yaml")
run_id = "RUN_ID" # replace
# Load available data
metrics, diagnostics = {}, {}
run_dir = pathlib.Path(f"./mmm-workspace/runs/{run_id}")
if (run_dir / "metrics.json").exists():
metrics = json.load(open(run_dir / "metrics.json"))
if (run_dir / "diagnostics.json").exists():
diagnostics = json.load(open(run_dir / "diagnostics.json"))
persona = "PERSONA" # replace with cmo/cfo/mops/ds/all
generated = []
if persona in ("cmo", "all"):
generate_cmo_report(spec, run_id, metrics, diagnostics, base=".")
generated.append("./mmm-workspace/reports/cmo.md")
if persona in ("cfo", "all"):
generate_cfo_report(spec, run_id, metrics, diagnostics, base=".")
generated.append("./mmm-workspace/reports/cfo.md")
if persona in ("mops", "all"):
generate_mops_report(spec, run_id, metrics, diagnostics, base=".")
generated.append("./mmm-workspace/reports/mops.md")
if persona in ("ds", "all"):
generate_ds_report(spec, run_id, metrics, diagnostics, base=".")
generated.append("./mmm-workspace/reports/ds.md")
for path in generated:
print(f"Generated: {path}")
EOF
Build the visual report from every run with results.json (the latest per framework),
including the comparison when there are two or more:
PY="${MMM_PYTHON:-.venv-mmm/bin/python}"
[ -x "$PY" ] || { echo "No MMM environment found. Run /mmm-setup first."; exit 1; }
"$PY" -P - "${CLAUDE_PLUGIN_ROOT:?agent-mmm plugin root is not set}" <<'EOF'
import sys, pathlib
sys.path.insert(0, str(pathlib.Path(sys.argv[1]) / "lib"))
from agent_mmm.results_schema import load_all
from agent_mmm.compare import compare
from agent_mmm.charts import build_report
latest = {}
for r in load_all("mmm-workspace/runs"):
latest[r.framework] = r
results = list(latest.values())
if not results:
print("No results.json found. Run /mmm-fit first."); raise SystemExit(1)
comp = compare(results) if len(results) > 1 else None
from agent_mmm.budget import load_plans
run_ids = {r.run_id for r in results}
plans = [p for p in load_plans(".") if p.run_id in run_ids] or None # from /mmm-budget, if run
out = build_report(results, comp, base=".", budget_plans=plans)
print(f"HTML report: {out['html']}")
print(f"Summary: {out['markdown']}")
for group, paths in out["figures"].items():
print(f"{group}: {len(paths)} charts")
EOF
The HTML file is self-contained (no internet needed, nothing loaded from outside) and safe to
email. If matplotlib or plotly is missing, re-run /mmm-setup (they are in the report extra).
Display each generated report or offer to open them.
Explain key findings to the user in plain language tailored to the requested persona.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub yakoub-ai/agent-mmm --plugin agent-mmm22 commands in this plugin
/mmm-analyze-dataMMM Data Audit and Improvement PlanRun the data quality audit on the dataset in spec.yaml, then turn it into a prioritised improvement plan (fix now + improve data collection going forward) and ideas for better use of the dataset. Writes to ./mmm-workspace/audit/./mmm-budgetMMM Budget ScenariosBudget scenarios with a guardrail ladder — the same budget optimised at small (±10%), moderate (±25%), large (±50%) and aggressive (0–2×) levels, at several total budgets, with uncertainty, an efficiency frontier, cross-framework agreement and a recommendation that explains what small vs larger adjustments buy./mmm-buildMMM BuildCompile spec.yaml plus recommended priors into the target framework, validate the model structure, and report anything the framework cannot express./mmm-compareMMM CompareCompare fitted models across frameworks (pymc-marketing, Meridian) on the same holdout — forecast error, convergence, ROAS and contribution intervals per channel, where the frameworks agree and disagree, and which model (if any) is fit for decisions./mmm-diagnoseMMM DiagnosticsRun diagnostics on a completed MMM run — convergence, fit, generalisation, baseline health, prior-to-posterior learning, and attribution plausibility./mmm-discoverMMM DiscoverProfile a folder of raw, unstructured marketing data — infer date formats, grain, currency and column roles, propose joins, and produce the list of questions that must be answered before the data can be trusted. Read-only.