Code Review Scripts

VerifiedSafe

Standalone code review agent for R, Stata, Python, Julia scripts. Checks code quality, reproducibility, figures, and polish.

Sby Skills Guide Bot
DevelopmentIntermediate
007/24/2026
Claude Code
#code-review#reproducibility#code-quality#r#stata

Recommended for

Our review

Reviews code quality in R, Stata, Python, or Julia scripts using a Debugger agent in standalone mode, focusing on categories 4-12 (structure, reproducibility, figure quality, etc.).

Strengths

  • Systematic and standardized code quality assessment.
  • Supports multiple languages (R, Stata, Python, Julia).
  • Clear separation between critique and correction (no automatic edits).
  • Generates detailed reports with severity levels.

Limitations

  • Does not cover strategic alignment (categories 1-3) in standalone mode.
  • Requires a configured and accessible Debugger agent.
  • May be time-consuming for large numbers of scripts.
When to use it

When you need a thorough, consistent code review across multiple scripts without immediate human oversight.

When not to use it

When you expect a review that includes business or strategic relevance, or if you want automatic fixes applied.

Security analysis

Safe
Quality score92/100

The skill uses only safe allowed tools (Read, Grep, Glob, Write, Task) and prohibits editing source files. It does not execute code or network calls, and the dispatching of a debugger agent is limited to code review tasks with no destructive actions.

No concerns found

Examples

Review a single R script
Run the review-r skill on scripts/analysis.R
Review all scripts in the project
Run the review-r skill on all scripts in scripts/R/ and scripts/stata/
Review scripts in a custom directory
Run the review-r skill on scripts/python/

name: review-r description: Code review dispatching the Debugger agent in standalone mode (categories 4-12 only). Checks code quality, reproducibility, figure standards, and professional polish. Use for R, Stata, Python, or Julia scripts. argument-hint: "[filename or 'all']" allowed-tools: ["Read", "Grep", "Glob", "Write", "Task"]

Review Code Scripts

Run the code review protocol by dispatching the Debugger agent in standalone mode.

In standalone mode, the Debugger runs categories 4-12 only (code quality). Categories 1-3 (strategic alignment) require a strategy memo and are only run within the pipeline or via /econometrics-check.

Workflow

Step 1: Identify Scripts

  • If $ARGUMENTS is a specific file: review that file only
  • If $ARGUMENTS is all: review all scripts in scripts/R/, scripts/stata/, scripts/python/, scripts/julia/
  • If $ARGUMENTS is a directory: review all scripts in that directory

Step 2: Launch Debugger Agent

For each script (or batch), delegate to the debugger agent via Task tool:

Prompt: Review [file] in standalone mode (categories 4-12 only).
Categories:
  4. Script structure (header, sections, flow)
  5. Console hygiene (no print/cat pollution, clean output)
  6. Reproducibility (set.seed, relative paths, no hardcoded values)
  7. Function design (DRY, appropriate abstraction level)
  8. Figure quality (labels, dimensions, theme, transparency)
  9. RDS pattern (saveRDS for all computed objects)
  10. Comments (explain why, not what)
  11. Error handling (graceful failures, informative messages)
  12. Polish (consistent style, no dead code, clean namespace)
Save report to quality_reports/[script_name]_code_review.md

Step 3: Present Summary

After all reviews complete:

  • Total issues found per script
  • Breakdown by severity (Critical / Major / Minor)
  • Top 3 most critical issues across all scripts
  • Code review score

Step 4: IMPORTANT

Do NOT edit any source files. Only produce reports. Fixes are applied after user review, either manually or by re-dispatching the Coder agent.


Principles

  • Standalone mode = code quality only. Strategic alignment (does the code match the design?) requires a strategy memo.
  • Language-flexible. Same categories apply to R, Stata, Python, Julia — adapt checks to language idioms.
  • Proportional severity. A missing set.seed() is Major. A missing comment is Minor.
  • Worker-critic separation. The Debugger never fixes code — it only critiques.
Related skills