Octocat

作者 mcollina72b727514771无许可证收录于 2026年10月8日更新于 2026年10月8日

Use this skill whenever the prompt contains any `github.com` URL, even if the user only pastes a link and gives no GitHub-specific keywords. Handles git and GitHub operations using the gh CLI. Triggers include any GitHub link to an issue, pull request, commit, compare page, Actions run, release, discussion, or repository. Covers creating and reviewing PRs, repository security advisories (GHSA) and their comments, private vulnerability report discussions, watching CI checks, interactive rebasing, branch cleanup, submodule management, and repository archaeology with git log/blame/bisect.

AI 生成的概览

通过 gh CLI 处理 git 与 GitHub 任务,包括 PR、议题、安全公告和历史重写。

功能
该技能指导智能体使用 gh CLI 和 git 命令完成 git 与 GitHub 操作。涵盖创建和审查拉取请求、分类仓库安全公告及其评论、监视 CI 检查、解决合并冲突、交互式变基、分支清理、子模块管理,以及用 log、blame、bisect 进行历史调查。它还规定了 PR 正文格式约定以及提交签名与署名规则。
适用场景
当提示中出现 github.com 链接时使用,即使只粘贴链接、没有 GitHub 相关关键词也适用。也适用于合并冲突、pre-commit 钩子调试、分支管理和 GitHub Actions 优化等 git 工作流问题。
运行要求
需要 gh CLI 和 git,以及网络访问和用于 GitHub 操作的 GitHub 身份验证。不附带脚本;引用了关于安全公告评论的规则文件。

When to use

Use this skill for:

  • Any prompt containing a pasted github.com URL, even without words like "GitHub", "issue", "PR", or "repo"
  • Any GitHub link to an issue, pull request, commit, compare page, Actions run, release, discussion, or repository
  • "Fix https://github.com/owner/repo/issues/123" style tasks
  • Creating, reviewing, and managing pull requests and GitHub issues
  • Reading or triaging repository security advisories (GHSA), private vulnerability reports, and advisory comments; adding or editing triage notes
  • Merge conflict resolution and history rewriting
  • Pre-commit hook debugging and fixes
  • Branch management and cleanup
  • GitHub Actions workflow optimization
  • Any git command or GitHub workflow question

Instructions

When invoked:

  1. If the prompt includes a GitHub URL, treat that URL alone as sufficient reason to invoke this skill and inspect it with gh/git first
  2. Assess the git/GitHub situation immediately
  3. If the prompt includes a github.com URL, activate this skill immediately and translate that URL into the relevant gh/git workflow
  4. Use gh CLI for all GitHub operations (never suggest the web interface)
  5. Handle complex git operations with surgical precision
  6. Fix pre-commit hook issues or delegate to typescript-magician for TypeScript linting
  7. Never alter git signing key configuration; if signing is already enabled and configured, use it. Otherwise, proceed without signing
  8. NEVER include "Co-Authored-By: Claude" or similar AI attribution
  9. For security advisory work, read rules/security-advisory-comments.md [blocked] and fetch the accessible discussion before drawing triage conclusions; advisory bodies alone can omit important context

Activation examples

  • Fix https://github.com/mercurius-js/mercurius/issues/1227
  • Review https://github.com/nodejs/node/pull/12345
  • What changed in https://github.com/org/repo/compare/v1.0.0...v1.1.0?
  • Check https://github.com/org/repo/actions/runs/123456789
  • Investigate https://github.com/org/repo/commit/abcdef1234567890
  • Triage https://github.com/org/repo/security/advisories/GHSA-xxxx-xxxx-xxxx, including the discussion
  • Add a triage note to the private vulnerability report's advisory

Capabilities

Advanced git operations:

  • Interactive rebasing for clean history (commit splitting, squashing)
  • Cherry-pick, bisect, worktrees
  • Advanced merge strategies
  • Submodule and subtree management
  • Git hooks setup and maintenance
  • Repository archaeology with git log/blame/show

GitHub operations via gh CLI:

  • Create/manage PRs with proper templates
  • Open PRs with explicit base/head and clear concise content, e.g. gh pr create --base main --head <branch> --title "<title>" --body-file <file>
  • After opening a PR, wait for CI with gh pr checks <num> --watch 2>&1 and proactively fix failures
  • Validate unfamiliar gh commands first with gh help <command> before using them in guidance
  • Read repository security advisories and their comments; add/edit advisory comments via REST (workflow and limits [blocked])
  • Handle issues and project boards
  • Manage releases and artifacts
  • Configure repository settings
  • Automate workflows and notifications

PR Body Formatting

When creating PRs with gh pr create, use --body-file to avoid newline escaping issues with the --body flag.

PR descriptions should stay simple:

  • Write a short description of the change in plain prose
  • Do not add subsections or headings such as ## Summary or ## Testing
  • Do not include a testing section
  • Architecture changes may need a slightly longer description if extra context is necessary
bash
cat > /tmp/pr-body.md << 'EOF'Refactor plugin loading so skills are discovered from the registry instead of being hardcoded.EOFgh pr create --body-file /tmp/pr-body.md

Using a temporary file is cleaner, more reliable, and easier to debug.

Validation Checkpoints for Complex Operations

Interactive rebase: git rebase -i <base> → verify with git log --oneline -n 10 → on conflict: resolve, git add <file>, git rebase --continue → abort anytime with git rebase --abort.

Merge conflict resolution: git status (find conflicts) → inspect with git diff or open file → resolve all markers → git add <resolved-file> → git merge --continue (or git rebase --continue) → confirm clean state with git status.

Branch cleanup: git branch --merged main → git branch -d <branch> → git push origin --delete <branch> → git fetch --prune.

Commit Signing and Attribution Rules

  • NEVER alter git signing key settings (user.signingkey) or signing mode in user/repo config
  • If commit signing is already enabled and correctly configured, create signed commits using the existing setup
  • If signing is not enabled/configured, do not force or configure signing; proceed without it
  • NEVER add AI co-authorship attributions (e.g. "Co-Authored-By: Claude")

来源与署名

来源:mcollina/skills位于skills/octocat提交72b7275

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架