agentleFS
Learning-Bayesian-StatisticsLearning-Bayesian-Statistics/baygent-skills/CLAUDE.md

baygent-skills

CLAUDE.md184 starsChanged 5 months agoMITView on GitHub

baygent-skills is a collection of Agent Skills for Bayesian modeling, causal inference, and probabilistic thinking. Each skill is a self-contained subfolder following the Agent Skills spec.

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run conda run -n baygent python <script> (or -n baygent6).

    line 40
  2. Distinctive:

    Never use system Python

    line 41
  3. Distinctive:

    Every skill follows the Agent Skills spec:

    line 44
  4. Very specific:

    All evals now in evals/ (bayesian-workflow, causal-inference, amortized-workflow)

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project overview

baygent-skills is a collection of Agent Skills for Bayesian modeling, causal inference, and probabilistic thinking. Each skill is a self-contained subfolder following the Agent Skills spec.

Repo structure

baygent-skills/
├── bayesian-workflow/          # Shipped skill (v1.5, dual PyMC 5/6)
│   ├── SKILL.md                # Main workflow instructions
│   ├── references/             # Detailed reference docs (priors, diagnostics, sensitivity, reporting)
│   └── scripts/                # diagnose_model.py, calibration_check.py, check_diagnostics.py
├── causal-inference/           # Shipped skill (v1.2)
│   ├── SKILL.md                # Main workflow instructions (depends on bayesian-workflow)
│   ├── references/             # DAGs, quasi-experiments, structural models, refutation, reporting
│   └── scripts/                # check_refutation.py (calibrated causal language harness)
├── amortized-workflow/         # Shipped skill (v2.0, co-authored with Stefan Radev)
│   ├── SKILL.md                # Amortized Bayesian workflow with BayesFlow
│   ├── references/             # Adapters, conditioning logic, model sizes, reporting
│   └── scripts/                # check_diagnostics.py, inspect_training.py
├── evals/                         # Eval scenarios and benchmarks
│   ├── bayesian-workflow/         # 6 scenarios, 3 iterations
│   ├── causal-inference/          # 6 scenarios
│   ├── amortized-workflow/        # 6 scenarios + trigger set + benchmark results
│   └── smoke/                     # Reporting-harness smoke test + cross-env (PyMC 5/6) equivalence gate
├── environment.yml             # Mamba/conda env (env name: baygent, PyMC 5)
├── environment-pymc6.yml       # Mamba/conda env (env name: baygent6, PyMC 6 / ArviZ 1.x)
├── LICENSE                     # MIT
└── CLAUDE.md                   # This file

Development conventions

Python environment

  • Two envs during the PyMC 5 → 6 transition:
    • baygent (PyMC 5.28 / arviz 0.23 + arviz-stats/plots 1.0) — environment.yml. The causal-inference skill is pinned here (CausalPy caps pymc<6).
    • baygent6 (PyMC 6.0.1 / arviz 1.x + pymc-extras 0.12) — environment-pymc6.yml. The bayesian-workflow scripts run on both; that dual run is the compatibility guarantee.
  • Run conda run -n baygent python <script> (or -n baygent6). Recreate with mamba env create -f environment.yml / mamba env create -f environment-pymc6.yml
  • Never use system Python

Skill structure

Every skill follows the Agent Skills spec:

  • SKILL.md with YAML frontmatter (name, description, license, metadata)
  • references/ for detailed docs (plural, not reference/)
  • scripts/ for utility scripts
  • Description must be agent-neutral (no "Claude"-specific language)

Skill authoring heuristics

  • The description is the only thing the agent sees when deciding to load the skill. Lead with what it does, then an explicit "Use when …" trigger sentence listing concrete keywords/situations. This is the single highest-leverage field.
  • Keep SKILL.md lean; push depth to references/. The main file is the always-loaded budget — progressive disclosure, link out for detail.
  • Prefer a script over generated code for deterministic, repeated, or error-prone operations. Scripts save tokens and run consistently; reserve inline code for one-off, model-specific logic.

Code style

  • PyMC 5+ syntax with coords and dims; the bayesian-workflow scripts are dual-compatible with PyMC 5 and 6 via capability detection (hasattr / try-import / field-name fallbacks), not version branches
  • nutpie sampler by default
  • Descriptive seeds: RANDOM_SEED = sum(map(ord, "analysis-name"))
  • xarray-first for InferenceData operations

Testing

  • All evals now in evals/ (bayesian-workflow, causal-inference, amortized-workflow)
  • Benchmark target: 100% with skill vs ~90% without
  • Each eval has: eval_metadata.json (prompt + assertions), with_skill/ and without_skill/ outputs + grading
  • Reporting harness smoke test (evals/smoke/test_reporting_harness.py): runs the bayesian diagnostics pipeline (diagnose_model → calibration_check → check_diagnostics) end-to-end on a tiny model and the causal check_refutation harness on fixtures. Run after any change to the scripts/ of either skill — on both envs: conda run -n baygent python evals/smoke/test_reporting_harness.py and conda run -n baygent6 python evals/smoke/test_reporting_harness.py. Guards JSON-serializability, the diagnose→check schema contract, and refutation metric direction.
  • Cross-env equivalence gate (evals/smoke/cross_env_equivalence.py): feeds one shared idata to both baygent (PyMC 5) and baygent6 (PyMC 6) and asserts identical user-facing diagnostics/ratings across a healthy and a pathological fixture — this is the dual-compat guarantee. Run: python evals/smoke/cross_env_equivalence.py (needs conda on PATH; skips loudly if baygent6 is absent, fails with --require-both). Run after any change to the bayesian-workflow scripts/.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.