Token导航 LogoToken导航

Agent Skill · 开发

github-integration(GitHub 集成)

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

github-integration 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 14,522。

总安装 692周安装 28GitHub Stars 236下载 217核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-integration(GitHub 集成)
来源仓库:https://github.com/codervisor/lean-spec
仓库路径:skills/github-integration
安装命令:
npx skills add https://github.com/codervisor/lean-spec --skill github-integration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codervisor/lean-spec --skill github-integration

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

GitHub Integration 扩展 gh CLI 在云端 AI 代理环境中的协作能力。支持创建 PR、管理 Issue、发布版本及调用 GitHub API 等写操作。自动检测 Claude Code 或 Copilot 环境并注入必要认证配置步骤。涉及写入操作时需验证 token 权限范围和仓库访问边界条件。

github-integration 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/github-integration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/codervisor/lean-spec --skill github-integratio…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

github-integration 怎么安装?

在终端执行 npx skills add https://github.com/codervisor/lean-spec --skill github-integration。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

github-integration 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

github-integration 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

github-integration 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

github-integration 用的人多吗?

公开数据是累计安装 692 次,近一周安装 28 次,下载 217 次,GitHub 236 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

github-integration 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
github-integration

GitHub 集成 · 本页

692236接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

GitHub Integration

Enable gh CLI access in Claude Code cloud and GitHub Copilot coding agent environments so agents can create PRs, manage issues, and interact with GitHub APIs.

When to Use This Skill

Activate when:

  • User wants cloud AI agents to use gh (PRs, issues, releases, API calls)
  • User needs to install gh in Claude Code cloud sessions
  • User wants to add copilot-setup-steps.yml for GitHub Copilot agents
  • gh commands fail with auth or "not found" errors in a cloud session
  • User wants to enable GitHub integration for any cloud-based AI coding agent

Decision Tree

Which cloud environment?

Claude Code cloud (claude.ai/code)?
  → gh is NOT pre-installed in the default image
  → Install via setup script: apt update && apt install -y gh
  → Set GH_TOKEN as environment variable in environment settings
  → For repo-portable setup, use SessionStart hook instead
  → Use -R owner/repo flag with gh due to sandbox proxy

GitHub Copilot coding agent?
  → Add .github/copilot-setup-steps.yml to the repo
  → gh IS pre-installed; just configure GH_TOKEN
  → Commit and push — agent sessions pick it up automatically

gh commands failing?
  → "command not found" → gh not installed; add to setup script
  → HTTP 401 → GH_TOKEN not set; add to environment variables
  → HTTP 403 → Token lacks required scope; check permissions
  → "could not determine repo" → Use -R owner/repo flag
  → See references/cloud-auth.md for more

Need gh in local dev too?
  → Run: gh auth login (interactive, browser-based)
  → Or set GH_TOKEN env var for headless/CI use

Two Environments, Two Approaches

Claude Code Cloud (claude.ai/code)

Claude Code cloud runs sessions in Anthropic-managed VMs. The gh CLI is not pre-installed. You need two things:

  1. Setup script — installs gh when the session starts
  2. GH_TOKEN env var — authenticates gh with your GitHub PAT
Quick Start: Setup Script

In the Claude Code web UI: Environment Settings → Setup script:

#!/bin/bash
apt update && apt install -y gh

Then add GH_TOKEN as an environment variable with your GitHub Personal Access Token (needs repo scope).

Alternative: SessionStart Hook (repo-portable)

Add to .claude/settings.json in your repo:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if [ \"$CLAUDE_CODE_REMOTE\" = \"true\" ]; then apt update && apt install -y gh; fi",
            "timeout": 120
          }
        ]
      }
    ]
  }
}

The CLAUDE_CODE_REMOTE check ensures it only runs in cloud sessions.

Important: The -R Flag

Due to the sandbox proxy, gh may not auto-detect the repo. Use the -R owner/repo flag:

gh pr create -R codervisor/myrepo --title "..." --body "..."
gh issue list -R codervisor/myrepo

GitHub Copilot Coding Agent

Copilot coding agents use .github/copilot-setup-steps.yml. The gh CLI is pre-installed; you just need to authenticate it.

Add this file at .github/copilot-setup-steps.yml:

name: "Copilot Setup Steps"

on: repository_dispatch

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Authenticate gh CLI
        run: gh auth status
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

See templates/copilot-setup-steps.yml for a full template with dependency installation.

Setup Scripts vs SessionStart Hooks vs copilot-setup-steps

Setup scriptsSessionStart hookscopilot-setup-steps.yml
PlatformClaude Code cloud onlyClaude Code (local + cloud)GitHub Copilot agents only
Configured inEnvironment settings UI.claude/settings.json in repo.github/copilot-setup-steps.yml
RunsBefore Claude launchesAfter Claude launchesBefore Copilot agent launches
Runs on resumeNo (new sessions only)Yes (every session)Yes
NetworkNeeds registry accessNeeds registry accessFull GitHub Actions network

Common gh Commands for Agents

# PRs (use -R in Claude Code cloud)
gh pr create -R owner/repo --title "..." --body "..."
gh pr list -R owner/repo
gh pr view -R owner/repo
gh pr merge -R owner/repo --squash --delete-branch

# Issues
gh issue list -R owner/repo
gh issue view 42 -R owner/repo
gh issue create -R owner/repo --title "..." --body "..."

# API (for anything not covered by subcommands)
gh api repos/owner/repo/actions/runs

Pitfalls

SymptomCauseFix
gh: command not foundNot installed (Claude Code cloud)Add apt install -y gh to setup script
HTTP 401 / auth errorGH_TOKEN not setAdd to environment variables in settings UI
HTTP 403 on pushToken lacks repo scopeRegenerate PAT with repo scope
could not determine repoSandbox proxy hides git remoteUse -R owner/repo flag
gh pr create failsNo upstream branchPush with git push -u origin <branch> first
Setup script failsNo network accessSet network to "Limited" (default) or "Full"

References

  • references/cloud-auth.md — Token auth, scopes, proxy details, troubleshooting
  • references/copilot-setup-steps.md — Full guide to customizing the Copilot setup workflow

Setup & Activation

npx skills add codervisor/forge@github-integration -g -y

Auto-activates when: user mentions "gh in cloud", "github integration", "setup script", "copilot setup steps", or gh auth failures in cloud environments.

平台分布

Codex

36.5%
按下载量换算79

Claude

31.12%
按下载量换算68

Cursor

20.3%
按下载量换算44

Gemini CLI

9.45%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills