stan-fundamentals

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

A reference guide for writing and reviewing Stan models. Stan is a programming language for statistical models, and the guide covers its structure, data types, probability distributions, and coding practices.

In plain words
What is it for?
Use it to create Stan models, understand existing Stan programs, translate models from other languages, or improve their code.
Why use it?
It reduces confusion about Stan syntax and the order and purpose of its model sections. It also helps catch mistakes when translating, optimizing, or reviewing model code.

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 Use it to create Stan models, understand existing Stan programs, translate models from other languages, or improve their code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/choxos/biostatagent/stan-fundamentals/github.svg)](https://agentmods.dev/skills/choxos/biostatagent/stan-fundamentals)
Your own site
<a href="https://agentmods.dev/skills/choxos/biostatagent/stan-fundamentals"><img src="https://agentmods.dev/badge/skills/choxos/biostatagent/stan-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 stan-fundamentals

Your own site · 80×15
<a href="https://agentmods.dev/skills/choxos/biostatagent/stan-fundamentals"><img src="https://agentmods.dev/badge/skills/choxos/biostatagent/stan-fundamentals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,591 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.00035 $0.01591
Opus 5 $0.00017 $0.00796
Sonnet 5 $0.00007 $0.00318
Haiku 4.5 $0.00003 $0.00159

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

Security

Grade A, and why

stan-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 10d 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/stan-fundamentals/SKILL.md · 246 lines

How it starts

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

Stan Fundamentals

When to Use This Skill

  • Writing new Stan models from scratch
  • Understanding Stan program structure
  • Learning Stan syntax and conventions
  • Translating models from other languages to Stan
  • Optimizing existing Stan code

Program Structure

Stan models have up to 7 blocks in this exact order:

functions { }           // User-defined functions
data { }                // Input data declarations
transformed data { }    // Data preprocessing
parameters { }          // Model parameters
transformed parameters { } // Derived parameters
model { }               // Log probability
generated quantities { }  // Posterior predictions

All blocks are optional. Empty string is valid (but useless) Stan program.

Type System Quick Reference

Scalars

int n;                    // Integer
real x;                   // Real number
complex z;                // Complex number

Vectors and Matrices

vector[N] v;              // Column vector
row_vector[N] r;          // Row vector
matrix[M, N] A;           // Matrix

Arrays (Modern Syntax)

array[N] real x;          // 1D array of reals
array[M, N] int y;        // 2D array of integers
array[J] vector[K] theta; // Array of vectors

Constrained Types

real<lower=0> sigma;              // Non-negative
real<lower=0, upper=1> p;         // Probability
simplex[K] theta;                 // Sums to 1
ordered[K] c;                     // Ascending
corr_matrix[K] Omega;             // Correlation
cov_matrix[K] Sigma;              // Covariance
cholesky_factor_corr[K] L_Omega;  // Cholesky correlation

Key Distributions

Continuous (SD parameterization!)

y ~ normal(mu, sigma);      // sigma is SD
y ~ student_t(nu, mu, sigma);
y ~ cauchy(mu, sigma);
y ~ exponential(lambda);
y ~ gamma(alpha, beta);
y ~ beta(a, b);
y ~ lognormal(mu, sigma);

Discrete

y ~ bernoulli(theta);
y ~ binomial(n, theta);
y ~ poisson(lambda);
y ~ neg_binomial_2(mu, phi);
y ~ categorical(theta);

Read the full file on GitHub · 246 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. 10d ago First seen · 246 lines · 35 tokens per session scan A b72f63eaec3a

Subscribe to this mod's changes

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