AGENT SKILL

copilot-review

Spawns a background subagent that babysits the GitHub Copilot reviewer on the current PR: each tick it fixes unaddressed findings against HEAD, re-requests review, and exits on convergence. Triggers: '/copilot-review', 'watch copilot', 'babysit copilot review', 'keep re-requesting copilot'.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 7
Forks
1

01 前言 Front Matter

name
copilot-review
description
Spawns a background subagent that babysits the GitHub Copilot reviewer on the current PR: each tick it fixes unaddressed findings against HEAD, re-requests review, and exits on convergence. Triggers: '/copilot-review', 'watch copilot', 'babysit copilot review', 'keep re-requesting copilot'.

02 资源文件 1

03 SKILL.md 正文

Copilot Review

Delegates Copilot babysitting to a background subagent so the main session stays free. The subagent loops internally and closes itself on convergence.

Transport check (before any GitHub step)

Run command -v gh; when it succeeds, run gh auth status; once the PR scope is resolved, run gh api repos/<owner>/<repo> --jq .permissions.push and take true as the pass. When any check fails, run the pr-loop-cloud-transport skill first, route every gh operation in this skill through its substitution matrix, and carry the same routing into the subagent prompt so the spawned watcher inherits it.

When this skill applies

The user is on a PR branch, wants Copilot (the GitHub Copilot reviewer bot) to keep re-reviewing after each push, and wants findings auto-addressed between ticks — but does not want the main conversation consumed by polling.

The Process

Step 0: Opt-out check

Before any other work, run:

python "$HOME/.claude/_shared/pr-loop/scripts/reviews_disabled.py" --reviewer copilot

Exit 0 — Copilot reviews are disabled: respond with the literal line /copilot-review is disabled via CLAUDE_REVIEWS_DISABLED. and stop — do not spawn the subagent, do not call the Copilot reviewer API, do not run any other step of this skill. Exit 1 — continue. Gate semantics live in the reviewer-gates skill (../reviewer-gates/SKILL.md).

Step 1: Gather PR context

From the current repo:

# MCP: pull_request_read(method="get") returns {number, url, head.sha, base.ref, head.ref, isDraft}

Capture number, head.sha, owner/repo (from url), and branch name. Pass these to the subagent so it does not rediscover them.

Step 2: Spawn the background subagent

Invoke the Agent tool with:

  • subagent_type: "general-purpose"
  • run_in_background: true
  • description: "Copilot review loop for PR #<N>"
  • prompt: the full instructions in Step 3 (Subagent prompt template), with placeholders filled in from Step 1.

Record the returned agent ID. Report to the user in one or two lines:

  • The subagent is running in the background.
  • It self-terminates on convergence.
  • To stop it early, the user says "stop the copilot loop" and you call TaskStop <agent_id>.
  • The main session stays free; completion arrives as a notification.

Let the subagent own the cadence. The skill's job in the main session ends once the subagent is spawned and reported.

Step 3: Subagent prompt template

Pass the prompt in templates/subagent-prompt.md to the subagent word for word, filling in the bracketed values ([NUMBER], [OWNER], [REPO], [BRANCH], [HEAD_SHA]) from Step 1. It carries the per-tick work, the escalation rule (three consecutive no-review ticks), the fix protocol, the stop conditions, and the 20-tick safety cap.

Step 4: Report back to the user

After spawning, tell the user in one or two lines: subagent ID, PR URL, that it will notify on convergence or blocker. Nothing else.

Stopping the subagent

  • Convergence → subagent stops itself.
  • Blocker → subagent reports and stops.
  • User says stop → TaskStop <agent_id>.
  • User asks what loops are running → TaskList.

Ground rules (for the subagent)

  • Append commits. Each tick adds one new commit on the existing branch with git commit and git push origin [BRANCH].
  • Honor pre-push and pre-commit hooks. When a hook rejects the change, read its output, fix the underlying issue (the failing test, the missing constant, the broken import), and retry. Solve, do not punt.
  • Respect the PR's current state. Whatever draft-vs-ready state the PR has when the loop starts is the state the subagent preserves. The user decides when to flip it.
  • One fix commit per tick. Batch all of the current tick's findings into a single commit; the next tick handles the next review round.
  • Use copilot-pull-request-reviewer[bot] with the [bot] suffix for the reviewer ID. That exact spelling is load-bearing — it is the only form the API accepts.

Examples

<example> User: /copilot-review Claude: [reads PR context, spawns background subagent with the Step 3 template, reports "subagent X watching PR #123; will notify on convergence"] </example>

<example> User: "babysit copilot on this PR until it's clean" Claude: [same as above] </example>

<example> Subagent tick fires, latest Copilot review is against an older commit. Subagent: [re-requests review, schedules next wakeup, returns] </example>

<example> Subagent tick fires, Copilot has 2 unaddressed inline findings on HEAD. Subagent: [TDD-fixes both, one commit, pushes, replies inline on both threads, resolves both threads, re-requests review, schedules next wakeup] </example>

<example> Subagent tick fires, latest review is clean against HEAD. Subagent: [reports convergence to parent, terminates — no further wakeups] </example>

04 同仓库更多 Skills

jl-cmd-projects
jl-cmd-projects/claude-dev-env

update

Fast-forwards a local repository's main branch to a remote's main after confirming the repo path and source remote through AskUserQuestion. Use when the user says '/update', 'update main', 'fast-forward main', 'sync main from origin', 'pull latest main into <path>', or 'bring main up to date'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

source-command-sr-loop

Converging cleanup loop: repeat /simplify until clean, then repeat /code-review --fix until clean

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

skill-builder

Skill lifecycle: classify, scaffold, write via the skill-writer-agent, self-audit, compose sub-skills, polish description triggers, enforce deterministic scripts. Triggers: build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, skill composition, description trigger catalog, deterministic skill scripts.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

session-tidy

Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

session-log

Logs a session report as an HTML page, tracks vault context, extracts decisions, and outputs a /rename command. Use for /session-log, 'journal this session', 'log this work', 'session report', 'summarize/log/record this session', 'save session', 'capture session', or 'document what we did'.

★ 7
jl-cmd-projects
jl-cmd-projects/claude-dev-env

run-claude-dev-env

Build, install, run, and test the claude-dev-env installer. Use when asked to run claude-dev-env, install the Claude Code config into ~/.claude, drive the installer, smoke-test it against a sandbox, or run its test suite.

★ 7