github-cli
使用 gh CLI 获取 GitHub 上下文
在没有完整上下文的情况下处理 GitHub 问题和 PR 会导致误解和信息遗漏。本技能教导 AI 主动使用 GitHub CLI 命令来检索 PR 描述、审查评论、CI 状态、问题讨论和仓库信息。
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "github-cli". Show me the context for PR #456 about the new authentication feature
Resultado esperado:
- Pull request #456 opened by @sarahchen
- Status: Open, all checks passed (3/3)
- Description: Adds OAuth2 authentication flow with Google and GitHub providers
- Reviews: 2 approvals, 1 change request
- Key comments: Security review flagged token handling, now fixed
- Files changed: 12 files, +432/-89 lines
A utilizar "github-cli". What is the discussion around issue #89 about the login bug
Resultado esperado:
- Issue #89 opened by @mikejohnson
- Priority: High, labels: bug, security
- Assignees: @devteam
- Comments: 7 total
- Key context: Users unable to login with SSO, workaround available
- Related PR: #92 merged to fix this
Auditoria de Segurança
SeguroPure documentation skill containing only markdown guidance on using GitHub CLI commands. No executable code, no file operations, no network calls. Static findings are all false positives caused by markdown syntax being misidentified as shell command execution patterns.
Fatores de risco
🌐 Acesso à rede (3)
⚙️ Comandos externos (28)
Pontuação de qualidade
O Que Você Pode Construir
在完整上下文中审查 PR
在深入代码变更之前,获取 PR 描述、内联评论、审查讨论和 CI 状态。
理解问题讨论
在回复或调试之前,查看带有所有评论、标签和受理人的完整问题线程。
检查 CI/CD 管道状态
查询工作流运行、检查运行状态,并在不打开浏览器的情况下验证 CI 检查。
Tente Estes Prompts
使用 gh pr view、gh pr diff 和 gh pr checks 来收集有关所提及的拉取请求的完整上下文。
使用 gh issue view 和 gh api 来检索此 GitHub 问题的所有评论和讨论。
从该 URL 中提取所有者、仓库和编号,然后使用 gh 命令收集相关上下文。
首先使用 git log 获取提交,然后使用 gh 命令检索 PR 讨论和 CI 状态。
Melhores Práticas
- 在回复 GitHub 相关查询之前,始终使用 gh 命令收集上下文
- 将本地 git 命令与 GitHub CLI 结合使用以获得完整信息
- 当需要结构化数据以便解析时,使用 --json 标志
Evitar
- 仅依赖本地 git,而忽略可用的 GitHub 上下文(评论、审查)
- 在 gh 命令可以检索信息时打开浏览器
- 在建议代码更改之前遗漏 CI 状态检查