/github-action:setupfrom github-action
Guides users through setting up the Claude Code GitHub Action for autonomous issue/PR handling via @claude mentions. Detects project ecosystem and writes workflow files.
Ships in github-action. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Set up the Claude Code GitHub Action so that @claude mentions on issues and PRs trigger autonomous Claude sessions. Claude reads the issue, implements changes on a branch, creates a PR, and responds to PR reviews — all without human intervention.
Before starting, verify:
git remote -v to confirm a GitHub remote exists..github/workflows/claude-issue.yml already exists. If it does, ask the user whether to overwrite or skip.The user must run a built-in Claude Code command to authenticate. Tell them:
Run
/install-github-appin your Claude Code CLI. Here's what to expect:
- Install the GitHub App — a browser window will open to install the Claude GitHub App on your repo. Follow the prompts.
- Select workflows — it will ask which workflows to install. Select any option (it doesn't matter which — we'll replace them with our own). You must select at least one to proceed.
- Authentication — choose "Use my Claude subscription" (unless you have a specific API key you'd rather use).
- Browser tab — it will open a browser tab to create a PR with template workflow files. Just close that tab — we'll generate our own opinionated workflows instead.
Let me know when you're done!
Wait for user confirmation before proceeding.
Scan the repo root for ecosystem indicators to determine the right dependency caching step:
| Indicator | Ecosystem |
|---|---|
uv.lock or pyproject.toml (no other lockfile) | Python + uv |
requirements.txt (no uv.lock) | Python + pip |
Cargo.toml | Rust |
package.json + package-lock.json | Node.js + npm |
package.json + bun.lock or bun.lockb | Node.js + bun |
Read the matching snippet from references/cache-steps.md. If no match or multiple ecosystems, leave the # CACHE_STEP comment as-is and tell the user to add caching later.
Create the destination directories (.github/workflows, .github/scripts, .github/prompts) then copy asset files directly using cp. For the two workflow files, after copying, replace the # CACHE_STEP comment with the detected snippet from the reference file (or leave it when no ecosystem matched). The other three files are copied as-is.
| Asset | Destination |
|---|---|
assets/claude-issue.yml | .github/workflows/claude-issue.yml |
assets/claude-pr.yml | .github/workflows/claude-pr.yml |
assets/update-comment.sh | .github/scripts/update-comment.sh |
assets/issue-prompt.md | .github/prompts/issue.md |
assets/pr-review-prompt.md | .github/prompts/pr-review.md |
The GitHub Action supports installing plugins from marketplaces. Detect the user's installed plugins and offer to include them in CI.
Read .claude/settings.json, .claude/settings.local.json and ~/.claude/settings.json looking for:
enabledPlugins — all enabled plugins (from any marketplace)extraKnownMarketplaces — all registered marketplacesShow the user which plugins and marketplaces were detected. Use AskUserQuestion to confirm which plugins to include in CI.
If the user selects no plugins, skip the rest of this step.
Replace the # PLUGINS comment in both workflow files with plugin_marketplaces and plugins inputs. Only include marketplaces that have at least one selected plugin. Marketplace references in settings may be shorthand (e.g. Crazytieguy/alignment-hive) — convert to full git URLs for the action. Example:
plugin_marketplaces: |
https://github.com/owner/repo.git
plugins: |
some-plugin@some-marketplace
For plugins that need secrets (e.g. remote-kernels needs RUNPOD_API_KEY), replace the # PLUGIN_ENV comment in both workflow files with the required env var lines:
RUNPOD_API_KEY: ${{ secrets.RUNPOD_API_KEY }}
For unknown plugins, ask the user if any environment variables are needed.
Then offer to set each secret via gh secret set, piping the value from the local environment (.env, .env.local, or shell). If that's not possible, explain how to set it manually in the repo's Settings → Secrets.
If no plugins need secrets, remove the # PLUGIN_ENV comment line from both workflow files.
Read .claude/settings.json and .claude/settings.local.json. Claude in the GitHub Action uses these for bash permissions, so check whether they contain Bash(...) allow rules for the project's build and test commands. Note the result for the summary — do not message the user yet.
List the files created (the Step 2 table) with a one-line purpose each.
If plugins were configured (from Step 3), list which plugins will be available in CI. Note which secrets were set and remind about any that still need to be added manually.
If Step 4 found no build/test permissions, include a warning:
Claude in the GitHub Action uses your project's
.claude/settings.jsonfor bash permissions. Without allow rules for your build/test commands, Claude can't run them autonomously.
Tell the user the following:
Next steps:
/install-github-app created a branch like add-claude-github-actions-*. Delete it from the GitHub UI or ignore it..github/prompts/issue.md and .github/prompts/pr-review.md control how Claude behaves autonomously. They're short and readable.main as defense in depth (Claude pushes to claude/issue-N branches, not main). Offer to help configure this — recommended rules: require pull request before merging (with at least 1 review), restrict direct pushes, restrict deletions, and block force pushes.@claude with a simple task.Using the integration:
@claude in an issue or PR comment to trigger a session. On Claude-authored PRs, submitting a review triggers it automatically.references/design-decisions.md — Explains why specific patterns were chosen (agent mode, wrapper script, permission model, etc.). Consult when the user asks "why" questions.references/cache-steps.md — YAML snippets for dependency caching per ecosystem.assets/claude-issue.yml (opens in a new tab)assets/claude-pr.yml (opens in a new tab)assets/issue-prompt.md (opens in a new tab)assets/pr-review-prompt.md (opens in a new tab)assets/update-comment.sh (opens in a new tab)references/cache-steps.md (opens in a new tab)references/design-decisions.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub crazytieguy/alignment-hive --plugin github-actionOther plugins' skills for the same job