Review R Scripts
Run the comprehensive R code review protocol.
Steps
Identify scripts to review:
- If
$ARGUMENTSis a specific.Rfilename: review that file only - If
$ARGUMENTSis a name pattern (e.g.,model_name): glob for matching.Rfiles. If multiple matches, use AskUserQuestion:- header: "Scripts"
- question: "Multiple R scripts match that pattern. Which should I review?"
- multiSelect: true
- options: list up to 4 matched files (label: filename, description: path and last modified). User can select multiple.
- If
$ARGUMENTSisall: review all R scripts inscripts/R/andFigures/*/ - If
$ARGUMENTSis empty, glob for all.Rfiles. If multiple found, use AskUserQuestion as above.
- If
For each script, launch the
r-revieweragent with instructions to:- Follow the full protocol in the agent instructions
- Read
rules/r-code-conventions.mdfor current standards - Save report to
quality_reports/[script_name]_r_review.md
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.