跳到正文
Skillpedia
部署与云(DevOps)16k · #10892

github-gitlab

它能做什么

让助手使用你已连接的账户检查代码仓库,并进行小型编辑。适合在 GitHub 或 GitLab 上工作的开发者。

适用场景

  • ✓当你要求助手检查某个代码仓库中问题或拉取请求的状态时。
  • ✓当你希望在托管项目中进行一个小型代码修改时。
  • ✓当你需要助手审查分支历史或找出哪些内容发生了变化时。

技能链接

https://github.com/yc-software/qm/blob/main/skills-seed/github-gitlab/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/yc-software/qm/blob/main/skills-seed/github-gitlab/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请查看我们仓库中待处理的拉取请求,并告诉我哪些正在等待审阅。”

每周 5 个新技能,1 分钟读完。

工作原理

助手会使用 GitHub 或 GitLab 的命令行工具,并使用你已授权的账户。如果在修改之前不清楚应使用哪个账户,它会询问你。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

GitHub / GitLab

Use this skill when the user asks to inspect repos, issues, pull requests, merge requests, code history, branches, or to make a small code change in a hosted repo.

Choose the account deliberately

Use the current credential manifest to choose an account authorized for this conversation that fits the user's intent. Run commands with execute and an explicit sandbox_id; keep that ID throughout checkout, edits, checks, and push. Personal and shared accounts are both valid choices; neither is an automatic fallback when the other fails. If the intended account is unclear before a write, ask. Do not infer permission from a login merely being present on the computer.

  • Personal login: use the authorized gh, glab, or Git login. Check the active provider account (for example, gh api user --jq .login) and the Git transport's auth configuration; a CLI API identity alone does not prove which account Git will use.
  • Shared org credential: if listed in the prompt, select its slug and use the core-hosted smart HTTP remote in the use-shared-credential skill. This uses the configured shared account, even when a personal OAuth connector is live. Its name is an admin label, not a verified upstream username.
  • Connected app: use only advertised capabilities. API access does not by itself establish native Git transport access or configure the CLI's active login.

For an existing checkout, inspect the remote and applicable credential-helper, SSH, proxy, and HTTP-header configuration. A reused checkout may still select a previous account. Commit author metadata is separate from transport identity. Resolve an unknown identity before a write; do not probe access by pushing.

Logging in

Use the native login only after an explicit authentication rejection. A TLS timeout, connection reset, rate limit, or GitHub server error is not evidence of logout or permission expiry. Do not consume another credential grant to repair transport.

For a confirmed missing or expired GitHub or GitLab login, follow the interactive-login skill: it runs gh auth login / glab auth login in a temporary home as a background job, relays the code and URL, and saves the login to the keychain so later commands use it through execute.credentials.

Read-only work

Check auth and inspect repo state:

gh auth status
gh repo view OWNER/REPO --json name,description,url,defaultBranchRef
gh issue list --repo OWNER/REPO --state open --limit 20
gh pr list --repo OWNER/REPO --state open --limit 20

For GitLab:

glab auth status
glab repo view GROUP/PROJECT
glab issue list --repo GROUP/PROJECT
glab mr list --repo GROUP/PROJECT

Use git log, git show, and git diff for codebase-change summaries. Cite commit hashes, PR/MR numbers, and links.

Checkout and edits

Clone or fetch only the repo the user asked for:

gh repo clone OWNER/REPO repo
cd repo
git checkout -b codex/small-change

Keep changes scoped. Run the repo's tests. If a push or PR/MR creation is requested, prepare the branch and summary first.

Writes require approval

Pushing branches, creating PRs/MRs, merging, closing issues, editing labels, changing repo settings, releases, or workflows are writes. Ask for approval before running the write command.

After approval:

git push -u origin codex/small-change
gh pr create --repo OWNER/REPO --title "..." --body-file pr.md

For GitLab:

git push -u origin codex/small-change
glab mr create --repo GROUP/PROJECT --title "..." --description-file mr.md

Report the final URL and leave enough context for review.

Wait for GitHub CI

Use the bundled helper instead of a bare gh pr checks --watch or a handwritten shell loop. Use the absolute directory reported by the skill read in place of <skill dir>. It is one blocking watcher process, not repeated agent turns:

node "<skill dir>/scripts/watch-ci.mjs" --repo OWNER/REPO --pr NUMBER --head REVIEWED_HEAD_SHA

Capture the full head SHA from gh pr view NUMBER --repo OWNER/REPO --json headRefOid before review. Use that same SHA for the watcher and the final merge gate. Start the watcher with execute using the selected sandbox_id and background:true, then subscribe with background action watch and its returned process_id. Keep one watcher per PR. Set the process lifetime longer than the helper's 30-minute deadline; use --timeout-ms for a different bounded deadline. Us

常见问题

助手使用哪个账户?

它会选择已为你的对话授权、且符合你请求的账户。如果在修改之前不清楚应使用哪个账户,它会询问你。

它能使用我没有选择的账户吗?

不能。它不会仅仅因为电脑上存在某个登录信息就使用它。如果在写入之前不清楚应使用哪个账户,它会询问。

如果某个账户失败怎么办?

它不会自动切换到其他账户。由你决定下一步使用哪个账户。

详情

作者的原始描述

Work with GitHub and GitLab repositories through resident gh/glab/git auth on the agent computer.

repo: yc-software/qm

热度

GitHub 星标
16k
排名
#10892
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能