AGENT SKILL
claude-agent-workflow
Add or update claude.yml workflow.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- claude-agent-workflow
- description
- Add or update claude.yml workflow.
- allowed-tools
- [ "Read", "Edit", "Write", "Bash" ]
- user-invocable
- true
03 SKILL.md 正文
claude-agent-workflow
Sets up or edits the @claude agent GitHub Actions workflow (.github/workflows/claude.yml or .github/workflows/claude-bot.yml),
which delegates to the reusable claude.yml workflow from Morrison-Lab/gha.
For the read-only PR review workflow,
use claude-review-workflow.
Path: .github/workflows/claude.yml (or .github/workflows/claude-bot.yml)
Standard caller stub
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
# `opened` is safe: the callee's mention-filter runs detect-bot-mention on
# issue body and title and stands down on a quoted mention (gha#554).
# `assigned` fires only when the issue body or title also mentions the bot
# and the issue author is trusted -- or add a dispatch-on-assignee clause
# below AND pass the dispatch-on-assignee input (see gha examples/claude.yml).
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
# Caller-side trusted-author gate, copied from gha examples/claude.yml at
# the pinned tag: an untrusted mention never invokes a workflow that holds
# write permissions and secrets. Re-diff against the example on every bump.
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association))
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: write
uses: Morrison-Lab/gha/.github/workflows/claude.yml@v3
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
SUBMODULES_TOKEN: ${{ secrets.SUBMODULES_TOKEN }}
WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
with:
setup-r: false
eager-pr: true
review-workflow-file: claude-review.yml
Load-bearing pieces (managed by Morrison-Lab/gha)
By delegating to Morrison-Lab/gha/.github/workflows/claude.yml@v3,
the consumer repo automatically inherits:
- Bot-actor filtering: Evaluates mention triggers (
@claude) on comments, reviews, and assigned issues while filtering out bot-generated loops. - Concurrency serialization: Per-issue/PR concurrency with
cancel-in-progress: falseto avoid clobbering concurrent in-flight agent pushes. - Late-comment polling: Scans for comments arriving during execution so long-running sessions drain multi-comment bursts.
- Post-push review triggering: Captures head SHAs before and after execution; if changes were pushed, automatically requests review and dispatches the review workflow.
- Tool permission sandboxing: Restricts allowed CLI tools (
ghread commands,git, build tools) and enforces secure WebFetch domain allowlisting. - Threaded inline replies: Automatically posts responses as threaded inline replies when triggered by pull request review comments.
- Environment and secret propagation: Handles private submodules (
SUBMODULES_TOKEN) and optional domain tokens (EPI202_TOKEN).
Inputs and customization
setup-r: Initialize R toolchain and renv package cache (truefor R packages / Quarto R repos).eager-pr: Open a draft PR up front when claiming an issue (trueby default).review-workflow-file: Name of the companion review workflow file (e.g.claude-review.ymlorclaude-code-review.yml).use-ai-config: Automatically loadai-configagent instructions (defaults totrue, setfalseforMorrison-Lab/ai-configitself).apt-packages/pip-packages: Additional build or analysis packages.
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.yml. Diff it against gha'sexamples/claude.ymlat the tag you pin, not against another consumer's caller: seegha-reusable-workflows.md's "Template propagation hazard". - Ensure required permissions (
contents: write,pull-requests: write,issues: write,id-token: write,actions: write) and named secrets (CLAUDE_CODE_OAUTH_TOKEN,ANTHROPIC_API_KEY,SUBMODULES_TOKEN,WORKFLOW_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. - Configure appropriate inputs (
setup-r,review-workflow-file, etc.).
Relationship to other skills
claude-review-workflow— Companion skill for the automated PR review workflow.upgrade-to-gha— Migration guidelines for upgrading standalone workflows toMorrison-Lab/gha.config-ai— Router for AI workflow capability requests.
04 同仓库更多 Skills
send-notes
Send content to Morrison-Lab notes repos.
★ 4
stack-prs
Stack dependent PR on another.
★ 4
finish-wave
Finish the current wave; start no new one.
★ 4
advisor
Read-only second opinion from a different model family.
★ 4
resolve-conflicts
Resolve merge conflicts.
★ 4
rec
Provide recommendations for choices.
★ 4