读入/转存 50+ 统计软件格式,对统计二进制格式完整保留变量标签/值标签/特殊缺失值等元数据。副作用声明(完整):运行环境检查(scripts/check_env.py);可应要求 pip 安装缺失包;写入主输出文件的同时可能生成 sidecar 元数据(CSV/TSV 旁 <名>_metadata.json、Parquet/Arrow 内嵌)及覆盖 .hyper 时的 .bak/.bak.1 备份;处理 .rda/.rds/.RData/.mtw/.mpj/.rec 时可调用本地 R 解释器,但该回退默认禁用,需 allow_r_exec=True 显式开启。 / Read/convert 50+ statistical software formats, preserving variable/value labels and missing-value metadata for binary stats formats. FULL side effects: runs environment checks (scripts/check_env.py); may optionally pip-install missing packages on request; writes the main output file AND may emit sidecar metadata (e.g. <name>_metadata.json beside CSV/TSV, embedded in Parquet/Arrow schema) and .bak/.bak.1 backups when overwriting .hyper; can invoke the local R interpreter for .rda/.rds/.RData/.mtw/.mpj/.rec files via a fallback DISABLED by default and opted in only with allow_r_exec=True.
集成
statsoft-cli
试用跨平台统计软件 CLI 集成,面向 AI Agent;覆盖 34+ 款软件(R/Stata/SAS/SPSS/Python/贝叶斯/ML等),双语。核心价值:激活历史代码资产,用于 AI 工作流自动化。 / Cross-platform statistical software CLI integration for AI Agent; 34+ packages (R/Stata/SAS/SPSS/Python/Bayesian/ML, etc.), bilingual. Core value: activating historical code assets for AI workflow automation.
它能做什么
跨平台统计软件 CLI 集成,面向 AI Agent;覆盖 34+ 款软件(R/Stata/SAS/SPSS/Python/贝叶斯/ML等),双语。核心价值:激活历史代码资产,用于 AI 工作流自动化。 / Cross-platform statistical software CLI integration for AI Agent; 34+ packages (R/Stata/SAS/SPSS/Python/Bayesian/ML, etc.), bilingual. Core value: activating historical code assets for AI workflow automation.
技能文档
Language
Pick the README that matches your language for human-readable, language-specific guides:
- English guide → README.md
- 中文指南 → README_zh-CN.md
This skill responds in the user's current input language (Chinese or English) and auto-detects / switches accordingly. The runtime scripts embed a locale check ($script:isZH in PowerShell, SCRIPT_LANG in Bash) so all user-facing prompts switch to Chinese on a zh-* UI culture and to English otherwise. Code comments and documentation are English-only.
The SKILL.md body, references/*.md, and ADDITIONAL_SOFTWARE.md are English-only and agent-facing; runtime command prompts switch to Chinese / English by locale. For end-to-end walkthroughs, examples, and troubleshooting in your language, open the README above.
Overview
Activates historical code assets locked in statistical software (syntax, scripts, projects) and wires them into AI workflows via automated detection, configuration, and execution.
Core Functions
Covers 34+ statistical / data-science packages, auto-routed by platform; non-Windows auto-hides incompatible software:
- Cross-platform (Win / Mac / Linux, CLI): R, Stata, SAS, CmdStan, GenStat, Gretl, H2O.ai, JAGS, Julia, KNIME, Mathematica, Matlab, OpenBUGS, Orange, OxMetrics, PSPP, Rattle, SHAZAM, Stat/Transfer, Tanagra, TSP, Weka
- Windows + limited cross-platform: Mplus
- Windows-only CLI: SPSS Statistics, EViews, JMP, LIMDEP, Microfit, NCSS, NLOGIT, Origin, Q(MRKS), SPSS Modeler, Statistica
- GUI-only detection + manual launch guide: AMOS, GraphPad Prism, JASP, jamovi, Minitab (never drive batch via CLI;
mtb.exe /runopens the Minitab GUI, not headless)
Full platform matrix in references/platform-support.md; extended config in ADDITIONAL_SOFTWARE.md.
Router Paths
When gate 0 classifies a request as Simple (clear tool + action), route straight to the canonical per-tool entry script. These are the 6 primary entry points; the rest are auto-discovered from the platform matrix:
scripts/windows-only/SPSS/setup_spss.ps1— SPSS Statistics (Windows)scripts/windows-only/statsoft-r.ps1— R CLI wrapper / data conversion (Windows)scripts/cross-platform/R/setup_r.sh— R (cross-platform)scripts/cross-platform/Stata/setup_stata.sh— Stata (cross-platform)scripts/windows-only/statsoft-sas.ps1— SAS (Windows)scripts/cross-platform/SAS/setup_sas.sh— SAS (cross-platform)
Clarification Gate (gate 0) — friendly menu policy
Per ct-base §13 (the same pattern ct-advisor implements as its gate 0), this skill triages the user's first message before opening any menu and defaults to the friendliest path. The interactive menus (scan-confirmation, config-mode selection) are only shown when step-by-step confirmation genuinely helps — never forced onto a simple request.
Classify the first message into one of three paths:
- Simple — specific, single-intent, answerable directly (e.g. "Connect SPSS 26", "Convert data.sav to data.dta", "Run my Stata do-file batch"). → Detect / act in one pass. Do NOT pop the scan or config menu. If the tool and target are clear, route straight to detection / configuration (detect-only by default) and report; optionally offer a deeper step ("want me to also scan for the rest?") rather than demanding a choice.
- Complex — multi-decision or "set up everything / I'm not sure what's installed" (Example 4 in the README). → Present the routing menu (auto-scan vs specify-paths) and confirm step by step. Only open the full menu when step-by-step confirmation genuinely helps.
- Vague — need unclear / user undecided (Example 5, "I want to use statistical software but don't know where to start"). → Enter grill-me clarify mode: ask 1–3 conclusion-changing questions per round (which tools are installed? what do you want to do — run old scripts / convert data / build new analysis? headless or GUI?), branch-by-branch, until the right tool is locked — never dump the 34-tool list or pick for the user.
Default to the friendliest path: when in doubt between simple and complex, give a short direct detection + an optional deeper-menu offer instead of forcing a menu. When the user's first message already names a clear target (a specific tool + action), skip the menu entirely and go straight to detection / configuration.
The clarification strings themselves follow the locale switch (
$script:isZH/SCRIPT_LANG), so menus and probes render in Chinese on azh-*system and English otherwise — consistent with ct-base §13.3 (this skill's script-embedded locale mechanism is the equivalent ofi18n.py).
Execution Workflow
- Detect Platform — cross-platform
source scripts/cross-platform/_platform-detect.sh(setsWB_OS/WB_ARCH; Windows handled inside.ps1scripts, no source) - Pre-scan Confirmation (only when gate 0 classifies the request as Complex) — before a full scan, prompt and wait:
- Prompt (English by default; auto-switched to Chinese on a
zh-*locale): "⚠️ Auto-scan may take a while (~30s on Windows). If you have ≤3 packages, specify paths to skip. Your choice?" Options: A) Auto-scan B) Specify paths - A → step 3; B → skip scan, go to step 4
- Prompt (English by default; auto-switched to Chinese on a
- System Scan (only if A) — batch-detect installed software:
- Windows:
scripts/windows-only/scan/scan_all.ps1; Mac/Linux:scripts/cross-platform/scan/scan_all.sh - Output JSON:
{"R":{"installed":true,"path":"...","version":"..."},...} - Batch scan (
scan_all.*): without explicit consent it is skipped entirely (prints a notice, exits 0, no JSON). With consent (setSTATSOFT_AUTO_WRITEto1orSTATSOFT_CONFIRMto1plus an interactivey) it returns the full{path, version}JSON.STATSOFT_REVEALdoes not affect the batch scan. - Per-software setup (
setup_*.sh/setup_*.ps1): reportsinstalled=truewith path / version hidden by default;STATSOFT_REVEALset to1reveals them in the setup output — this is the only thingREVEALcontrols.
- Windows:
- Select Config Mode — batch / specified / single-software (calls individual
setup_*.ps1orsetup_*.sh) - Detect & Setup — route to the platform script; non-Windows auto-hides incompatible software
- Save Config — detect-only by default; writes
config.jsononly with explicit authorization (setSTATSOFT_AUTO_WRITEto1orSTATSOFT_CONFIRMto1plus an interactivey) - Output Summary — per
references/completion-prompts.mdtemplate
Default-Deny Gates
All persistence and sensitive operations are off by default and require explicit authorization (fail-closed), consistent with the scripts:
| Gate | Effect | Default |
|---|---|---|
STATSOFT_AUTO_WRITE set to 1 | Persist config.json (non-interactive / agent context) | off |
STATSOFT_CONFIRM set to 1 + TTY y | Persist after interactive confirmation | off |
STATSOFT_REVEAL set to 1 | Reveal path / version in per-software setup output only (batch scan_all needs consent, not REVEAL) | off |
STATSOFT_VERIFY set to 1 | Allow launching third-party binaries for version / verification | off |
STATSOFT_CMDSTAN_RUN set to 1 | Allow compiling & running user Stan models (untrusted native code) | off |
All writes go through scripts/common/write_config.py: accepts only the canonical config.json under the skill root, and before writing takes a timestamped backup (config.json.bak.yyyymmdd_hhmmss) then atomic-replaces.
Core Permissions
- Local file read-write —
config.json, temp scripts - Process execution — statistical software binaries
- Network access — CRAN / Anaconda repos
Trust & Safety
This skill performs high-risk operations; understand the risk levels before use:
| Risk | Level |
|---|---|
| Execute local executables | 🔴 High |
| Download & install software | 🔴 High |
Execute user scripts (e.g. .sps via SPSS Python) | 🔴 High |
| Modify config.json | 🟡 Medium |
| Network access | 🟡 Medium |
Pre-flight: ✅ review all scripts; ✅ confirm config.json changes (auto-backup); ✅ confirm any downloads; ✅ inspect generated commands for sensitive projects.
Reference Files
ADDITIONAL_SOFTWARE.md— extended software config (31 packages)references/command-examples.md— per-software CLI command examplesreferences/config-templates.md—config.jsontemplates & field referencereferences/version-specifics.md— version differencesreferences/completion-prompts.md— completion prompt templatesreferences/trust-and-safety.md— risk levels & pre-flight detailsreferences/workflow.md— workflow gating detailsreferences/platform-support.md— full platform support matrixtests/— automated test scripts
相关技能
药企药物研发辅助临床试验数据统计。参考 Statistical Analysis skill 的 descriptive statistics 与 group comparison 部分,构建试验分析支持能力。
Statista (statista.com). Use this skill for ANY Statista request — searching and reading data. Whenever a task involves Statista, use this skill instead of c...
完整实证研究工作流管理技能。整合 codex-stata-for-economists 的工程化方法论与 Stata-MCP 执行工具。 使用场景:(1) Stata do-file 编写、调试、执行与优化 (2) 实证研究流水线搭建与项目管理 (3) 论文结果复现与审查(replication/robustness)(4) 计量经济学方法选择与实现 (5) 研究日志溯源校验(log verification)(6) 提交前质量审核与评分 当用户提到以下关键词时触发:stata, do文件, do-file, dofile, dta, 面板数据, panel, did, 双重差分, 倍分法,
上传数据文件,直接拿到图表、清洗后的数据集、统计报告和可视化看板,代码在后台自动执行。
JavaScript AI 应用 SDK 入门工具,支持模型调用、文件上传与基础代理配置。Use when 需要AI模型调用、智能对话、Agent编排、LLM应用时使用。不适用于需要100%确定性的关键决策。适用于独立开发者、企业团队和自动化工作流场景。支持中文交互,无需复杂配置即开即用。输出结果可直接使用,减少二次加工成本。