marimo-batch — скилл для Claude Code: что делает и как установить
Скилл переводит блокноты marimo в режим пакетного запуска через CLI и планировщик. Он добавляет типизацию параметров на Pydantic и сохраняет работу в веб-интерфейсе.
npx skills add marimo-team/skills --skill marimo-batch -a claude-codeЧто делает marimo-batch
Скилл настраивает ноутбук marimo так, чтобы его можно было запускать и в интерактивном режиме, и в фоновом скрипте через uv run. Базовой структурой становится модель BaseModel из Pydantic. Внутри задаются аргументы вычислений с типами и значениями по умолчанию. При интерактивной работе поля заполняются через форму UI, а в режиме скрипта значения берутся из флагов командной строки через mo.cli_args().
Для работы с секретами скилл настраивает чтение .env через python-dotenv и форму EnvConfig из библиотеки wigglystuff. Если проекту нужен мониторинг в Weights & Biases, модель параметров расширяется полями wandb_project и wandb_run_name. Разметка колонок остаётся нетронутой. Вызовы @app.cell(column=...) сохраняют свою структуру во избежание поломки интерфейса.
Для перебора гиперпараметров подключается скрипт grid.py, совместимый с Hugging Face Jobs, Modal или RunPod. По умолчанию он делает сухой прогон. Это исключает случайный расход вычислительных ресурсов до ручной проверки комбинаций флагом --launch.
Какие задачи решает
- подготовить ноутбук marimo к пакетному запуску по расписанию
- вынести гиперпараметры модели в Pydantic с поддержкой аргументов командной строки
- настроить безопасную загрузку переменных окружения через EnvConfig и .env
- запустить сухой прогон сетки гиперпараметров перед отправкой задач в облако
Примеры запросов агенту
- Подготовь мой ноутбук marimo к пакетному запуску через uv run и вынеси sample_size в аргументы CLI.
- Добавь в marimo-ноутбук логирование в Weights and Biases и проверку ключей окружения.
- Сделай форму параметров на Pydantic для интерактивного режима и чтения флагов скрипта.
Как установить marimo-batch
1Через Skills CLI (Vercel)
npx skills add marimo-team/skills --skill marimo-batch -a claude-code2Вручную: положить файлы
~/.claude/skills/marimo-batch/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/marimo-batch/
1Через Skills CLI (Vercel)
npx skills add marimo-team/skills --skill marimo-batch -a codex2Вручную: положить файлы
.agents/skills/marimo-batch/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add marimo-team/skills --skill marimo-batch -a cursor2Вручную: положить файлы
.cursor/skills/marimo-batch/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install marimo-team/skills marimo-batch2Вручную: положить файлы
.github/skills/marimo-batch/SKILL.md1Через Skills CLI (Vercel)
npx skills add marimo-team/skills --skill marimo-batch -a gemini-cli2Командой платформы
gemini skills install https://github.com/marimo-team/skills --path skills/marimo-batchВручную: положить файлы
.devin/skills/marimo-batch/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add marimo-team/skills --skill marimo-batch -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора8
Похожие
Рядом в теме «ИИ и ML»
Всё по теме «ИИ и ML» →Вопросы о marimo-batch
Как установить marimo-batch в Claude Code?
Выполните в терминале команду npx skills add marimo-team/skills --skill marimo-batch -a claude-code.
Что делает скилл marimo-batch?
Скилл адаптирует блокнот marimo для параллельного использования в UI и через терминал. Он генерирует Pydantic-схему для параметров, организует парсинг аргументов CLI и помогает настроить запуск фоновых ML-задач.
Как запускается поиск по сетке гиперпараметров?
Через вспомогательный скрипт grid.py, который сэмплирует параметры из схемы ModelParams. Команда uv run grid.py выполняет сухой прогон, а флаг --launch отправляет задачи на выполнение в облачный провайдер вроде Hugging Face Jobs или Modal.
Исходный текст
SKILL.md · Apache-2.0
---
name: marimo-batch
description: An opintionated skill to prepare a marimo notebook to make it ready for a scheduled run.
---
Pydantic is a great way to declare a source of truth for a batch job, especially for ML. You can declare something like:
```python
from pydantic import BaseModel, Field
class ModelParams(BaseModel):
sample_size: int = Field(
default=1024 * 4, description="Number of training samples per epoch."
)
learning_rate: float = Field(default=0.01, description="Learning rate for the optimizer.")
```
You can fill these model params with two methods too, you can imagine a form in the UI.
```python
el = mo.md("""
{sample_size}
{learning_rate}
""").batch(
sample_size=mo.ui.slider(1024, 1024 * 10, value=1024 * 4, step=1024, label="Sample size"),
learning_rate=mo.ui.slider(0.001, 0.1, value=0.01, step=0.001, label="Learning rate"),
).form()
el
```
But you can also use the CLI from marimo.
```python
if mo.app_meta().mode == "script":
if "help" in mo.cli_args() or len(cli_args) == 0:
print("Usage: uv run git_archaeology.py --repo <url> [--samples <n>]")
print()
for name, field in ModelParams.model_fields.items():
default = f" (default: {field.default})" if field.default is not None else " (required)"
print(f" --{name:12s} {field.description}{default}")
exit()
model_params = ModelParams(
**{k.replace("-", "_"): v for k, v in mo.cli_args().items()
})
else:
model_params = ModelParams(**el.value)
```
The user can now run this from the command line via:
```bash
uv run notebook.py --sample-size 4096 --learning-rate 0.005
```
This is the best of both worlds, you can use the UI to test and iterate, and then use the CLI to run the batch job. Another benefit is that you can run the notebook with settings to make it run quickly to see if there are any bugs in the notebook.
The user wants to be able to run a notebook using this pattern, so make sure you ask the user which parameters they want to make configurable via the CLI and the proceed to make the changes to the notebook. Make sure you verify the changes with the user before making them.
## Weights and Biases
It is possible that the user is interested in adding support for weights and biases. Make sure you confirm if this is the case yes/no. If that is the case, make sure these ModelParams are logged. You also want to make sure that the `wandb_project` and `wandb_run_name` are part of the ModelParams is the user wants to go down this route.
If the user is keen to start a training job for ML, make sure you use [this starting point](references/starting-point.py). Make sure you keep the columns intact in this notebook!
## Environment Variables
You may need to read environment variables for the job. Use python-dotenv to read a .env file if it exists, but also add an `EnvConfig` so users may add keys manually in a ui.
```python
from wigglystuff import EnvConfig
# With validators
config = EnvConfig({
"OPENAI_API_KEY": lambda k: openai.Client(api_key=k).models.list(),
"WANDB_API_KEY": lambda k: wandb.login(key=k, verify=True)
})
# Block until valid, useful in cell that needs the key
config.require_valid()
# Access values
config["OPENAI_API_KEY"]
config.get("OPENAI_API_KEY", "some default")
```
Make sure you add this `EnvConfig` at the top of the notebook.
## Columns
It can be common for larger marimo notebooks to use the columns feature to make it easy to navigate. If that is the case, you must keep these columns intact!
```python
@app.cell(column=0, hide_code=True)
def _(mo):
mo.md(r"""demo""")
```
## Compute platform
When the job is ready to get some serious compute, it is important that we keep good practices in mind. Consider batch sizes for the data set and make sure that there are plenty of logs so the user can spot if issues arise.
## Grid search
When the user wants to run a hyperparameter sweep, point them to [this grid launcher](references/grid.py). It works with the notebook in `references/starting-point.py` out of the box: it samples random combinations from a search space that matches the notebook's `ModelParams` fields and launches each one as a separate job.
By default the script does a dry run (`uv run grid.py`) so the user can inspect the combinations before spending compute. Pass `--launch` to actually submit jobs. The `--count` and `--seed` flags control how many combinations to sample and the RNG seed.
The reference uses Hugging Face Jobs as the compute provider, but this is just one option. The user can swap it out for Modal, RunPod, or any other provider that can run a uv script.
© marimo-team · Apache-2.0 · marimo-team/skills