code-review-loop
Skill2 starsChanged 4 months agoMITView on GitHub
Run an explicitly requested PR-to-deployment loop: publish a PR, reach Greptile 5/5, merge, and verify deployment. Use only when the user asks for the full lifecycle.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- mtarcure/claude-vibe-squadtheir own version, first seen Oct 28, 2026
- aditya-deokar/software-factorytheir own version, first seen Sep 29, 2026
- nkmani/claude-skillstheir own version, first seen May 21, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- mtarcure/claude-vibe-squad★ 220same name
- aditya-deokar/software-factory★ 0same name
- nkmani/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- adversarial-code-reviewSkill
- effect-loggingSkill
- finalizeSkill
- fly-optimizationSkill
- formattingSkill
- product-design-evolveSkill
- product-design-extendSkill
- product-design-propagateSkill
- simplifySkill
- style-docSkill
- test-value-auditSkill
- typescript-structureSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Start when the current conversation explicitly authorizes the full lifecycle: publish the branch, open or update the PR, handle review …
- Distinctive: line 22
Use normal additive commits and pushes.
- Distinctive: line 26
Before changing repository state:
- Distinctive: line 28
Read applicable repository instructions and discover commit, PR, merge, required-check, and deployment policies.
- Distinctive: line 53
Commit and push one coherent correction set.
- Very specific: line 63
Every required check reports success for <head-sha>.
- Distinctive: line 64
Every blocking thread is resolved and every review comment has a recorded disposition.
- Very specific: line 77
Every required deployment is tied to that result or a proven descendant on <base-branch>.
- Distinctive: line 78
Every required deployment and post-deploy health/release check reports terminal success within its deadline.
- Distinctive: line 79
No required target remains pending, failed, cancelled, or timed out.
- Very specific: line 83
When a required deployment fails, diagnose the smallest causal blocker from provider evidence.
- Very specific: line 92
Use a direct <base-branch> commit only when the user separately authorizes it in the current conversation and repository policy permits it.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Review Loop
Own only the explicitly requested PR-to-deployment lifecycle. Start from a merge-ready tree produced by finalize or equivalent evidence; general hardening belongs to finalize, and behavior-preserving cleanup belongs to simplify.
Authorization and Outcomes
Start when the current conversation explicitly authorizes the full lifecycle: publish the branch, open or update the PR, handle review feedback, merge after the gate passes, and monitor and recover the resulting deployment. Missing authorization produces BLOCKED_AUTHORIZATION before the first ungranted transition.
The terminal outcomes are:
DEPLOYED: every merge and deployment gate passed.BLOCKED_PREFLIGHT: the tree, repository state, base branch, or required access is not ready.BLOCKED_REVIEW: the latest head SHA cannot reach the review gate within its budget.BLOCKED_MERGE: the review gate passed but policy, permissions, or platform state prevents a verified merge.BLOCKED_DEPLOYMENT: deployment cannot pass within the recovery budget or requires an unsafe/unauthorized decision.
Use normal additive commits and pushes. A force push, direct base-branch commit, production-data mutation, secret/permission change, billing change, or infrastructure policy change requires separate explicit authorization and repository support.
Resolve Invariants
Before changing repository state:
- Read applicable repository instructions and discover commit, PR, merge, required-check, and deployment policies.
- Resolve
<base-branch>from the user's explicit target when supplied; an existing PR base must match it. With no explicit target, use the existing PR base, then the remote default from provider metadata ororigin/HEAD. Verify the branch exists remotely, record it once, and use<base-branch>throughout. - Resolve the topic branch, remote, PR platform, required reviewers/checks, merge method, deployment provider, and required deployment targets.
- Record finite budgets. Use repository/user values when supplied; otherwise use five reviewed head SHAs per PR, 20 minutes of review polling per head SHA at intervals of at least 60 seconds, two deployment-recovery attempts, and 30 minutes per required deployment.
Invariant resolution is complete when every placeholder above has one evidenced value and every budget is finite. Conflicting or missing material values produce BLOCKED_PREFLIGHT.
Preflight and Publish
Require a TREE_MERGE_READY result for the current tree or equivalent evidence covering scope, findings, simplification, and validation. Otherwise return BLOCKED_PREFLIGHT and route preparation to finalize.
Inspect current status, branch, full intended diff, untracked files, and git diff --check. Confirm that unrelated work is excluded from staging and that intended generated artifacts, secrets policy, and repository checks still match the readiness evidence.
When the current branch is <base-branch>, create the authorized topic branch before staging. Stage only intended files, inspect the staged diff and check it, commit under repository policy, and push normally. Reuse an existing PR for the topic branch or open one with the change, rationale, validation, and material caveats.
Preflight is complete when the remote topic head equals local HEAD, the PR targets <base-branch>, and the PR diff contains exactly the intended changes.
Bounded Head-SHA Review
Each PR gets an independent head-SHA budget. A cycle is bound to one immutable <head-sha>:
- Capture the remote PR head SHA after each push and increment the reviewed-head count. A SHA beyond the configured count produces
BLOCKED_REVIEW. - Poll until the per-SHA deadline for Greptile output and required checks that platform evidence ties to that exact SHA. Older comments and scores remain history, not current evidence.
- Record the Greptile score, required-check results, blocking threads, and a disposition for every current comment: fix, already addressed, incorrect/outdated, out of scope, or behavior-risk decision.
- Route cleanup-only fixes through
simplifywith the PR's resolved<base-branch>and current<head-sha>as its effective diff. Apply correctness fixes only when repository evidence gives a clear in-scope answer; validate every invalidated surface. Reply with evidence for no-change dispositions. - Commit and push one coherent correction set. The new remote SHA begins the next cycle; the prior cycle cannot satisfy its gate.
A behavior-risk decision that needs product or contract intent, a required check failing for an unrelated cause, unavailable review evidence at the deadline, or an exhausted head budget produces BLOCKED_REVIEW with the exact evidence.
Merge Gate
Merge only when all statements are true at the same observed <head-sha>:
<head-sha>equals the latest remote PR head.- Greptile reports 5/5 for
<head-sha>. - Every required check reports success for
<head-sha>. - Every blocking thread is resolved and every review comment has a recorded disposition.
- The PR is mergeable and satisfies the repository's update and approval policy.
- A fresh comparison against
<base-branch>contains exactly the intended diff.
Use the repository's established merge method. Capture <merged-sha> from the platform, then verify that remote <base-branch> contains it or, for squash/rebase workflows, contains the platform-reported resulting commit. Failure of any statement produces BLOCKED_MERGE; review failures return to the bounded review loop only while budget remains.
Deployment Gate
Locate each required deployment triggered by the resulting <merged-sha> or by a later <base-branch> commit proven to contain it. Monitor each until success or its deadline, retaining provider status and relevant build, migration, runtime, and health evidence.
Report DEPLOYED only when all statements are true:
- The PR is merged into the resolved
<base-branch>and remote history contains the platform-reported result. - Every required deployment is tied to that result or a proven descendant on
<base-branch>. - Every required deployment and post-deploy health/release check reports terminal success within its deadline.
- No required target remains pending, failed, cancelled, or timed out.
Bounded Deployment Recovery
When a required deployment fails, diagnose the smallest causal blocker from provider evidence. An unrelated failure, unclear causality, or a fix requiring a separately authorized action produces BLOCKED_DEPLOYMENT.
For each available recovery attempt:
- Increment the recovery count, update remote
<base-branch>, and create a recovery branch from that exact tip. The default recovery path is branch plus PR; the base branch remains an integration target rather than an editing workspace. - Apply only the causal fix and run
finalizeto establishTREE_MERGE_READYfor the recovery diff. - Publish a recovery PR targeting
<base-branch>. Give it a fresh bounded head-SHA review loop and require the complete merge gate. - Capture the new merge result and rerun the complete deployment gate for every invalidated target.
Use a direct <base-branch> commit only when the user separately authorizes it in the current conversation and repository policy permits it. Exhausting the recovery count or any recovery PR's review budget produces BLOCKED_DEPLOYMENT.
Report
Return the terminal outcome; <base-branch>; PR URL; latest reviewed head SHA and budget usage; Greptile score, checks, and comment dispositions; merge method and resulting SHA; deployment targets, URLs, and evidence; recovery usage; and every blocker. Claim success only as DEPLOYED after the complete deployment gate passes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

