Awesome-Agent-Skills-for-Empirical-Research marimo
git clone https://github.com/brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research
T=$(mktemp -d) && git clone --depth=1 https://github.com/brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/17-DAAF-Contribution-Community-daaf/dot-claude/skills/marimo" ~/.claude/skills/brycewang-stanford-awesome-agent-skills-for-empirical-research-marimo && rm -rf "$T"
skills/17-DAAF-Contribution-Community-daaf/dot-claude/skills/marimo/SKILL.mdmarimo
marimo reactive Python notebook system for reproducible and interactive data work. Covers cell reactivity model, UI elements (sliders, dropdowns, tables, forms), SQL cells, DataFrame display, plotting integration, validation patterns for data pipelines, and deployment as apps, scripts, or WASM. Use when assembling Stage 9 research notebooks, developing reactive marimo notebooks, building interactive data apps, or converting Jupyter notebooks to marimo's Git-friendly .py format.
Comprehensive skill for building reactive Python notebooks with marimo. Use decision trees below to find the right guidance, then load detailed references.
What is Marimo?
marimo is an open-source reactive Python notebook that automatically keeps code and outputs consistent:
- Reactive: Run a cell, and dependent cells automatically re-run
- No hidden state: Delete a cell, its variables are scrubbed from memory
- Pure Python: Notebooks stored as
files (Git-friendly).py - Interactive: UI elements sync with Python without callbacks
- Deployable: Run as scripts, deploy as web apps, export to WASM
How to Use This Skill
Reference File Structure
Each topic in
./references/ contains focused documentation:
| File | Purpose | When to Read |
|---|---|---|
| Installation, CLI, first notebook | Starting a new project |
| Cell execution model, dataflow | Understanding marimo's reactive model |
| Transform-validate patterns, checkpoints | REQUIRED for data analysis workflows |
| Interactive elements (mo.ui.*) | Adding interactivity |
| SQL cells, dataframes, plotting | Working with data |
| Markdown, layouts, formatting | Styling outputs |
| Apps, scripts, export, deploy | Sharing/deploying notebooks |
| Common errors, best practices | Debugging issues |
Reading Order
- New to marimo? Start with
thenquickstart.mdreactivity.md - Data analysis workflows? Read
(REQUIRED for rigorous analysis)validation-patterns.md - Building features? Read the relevant topic file
- Having issues? Check
firstgotchas.md
Related Skills
Load these skills together with marimo for comprehensive workflow support:
Always Load Together:
- Provides validation methodology and EDA principles that inform notebook structuredata-scientist
- DataFrame operations for data transformations within notebookspolars
Load for Specific Features:
- Static publication-quality plots (ggplot2 style)plotnine
- Interactive visualizations with hover/zoomplotly
Prerequisite Knowledge: If new to marimo, first understand:
- Python basics
- DataFrame operations (polars or pandas)
- Basic plotting concepts
CRITICAL: Stage 9 is Script COMPILATION, Not Dashboard Building
For data research workflows, the Stage 9 marimo notebook has ONE job: LITERALLY COPY script file contents into cells.
What Stage 9 IS
- A script viewer — Copy-paste scripts into marimo cells
- An audit tool — Display execution logs to prove what ran
- A file compiler — Read files, copy contents, format as notebook
What Stage 9 is NOT
- ❌ NOT a dashboard builder
- ❌ NOT an interactive analysis tool
- ❌ NOT a place for new aggregations or filters
- ❌ NOT a place for UI widgets (dropdowns, sliders, search)
Stage 9 Notebook Assembly
Stage 9 is handled by the notebook-assembler agent (see
.claude/agents/notebook-assembler.md), which:
- READS script files from
scripts/stage{5,6,7,8}_*/ - COPIES script code VERBATIM into code cells
- COPIES execution logs VERBATIM into accordion cells
- ADDS ONLY simple
cellspl.read_parquet() + mo.ui.table()
ABSOLUTE PROHIBITIONS for Stage 9
The following are NEVER ALLOWED in Stage 9 notebooks:
| Prohibited Element | Why |
|---|---|
| No dropdowns — not a dashboard |
| No sliders — not a dashboard |
| No multiselects — not a dashboard |
for search | No search boxes — not a dashboard |
(new) | No new aggregations — copy script code only |
(new) | No new aggregations — copy script code only |
(new) | No pivot tables — copy script code only |
in data cells | No filtering — just load and display |
in data cells | No transforms — just load and display |
| "Interactive Filters" section | Not a dashboard |
| "Data Explorer" section | Not a dashboard |
| "Institution Lookup" feature | Not a dashboard |
The ONLY New Code Allowed
Data inspection cells may contain ONLY these two lines:
df = pl.read_parquet("path/to/file.parquet") mo.ui.table(df.head(100))
No
.filter(). No .with_columns(). No .select(). No aggregations. Just load and display.
Anti-Patterns (What BAD Output Looks Like)
# ❌ WRONG — This is new analysis code tier_summary = risk_data.group_by("tier").agg(pl.len()) # ❌ WRONG — This is a dashboard widget sector_dropdown = mo.ui.dropdown(options=["Public", "Private"]) # ❌ WRONG — This is a transformation when loading df = pl.read_parquet("data.parquet").with_columns(pl.col("x") * 2) # ❌ WRONG — This is filtering filtered = df.filter(pl.col("state") == "VA")
# ✅ CORRECT — Verbatim script code in code cell # SOURCE: scripts/stage5_fetch/01_fetch.py import polars as pl def _(): # ... exact script contents (marimo cell wrapper) ... # ✅ CORRECT — Simple load + display df = pl.read_parquet("data/raw/file.parquet") mo.ui.table(df.head(100))
See:
for the complete behavioral protocol.claude/agents/notebook-assembler.md
Stage 9 for templateagent_reference/WORKFLOW_PHASE4_ANALYSIS.md
Quick Decision Trees
"I need to get started"
Getting started? ├─ Install marimo → ./references/quickstart.md ├─ Create first notebook → ./references/quickstart.md ├─ Understand how cells work → ./references/reactivity.md └─ Run built-in tutorials → marimo tutorial intro
"I need interactivity"
Need interactive elements? ├─ Sliders, dropdowns, text inputs → ./references/ui-elements.md ├─ Tables with selection → ./references/ui-elements.md ├─ Forms with submit buttons → ./references/ui-elements.md ├─ Dynamic arrays of elements → ./references/ui-elements.md ├─ Charts with selection → ./references/sql-data.md (plotting section) └─ Custom widgets (anywidget) → ./references/ui-elements.md
"I need to work with data"
Need data operations? ├─ Query dataframes with SQL → ./references/sql-data.md ├─ Connect to databases (Postgres, SQLite) → ./references/sql-data.md ├─ Display/filter dataframes → ./references/sql-data.md ├─ Create plots (Altair, Matplotlib, Plotly) → ./references/sql-data.md └─ Interactive data exploration → ./references/sql-data.md
"I need to format output"
Need output formatting? ├─ Write markdown with Python values → ./references/outputs-layouts.md ├─ Arrange elements (hstack, vstack) → ./references/outputs-layouts.md ├─ Tabs, accordions, sidebars → ./references/outputs-layouts.md ├─ Progress bars, spinners → ./references/outputs-layouts.md └─ Conditional output display → ./references/outputs-layouts.md
"I need to share/deploy"
Need to share or deploy? ├─ Run as read-only web app → ./references/apps-deployment.md ├─ Execute as Python script → ./references/apps-deployment.md ├─ Export to HTML/WASM → ./references/apps-deployment.md ├─ Deploy with Docker → ./references/apps-deployment.md ├─ Grid/slides layout → ./references/apps-deployment.md └─ Convert from Jupyter → ./references/quickstart.md
"Something isn't working"
Having issues? ├─ "Multiple definitions" error → ./references/gotchas.md ├─ Cells not re-running as expected → ./references/reactivity.md ├─ UI element not updating → ./references/gotchas.md ├─ Cycle dependency error → ./references/gotchas.md ├─ Expensive cells running too often → ./references/gotchas.md └─ Mutations not triggering updates → ./references/reactivity.md
Quick Reference
Essential CLI Commands
| Command | Purpose |
|---|---|
| Launch notebook server |
| Create/edit specific notebook |
| Run as read-only app |
| Execute as script |
| Run interactive tutorial |
| Convert other formats INTO marimo (inbound only) |
| Export to HTML |
Docker: When running in a container, add
to--host 0.0.0.0 --port 2718 --headlessandruncommands.edit
Core marimo Library
| Function | Purpose |
|---|---|
| Render markdown |
| Create slider |
| Create dropdown |
| Interactive table |
| Horizontal layout |
| Vertical layout |
| SQL query |
| Conditionally stop execution |
Topic Index
| Topic | Reference File |
|---|---|
| Installation & Setup | |
| CLI Commands | |
| Reactive Execution | |
| Cell Dataflow | |
| Validation Patterns | |
| Transform-Validate Pairs | |
| Data Quality Checkpoints | |
| Sliders & Inputs | |
| Tables & Forms | |
| SQL Cells | |
| DataFrames | |
| Plotting | |
| Markdown | |
| Layouts | |
| Apps & Scripts | |
| Export & Deploy | |
| Common Errors | |
| Best Practices | |
Citation
When this library is used as a primary analytical tool, include in the report's Software & Tools references:
marimo team. marimo: Reactive Python notebook [Computer software]. https://marimo.io/
Cite when: The analysis notebook is delivered as a marimo notebook (typically always true in DAAF pipelines). Do not cite when: marimo is not used for the analysis delivery format.