bugs-fundamentals

bugs-fundamentals is a skill for Claude Code from choxos/BiostatAgent. It costs 42 tokens per session (1,379 once invoked), scanned A, original, MIT.

A reference guide for writing BUGS and JAGS statistical models, languages used for Bayesian analysis. It covers model structure, probability distributions, precision values, and connections to R.

In plain words
What is it for?
Creating or reviewing BUGS/JAGS models, converting models to Stan, choosing distributions, and connecting models to R through R2jags or R2WinBUGS.
Why use it?
It helps prevent common modeling mistakes, especially confusing precision with standard deviation and misunderstanding the declarative model format.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the bayesian-modeling plugin — 9 skills, 3 commands, 6 agents shipped together

Good fit Creating or reviewing BUGS/JAGS models, converting models to Stan, choosing distributions, and connecting models to R through R2jags or R2WinBUGS.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/choxos/biostatagent/bugs-fundamentals
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.

Any agent
npx skills add choxos/BiostatAgent --skill bugs-fundamentals
Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent

Made for: Claude Code.

Or install bayesian-modeling, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bugs-fundamentals

README.md
[![agentmods](https://agentmods.dev/badge/skills/choxos/biostatagent/bugs-fundamentals/github.svg)](https://agentmods.dev/skills/choxos/biostatagent/bugs-fundamentals)
Your own site
<a href="https://agentmods.dev/skills/choxos/biostatagent/bugs-fundamentals"><img src="https://agentmods.dev/badge/skills/choxos/biostatagent/bugs-fundamentals/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bugs-fundamentals

Your own site · 80×15
<a href="https://agentmods.dev/skills/choxos/biostatagent/bugs-fundamentals"><img src="https://agentmods.dev/badge/skills/choxos/biostatagent/bugs-fundamentals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,379 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00042 $0.01379
Opus 5 $0.00021 $0.00690
Sonnet 5 $0.00008 $0.00276
Haiku 4.5 $0.00004 $0.00138

Measured 9d ago against content hash 58c011128872, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

bugs-fundamentals 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 9d 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/skills/bugs-fundamentals/SKILL.md · 192 lines

How it starts

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

BUGS/JAGS Fundamentals

When to Use This Skill

  • Writing new WinBUGS or JAGS models
  • Understanding BUGS declarative syntax
  • Converting between BUGS and Stan
  • Integrating with R via R2jags or R2WinBUGS

Model Structure

BUGS uses a single declarative block where order doesn't matter:

model {
  # Likelihood (order doesn't matter)
  for (i in 1:N) {
    y[i] ~ dnorm(mu[i], tau)
    mu[i] <- alpha + beta * x[i]
  }

  # Priors
  alpha ~ dnorm(0, 0.001)
  beta ~ dnorm(0, 0.001)
  tau ~ dgamma(0.001, 0.001)

  # Derived quantities
  sigma <- 1 / sqrt(tau)
}

CRITICAL: Precision Parameterization

BUGS uses PRECISION (tau = 1/variance), NOT standard deviation:

Distribution BUGS Syntax Meaning
Normal dnorm(mu, tau) tau = 1/sigma²
MVN dmnorm(mu[], Omega[,]) Omega = inverse(Sigma)

Converting SD ↔ Precision

# Precision from SD
tau <- pow(sigma, -2)

# SD from precision
sigma <- 1 / sqrt(tau)

Distribution Reference

Continuous (All use precision!)

y ~ dnorm(mu, tau)        # Normal: tau = 1/sigma²
y ~ dlnorm(mu, tau)       # Log-normal (log-scale)
y ~ dt(mu, tau, df)       # Student-t
y ~ dunif(lower, upper)   # Uniform
y ~ dgamma(shape, rate)   # Gamma
y ~ dbeta(a, b)           # Beta
y ~ dexp(lambda)          # Exponential (rate)
y ~ dweib(shape, lambda)  # Weibull
y ~ ddexp(mu, tau)        # Double exponential

Discrete

y ~ dbern(p)              # Bernoulli
y ~ dbin(p, n)            # Binomial (p first!)
y ~ dpois(lambda)         # Poisson
y ~ dnegbin(p, r)         # Negative binomial
y ~ dcat(p[])             # Categorical
y ~ dmulti(p[], n)        # Multinomial

Multivariate

y[1:K] ~ dmnorm(mu[], Omega[,])    # MVN (precision matrix!)
Omega[1:K,1:K] ~ dwish(R[,], df)   # Wishart (for precision)
p[1:K] ~ ddirch(alpha[])           # Dirichlet

Syntax Essentials

Stochastic vs Deterministic

# Stochastic (random variable)
y ~ dnorm(mu, tau)

# Deterministic (function)
mu <- alpha + beta * x

Read the full file on GitHub · 192 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. 9d ago First seen · 192 lines · 42 tokens per session scan A 58c011128872

Subscribe to this mod's changes

bugs-fundamentals is a skill published in the GitHub repository choxos/BiostatAgent (11 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 1,379 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 skills, from other repositories

imaging-data-commons

Query and download public cancer imaging data from NCI Imaging Data Commons. Invoke for any question about IDC collections, cancer imaging datasets, DICOM data access, radiology (CT, MR, PET) or pathology AI training sets, metadata queries, visualization, or license checks — even when the user doesn't explicitly…

K-Dense-AI/scientific-agent-skills · 75 tokens

lab-hardware-cad

Design custom laboratory hardware as parametric build123d models and export fabrication-ready STEP, STL, and DXF files - microfluidic chips and molds, optomechanical mounts and breadboard adapters, cuvette and microplate holders, tube racks, animal-behavior rigs, and 3D-printed instrument fixtures. Use when a research…

K-Dense-AI/scientific-agent-skills · 106 tokens

pkpd-modeling

Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK/PD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when…

K-Dense-AI/scientific-agent-skills · 273 tokens

statistical-analysis

Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required…

K-Dense-AI/scientific-agent-skills · 111 tokens

diffdock

DiffDock and DiffDock-L molecular docking. Use for protein-small-molecule pose prediction from PDB or sequence plus SMILES/SDF/MOL2, batch docking, virtual screening, and pose-confidence interpretation. Not for binding affinity prediction.

K-Dense-AI/scientific-agent-skills · 51 tokens

hypothesis-generation

Formulate evidence-bounded scientific questions, candidate hypotheses, rival explanations, causal or associational claims, discriminating predictions, measurements, and preregistration-ready analysis plans. Use when turning observations or preliminary findings into transparent, testable research plans without treating…

K-Dense-AI/scientific-agent-skills · 58 tokens