method-sas-stata
Assesses SAS and Stata code (.sas, .do, .ado, .dta) for reproducibility, review risk, and porting feasibility. Use when a repo has SAS or Stata work to review or port.
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- method-sas-stata
- description
- Assesses SAS and Stata code (.sas, .do, .ado, .dta) for reproducibility, review risk, and porting feasibility. Use when a repo has SAS or Stata work to review or port.
- argument-hint
- [optional: --scan-dir analysis --report analysis/sas-stata-assessment.md]
02 资源文件 2
- 参考文档references/assessment-checklist.md2.2 KB
- 脚本scripts/assess_sas_stata.py7.9 KB
03 SKILL.md 正文
SAS/Stata Project Assessment
Run the script from the user's project root.
$SKILL_DIRanchors the script path;--scan-dirand--reportresolve against--project-rootand must stay project-relative.
Skill Value
- Problem it solves: Legacy SAS/Stata analyses need review and migration planning before automated rewrites are safe.
- Use when: The repo contains .sas, .do, .ado, .dta, PROC statements, or Stata commands and the user asks what can be reviewed or ported.
- Output: Assessment of reproducibility risks, migration readiness, and recommended next steps.
- Ask only if: Only when target outcome, validation standard, or migration destination is unclear.
- Do not do: Do not claim full SAS/Stata equivalence or scaffold unsupported workflows.
- Interaction: Check repo/config/chat evidence first. Ask one decision-changing question at a time; use the current harness's blocking question UI when available, otherwise present numbered choices and wait.
This skill is intentionally assessment-first. The plugin does not yet provide first-class SAS or Stata scaffolding. It can identify the surface area, likely statistical procedures, portability risks, and a safe handoff path to R/Python/Quarto workflows.
Workflow
- Scan the project for
.sas,.do, and.adofiles. - Identify common procedure/model families and IO patterns.
- Write a concise assessment report:
SKILL_DIR="<absolute path of the directory containing this SKILL.md>";
python3 "$SKILL_DIR/scripts/assess_sas_stata.py" --project-root . --scan-dir analysis --report analysis/sas-stata-assessment.md
- Use the report to decide whether to:
- keep the legacy code and add reproducibility wrappers,
- port a bounded analysis to R/Python,
- ask a human SAS/Stata analyst to validate model equivalence.
Guardrails
- Do not generate new SAS/Stata project scaffolds automatically.
- Do not claim statistical equivalence after a port without paired output comparison.
- Never commit
.dta,.sas7bdat, or other patient-level files to Git. - Sensitive-data boundary. Resolve
phi_environment.modein.methodsmith/config.local.yaml(worktree, then main checkout; legacycompliant: true=approved,compliant: false=schema-only,sensitive_data: false=no-sensitive-data; any schema-only signal wins; unreadable =schema-only).approvedorno-sensitive-data: proceed silently and never mention the boundary again.schema-only: headings, types, counts, and aggregates only; never open, print, or paste data values; run data-reading scripts asmethod-safe-run -- <command>(path in the guard's deny message); save results as aggregate tables (counts under 11 suppressed) inoutput/or aphi_environment.aggregate_dirsentry. Unset, interactive: ask once with the blocking question tool (else a numbered list) offeringApproved endpoint: full access,Not approved or unsure: schema-only, andNo sensitive data: public or synthetic; save the answer asphi_environment.modethere oncegit check-ignore -q .methodsmith/config.local.yamlpasses (else first add.methodsmith/*.local.yamlto.gitignore) so the guard hook sees it. Unset, headless: schema-only.
References
@./references/assessment-checklist.md
04 同仓库更多 Skills
skill-one
Sample skill
disabled-skill
A skill with model invocation disabled
claude-only-skill
A skill restricted to Claude Code only
default-skill
暂无简介
custom-skill
暂无简介
method-write
Drafts, revises, and audits evidence-bound manuscripts, sections, abstracts, and reviewer responses with claim provenance. Use when scientific prose must be written or revised (entry point).