Skip to content
Back to skills

Stata Peer Audit

ASecurity

Read-only review of Stata research code and outputs. Use for “검토만 해줘,” a second opinion, or a request to explain a discrepancy in a project before anyone edits it. Trace findings to specific lines, samples, and results.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsnode

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add Plokies-2/stata-research-guard --skill stata-peer-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stata Peer Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stata Peer Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plokies-2-stata-peer-audit/badge)](https://www.skillsdirectory.com/skills/plokies-2-stata-peer-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stata-peer-audit
description: Read-only review of Stata research code and outputs. Use for “검토만 해줘,” a second opinion, or a request to explain a discrepancy in a project before anyone edits it. Trace findings to specific lines, samples, and results.
---

# Stata Peer Review

Act as a fresh-context, read-only peer researcher. For a focused result question, start with the producing code and observed output. Follow dependencies and consult only references needed to resolve the question. For a whole-file or broad readability review, use [the general rules](../stata-replication-workflow/references/general-rules.md) and [the edited-code examples](../stata-replication-workflow/references/after-editing.md). For descriptive table or figure construction, use [the descriptive output examples](../stata-replication-workflow/references/descriptive-outputs.md).

## Independent interpretation

Trace a disputed value from its label to its producer and consumer. For grouped outputs, use one group to check the contributing units, denominator and missing-value rule. When adjacent reductions change the unit, compare an unequal-size group before calling either step redundant. Explain a correct value or identify the first line that changes its meaning. Open help for unfamiliar behavior.

Before removing a variable, trace how it defines the research sample through filters, `missing()`, weights or merge keys. If an output variable was renamed, check which value the next file reads under the original name. For `r()`, `e()` and `_rc`, follow the value to its consumer. An ordinary `count` after `capture confirm` sets `r(N)` and leaves `_rc` intact. If another `capture` overwrites it, check why that command may fail. Let required work fail where it runs. After a captured fit, check which estimates remain before attributing a coefficient to it. Save the earlier status when both checks are needed.

For an output built from saved estimates, trace the `estimates use` slot to the intended fit in the save and append sequence. The default slot is `number(1)`. `estimates use` sets `e(sample)` to zero. If a consumer needs original sample membership, trace it to the live fit or to a verified observation-level match against that fit's analysis data. Check identity by key even when the counts agree.

For a merge edit, trace unmatched rows into the coverage log and final sample. Identify counts or rows a proposed filter would lose. Recommend `joinby` only when each within-key pair is an intended observation.

For a panel change, trace one affected key to the required earlier period or observed record. Check whether filtering or inserting rows changed that source.

For a whole-file review, run `node hooks/stata-repeats.cjs <file.do>` and `node hooks/stata-align.cjs --check <file.do>` from the plugin root on each target file, including code older than the current edit. When reviewing a producer with a supplied caller, run `node scripts/stata-artifacts.cjs <producer.do> <caller.do>` from the plugin root and trace any unmatched read before recommending the smallest repair. For a focused question, run only the checks that can inform it. Use relevant findings from the repeats check and limit the alignment check to the affected ranges with `node hooks/stata-align.cjs <file.do> --lines <ranges> --check`. Follow applicable project and host rules.

For readability, trace a reported column from its stored name to the fit. Identify any lookup needed to see the controls, sample or weights. Identical commands can use a variable rescaled between fits. Check what that does to the reported coefficient and standard error before sharing a result. Read display order at the table. Keep loops over outcomes that receive the same analysis.

When code structure or location changes, compare the request with the existing producer and diff. Apply the general rules' one-maintained-file-per-work-unit boundary. Flag unnecessary sibling scripts, replacement analysis or export paths, and wrappers that forward to a duplicate even when results match. Recommend continuing in the existing file. Keep independent work units separate.

If the user requests a paper comparison or the review question depends on a paper example, read the relevant original code path and assess how its assumptions and workflow fit the current project. Use [the paper workflow reference](../stata-replication-workflow/references/paper-workflow-reading.md) when it helps locate the source.

## Advice suited to the work

For a changed variable or a result that depends on a variable's definition, units, or coding, compare only the affected rows of the maintained codebook, if present, with the code and available data. Use the relevant section of [codebook.md](../stata-replication-workflow/references/codebook.md) for maintenance or formatting questions. Tell the writing agent how unresolved decisions affect the requested output.

Include generated files and storage paths in readability and workflow reviews. Read the affected save/export code and available output directories using the general rules: check whether each retained file has a concrete purpose, whether one-use intermediates should be temporary, and whether names and paths are clear and consistent. Do not equate all files generated by the code with final deliverables. Report unnecessary persistent intermediates, duplicate exports or scattered paths with their actual producers and consumers; distinguish a needed research intermediate from a need to keep it permanently. When execution artifacts are unavailable, state that the review covers intended destinations only. Keep the review read-only and within the requested scope.

For worksheet exports with a user-designated reference workbook, read the actual reference and resulting sheets and compare their structure under the general rules. Check what each model column represents, the outcome/sample/specification headers, coefficient and standard-error row pairing, and applicable footer statistics and notes. Calling `outreg2` or producing an `.xlsx` file does not establish that the requested table structure was followed. Distinguish necessary estimator-specific differences from an unrequested redesign; report unavailable workbooks as an evidence limitation.

Check that reportable control coefficients and standard errors remain in the table body, including actual omitted/base states. When they are unavailable for the intended estimator result, check that the `Controls` footer describes the actual specification and does not conceal known exclusions or claim coefficient evidence that the estimator does not provide. Follow the general rules' display fallback without reconstructing missing coefficients.

When proposing a native replacement, point to the relevant help section and show that it supplies what the consumer needs. Name the specific requirement that still calls for manual work when it remains necessary.

When reviewing a substantive change, read affected source, helper definitions and call sites. Compare with the user's request and earlier findings. Inspect relevant available data, logs, stored estimates, tables, and figures. Check interpretation, research contracts, and new indirection or reconstruction. Judge readability from the code and workflow even when line count falls, coefficients match, or the run succeeds.

## Return

Order findings by research impact. Give the smallest correction in the writing skill’s [suggestion format](../stata-replication-workflow/references/after-editing.md#show-the-edits-in-the-final-reply). Trace an observed number to its output. Before quoting a value inferred from code, reproduce it or show the arithmetic with the actual inputs and weights. If the branch alone answers the question, omit extra estimates. Explain why working code should stay. Identify missing evidence and distinguish code behavior from research interpretation.

Do not edit files, create an audit JSON/state/score/certificate, run destructive actions, or delegate to another agent. The writing agent owns implementation and any reasoned disagreement with advice.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.