Inspects Stata do-files for safety, encoding issues, dangerous commands, and data-overwrite risks. Outputs a read-only JSON diagnostic report without modifying the original file.
Ships in stata-toolbox. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill inspects a Stata do-file without changing the original file and outputs a JSON diagnostic report. The underlying script reuses stata_mcp.utils.parse_dofile and stata_mcp.guard.blacklist, so it handles Stata command abbreviations, prefixes (capture / quietly), macro expansion, block comments, #delimit ;, and other common constructs.
Recommended situations:
This skill is not required every time you write a do-file. For analysis code you wrote yourself, understand, and trust, you can run it directly without generating a diagnostic report each time.
uv run plugins/stata-toolbox/skills/diagnostic-dofile/diagnose_dofile.py path/to/file.do
Save the report to a file:
uv run plugins/stata-toolbox/skills/diagnostic-dofile/diagnose_dofile.py path/to/file.do -o report.json
Based on src/stata_mcp/guard/blacklist.py:
!, !!, shell, xshell, winexec, unixcmd.erase, rm, rmdir.do, run, include.python, mata, java, plugin.ssc, net, github, adoupdate, update.cd, chdir.use xxx.dta followed by save xxx.dta, replace pointing to the same file.clear all / drop _all.graph export xxx, replace.export xxx, replace.replace such as outreg2, esttab, estout, putexcel, putdocx, putpdf, logout, texdoc.log using xxx.log, replace.saveold xxx, replace.reghdfe, estout, outreg2, esttab, coefplot, ivreg2, rdrobust.help <command> to verify installation./Users/... or C:\....webuse or network URLs for loading data.cd / chdir working-directory changes.The report is a JSON object with the following structure:
{
"schema_version": "0.1.0",
"generated_at": "2026-09-22T12:34:56.789012Z",
"file": {
"path": "/project/analysis.do",
"size_bytes": 1234,
"sha256": "abc123...",
"encoding": "utf-8",
"has_bom": false,
"line_ending": "lf"
},
"summary": {
"total_lines": 100,
"code_lines": 60,
"comment_lines": 30,
"blank_lines": 10,
"error_count": 2,
"warning_count": 5,
"info_count": 3
},
"findings": [
{
"level": "error",
"line": 12,
"category": "dangerous_command",
"message": "Detected dangerous command 'shell'"
}
]
}
stata_do. To disable the guard, configure ~/.statamcp/config.toml, but this is not recommended.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/stata-toolbox:diagnostic-dofilefrom stata-toolbox
npx claudepluginhub sepinetam/mcp-for-stata --plugin stata-toolbox4 skills in this plugin
/stata-auditInspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp. Use when a user asks what tools ran, whether a security guard blocked anything, how one run links across JSONL files, whether snapshots are intact, or wants an interactive audit dashboard./stata-discoverUse this skill when you need to find Stata on the user's machine or configure `stata-mcp` to use it. `stata-discover` provides the workflow for discovering Stata executables and the official way to configure `stata-mcp`. If the user's computer has multiple Stata executables available, this skill also provides the version the user most likely wants to use./stata-skillA packaged Stata Runner skill via official MCP-for-Stata server including stata_do, ado_package_install, help, read_log and get_data_info tools. Use it when (1) need to execute Stata do-file; (2) missing ado-packages; (3) find code error caused by syntax in Stata; (4) want to read smcl and text format log file with rich text output; (5) first encounter a data file and want to understand its structure and content.
2 plugins ship this exact skill · first indexed Oct 1, 2026
Other plugins' skills for the same job