com um clique
render-report
// Render a Quarto report (Stata engine) to HTML / PDF / DOCX. Performs freshness check on included tables/figures, verifies the Stata Quarto engine, and validates numerical claims before rendering.
// Render a Quarto report (Stata engine) to HTML / PDF / DOCX. Performs freshness check on included tables/figures, verifies the Stata Quarto engine, and validates numerical claims before rendering.
Combine saved Stata estimates into publication-ready tables via esttab. Produces both .tex (for paper) and .csv (for audit) with consistent formatting.
Simulate a fresh-clone reproduction of the entire pipeline and diff the new outputs against the committed ones. Catches drift before paper submission or release.
End-to-end Stata analysis workflow — load, explore, clean, estimate, and produce publication-ready tables and figures with full logging.
Run a holistic narrative review on a Quarto report or Markdown document. Checks reader prerequisites, worked examples, notation clarity, structural arc, and pacing.
Apply the replication protocol to a paper. Inventory the replication package, record gold-standard targets with tolerances, translate the analysis to this project's Stata pipeline, and report a tolerance-by-tolerance comparison.
Run the stata-reviewer agent on a do-file. Produces a structured code-review report covering reproducibility, logging, naming, magic numbers, table/figure quality, and conformance to project conventions.
| name | render-report |
| description | Render a Quarto report (Stata engine) to HTML / PDF / DOCX. Performs freshness check on included tables/figures, verifies the Stata Quarto engine, and validates numerical claims before rendering. |
| disable-model-invocation | true |
| argument-hint | [reports/file.qmd] |
| allowed-tools | ["Bash","Read","Grep","Glob","Task"] |
Render a .qmd report that uses the Stata Quarto engine (or pure-Markdown Stata code blocks). Pre-flight checks ensure the report is complete, fresh, and honest (no unverified numerical claims).
From $ARGUMENTS find the .qmd. If just a basename, search reports/. If empty, list reports/*.qmd and ask.
a) Quarto + Stata engine available:
quarto check
Confirm "Stata: OK" (or equivalent). If missing, emit a clear setup instruction:
"Quarto's Stata engine is not installed. Install with:
pip install nbstata(orpip install pystata), then re-run."
Do NOT attempt to render without the engine — it will fail confusingly.
b) No inline analysis — grep the .qmd for analysis commands inside Stata code chunks:
grep -n -E "regress|reghdfe|ivreg|areg|xtreg|csdid" reports/<file>.qmd
If found inside {stata} chunks → flag and refuse to render. Analysis lives in dofiles/, not in reports.
c) Freshness check for every included artifact (per single-source-of-truth):
output/tables/X or output/figures/X referenced in the .qmddofiles/)/run-stata BEFORE renderingd) Citation completeness:
@key from the .qmdreferences.bibe) Numerical-claim validation:
log-validator agent against the relevant logs/*.logUNVERIFIED → refuse to render until either the do-file re-runs or the claim is removedquarto render reports/<file>.qmd
By default, produces HTML in docs/ (or report-local _files/). For PDF or DOCX, the .qmd needs the format block to declare them.
/render-report reports/analysis_report.qmd
→ Full pre-flight + render.
/render-report analysis_report → resolves to reports/analysis_report.qmd.
nbstata or pystata; see Quarto Stata engine docs.dofiles/..qmd references output/figures/X.pdf but the file doesn't exist. Re-run the producing do-file.Bibliography file not found — the _quarto.yml should point to bibliography: ../references.bib (relative from reports/).include from there.log-verification-protocol.docs/ for GitHub Pages compatibility (set in _quarto.yml).