claude-review-workflow
Add or update claude-review workflow.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- claude-review-workflow
- description
- Add or update claude-review workflow.
- allowed-tools
- [ "Read", "Edit", "Write", "Bash" ]
- user-invocable
- true
03 SKILL.md 正文
claude-review-workflow
Sets up or edits the Claude PR review workflow (.github/workflows/claude-code-review.yml or .github/workflows/claude-review.yml),
which delegates to the reusable claude-code-review.yml workflow from Morrison-Lab/gha.
For the agent workflow that edits files in response to @claude mentions,
use claude-agent-workflow.
Path: .github/workflows/claude-code-review.yml (or .github/workflows/claude-review.yml)
Standard caller stub
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
workflow_dispatch:
inputs:
pr_number:
description: 'Pull request number to review'
required: true
type: string
jobs:
gather-context:
runs-on: ubuntu-latest
permissions:
issues: read
outputs:
prior-reviews: ${{ steps.fetch.outputs.prior-reviews }}
steps:
- id: fetch
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
REPO: ${{ github.repository }}
run: |
REVIEWS=$(gh api "repos/${REPO}/issues/${PR_NUMBER}/comments" \
--jq '[.[] | select(.user.login == "claude[bot]")] | .[-3:] |
.[] | "=== Review posted \(.created_at) ===\n\(.body)\n"' \
2>/dev/null | head -c 12000 || true)
{
echo 'prior-reviews<<__REVIEWS_EOF__'
echo "$REVIEWS"
echo '__REVIEWS_EOF__'
} >> "$GITHUB_OUTPUT"
review:
needs: gather-context
permissions:
contents: read
pull-requests: write
issues: write
actions: read
checks: read
uses: Morrison-Lab/gha/.github/workflows/claude-code-review.yml@v3
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
SUBMODULES_TOKEN: ${{ secrets.SUBMODULES_TOKEN }}
with:
pr-number: ${{ github.event.pull_request.number || inputs.pr_number }}
Load-bearing pieces (managed by Morrison-Lab/gha)
By delegating to Morrison-Lab/gha/.github/workflows/claude-code-review.yml@v3,
the consumer repo automatically inherits:
- History preservation: Fresh review comment posted per run without deleting prior review history.
- Inline comment prompt: Pushes review findings toward line-anchored comments via
mcp__github_inline_comment__create_inline_comment. - Dispatch and event-gating: Handles both
pull_requestandworkflow_dispatchtriggers, with branch-anchored dispatch resolution. - Draft and fork guards: Skips unready drafts, Dependabot PRs, and tokenless fork PRs while executing dispatched runs.
- Concurrency & self-cancellation safety: Concurrency group keyed per PR with
cancel-in-progress: true. - Package customization: Supports
apt-packagesandpip-packages(e.g.maxima,sympy) for CAS-driven mathematical verification when needed. - Prompt extensions: Custom repo-level instructions passed via
prompt-addendum.
Inputs and customization
pr-number: Required PR number passed from caller.prompt-addendum: Repo-specific review instructions (e.g. Quarto/R checks, domain invariants).apt-packages/pip-packages: Optional system/Python packages for verification (e.g. CAS engines).setup-r: Settrueif R packages or renv environment need initialization during review.
Setting up in a new repo
- Confirm
CLAUDE_CODE_OAUTH_TOKENsecret exists in repo/org secrets (gh secret list). - Add the caller stub at
.github/workflows/claude-code-review.yml. Diff it against gha'sexamples/claude-code-review.ymlat the tag you pin, not against another consumer's caller: seegha-reusable-workflows.md's "Template propagation hazard". If this is the repository's first workflow, the PR adding it cannot get a bot review: seeclaude-review-dispatch.md's first-workflow section. - Ensure required permissions (
contents: read,pull-requests: write,issues: write,actions: read,checks: read) and named secrets (CLAUDE_CODE_OAUTH_TOKEN,ANTHROPIC_API_KEY,SUBMODULES_TOKEN) are declared on the caller job. Pass secrets explicitly rather than viasecrets: inherit: GitHub only inherits secrets into a reusable workflow owned by the same organization or user, and naming secrets satisfies zizmor's defaultsecrets-inheritrule so no ignore rule is needed in.github/zizmor.yml. - Pass any project-specific guidance via
prompt-addendum. Fact-check it like a PR body, not less: it is the standing instruction every future review runs under (seefact-check-prose's "A prompt is a standing instruction").
Relationship to other skills
claude-agent-workflow— Companion skill for the interactive editing agent workflow.upgrade-to-gha— Migration guidelines for upgrading standalone workflows toMorrison-Lab/gha.config-ai— Router for AI workflow capability requests.
04 同仓库更多 Skills
triage
Triage backlog: P1/P2/P3 or close.
st
Start task issue-first.
mwc
Session merge grant with confidence gate.
migrate-discussion
Move items between Issues and Discussions.
memorize
Persist memory across sessions.
defer-issue
File issue for deferred work.