| name | review-r |
| description | Review existing R analysis code for quality and reproducibility. |
Review R Scripts
Run the comprehensive R code review protocol.
Steps
-
Identify scripts to review:
- If
$ARGUMENTS is a specific .R filename: review that file only
- If
$ARGUMENTS is a name pattern (e.g., model_name): glob for matching .R files. If multiple matches, ask the user to choose conversationally. Do not use request_user_input here because the selection may be multi-file and Codex question UI is single-choice only.
- If
$ARGUMENTS is all: review all R scripts in scripts/R/ and Figures/*/
- If
$ARGUMENTS is empty, glob for all .R files. If multiple are found, ask the user to choose conversationally as above.
-
For each script, read agents/r-reviewer.md and apply that review protocol.
- Follow the full protocol in the agent instructions
- Read
rules/r-code-conventions.md for current standards
- Create
quality_reports/ if it is missing before saving
- Save the report to
quality_reports/[script_name]_r_review.md
- If the user explicitly requested delegated review, you may run the
r-reviewer as a separate subagent and merge the result
-
After all reviews complete, present a summary:
- Total issues found per script
- Breakdown by severity (Critical / High / Medium / Low)
- Top 3 most critical issues
-
IMPORTANT: Do NOT edit any R source files.
Only produce reports. Fixes are applied after user review.