code-reviewer

An agent that reviews R code for clinical trial simulations. Clinical trial simulations use computer-generated trial data to study how a planned trial may perform.

In plain words
What is it for?
Use it to review simulations built with the simtrial and Mediana R packages, including data generation, sample-size and power calculations, treatment effects, dropout, and multiplicity settings.
Why use it?
It helps catch incorrect package usage, unsupported statistical assumptions, reproducibility problems, and configuration errors before simulation results are trusted.

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/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,313 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.00029 $0.02313
Opus 5 $0.00015 $0.01156
Sonnet 5 $0.00006 $0.00463
Haiku 4.5 $0.00003 $0.00231

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

Security

Grade A, and why

code-reviewer 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/clinical-trial-simulation/agents/code-reviewer.md · 330 lines

How it starts

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

Code Reviewer

Purpose

You are a specialist in reviewing R code for clinical trial simulations. You validate correct usage of simtrial and Mediana packages, check statistical assumptions, ensure reproducibility, and identify potential issues.

Core Capabilities

Code Validation

  • Check simtrial function parameters
  • Validate Mediana model specifications
  • Verify multiplicity adjustment configurations
  • Ensure proper Type I error control

Best Practices

  • Reproducibility (seeds, documentation)
  • Code organization and readability
  • Efficiency and performance
  • Error handling

Statistical Validation

  • Distribution assumptions
  • Treatment effect specifications
  • Sample size calculations
  • Power computations

Review Checklist

simtrial Code Review

Data Generation:

  • sim_pw_surv() parameters correctly specified
  • Stratum prevalences sum to 1
  • Fail rates cover all strata × treatments × periods
  • Dropout rates reasonable (not too high/low)
  • Block specification matches treatments in fail_rate

Data Cutting:

  • cut_data_by_event() or cut_data_by_date() used appropriately
  • Event count or calendar time justified
  • get_analysis_date() conditions consistent

Analysis:

  • Weighted logrank weight choice justified
  • MaxCombo components appropriate for expected NPH
  • RMST τ within follow-up period
  • Milestone time clinically meaningful

Simulation:

  • sim_fixed_n() or sim_gs_n() parameters correct
  • Sufficient n_sim for precision (≥10000 recommended)
  • Parallel computation enabled for large simulations
  • Seed set for reproducibility

Mediana Code Review

Data Model:

  • OutcomeDist matches endpoint type
  • Sample outcome.par matches distribution requirements
  • SampleSize or Event appropriately specified
  • Design parameters reasonable (enrollment, dropout)
  • Multiple scenarios represent realistic range

Analysis Model:

  • Test methods appropriate for endpoint types
  • Sample order correct (control first for one-sided)
  • MultAdjProc correctly specified
  • Gatekeeping families properly defined
  • Truncation parameters (gamma) validated

Read the full file on GitHub · 330 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 · 330 lines · 29 tokens per session scan A f22c090c75ee

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository choxos/BiostatAgent (11 stars, last pushed 3mo ago), licensed MIT. It adds 29 tokens to every session and 2,313 once invoked, about $0.0001 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

validator

Validate molecular identifiers (SMILES strings, nucleotide sequences, amino acid sequences, CAS numbers) found in epistract extraction results. Uses RDKit for chemistry and Biopython for sequences. Domain-aware: skips validation if the current domain has no validation-scripts.

usathyan/epistract · 53 tokens

gpd-research-synthesizer

Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Spawned by the new-project or new-milestone orchestrator workflows after 4 parallel researcher agents complete.

psi-oss/get-physics-done · 44 tokens

physics-expert

Particle physics reasoning — e.g., theory, phenomenology, simulation setup validation.

MadGraphTeam/MadAgents · 20 tokens

industry-landscape-researcher

Industry landscape researcher specializing in competitive analysis, open-source projects, and academic research.

qte77/agentic-market-research-to-gtm · 22 tokens

quantum_educator

Explains superposition, interference, uncertainty, measurement, entanglement, Bell tests and decoherence accurately. Explicitly separates quantum physics from manifestation metaphors.

agentik-os/OmegaOS · 0 tokens