Install
openclaw skills install @yexinjia/smart-gitUse the smart-commit-host-agent CLI for local code review, creating a PR/MR, reviewing an existing PR/MR, listing my open PRs/MRs, batch-reviewing my PRs/MRs, or listing my own commits for a date range. Triggers: create MR / create PR / create pull request / open a PR / submit and create MR; review MR / review PR plus a PR/MR URL; list my MRs / list my open PRs / my MR list / my-pull-request list; batch review my MRs / batch-review my PRs / my-pull-request batch-review; list my commits / my commits today / my commits this week / what did I commit / my-commit list; local code review / local review of changes / local review diff / smart-git local review. Do not use for ordinary code review / review code without the word local. Must read this SKILL.md first. CLI task flow plus Host-Agent turn loop only; do not use gh for GitLab; no manual commit/push/API; do not edit business source based on review.
openclaw skills install @yexinjia/smart-gitVia the CLI smart-commit-host-agent (>= 0.1.7), six mutually exclusive modes are supported. After entering, route the mode first; do not mix commands.
| Mode | CLI | Purpose |
|---|---|---|
| Local Code Review | bridge --review-only | Review local changes; no commit / push / create PR/MR |
| Create PR/MR | bridge / pull-request create | Review then commit, push, create PR/MR (or resume from a breakpoint) |
| Review PR/MR | pull-request review url | Review an existing GitHub PR / GitLab MR |
| List my PRs/MRs | my-pull-request list | List open PRs/MRs for the current account/workspace; no review, no commit |
| Batch-review my PRs/MRs | my-pull-request batch-review | List open PRs/MRs by batchReviewKinds, then review them serially (includes platform publish actions; requires Host-Agent turns) |
| List my commits | my-commit list | List commits I authored on GitHub/GitLab for a date range; no review, no commit, no turn |
This CLI obtains model text via Host-Agent turns: when it returns status "needs_host_agent" (exit 10), this Agent must write the turn response file and resume with --session. See HOST_AGENT_LOOP.md. Exception: my-pull-request list and my-commit list have no turn and do not need the Host-Agent loop. my-pull-request batch-review has turns (same path as a single pull-request review).
Do not: edit business source based on review comments; switch Git branches; manually git commit / git push / fall back to platform APIs; silently turn a list-my-MRs result into batch-review (the user must explicitly trigger batch review); silently turn a list-my-commits result into a report, review, or MR.
This skill runs independently: it does not call or hand off to other skills.
Behavior is configurable: review threshold, review skill, commit message, Git auto-commit/push, PR/MR platform, assignees/reviewers/labels/milestone/draft, review comments and approve/merge, etc. are all controlled by the colocated smart-commit.host-agent.json. Out-of-box defaults: pullRequest.provider=auto; commitMessage.scope is forbidden; commitMessage.validation.protocol is none; pullRequestReview.autoApprove / autoMerge are true; summarySeverities is ["P0","P1"]; myPullRequest.listScope=account; myCommit.scope=account; myCommit.range=today; pullRequest.remoteHost="" (empty; shared by List / Batch-review / List my commits; if empty, ask before listing against public gitlab.com/github.com for self-hosted GitLab; myPullRequest.remoteHost is a deprecated fallback). Users adapt by editing that file; no skill changes required. A value stated in the request itself ("no auto-merge this time", "threshold 8") overrides the file for that run only (shared prerequisite 4.1). review.skill / commitMessage.skill are host-agent built-in templates, not other agent skills. See CONFIG.md and SETUP.md.
At these times, the Agent should remind the user in one or two sentences that they can edit this config (do not paste the full JSON, do not restate the token):
When showing that reminder, write it as a clickable Markdown link using the absolute path of the effective skill directory (SKILL_DIR comes from config resolve / the skill copy read this turn), for example:
Tip: edit [smart-commit.host-agent.json]({SKILL_DIR}/smart-commit.host-agent.json) to adjust the review threshold, review skill, commit message, Git flow (auto-stage/commit/push), auto-approve/merge, assignees/reviewers, and more. See [CONFIG.md]({SKILL_DIR}/CONFIG.md) for field docs.
Keep the filename structure at the end of each mode summary so the files are clickable; do not use a bare filename or a backtick-wrapped filename only.
| User message | Mode |
|---|---|
| Hits keywords for more than one mode at once (local / review MR / create MR / list my MRs / batch-review / list my commits). A batch-review phrase is not also Review PR/MR just because it contains "review" | Stop and ask |
| Local Code Review keywords | Local Code Review |
| Batch-review my PRs/MRs keywords | Batch-review my PRs/MRs (will serial-review and may approve/merge) |
| List my PRs/MRs keywords | List my PRs/MRs (does not review) |
| List my commits keywords | List my commits (does not review, commit, or create MRs) |
| Review MR keywords plus URL | Review PR/MR |
| Create MR keywords only | Create PR/MR |
| Only cites this skill, semantics unclear | Ask |
Local keywords (any one): local\s*code\s*review, local\s*review\s*(of\s*)?(changes|diff), smart-git.*local\s*review.
Batch-review my PRs/MRs keywords (any one): batch[\s-]*review\s*(my\s+)?(open\s+|pending\s+)?(MRs?|PRs?|pull\s*requests?), my-pull-request\s*batch-review (case-insensitive).
Must include batch or batch-review semantics; do not treat list my MRs / my pending MRs alone as batch review; do not treat review MR plus a single URL as this mode (that is single-item review).
List my PRs/MRs keywords (any one): list\s*my\s*(open\s+|pending\s+)?(MRs?|PRs?|pull\s*requests?|merge\s*requests?), my-pull-request\s*list, my\s*(open\s+|pending\s+)?(MR|PR)\s*list, list\s*(open\s+|pending\s+|created\s+|assigned\s+)?(MRs?|PRs?), list\s*(MRs?|PRs?)\s+I\s+created (case-insensitive).
Do not treat a message that only contains review MR plus a URL as list; list mode does not publish comments/approve/merge.
If the same message hits both list and batch-review, or contains both list and batch-review wording (e.g. list and batch-review my MRs), stop and ask.
List my commits keywords (any one): list\s*my\s*(own\s+)?(recent\s+)?commits?, my-commit\s*list, my\s+(own\s+)?commits?\s+(for\s+|from\s+|in\s+|since\s+)?(today|yesterday|this\s+week|last\s+week|this\s+month|last\s+month|the\s+last\s+\d+\s+days), what\s+(did|have)\s+I\s+commit(ted)?, show\s+(me\s+)?my\s+commits? (case-insensitive).
Must refer to commits I authored (my commits); the bare word commit / commit message does not trigger this mode (Create PR/MR commits as a step). Do not treat list my MRs / list my PRs as this mode. If the same message also hits list my MRs / batch-review / create MR, or asks to list commits together with MRs/PRs (e.g. list my commits and MRs, which the list-my-MRs regex alone misses), stop and ask.
Review MR keywords (any one): review\s+(my\s+|an?\s+|the\s+|this\s+)?(open\s+)?(MR|PR), MR\s*review, PR\s*review, review\s+(an?\s+|the\s+|this\s+)?(merge\s*request|pull\s*request) (case-insensitive) plus a parseable URL.
Do not treat a message that already matches batch-review keywords as this mode, even if it contains the word review and pull request / merge request (that is Batch-review my PRs/MRs).
Create MR keywords (any one): create\s*(a\s+|an\s+|new\s+)?(MR|PR), create\s+(a\s+|an\s+|new\s+)?(merge\s*request|pull\s*request), open\s+(a\s+|an\s+|new\s+)(MR|PR), open\s+(a\s+|an\s+|new\s+)?pull\s*request\b, submit\s*(and\s*)?(create\s*)?(MR|PR).
Do not treat adjective "open" as Create (list my open MRs / review my open PR / batch-review my open PRs are not Create).
Ordinary code review / review code (without local) does not trigger this skill. "review MR" / "review PR" plus a URL still is Review PR/MR.
For commands that issue turns — bridge / pull-request create / pull-request review / my-pull-request batch-review (not my-pull-request list / my-commit list):
loop: run {CLI prefix} cmd ... --output json if status == "needs_host_agent" (exit 10): 1. Read requestPath (turns/NNNN.request.json) 2. Produce this turn's content from messages + responseSchema + purpose 3. Write sessionPath/turns/{turnId}.response.json shape: turnId same as request, content is always a string. code-review / pr-content: JSON.stringify into content. commit-message: plain text, not a JSON object 4. Resume the same command: drop --session-base, pass --session sessionPath instead (never pass both). Do not start a new first-run command without a session else finish (passed | blocked | error | created | ok | ...)
| purpose (common) | content shape |
|---|---|
| code-review or code-review: | JSON string: score, decision, summary, details[]. batch-review often suffixes each MR's purpose with the URL. Follow Review skill guidance and Detected diff domain in the request; when PR/MR review includes line-number annotations, lineNumber must copy the visible number |
| commit-message | Commit message as plain text. Follow the request language / structure / protocol / scope / skill; when User draft is present (hybridGenerate), refine the draft, do not discard it. subjectOnly outputs a single line. Typed subject: scope=required must be type(scope): (missing scope fails immediately, no correction turn); forbidden must not include (scope) (CLI strips it, no second turn); auto is optional. Gitmoji / non-typed are unchanged. Do not confuse with myPullRequest.listScope. |
| pr-content | JSON string: title, description (bridge issues this turn after push, before creating the MR; do not paste the commit message as the description). Follow Title/Description prompt tuning in the request. When titlePrompt is non-empty, the CLI will not overwrite title with a single commit subject; only when titlePrompt is empty and there is exactly 1 commit relative to target does the CLI overwrite with that commit subject |
Allowed: read the request, write the session response file, parse CLI JSON. Forbidden: Write/StrReplace business source based on this; use gh prefetch instead of pull-request review; skip the turn and pretend it passed.
Default --session-base: ${TMPDIR:-/tmp}/scha-sessions (on Windows with no TMPDIR, use %TEMP% or Git Bash /tmp).
smart-commit.host-agent.json is colocated with SKILL.md. The bash resolve-config.sh path lookup may run immediately. The CLI command config resolve waits until Node and the CLI prefix are ready (section 2); do not run the CLI before that.
SKILL_DIR="<directory of the smart-git/SKILL.md read this turn>"
DISCOVER="${SKILL_DIR}/scripts/discover-resolve-script.sh"
RESOLVE_SCRIPT="$(bash "${DISCOVER}")" || exit
SMART_GIT_CONFIG="$(bash "${RESOLVE_SCRIPT}")" || exit
test -f "$SMART_GIT_CONFIG"
SMART_GIT_CONFIG may override explicitly. The summary must record the config source (absolute path, no secrets). Installation: SETUP.md. The resolve scripts require bash; on Windows run them in Git Bash / WSL or an Agent shell that already provides bash. Always use the config from the skill directory read this turn; do not switch to a copy in another tool's directory. To use a different JSON, set SMART_GIT_CONFIG.
Use an existing usable install if present. Auto-install globally only when none is found. Order is fixed: ensure Node >= 20, resolve a usable CLI by priority, globally install the package only if every probe fails, then run business commands. The summary must record Node version, chosen CLI prefix and source (PATH / project-local / explicit path / global install this turn), and version output. If a global install, a project dependency, or a locally built binary already runs with the required subcommands, use it as-is and do not install.
Check node -v; major version must be >= 20. If not, in the same shell session switch to an installed 20+ (nvm / fnm / asdf / mise / volta; prefer project .nvmrc / .node-version if already >= 20), then re-check. If this machine has no Node >= 20 at all, skip the whole skill. Summary: skipped, did not run bridge / pull-request. Reason: Node.js >= 20 not found. Do not run the CLI with Node below 20.
After Node is ready, probe in this order and stop on first usable prefix whose help includes the current mode's subcommands:
Any candidate succeeds: freeze that CLI prefix, record the source, do not run 2.3. All fail: go to 2.3.
Mode help requirements: Local needs bridge and --review-only. Create PR/MR needs bridge; breakpoint resume also needs pull-request create. Review PR/MR needs pull-request review. List needs my-pull-request list. Batch-review needs my-pull-request batch-review. List my commits needs my-commit list. Every mode also requires CLI >= 0.1.7: --version must print 0.1.7 or later. Older CLIs silently ignore pullRequest.remoteHost and myCommit in the JSON (a self-hosted host would quietly fall back to the public host), may lack --set, and require --repo for pull-request review, so an older candidate counts as a miss; the global install in 2.3 then upgrades to the latest package.
Run only when 2.2 missed all candidates (do not ask the user whether to install): globally install package smart-commit-host-agent. After install, re-check the global command on PATH (exists, version, help). If recheck passes and subcommands are complete, prefix is smart-commit-host-agent; note auto global install this turn, then continue. Recheck fails: go to 2.4.
Forbidden: forcing a global install when 2.2 already found a usable CLI; forging an unverified path after a failed install; hiding an install failure; using elevated privileges for global install unless the user explicitly asked this turn.
Skip the whole skill (do not enter config resolve / bridge / pull-request) if: no Node >= 20; 2.2 all missed and registry/network failed; 2.2 all missed and permission failed; command still unavailable after global install. Summary must say skipped, what was probed (SMART_COMMIT_CLI / PATH / project node_modules), what was tried, and that the skill did not pretend it is installed.
| Check | Requirement |
|---|---|
| Node | Major version >= 20 (see 2.1; may auto-switch) |
| CLI | 2.2 resolved a usable prefix, or automatic global install this turn succeeded |
| Platform token | Only Create PR/MR / Review PR/MR / List / Batch-review / List my commits need it (see 3.1). Local Code Review does not |
| Config | resolve-config.sh plus config resolve succeeded |
| Mode | Needs pullRequest.authToken? |
|---|---|
| Local Code Review (bridge --review-only) | No. Even if SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN is unset, continue config resolve and the business CLI |
| config resolve (prerequisite of any mode) | No. The CLI resolves missing env: refs to empty and does not CONFIG_ERROR for that |
| Create PR/MR, Review PR/MR, List my PRs/MRs, Batch-review my PRs/MRs, List my commits | Yes. Calls GitHub/GitLab APIs |
The colocated config still writes pullRequest.authToken: "env:SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN".
Modes that do not need a token: skip the env check below and go straight to config resolve / the business CLI.
Modes that need a token: before config resolve / the business CLI, if SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN is unset or empty: stop immediately; do not guess a token, copy secrets from files/chat, or ask the user to paste a token into the conversation; guide the user to configure SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN (GitHub PAT or GitLab Personal Access Token) so the shell used by the current AI tool can read it. Local Code Review does not need this token.
Permission suggestions (default provider is auto): GitLab api (or enough to create/comment/merge MRs; read_api is enough for List my commits alone); GitHub repo (private repos) or the PR permissions needed for public repos. After configuring, the user can say create MR / review MR / list my MRs / batch-review my MRs / list my commits again. Do not send the token in the conversation.
Summary must say Skipped (waiting for SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN); do not phrase it as a CLI/review failure. If config resolve still reports CONFIG_ERROR because of other env refs, guide by field and stop. Treat every authToken in output as sensitive; do not paste it to the user (including redacted). If JSON points authToken at a variable name that does not exist in the current shell, and this turn is a token-required mode: offer two options — change authToken back to env:SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN, or write that variable into the shell config so the current AI tool's shell can read it, then re-trigger.
Run: {CLI prefix} config resolve --config "$SMART_GIT_CONFIG" optionally --repo Git-root, plus the same --set flags this turn will use (shared prerequisite 4.1), so invalid overrides fail early and the resolved values reflect them.
When this mode later runs bridge / pull-request at a Git root, config resolve must pass the same --repo (relative configFilePath overlays resolve relative to the repo root; absolute paths are probed as-is). Account-scoped List my PRs/MRs / List my commits that does not read a local repo may omit --repo.
host-agent has no target-branch flag. For Create PR/MR, generate a temporary config with the script:
RUNTIME_CONFIG="$(bash "${SKILL_DIR}/scripts/with-target-branch.sh" "$SMART_GIT_CONFIG" "<MR target branch>" "<Git root>")"
then --config "$RUNTIME_CONFIG"
The script merges that repo's pullRequestCreation.configFilePath overlay using CLI rules, then writes the conversation-specified targetBranch, and clears configFilePath in the temp config (so the CLI does not load the overlay a second time and overwrite the target). One RUNTIME_CONFIG per Git root.
Except --repo, --config, --session / --session-base, --review-only, breakpoint resume --no-commit / --no-push, --output, user-explicit dry-run, a --commit-message the user clearly gave this turn, the --my-pull-request-* overrides allowed for List / Batch-review, the --my-commit-* and --start-date / --end-date overrides allowed for List my commits, --pull-request-remote-host for a host the user named this turn (List / Batch-review / List my commits only), and --set overrides derived from the user's words (4.1), do not pass flags that would override config such as --provider / --pull-request-provider / --pull-request-api-base-url / --pull-request-auth-token (the token only goes through the env var plus config env: ref; a platform switch the user asks for goes through --set=pullRequest.provider=...).
When the user's message this turn states a config value in natural language, apply it to this run only with the CLI's generic --set flag. Never edit smart-commit.host-agent.json for this; the next request goes back to the file unless the user restates the value. If the user wants it permanent, point them at the JSON field instead.
Form: one token per field, --set=path=value, where path is the dotted field under smartCommitHostAgent (same names as CONFIG.md). Quote the whole token when the value has spaces or JSON, e.g. '--set=pullRequestCreation.titlePrompt=Use a Chinese title'. Values: numbers; true / false; plain text; arrays as a comma list (--set=pullRequestCreation.reviewers=alice,bob) or JSON; an empty value clears an array.
Rules:
CLI support: --set is part of the >= 0.1.7 requirement in 2.2. Never drop overrides silently.
pullRequestReview.configFilePath is loaded automatically by the CLI in config resolve / pull-request review / batch-review (comma-separated, first existing file; absolute paths as-is, relative paths relative to the repo root when --repo is present). The Agent must not manually read/merge overlay files. Review overlays must not contain configFilePath. Creation-overlay merge only goes through with-target-branch.sh; do not hand-edit the temp JSON afterwards.
If pullRequestReview.configFilePath is a relative path: CLI config resolve, pull-request review, and batch-review must pass --repo, otherwise it resolves against cwd and the file is not found (CONFIG_ERROR). List / account-scoped batch-review / List my commits that would otherwise omit --repo must still pass --repo of a relevant Git root when that overlay path is relative (List and List my commits do not use the overlay content, but the CLI still loads it). Pure absolute paths need not depend on --repo.
Local Code Review and Create PR/MR share the same table for reviewDetails (review of an existing MR / batch-review do not make local jumps):
| Severity | Description | Location |
|---|---|---|
| P1 | ... | src/main.js#L101 |
Location: show filePath relative to the repo root (may include #L line); href must be that item's {repositoryPath}/{filePath} absolute path (use filePath directly if it is already absolute). No path: write an em dash. Multi-repo: one table per repo, do not mix repos; do not use a relative path only (workspaces often have same-named files).
Review PR/MR / batch-review still do not make local jumps.
Run when any of the following holds:
Do not trigger: the user is still writing code and has not asked to create a PR/MR (dirty porcelain after they did ask is the main Create path: run bridge); review/local-review keywords only; workspace is clean, no commits relative to target, and breakpoint resume does not apply.
Strip quotes and the origin/ prefix.
Before calling with-target-branch.sh, bridge, or pull-request create, a unique target must already be resolved. If the user only said create MR and context has no base branch:
Run only when all of the following hold:
porcelain non-empty: must bridge first. REVIEW_BLOCKED: do not bypass with create.
No upstream and not pushed: do not push manually; tell the user to git push -u origin and re-trigger.
cd to the Git root. Record porcelain and current branch. Generate RUNTIME_CONFIG with with-target-branch.sh using SMART_GIT_CONFIG, the MR target branch, and pwd.
| porcelain | commits relative to target | Action |
|---|---|---|
| non-empty | any | bridge plus Host-Agent loop |
| empty | yes | pull-request create plus loop |
| empty | no | skip |
bridge (main path): cd Git root, set SESSION_BASE to ${TMPDIR:-/tmp}/scha-sessions, run {CLI prefix} bridge --repo . --config RUNTIME_CONFIG --session-base SESSION_BASE optional --commit-message if the user clearly gave one this turn, optional --set=... overrides (4.1), --output json. On needs_host_agent, write the response and resume with the same args except replace --session-base with --session sessionPath (never pass both).
Typical purpose order: commit-message (when autoGenerate is true and input is empty, or hybridGenerate is true with a draft), then code-review, then (after push) pr-content, then create MR. Add --commit-message only when the user clearly gave a commit message this turn (equivalent to commitMessage.input). hybridGenerate=true plus a non-empty input / --commit-message: refinement turn (request includes User draft). hybridGenerate=false plus a non-empty input: no commit-message turn (validate and use the draft). Default hybridGenerate=false and autoGenerate=true with empty input: the CLI still issues a commit-message turn to generate from the diff; do not skip it. commit-message: follow structure/protocol/scope/skill; if User draft is present, refine. required: type(scope): kebab-case from the changed area; missing scope fails immediately, do not expect a correction turn forbidden: type: / type!: no parenthesized scope; CLI strips it, no second turn auto: (scope) optional; Gitmoji / non-typed unaffected by scope hybrid: required may add scope to a draft that has none; an existing scope must be kept as-is; forbidden strips parenthesized scope from the draft code-review: follow Review skill guidance; local bridge has no line-number annotations pr-content must be a JSON string of title and description; do not paste the commit message as the description title: titlePrompt non-empty uses this turn's title; titlePrompt empty and exactly 1 commit relative to target: CLI overwrites with that commit subject reviewers / milestone / draft are sent to the platform API from config; do not fill them in the turn JSON
pull-request create (breakpoint): {CLI prefix} pull-request create --repo . --config RUNTIME_CONFIG --session-base SESSION_BASE --no-commit optional --no-push, optional --set=... overrides (4.1), --output json.
| relative to @{u} | flags |
|---|---|
| ahead = 0 | --no-commit --no-push |
| ahead > 0 | --no-commit (let the CLI push only if git.autoPush is true; if autoPush is false, also pass --no-push) |
| no upstream | do not run; tell the user to push |
| Result | Behavior |
|---|---|
| needs_host_agent | continue the turn loop (not a failure) |
| passed plus push plus MR created/existing | success |
| NO_CHANGES / committed but no MR, and breakpoint applies | pull-request create only if autoCreateAfterPush is true; if false, stop as success without an MR |
| REVIEW_BLOCKED / blocked plus review block | stop the whole skill; output the review only; do not edit code or resume create |
| other error | skip that repo (continue if multi-repo) |
Every bridge must write into the summary: score, threshold, reviewDecision, reviewSummary, reviewDetails (table format: shared prerequisite 6).
Heading: Git / MR summary — branch name. Include: MR target branch and source (user-specified / conversation / config); temporary overrides applied (4.1) or none; CLI smart-commit-host-agent version and all-succeeded / partial / all-failed / skipped; a table of repo, source branch, target, path (bridge / pull-request create), result, score, commit, push, MR, link; Code Review per repo with score / threshold / decision / summary / details table. End with the clickable config reminder: smart-commit.host-agent.json and CONFIG.md.
Must have at least one PR/MR URL (GitHub .../pull/N or GitLab .../merge_requests/N). No URL: ask.
Default-config impact (know this before a live review): in the colocated smart-commit.host-agent.json, pullRequest.provider defaults to auto; pullRequestReview.autoApprove / autoMerge default to true; summarySeverities defaults to ["P0","P1"]. So a live pull-request review may auto-approve and merge after a passing review. When the user has not changed the config:
Run: {CLI prefix} pull-request review URL --config $SMART_GIT_CONFIG --session-base ${TMPDIR:-/tmp}/scha-sessions optional --repo path, optional --dry-run, optional --set=... overrides (4.1), --output json. Keep the URL right after "pull-request review" and use the single-token --set= form.
--repo is optional. Platform, project, number, and diff all come from the URL, so no local checkout is needed; without --repo the CLI uses the current directory (Git or not) and never writes into it. Pass --repo only when pullRequestReview.configFilePath or review.skill is a relative path that lives in a specific repo (point it at that repo's Git root), or when the user is already working in that PR/MR's local clone.
Do not pass --provider / --pull-request-provider (default auto; a platform switch the user asks for this turn uses --set=pullRequest.provider=..., a permanent one goes in the JSON). Multiple URLs are reviewed one by one; a single URL failure does not stop the rest (except a global CONFIG failure).
pullRequestReview.configFilePath is loaded automatically by the CLI (rules: shared prerequisite 4). A non-empty skillPromptTuning overrides review.skill.promptTuning and only affects this mode / batch-review, not local bridge. When filling the code-review turn, follow Review skill guidance; when the request has line-number annotations, copy the visible lineNumber.
The summary must include: score, threshold, details, summary, platform action fields (including approve/merge), temporary overrides applied (or none). On blocked, do not edit code and should not merge.
Do not use gh pr view prefetch in place of the CLI.
Run when any of the following holds (no URL needed, no local changes needed):
Do not trigger: review MR with a parseable URL (Review mode); create MR; local code review; wording that includes batch / batch-review (Batch-review my PRs/MRs).
listScope:
remoteHost (commonly used for account; strongly recommended for self-hosted GitLab; shared with Batch-review and List my commits):
With pullRequest.provider=auto, a remoteHost other than github.com / gitlab.com is CONFIG_ERROR ("Could not infer GitHub/GitLab from ..."). Guide the user to set pullRequest.provider to gitlab or github (and pullRequest.apiBaseUrl if needed) in the JSON, or, if they state the platform in the request, pass --set=pullRequest.provider=gitlab for this run (4.1); do not pass --pull-request-provider and do not edit the config yourself.
listKinds (multi-select: created / assigned / reviewer):
--repo:
{CLI prefix} my-pull-request list --config $SMART_GIT_CONFIG optional --repo paths, --my-pull-request-list-scope account|workspace, --my-pull-request-list-kinds created,assigned,reviewer, --pull-request-remote-host host, --output json.
Allowed one-shot overrides: only the --my-pull-request-* flags above, --pull-request-remote-host, --set=... for other fields the user stated (4.1, e.g. pullRequest.provider), plus --repo / --config / --output. Do not use the deprecated --my-pull-request-remote-host. Forbidden: --pull-request-auth-token (keeps the token out of command-line history), --provider / --pull-request-provider overriding config, hand-written gh / platform REST lists.
Per-repo failure warnings: with status ok the CLI downgrades a single repo's listing error to a warnings entry (mostly workspace scope), e.g. HTTP 401/403, Bad credentials, token rejected, request failed. Check warnings before treating status ok as success.
| Result | Behavior |
|---|---|
| status ok, items non-empty, no per-repo failure warnings | success; render the summary table |
| status ok, items empty, no per-repo failure warnings | success but no matches; record summary / warnings as-is |
| status ok, items empty, per-repo failure warnings | listing failed, not "no matches": name the failed repos; for 401/403 guide the user to fix SMART_COMMIT_PULL_REQUEST_AUTH_TOKEN (shared prerequisite 3.1) |
| status ok, items non-empty, per-repo failure warnings | partial results: render the items, then name the failed repos and say their MRs/PRs are missing; for 401/403 guide the token fix as above |
| CONFIG_ERROR / Token | guide per shared prerequisites; stop |
| other error | skip/failure summary (do not pretend success in multi-repo) |
Take from JSON: scope, kinds, items[] (at least title, url, repoName/projectPath, roles, sourceBranch, targetBranch, draft, author, updatedAt), warnings, summary.
Heading: List my PRs/MRs. Include CLI version; query scope/kinds/remoteHost/repos; temporary overrides applied (if any); results summary; a table of repo, title, roles, source->target, draft, updated, link; warnings. End with the clickable reminder pointing at smart-commit.host-agent.json for myPullRequest.listScope / listKinds and pullRequest.remoteHost, and CONFIG.md. Do not paste the token / authToken. After listing, if the user wants to review one item they must separately say review MR plus URL; if they want a batch review they must separately say batch-review my MRs. Do not automatically switch to pull-request review / batch-review.
Run when any of the following holds (no need to paste URLs, no local changes needed):
Do not trigger: only list my MRs / my pending MRs (List mode, does not review); review MR plus one or more URLs (single pull-request review); create MR; local code review.
Default-config impact (know this before a live batch review): in the colocated config, pullRequestReview.autoApprove / autoMerge default to true. Batch items that pass may also be auto-approved and merged. When the user has not changed the config:
listScope / remoteHost: same as List my PRs/MRs (user explicit then pullRequest.remoteHost then deprecated myPullRequest.remoteHost; for account plus empty remoteHost on self-hosted GitLab, ask first; provider=auto with a self-hosted host is CONFIG_ERROR).
batchReviewKinds (multi-select: created / assigned / reviewer) — not listKinds
--repo: same as list mode (workspace passes each Git root; account plus non-empty remoteHost may omit).
{CLI prefix} my-pull-request batch-review --config $SMART_GIT_CONFIG optional --repo paths, --my-pull-request-list-scope, --my-pull-request-batch-review-kinds, --pull-request-remote-host, --session-base ${TMPDIR:-/tmp}/scha-sessions, optional --dry-run, optional --set=... overrides (4.1), --output json. On needs_host_agent, write the response and resume with the same args except replace --session-base with --session sessionPath (never pass both). On resume do not list again; the CLI skips completed URLs from session progress.
Allowed one-shot overrides: the --my-pull-request-* flags above, --pull-request-remote-host, --set=... (4.1), --repo / --config / --session / --session-base / --dry-run / --output. Do not use the deprecated --my-pull-request-remote-host. Forbidden: --pull-request-auth-token, --provider / --pull-request-provider override, gh / hand-written platform APIs, using multiple pull-request review calls instead of this command (unless the user only wants a few specific URLs), chaining batch-review after list mode on your own.
| Result | Behavior |
|---|---|
| needs_host_agent | continue the turn loop (not a failure); keep sessionPath |
| status ok, totalListed 0, no per-repo failure warnings (defined under List my PRs/MRs parse results) | success but no matches; record summary / warnings as-is |
| status ok, totalListed 0, per-repo failure warnings | same as the List my PRs/MRs row "items empty, per-repo failure warnings": listing failed, not "no matches" |
| status ok plus outcomes, no per-repo failure warnings | terminal success path; combine with exit: 0 all passed; 2 some not_passed; 4 some error / cancelledRemaining |
| status ok plus outcomes, per-repo failure warnings | report the outcomes per exit code as in the row above, then apply the List my PRs/MRs row "items non-empty, per-repo failure warnings": name the failed repos and say their MRs/PRs were neither listed nor reviewed |
| CONFIG_ERROR / Token | guide per shared prerequisites; stop |
| other error | failure summary (do not edit business source) |
Take from JSON: scope, kinds, totalListed, outcomes[] (status passed / not_passed / error / skipped; plus title/url/score/threshold or errorMessage), cancelledRemaining, warnings, summary, dryRun, sessionPath.
Heading: Batch-review my PRs/MRs. Include CLI version and succeeded / some not passed / failed / skipped / dry-run; query scope, batchReviewKinds, remoteHost, dryRun, repos; temporary overrides applied (or none); overview summary, totalListed, cancelledRemaining; a table of status, title, score, threshold, link/error; warnings. End with the clickable reminder for myPullRequest.batchReviewKinds / listScope, pullRequest.remoteHost, and pullRequestReview.autoApprove/autoMerge. Do not paste the token / authToken. Any item not passed or error: do not Write/StrReplace business source based on it.
Run when any of the following holds (no URL needed, no local changes needed):
Do not trigger: create MR / commit my changes (Create PR/MR); list my MRs (List my PRs/MRs); local code review; a request to write a report (this mode only lists commits; summarizing them is a separate request).
scope:
remoteHost: same as List my PRs/MRs (user hostname -> --pull-request-remote-host, then pullRequest.remoteHost, then deprecated myPullRequest.remoteHost; account plus empty host on self-hosted GitLab: ask first; provider=auto with a self-hosted host is CONFIG_ERROR). workspace scope ignores remoteHost and scans the --repo remotes.
range (dates are local calendar days of this machine; weeks start on Monday):
| User says | Flags |
|---|---|
| today | --my-commit-range today |
| yesterday | --my-commit-range yesterday |
| this week | --my-commit-range thisWeek |
| last week | --my-commit-range lastWeek |
| this month | --my-commit-range thisMonth |
| last month | --my-commit-range lastMonth |
| last N days, since a date, a specific date, or a date span | --my-commit-range custom --start-date YYYY-MM-DD --end-date YYYY-MM-DD (inclusive; compute from today's local date; "last 3 days" = today and the 2 days before) |
| nothing about time | omit; use config myCommit.range |
authorAliases / merge commits:
--repo:
{CLI prefix} my-commit list --config $SMART_GIT_CONFIG optional --repo paths, --my-commit-scope account|workspace, --my-commit-range preset, --start-date / --end-date (custom only), --my-commit-author-aliases list, --my-commit-include-merge-commits[=false], --pull-request-remote-host host, --output json.
Allowed one-shot overrides: only the flags above, --set=... for other fields the user stated (4.1, e.g. pullRequest.provider), plus --repo / --config / --output. Leave --my-commit-concurrency / --my-commit-request-delay-ms to config unless the user explicitly asks this turn. Always use --output json; do not pass --my-commit-output-format (it only changes CLI text output). The summary style is chosen by the skill, see Output summary below. Forbidden: --pull-request-auth-token, --provider / --pull-request-provider / --pull-request-api-base-url overriding config, the deprecated --my-pull-request-remote-host, git log on local clones or hand-written gh / platform REST calls in place of this command.
| Result | Behavior |
|---|---|
| status ok plus records | success; render the summary in the chosen style (compact or full) |
| status ok plus records empty | success but no matches; record summary / warnings as-is; if the user expected commits, mention myCommit.authorAliases (commits authored under another name or email are not matched) |
| complete false | still exit 0; results are partial (query stopped early, usually a low rate limit). Say so explicitly, show warnings, suggest retrying later or raising myCommit.requestDelayMs / lowering myCommit.concurrency |
| CONFIG_ERROR (exit 3) | token missing -> guide per shared prerequisite 3.1; invalid range / dates / myCommit.* / provider-host mismatch -> report the field and stop |
| RUNTIME_ERROR (exit 4) | e.g. rejected token or invalid repository path; failure summary, do not pretend success |
Take from JSON: scope, dateRange (preset, label, since, until, dayCount), provider (kind, host), account.login, records[] (projectPath, sha, message, authoredAt, branches, url, isMergeCommit), complete, repositoryCount, scannedRepositoryCount, warnings, summary, config.myCommit.outputFormat.
Style (high to low):
compact (default): heading List my commits, then one line with range label (local since / until), total commits, repositories scanned (scannedRepositoryCount / repositoryCount), complete yes/no; then a plain bullet list of each commit message's first line, newest first (no SHA / time / link); then warnings. No CLI version / provider / account lines unless something failed.
full: heading List my commits. Include CLI version; provider and host; account login; scope; range label with local since / until; total commits, repositories scanned, complete yes/no; then a table of repo (projectPath), short SHA (first 8 chars), message (first line), authored at (local time), branches (empty for GitLab), link; warnings.
Both styles: complete false must be stated as partial results; empty results say no commits matched; temporary overrides applied this run (4.1) get one line when there are any. End with the clickable reminder pointing at smart-commit.host-agent.json for myCommit.outputFormat / range / scope / authorAliases / includeMergeCommits and pullRequest.remoteHost, and CONFIG.md. Do not paste the token / authToken, and do not paste authorEmail values beyond what the user asked for.
cd to the Git root. Run {CLI prefix} bridge --repo . --config $SMART_GIT_CONFIG --review-only --session-base ${TMPDIR:-/tmp}/scha-sessions optional --set=... overrides (4.1; review.* fields such as threshold / language / skill are the useful ones here) --output json. The summary lists the overrides applied (or none).
This skill runs independently; it does not call or hand off to other skills. Route only among this skill's six modes based on the user message:
| User input | Mode |
|---|---|
| local code review / local review of changes etc. | Local Code Review |
| batch-review my MRs / batch-review etc. | Batch-review my PRs/MRs |
| list my MRs / my MR list / list my PRs etc. | List my PRs/MRs |
| list my commits / my commits this week / what did I commit yesterday etc. | List my commits |
| review MR / review PR plus URL | Review PR/MR |
| create MR / open a PR / create PR | Create PR/MR |
| local review plus create MR / review MR / list / batch-review / list my commits (multiple modes in one message) | Stop and ask |
| ordinary code review / review code (without local) | Do not trigger this skill |
Resolution priority: