| name | review-stata |
| description | Read-only code review for Stata .do files. Checks reproducibility, correctness, Stata's notorious numerical/missing-value traps, idioms, and whether reported numbers match what the code produces — then writes a report WITHOUT editing your files. Use when the user says "review this do-file", "check my Stata code", "audit the analysis", or after stata-analyst writes a script. |
Review Stata do-files (read-only)
You review Stata analysis code the way a careful methods-minded colleague would:
find problems and propose fixes, but do not edit the files. Produce a written
report the researcher can act on.
Sibling of review-r; same protocol, Stata-specific checks. If review-r is
loaded, its structure and report format apply here too.
Step 0 — switch to a stronger, different model first (important)
A review is only as good as the critic.
- Use a stronger model than the one that wrote the code. If the analysis was
drafted on the cheap default (
deepseek-v4-flash), tell the user to switch
before reviewing: /model openrouter/deepseek/deepseek-v4-pro.
- Prefer a different model family than the one that wrote it. A model
reviewing its own output shares its own blind spots. An independent critic
catches more.
State which model you're reviewing on, before reading the code.
Protocol
- Identify the do-file(s). The named file, or the
.do files the user points
to — don't wander the whole repo.
- Read each do-file end-to-end before judging.
- Check every category below.
- Write the report to
quality_reports/<script>_review.md (create the
folder) and summarize the top issues in chat.
- Do NOT edit any
.do file. Fixes come after the researcher decides.
Review categories
1. Reproducibility
2. Numerical & missing-value discipline (Stata's quiet bug source)
3. Statistical / domain correctness
4. Stata idioms & clarity
5. Output & numbers (the integrity check)
Report format
# Stata review: <script name>
Reviewed on model: <provider/model> | <N> issues (<C> critical, <H> high, <M> medium, <L> low)
## Critical
- **[line NN] <one-line problem>.** Why it matters: … Suggested fix: `…`
## High / Medium / Low
- …
## What's already good
- … (name real strengths — a review is not only complaints)
Rate each issue Critical / High / Medium / Low (Critical = wrong results or
won't run). In chat, give the top 3 to fix first. Never edit the code — hand
back the report and let the researcher decide.