source-command-sr-loop

Runs a converging cleanup loop repeating simplify and code-review passes until a PR diff is clean.

6|1|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/jl-cmd/claude-dev-env --skill source-command-sr-loop-jl-cmd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: source-command-sr-loop
Source: https://github.com/jl-cmd/claude-dev-env/tree/main/skill-archive/source-command-sr-loop
Command: npx skills add https://github.com/jl-cmd/claude-dev-env --skill source-command-sr-loop-jl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Iterating on code review feedback manually is slow and easy to abandon halfway. This Skill automates a converging cleanup loop on a pull request: it repeatedly runs simplification passes and then code-review-with-fix passes until each phase returns zero new findings, committing and pushing along the way. ## Core Features & Use Cases - Phase A simplify loop: Invokes the simplify skill's 4-lens review (reuse, simplification, efficiency, altitude), applies fixes, runs scoped tests, commits, and pushes after each pass until no new findings remain. - Phase B code-review loop: Runs the real code-review command headlessly via claude -p "/code-review low --fix" with a fallback to the e-code-review skill, repeating until a pass reports zero findings. - Stack-aware fixes: Loads the full PR stack from base through the target PR before applying any fix, so changes fit the stack's design and intent. - Use Case: You have a draft PR that needs polish before review. Ask to run sr-loop on the PR URL; the loop simplifies, reviews, fixes, tests, commits, pushes, and finally marks the PR ready with gh pr ready. ## Quick Start Run the sr-loop skill on my current branch's pull request to simplify and code-review it until clean.

Frequently Asked Questions about source-command-sr-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an automated code review loop on a pull request?▼

Invoke the sr-loop skill with a PR URL, branch name, or blank for the current branch's diff. It repeats simplify passes, then code-review --fix passes, testing, committing, and pushing after each pass until both phases report zero new findings.

How does the sr-loop skill know when to stop iterating?▼

Each phase converges when a full pass returns zero new findings. A pass that finds only nits is applied, tested, committed, and pushed, then treated as clean without running another pass unless the user requests it.

Can I run code-review headlessly with the claude CLI?▼

Yes. The skill runs `claude -p "/code-review low --fix" --max-turns 40` as a headless subprocess with a 10-minute timeout. A -p prompt arrives as user input, so the disable-model-invocation flag does not block it.

What happens if the headless code-review run fails?▼

The skill falls back to invoking the e-code-review skill with `low --fix`, which follows the same review-and-fix contract without the invocation restriction, then continues the loop normally.

Why does sr-loop run scoped tests instead of the full test suite?▼

Scoped tests covering only files beside the touched code keep each pass within a single foreground tool call's lifetime. A full-suite run can outlive one tool call, and a hung or newly slow suite is treated as a finding to investigate.

What are the limitations of running sr-loop in a subagent?▼

The loop must run in the main conversation. A wrapper subagent cannot see the review skills, and a nested agent's own subagent reports route to the main conversation instead of back to it, breaking the loop.