Install
$ agentstack add skill-yale-som-hpc-claude-code-marketplace-running-stata ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Running Stata
Rule: run Stata in batch jobs, write logs, put temp files on scratch, and request only the cores Stata will use.
What you get: the stata module is a complete MP install — no package-bootstrap step (unlike R, whose base module ships nothing). ssc install packages land in your personal ado directory.
Slurm template
#!/bin/bash
#SBATCH --job-name=stata-job
# default_queue caps at 4h; for long/large work use cpunormal or gpunormal (see managing-jobs)
#SBATCH --partition=default_queue
#SBATCH --time=01:00:00
#SBATCH --cpus-per-task=4
#SBATCH --mem=16G
#SBATCH --output=logs/%x_%j.out
set -euo pipefail
module purge
module load stata
# These only affect external BLAS calls; native Stata/MP threading is controlled
# by `set processors` (below), not by these. Harmless to keep for portability.
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}
export OPENBLAS_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}
# The stata/19 module defaults STATATMP=/gpfs/scratch60; override for per-job isolation:
export STATATMP=/gpfs/scratch60/$USER/stata-tmp/${SLURM_JOB_ID}
mkdir -p "$STATATMP" logs
trap 'rm -rf "$STATATMP"' EXIT
cd /gpfs/project/myproject/code
stata-mp -b do src/main.do
Two log gotchas, both verified on the cluster:
- Read the
.log, not the.out. Understata-mp -b, Stata sends all output to its own log file; the Slurm--output.outfile ends up empty. Thelog usinginside your do-file (below) is what you read. stata-mp -b do src/main.doalso writesmain.login the working directory (named after the do-file), in addition to yourlog using. Either expect/clean up that stray file or name yourlog usingdifferently.- Check the log for errors — batch mode can exit 0 on a Stata error. Grep the
.logfor anr(###)return code;set -ewill not catch a do-file error on its own.
Do-file preamble
capture log close _all
local jobid : env SLURM_JOB_ID
if "`jobid'" == "" local jobid local
log using "logs/main_`jobid'.log", replace text
local ncpus : env SLURM_CPUS_PER_TASK
if "`ncpus'" == "" local ncpus 1
set processors `ncpus'
local statatmp : env STATATMP
di "STATATMP=`statatmp'"
set more off
version 19
Memory hygiene
compress
describe
memory report
Use frames, tempfile, and preserve/restore deliberately. Drop unneeded variables before merges.
Job arrays
local task_id : env SLURM_ARRAY_TASK_ID
if "`task_id'" == "" local task_id 1
di "Running task `task_id'"
Each array task should write a separate output file.
License courtesy
Stata MP licenses are shared. Do not leave interactive Stata sessions idle. Do not request more CPUs than set processors uses.
Checklist
- [ ] Stata runs via
stata-mp -b do, not interactively on the login node. - [ ] Logs are written to
logs/. - [ ]
STATATMPpoints to scratch and is cleaned up. - [ ]
set processorsmatchesSLURM_CPUS_PER_TASK. - [ ] Each array task writes separate output.
- [ ] Idle Stata sessions are closed.
Further reading
- Stata batch mode (
gswbPDF) —-b do, log behavior, exit codes. - Stata
set processors— MP core control. - Stata
framesreference — multiple in-memory datasets.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yale-som-hpc
- Source: yale-som-hpc/claude-code-marketplace
- License: Unlicense
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.