Guide · Agent skill
How to use the PyMC Bayesian Modeling agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The pymc skill teaches an AI agent to build, check and compare Bayesian statistical models in PyMC, a Python library for probabilistic modeling. It is for analysts, researchers, developers and students who want estimates with honest uncertainty rather than single numbers. After this guide you will know what the skill changes, how to install it, how to ask for it in plain language, and what it needs and risks before you run it on your data.
Quick start
- 1Download and unzip the skill. Download the pymc ZIP from this page and unzip it so the skill folder containing SKILL.md sits in ~/.claude/skills/ or in a project's .claude/skills/ folder.
- 2Or upload it in the Claude apps. If you use the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
- 3Install Python 3.12 or newer. Make sure your environment runs Python 3.12 or newer, since the skill requires it.
- 4Run the synthetic smoke test. From the skill directory, run one of the bundled templates with the documented uv command to confirm the setup works and output files are written.
- 5Describe your modeling task. Ask the agent in plain language for a PyMC model, naming your data, the grouping and the prediction you need.
- 6Review priors and checks. Let the agent run the prior predictive check and show you the diagnostics before you accept any estimates.
- 7Compare and report. Ask for PSIS-LOO comparison if you have alternative models, and report estimates with their uncertainty and the diagnostic results.
What the pymc skill makes the agent do
An agent skill is a folder of instructions and helper files that an AI agent reads when a task matches the skill's description. With the pymc skill loaded, the agent follows a Bayesian workflow: it defines the question you are answering, sets priors, runs sampling, checks convergence and predictive fit, and then compares candidate models.
The skill covers hierarchical models, NUTS MCMC sampling, variational inference, predictions using mutable data, posterior predictive checks, diagnostics and PSIS-LOO model comparison. Results are reported with uncertainty.
- Ready-made templates for linear regression and hierarchical (multi-group) regression, both runnable on synthetic data.
- A diagnostics helper that screens sampling output for problems such as nonfinite statistics, too few chains and low effective sample size.
- A model comparison helper that checks PSIS-LOO reliability and ranks models by expected log predictive density.
- Reference notes on distributions, common model structures, sampling and the standard workflow.
Install the pymc skill from the ZIP download
Download the ZIP for the pymc skill from this page. Unzip it so that the skill folder (containing SKILL.md) ends up in your personal skills folder, ~/.claude/skills/, or in a project folder at .claude/skills/ inside the project you are working in. A project-level install applies only to that project.
If you use the Claude apps instead of a local setup, you can upload the skill under Settings → Capabilities → Skills rather than unzipping it yourself.
- Personal install: place the skill folder in ~/.claude/skills/.
- Project install: place the skill folder in .claude/skills/ within the project.
- Claude apps: upload the ZIP under Settings → Capabilities → Skills.
- Check that SKILL.md is inside the skill folder after unzipping.
Set up Python and the required packages
The skill needs Python 3.12 or newer. It targets specific pinned releases of PyMC, PyTensor and ArviZ, which are listed in SKILL.md and in the run commands below. Using other versions of these libraries may not match the skill's instructions, so pin them as shown.
The bundled helpers also use NumPy, pandas, Matplotlib, h5netcdf and h5py. Optional samplers such as nutpie, NumPyro or BlackJAX need separate installation and are not required for the basic workflow.
- Required: Python 3.12 or newer, PyMC, PyTensor, ArviZ 1.x-compatible packages, NumPy, pandas, Matplotlib, h5netcdf, h5py.
- The documented run commands use uv to create an isolated environment.
- Optional: nutpie, NumPyro or BlackJAX samplers, installed separately.
Run the bundled smoke test
Before using your own data, run one of the synthetic templates from the skill directory. This confirms that the packages install and that the model runs and writes its output folder. The short run settings only test execution; they do not produce reliable scientific estimates.
The hierarchical template works the same way with its own script name and output folder.
- The output folder is named by the --output-dir option, for example linear_smoke.
- Use the linear template to check a simple regression and the hierarchical template to check multi-group structure.
uv run --isolated --with "pymc==6.3.2" --with "arviz==1.3.0" --with "pytensor==3.3.2" --with matplotlib --with pandas --with h5netcdf --with h5py python assets/linear_regression_template.py --draws 80 --tune 80 --chains 2 --output-dir linear_smokeTrigger the skill with natural requests
You do not need special syntax. Describe the modeling task in plain language and mention PyMC or Bayesian modeling. The agent should match the request to the skill's description, which covers probabilistic modeling and uncertainty inference in PyMC.
Good requests state the outcome, the data and the question. For example, you might ask for a model of how a measurement varies between groups, with uncertainty intervals for each group and for a new group. Mention the prediction you need, because the skill asks you to define the estimand and the predictive unit first.
- Ask for a model with a stated question: 'Build a PyMC model of conversion rates by store, with uncertainty for each store.'
- Ask for checks explicitly: 'Run prior predictive and posterior predictive checks and report R-hat and ESS.'
- Ask for comparisons: 'Compare these two PyMC models with PSIS-LOO and warn me if the diagnostics are unreliable.'
- Name your data file and columns so the agent can inspect them before fitting.
Example workflows
A typical session starts with the agent asking what you want to predict and how the data are grouped. It then proposes priors, runs a prior predictive check, fits several chains with explicit seeds, and reports diagnostics before any interpretation.
For a multi-group problem, the hierarchical template shows how to predict an unseen group. The skill's notes say to draw group effects from every hyperposterior draw and add observation noise, rather than using only population means, because population means leave out between-group uncertainty.
- Estimating average effects across sites or classes with partial pooling.
- Comparing a linear model with a robust alternative using PSIS-LOO and reporting whether the comparison is reliable.
- Producing predictions for a new group with uncertainty that includes between-group variation.
- Checking whether a fitted model reproduces the tails, zeros or time patterns that matter for your question.
Safety notes: scripts and network
The skill runs scripts. The agent will execute local Python code on whatever data you provide, so only use it on data you are allowed to process in that environment. The listing states that the skill does not use the network at runtime, but the installation commands do fetch packages.
Review the data and the code the agent writes before running it on sensitive or regulated data. The skill's own guidance also warns that in-sample checks do not validate a model externally.
- Runs scripts: yes. Uses network: no, according to the listing.
- Keep sensitive data in a controlled environment and review the agent's code first.
- Record the environment, seeds, preprocessing and data source for any analysis you report.
Tips for getting reliable results
Treat the smoke test as a check that the setup works, not as an answer. For real analysis, set priors with domain knowledge, use several chains with explicit seeds, and inspect R-hat, effective sample size, divergences and posterior predictive fit before interpreting estimates.
If diagnostics look bad, the skill recommends fixing the model geometry or initialization before simply adding more draws. A clean diagnostic screen does not prove convergence.
- Choose the number of draws from diagnostics and your precision target, not from the template defaults.
- Use a broad prior check: a broad prior is not automatically plausible.
- Compare models only when the outcome, scale and predictive unit are identical.
- Treat model averaging weights as predictive combination weights, not posterior model probabilities.
What people use it for
- Estimating group-level rates with uncertainty when your measurements are grouped by site, class or patient.
- Building a hierarchical model that partially pools information across groups and predicts an unseen group.
- Comparing a simple linear model against a more robust variant using PSIS-LOO with reliability checks.
- Teaching or learning Bayesian workflow with prior predictive checks, R-hat, ESS and LOO done in order.
Frequently asked questions
Is the pymc agent skill free to use?
The listing gives the license as MIT, but the SKILL.md file in the download names the Apache License, Version 2.0. Check the license file inside the ZIP before relying on either. PyMC and the other libraries are separate open-source Python packages that you install yourself.
What do I need to install before using the pymc skill?
You need Python 3.12 or newer, plus PyMC, PyTensor and ArviZ at the versions named in SKILL.md, along with NumPy, pandas, Matplotlib, h5netcdf and h5py. The run commands use uv, and optional samplers such as nutpie need separate installs.
Where do I put the skill folder so the agent can find it?
Unzip it into ~/.claude/skills/ for a personal install, or into .claude/skills/ inside a project for a project-only install. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
Why does my smoke test run but the results look unreliable?
The bundled templates use short runs to test that the code executes and writes artifacts. The skill states these runs are not adequate evidence of converged estimates. Use longer runs chosen from diagnostics for a real analysis.
How does the pymc skill compare with using PyMC directly?
The skill adds a workflow and checks: it asks you to define the question, run prior and posterior predictive checks, inspect diagnostics and compare models with PSIS-LOO. Using PyMC directly gives you the library without these guided steps, so you must know the workflow yourself.
Can I use the pymc skill on sensitive data?
The skill runs local Python code on the data you provide, so only use it where that is permitted. Review the code the agent writes and keep records of your environment, seeds and data source, especially for regulated data.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use the pymc skill if you are an analyst, researcher, developer or student who wants a guided Bayesian workflow in PyMC with honest uncertainty and built-in checks. Pick something else if you need a finished scientific conclusion without review, if you work outside Python, or if you must use older PyMC or ArviZ versions than the skill targets.
Download the skill