stata-preflight
Skill17 starsChanged 4 months agoMITView on GitHub
Use before editing or running any Stata .do file in the user's research projects. Checks for missing `<your-stata-username>` username path branches, `cap`-suppressed esttab calls, and other recurring Stata pitfalls. Catches issues that otherwise surface only as silent failures (no log produced, lost estimates).
In this repository14 other files it gives its agents.
- codex-bridgeSkill
- codex-review-planSkill
- overleafSkill
- plan-debateSkill
- power-firstSkill
- referee-panelSkill
- refresh-pipelineSkill
- review-codex-planSkill
- robustness-batterySkill
- spec-curve-sweepSkill
- sync-overleafSkill
- tableSkill
- verify-claimsSkill
- verify-numbers-pipelineSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Before running or finishing edits to any .do file, run these checks.
- Very specific: line 12
Every do-file needs a <your-stata-username> branch in its path-setting block:
- Distinctive: line 18
If the file is listed (no match), the path block is missing the user's branch and the script will fail silently on this machine.
- Distinctive: line 42
If missing, add one near the top so failures leave a diagnosable trail.
- Very specific: line 46
Verify *.log was produced and mtime is recent.
- Very specific: line 48
If using esttab, confirm the output .tex/.csv was actually written and has content.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stata Pre-flight
Before running or finishing edits to any .do file, run these checks. The user's Stata username is <your-stata-username> (Stata base path /Users/<your-username>/).
1. Username path branch
Every do-file needs a <your-stata-username> branch in its path-setting block:
grep -L "<your-stata-username>" path/to/file.doIf the file is listed (no match), the path block is missing the user's branch and the script will fail silently on this machine. Add a branch like:
if "`c(username)'" == "<your-stata-username>" {
global root "/Users/<your-username>/.../<project>"
}2. No cap around esttab
grep -nE "(^|[^a-z])cap(ture)?[[:space:]]+esttab" path/to/file.doAny hit must be unwrapped. cap esttab silently drops in-memory estimates, producing empty tables. Same goes for cap est store chains that feed esttab.
3. Log file declared
Confirm the do-file opens a log:
grep -nE "^log using" path/to/file.doIf missing, add one near the top so failures leave a diagnosable trail.
4. After running
- Verify
*.logwas produced and mtime is recent. - Open the tail of the log and confirm no
r(xxx);errors before declaring success. - If using
esttab, confirm the output.tex/.csvwas actually written and has content.
Reporting
Report each check as PASS/FAIL. If anything is FAIL, do not run the script — fix first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

