Repository navigation
fix(code-review-gate,review-pipeline): run /code-review directly ahead of headless - #237
Merged
Merged
Conversation
The Skill tool can invoke the built-in /code-review again, so the gate no longer rests on the premise that it cannot. The direct lane runs first; the headless claude -p lane stays behind it for drivers without a Skill tool and for sessions where direct invocation is disabled. The direct invocation reviews the session's working directory rather than the shell's, so the lane switches the session into the review tree first, and it abandons without retry when it cannot be run at all. Lanes are named instead of numbered, and the review command is defined once for every lane that runs it. Refs #236
… input Three lanes run the review command in the working tree that holds the change, but the gate's inputs named only effort and root, so nothing supplied that tree's location. The gate now takes the review tree's absolute path as a third input, every lane that runs the review command runs it there, and the user lane hands the path to the user. review-pipeline passes the tree its Phase 0.5 commit step ran in, on the first run and on each re-run. The direct lane's output rule now states its condition: it applies when the Skill tool runs the review in the background. Refs #236
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The fix-loop re-run omits the gate’s required root input.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds direct /code-review Skill-tool execution before existing fallback lanes.
Changes:
- Adds review-tree-aware direct, headless, user, and subagent lanes.
- Passes the review tree from
review-pipeline. - Updates documentation and bumps the plugin version.
| File | Description |
|---|---|
skills/code-review-gate/SKILL.md |
Defines the direct lane and named fallback chain. |
skills/review-pipeline/SKILL.md |
Supplies the review tree to the gate. |
README.md |
Updates the gate description. |
.claude-plugin/marketplace.json |
Bumps version to 2026.9.10. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ep 2 passed The fix-loop re-run named only the review tree and effort, which read as dropping the root the gate requires. It now re-passes the inputs step 2 passed. Step 2 also points at the gate for the effort choice instead of restating the gate's effort rule. Refs #236
Switching the session into the review tree with EnterWorktree left the session worktree-isolated for the rest of the run, and later phases then had commands refused. The direct lane now joins the chain only when the session's primary working directory, as the harness states it, is already the review tree, and it never switches the session. Chain membership is decided at each gate run; a lane not in the chain is neither entered nor abandoned, and an abandoned lane stays abandoned. Refs #236 Closes #238
This was referenced Sep 30, 2026
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
code-review-gaterested on the premise that the Skill tool cannot invoke the built-in/code-review, and that premise no longer holds. The gate now tries a direct Skill-tool invocation first when the session already sits in the working tree under review, and keeps the headlessclaude -plane behind it, because a driver without a Skill tool, a session started elsewhere, and a Claude Code session in which direct invocation is disabled all still need a way to get a Claude review.Closes #236 Closes #238
Changes
code-review-gatetakes a third input, the review tree: the absolute path of the working tree that holds the change. The gate reads what it reviews there — the branch's committed diff against the root, the uncommitted changes, and the untracked files — and every lane that runs the review command runs it there./code-review <effort> <root-rev>...HEAD, is defined once and referenced by each lane that runs it.<effort>is the caller's effort and<root-rev>is the caller's root (the branch the change merges into), refreshed fromoriginwhen it is a branch.review-telemetryrecord, is recorded by name, for examplelanes: [direct, direct, headless].code-review-gateskill'sdescriptionfrontmatter and itsREADME.mdrow no longer state the cannot-invoke premise or enumerate the lanes.review-pipelinePhase 0.5 passes, as the review tree, the working tree in which it ran its/stage-commit-pushstep, and re-runs the gate with every input its first run passed.metadata.versionin.claude-plugin/marketplace.jsonis2026.9.10.Impact
review-pipelineis the only skill that invokescode-review-gatedirectly, and it now supplies the new input.land-via-integration-branchreaches the gate throughreview-pipelinePhase 0.5, so it needs no change.review-telemetryrecords written before this change carry numeric lane labels, and records written after it carry names.Verification
/code-review mediumover the branch range through the Skill tool, and the run returned an explicit clean verdict with no findings.pre-commit run --filesover each changed file: mdformat passed.Plan-vs-actual delta
Compared against the Scope, Out of scope, and Acceptance of #236.
Scope additions
review-pipelinechanged with it, although Phase 2: Direct Skill-tool lane ahead of headless in code-review-gate #236 stated thatreview-pipelinewould not change. The first version located the tree only through a definition inside the gate, "the working tree the caller commits the change in". The pre-merge audit then reported three times that the direct, headless, and user lanes all need the tree's path while the gate's written inputs named only effort and root. The fix makes the caller supply the path, andreview-pipelinePhase 0.5 passes the tree in which it ran its commit step.review-pipelinePhase 0.5 re-runs the gate with every input its first run passed, and it points at the gate for choosing the effort instead of restating the gate's effort rule (mediumby default,highfor a large or risky diff). Both changes answer the Copilot finding in this thread, which read the earlier re-run wording as dropping the root.Scope changes
EnterWorktreewhen the session was elsewhere. After that switch the session stayed worktree-isolated for the rest of the run, and Claude Code then refused later commands that contained the substringgitor chained several commands. The direct lane therefore no longer switches the session: it joins the chain only when the session already sits in the review tree, and the chain starts at the headless lane otherwise. This resolves code-review-gate direct lane leaves the session worktree-isolated for later phases #238, which had asked whether the lane should leave the worktree again after its run.Scope subtractions: none.
Out-of-scope churn
review-pipeline-codexskill, and relaxing the untracked-part rule for the direct lane.Acceptance
code-review-gateor theREADME.mdrow states that the Skill tool cannot invoke/code-review: met.review-pipelinerun passed its code-review gate through the direct lane: met, as the first Verification item records.