| name | review-branch | ||||
|---|---|---|---|---|---|
| description | Reviews the current local Git branch with Greptile CLI before opening a PR or MR. Compares committed branch changes against a base branch, reports Greptile findings from the terminal, optionally fixes actionable issues, and can rerun the CLI review. Use when the user wants a fast pre-PR Greptile review without creating or triggering a PR/MR review comment, check run, dashboard review, or greploop. | ||||
| license | MIT | ||||
| compatibility | Requires git and Greptile CLI installed and authenticated with `greptile login`. | ||||
| metadata |
|
||||
| allowed-tools | Bash(git:*) Bash(greptile:*) |
Run Greptile CLI against the current local branch before opening a PR/MR. This skill is for committed branch diffs only: Greptile CLI ignores uncommitted changes.
- Base branch (optional): If not provided, use the repository default branch when it can be inferred, otherwise ask the user.
- Output format (optional):
agentby default. Usejsonwhen another tool needs to parse the result. - Loop mode (optional): If requested, fix actionable findings and rerun Greptile CLI until no actionable findings remain or the user chooses to stop.
Run from the repository root or move there first:
git rev-parse --show-toplevel
greptile --version
greptile whoamiIf greptile whoami fails, ask the user to authenticate with:
greptile loginDo not use PR/MR review triggers for this workflow. In particular, do not post @greptile review, do not trigger Greptile through GitHub/GitLab comments, and do not use dashboard or app-based review flows.
Identify the current branch and working tree state:
git branch --show-current
git status --shortIf there are uncommitted changes, tell the user that Greptile CLI will ignore them. Ask whether they want to commit first, or continue with only committed branch changes in scope.
Choose the base branch:
git symbolic-ref --quiet --short refs/remotes/origin/HEADIf origin/HEAD is unavailable, try main or master. If the intended base branch is still unclear, ask the user.
Verify there are committed changes to review:
git diff --stat <BASE>...HEAD
git rev-list --count <BASE>..HEADIf there are zero commits against the base branch, stop and report that Greptile CLI has nothing to review.
For agent-readable text:
greptile review -b <BASE> --agent --no-colorFor machine-readable output:
greptile review -b <BASE> --json --no-colorTo resume the latest unfinished review:
greptile review --resume --agent --no-colorIf the user wants inline code context:
greptile review -b <BASE> --diff --context=25 --agent --no-colorClassify each finding before changing code:
| Category | Meaning |
|---|---|
| Actionable | Correctness, security, maintainability, test, or requirement issue that should be fixed |
| Needs decision | Plausible issue, but depends on product intent, API contract, or team tradeoff |
| Not actionable | False positive, already addressed, outside the reviewed diff, or only a style preference |
Report the categories clearly. Do not present a clean Greptile result as covering uncommitted local changes.
If the user asks to fix findings:
- Read the surrounding code and relevant project instructions.
- Make the smallest code change that addresses the actionable issue.
- Run focused validation that matches the changed surface.
- Commit only if the user explicitly asks you to commit.
If the user requested loop mode, rerun Greptile only after the fixes are committed with explicit user approval. If the user does not approve a commit, stop after local validation and report that Greptile was not rerun because the fixes remain uncommitted.
After the fixes are committed, rerun:
greptile review -b <BASE> --agent --no-colorStop when there are no actionable findings, the remaining findings need user/product decision, or the user asks to stop.
When the branch is ready, summarize the review result and ask before creating or pushing a PR/MR. This skill does not create PRs/MRs by itself; hand off to the user's normal PR/MR creation workflow when explicitly requested.
Review Branch complete.
Base: main
Branch: feature/example
Greptile command: greptile review -b main --agent --no-color
Actionable findings: 0
Needs decision: 1
Not actionable: 2
Validation: npm test -- auth.test.ts
Next: ready for PR creation when requested
If not complete:
Review Branch stopped.
Base: main
Branch: feature/example
Actionable findings remaining: 2
Reason: product decision needed before changing API behavior
For exact Greptile CLI flags and examples, see Greptile CLI Reference.