Skip to content
Back to skills

Stan Model Contract

ASecurity

Extract a structured contract from simple Stan programs so score-model workflows can identify data, constrained parameters, transforms, model terms, and generated quantities.

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
businesspythongo

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill stan_model_contract --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stan Model Contract?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stan Model Contract
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-stan-model-contract/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-stan-model-contract)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stan_model_contract
description: Extract a structured contract from simple Stan programs so score-model workflows can identify data, constrained parameters, transforms, model terms, and generated quantities.
---

# Stan Model Contract

Use this skill when a recovery or algorithm needs a lightweight, language-neutral contract for a small Stan model. Do not use it as a general Stan compiler or full parser.

## Inputs
- Stan source text or a path to a `.stan` file.
- Optional observed data dictionary for downstream validation.

## Outputs
- JSON with `data`, `parameters`, `transformed_parameters`, `model_terms`, and `generated_quantities`.
- Diagnostics for unsupported or missing sections.

## Workflow
1. Read the Stan source.
2. Call `scripts/stan_contract.py --stan <path> --output <json>`.
3. Inspect the output contract before passing it to transform or score-evaluation modules.
4. Treat unsupported syntax as a blocker for this reduced parser, not as evidence about real BridgeStan.

## Validation
Run `python tests/test_stan_contract.py` from this skill directory.

## Limitations
The parser intentionally supports the Bernoulli-style recovery subset: scalar bounded real parameters, integer data arrays, simple transformed-parameter assignments, distribution statements, and generated-quantity assignments.

Files in this skill

  • SKILL.md1.3 KB
  • scripts/stan_contract.py3.4 KB
  • tests/test_stan_contract.py1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.