Run tests iteratively fixing code or tests until all pass, then commit. Arguments: $ARGUMENTS (optional scope) - commit: Test only staged files - pr: Test all files changed in the current PR - all: Run full test suite - If no argument provided: - If in a PR branch: defaults to 'pr' - Otherwise: defaults to 'commit' Phase 1: Scope and Test Discovery 1. Determine scope based on $ARGUMENTS 2. Discover test framework (pytest, testthat, jest, Pkg.test, etc.) 3. Identify test file patterns (test .py, .test.js, test- .R) 4. Check for untested new features and flag them Phase 2: Create Missing Tests…