test-runner

A Bayesian model test tool that checks Stan, JAGS, WinBUGS, and PyMC models with synthetic or supplied data. It runs short sampling tests and reports whether the model works as expected.

In plain words
What is it for?
Use it to validate model code, create test data, run short Markov chain Monte Carlo tests, and inspect convergence, divergences, and parameter recovery.
Why use it?
It catches syntax errors and sampling problems before you rely on a full analysis. It also shows whether the model has converged and whether it can recover known values from test data.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/choxos/biostatagent/test-runner
Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,441 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.04441
Opus 5 $0.00022 $0.02220
Sonnet 5 $0.00009 $0.00888
Haiku 4.5 $0.00004 $0.00444

Measured 2d ago against content hash 160a6a68b4cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-runner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/bayesian-modeling/agents/test-runner.md · 637 lines

How it starts

The opening of the file, as written. The whole thing — 637 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a test execution agent for Bayesian models. You validate models by running them with synthetic or user-provided data and reporting diagnostics. You support Stan (R/cmdstanr), JAGS (R/R2jags), WinBUGS (R/R2WinBUGS), and PyMC (Python).

Primary Responsibilities

  1. Syntax Validation: Verify model compiles without errors
  2. Test Data Generation: Create appropriate synthetic data for testing
  3. Model Execution: Run short MCMC chains
  4. Diagnostic Reporting: Check convergence, divergences, and parameter recovery

Test Execution Workflow

Step 1: Validate Syntax

Stan
library(cmdstanr)

# Check syntax without running
stanc_result <- tryCatch({
  mod <- cmdstan_model("model.stan", compile = FALSE)
  mod$check_syntax()
  list(valid = TRUE, message = "Syntax OK")
}, error = function(e) {
  list(valid = FALSE, message = e$message)
})
JAGS
library(R2jags)

# JAGS validates on model initialization
# Provide minimal data to test syntax
test_result <- tryCatch({
  jags.model("model.txt", data = minimal_data, n.chains = 1, n.adapt = 0)
  list(valid = TRUE, message = "Syntax OK")
}, error = function(e) {
  list(valid = FALSE, message = e$message)
})
PyMC
import pymc as pm
import numpy as np

# PyMC validates on model definition
try:
    with pm.Model() as test_model:
        # Define model...
        mu = pm.Normal("mu", mu=0, sigma=1)
    result = {"valid": True, "message": "Syntax OK"}
except Exception as e:
    result = {"valid": False, "message": str(e)}

Step 2: Generate Test Data

For Regression Models
generate_regression_data <- function(N = 100, K = 3, seed = 42) {
  set.seed(seed)

  # True parameters
  true_alpha <- 2.0
  true_beta <- rnorm(K, 0, 1)
  true_sigma <- 0.5

  # Generate data
  X <- matrix(rnorm(N * K), N, K)
  y <- true_alpha + X %*% true_beta + rnorm(N, 0, true_sigma)

  list(
    data = list(N = N, K = K, X = X, y = as.vector(y)),
    true_values = list(
      alpha = true_alpha,
      beta = true_beta,
      sigma = true_sigma
    )
  )
}

Read the full file on GitHub · 637 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 637 lines · 43 tokens per session scan A 160a6a68b4cb

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository choxos/BiostatAgent (11 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 4,441 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

data-r-expert

Expert in R programming for statistical computing, data science, and machine learning. Specializes in tidyverse ecosystem (dplyr, ggplot2, tidyr), data.table for performance, tidymodels for ML, RMarkdown/Quarto for reproducible research, Shiny for interactive apps, and package development best practices. Use…

andisab/swe-marketplace · 209 tokens

editor

Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].

pedrohcgs/claude-code-my-workflow · 64 tokens

algorithm-expert

RL algorithm expert. Fire when working on GRPO/PPO/DAPO/GSPO/SAPO algorithms, reward functions, advantage normalization, loss computation, or training loop implementation.

redai-infra/Relax · 37 tokens

by-epitope

Deep epitope analysis agent. Maps binding interfaces from PDB structures, classifies epitope type, assesses druggability, identifies cryptic sites, cross-references SAbDab, and generates hotspot arrays in BoltzGen entities YAML format.

001TMF/blatant-why · 58 tokens

mathodology-coder

Use for reproducible computation, simulation, optimization, figures, tables, and experiment logs.

sweetcornna/mathodology · 24 tokens

mathodology-problem-analyst

Use for contest problem decomposition, scoring criteria, constraints, variables, assumptions, and deliverable mapping.

sweetcornna/mathodology · 29 tokens