AI agent skills for GitHub operations and Git workflow best practices.
This repository contains three complementary skills for AI agents working with Git and GitHub:
- gh-cli - Comprehensive GitHub CLI (
gh) reference covering all major GitHub operations - git-commit-push - Git init, commit & push workflow guidelines ensuring proper repository setup, safe atomic commits with user approval
- code-review - Structured code review framework covering quality, security, performance, and testing standards
Comprehensive GitHub CLI (gh) reference skill for AI agents.
Description: Complete documentation and reference for GitHub CLI (gh), enabling AI agents to work seamlessly with GitHub from the command line. Covers repositories, issues, pull requests, Actions, projects, releases, gists, codespaces, organizations, and extensions.
Key Features:
- Modular Design: SKILL.md serves as a navigation hub (189 lines), with detailed content in 13 modular reference documents
- Progressive Disclosure: Load only the documentation you need, reducing context window usage by 92%
- Complete Command Reference: All
ghcommands with examples and options - Best Practices: Critical warnings and workflows for common pitfalls
Structure:
- SKILL.md: Navigation hub with modular document links (189 lines)
- references/: 13 modular reference documents covering all
ghcommands - See full file tree
Features:
- Authentication Guide (auth.md)
- Repository Management (repo.md)
- Issue Tracking (issues.md)
- Pull Request Workflow (prs.md)
⚠️ Critical warnings inside - PR Reviews Extension (pr-reviews.md) - Inline code review, review threads, gh-pr-review extension
- GitHub Actions (actions.md)
- Project Boards (projects.md)
- Releases & Packages (releases.md)
- Codespaces (codespaces.md)
- Search (search.md)
- Organization Tools (advanced.md)
- Extensions & API Access (advanced.md)
Git init, commit & push workflow guidelines ensuring proper repository initialization and safe, user-approved commits.
Description: 规范化Git初始化仓库、提交与推送流程,确保遵循.gitignore配置、用户审核、原子提交、精准文件选择等核心原则。基于实际错误案例总结的最佳实践。
Core Principles:
- User Approval Required - Never execute
git commitorgit pushwithout explicit user consent. Each operation requires separate approval. - Atomic Commits - One logical change per commit. Complete a feature, then ask to commit.
- Completeness - Ensure code compiles/runs before committing. Don't commit half-finished work or debug code. Submit related files together to avoid omissions.
- Timeliness - Commit after completing small features. Don't accumulate large changes before committing.
- Precise File Selection - Never use
git add -Aorgit add .. Always specify exact files to commit. - Temporary File Management - Use
<workspace_dir>/temp/directory for temporary files; never commit them accidentally. - Structured Commit Messages - Follow conventional commit format; use temp files for multi-line messages.
- Clean Branch History - Use
git rebase(not merge) when updating feature branch with master. Keep PR history linear. Force push requires user approval.
Key Guidelines:
# ✅ CORRECT: Specify files explicitly git add src/file1.ts src/file2.ts # ❌ WRONG: Adds all files including temporaries git add -A && git commit -m "..." # ✅ CORRECT: Check before committing git status git diff --cached # ✅ CORRECT: Multi-line commit messages via file git commit --file=<workspace_dir>/temp/git-commit-msg.txt # ✅ CORRECT: Update feature branch with rebase (clean history) git checkout master && git pull origin master git checkout feature/your-branch && git rebase master # ✅ CORRECT: Push only after user approval # Ask user before any push operation
结构化代码审查框架,覆盖代码质量、安全性、性能和测试标准。
Description: 提供 8 步代码审查方法论,适用于 PR 审查和本地代码审查。涵盖架构评估、命名规范、SOLID 原则、安全审计、性能分析、测试审查、文档审查等维度,附带完整的审查检查清单和常见反模式识别。
Key Features:
- 8 步审查流程:理解上下文 → 高层审视 → 详细审查 → 安全审查 → 性能审查 → 测试审查 → 文档审查 → 提供反馈
- 完整检查清单:功能正确性、代码质量、安全性、性能、测试、文档 6 大类
- 反模式识别:上帝类、魔法数字、深层嵌套等常见问题
- 安全漏洞示例:SQL 注入、XSS、硬编码密钥的修正方案
- CI/CD 集成:支持平台 CI 状态检查,也支持本地运行测试
- 工具推荐:各语言 Linter、安全扫描工具、代码质量平台
审查流程概览:
| 步骤 | 内容 |
|---|---|
| 第 1 步 | 理解上下文(PR 描述、改动范围、CI/本地测试) |
| 第 2 步 | 高层审视(架构设计、代码组织) |
| 第 3 步 | 详细审查(命名、函数、类/SOLID、错误处理、代码质量) |
| 第 4 步 | 安全审查(输入校验、认证授权、数据保护、依赖检查) |
| 第 5 步 | 性能审查(算法、数据库、缓存、资源管理) |
| 第 6 步 | 测试审查(覆盖率、测试质量、命名规范) |
| 第 7 步 | 文档审查(注释、函数文档、README) |
| 第 8 步 | 提供反馈(建设性、具体、分级:🔴严重/🟡重要/🟢锦上添花) |
skills/
├── gh-cli/ # GitHub CLI reference skill
│ ├── SKILL.md # Navigation hub
│ └── references/ # 13 modular reference documents
│ ├── auth.md
│ ├── repo.md
│ ├── issues.md
│ ├── prs.md # Pull request workflows ⚠️ Critical warnings
│ ├── pr-reviews.md # PR Reviews extension - Inline code review
│ ├── actions.md
│ ├── projects.md
│ ├── releases.md
│ ├── gists.md
│ ├── codespaces.md
│ ├── search.md
│ ├── advanced.md
│ └── config.md
├── git-commit-push/ # Git workflow guidelines skill
│ └── SKILL.md # Commit/push best practices
└── code-review/ # Code review framework skill
└── SKILL.md # 8-step review methodology
Install skills using your agent's skill manager:
# Install specific skills npx skills add https://github.com/WhizZest/agent-git-skills --skill gh-cli npx skills add https://github.com/WhizZest/agent-git-skills --skill git-commit-push npx skills add https://github.com/WhizZest/agent-git-skills --skill code-review # Or install all skills at once npx skills add https://github.com/WhizZest/agent-git-skills # Or manually copy the skill directories to your agent's skills directory # Or use symbolic links to keep them in sync with the repo # (Both methods require cloning this repository first)
# macOS brew install gh # Linux curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt update sudo apt install gh # Windows winget install --id GitHub.cli # Verify installation gh --version
Git must be installed and configured with user identity:
git config --global user.name "Your Name" git config --global user.email "[email protected]"
gh auth login gh auth status
gh repo create my-project --public --description "My awesome project"
gh repo clone owner/repo
gh repo view --webgh issue list gh issue create --title "Bug report" --body-file workspace_dir/temp/issue-body.md gh pr list gh pr create --title "Fix bug" --body-file workspace_dir/temp/pr-body.md
The git-commit-push skill should be invoked automatically when an AI agent needs to commit or push changes. It enforces:
- Ask user before committing - Show which files will be committed
- Get approval on commit message - Let user review the message content
- Specify files explicitly - Never use
git add -A - Use temp directory - Keep temporary files out of commits
NEVER use --body parameter! Command-line argument parsing fails with special characters, especially backticks (`) used in code blocks.
# ✅ CORRECT, workspace_dir is the workspace root (top-level directory containing all repositories). Exception: if workspace itself is a repository root, use that directory. gh pr create --title "Feature" --body-file workspace_dir/temp/description.md # ❌ WRONG - backticks cause escaping issues gh pr create --title "Feature" --body "Use \`code()\` function..."
NEVER view PR comments directly in terminal! Terminal output may be truncated, causing loss of important information.
# ✅ CORRECT workflow, workspace_dir is the workspace root (top-level directory containing all repositories). Exception: if workspace itself is a repository root, use that directory. gh pr view 123 --comments > workspace_dir/temp/pr-123.md cat workspace_dir/temp/pr-123.md # ❌ WRONG (may lose data) gh pr view 123 --comments
See prs.md for more details.
# Check your open PRs gh pr list --author @me # Check recent issues assigned to you gh issue list --assignee @me # View notifications gh api notifications # Create a release gh release create v1.0.0 --title "Version 1.0.0" --notes "Release notes"
# List projects gh project list # Add item to project gh project item-add 123 --url https://github.com/org/repo/issues/456 # Update item status gh project item-edit --id ITEM_ID --status-field-id FIELD_ID --single-select-option-id OPTION_ID
These two skills are designed to complement each other:
| Scenario | Skill Used | Purpose |
|---|---|---|
| Clone/create repos | gh-cli | Repository operations |
| Manage issues & PRs | gh-cli | GitHub issue/PR workflow |
| Run CI/CD actions | gh-cli | GitHub Actions management |
| Commit local changes | git-commit-push | Safe, approved commits |
| Push to remote | git-commit-push | User-approved push |
| Code review | gh-cli | PR review and comments |
| Release management | gh-cli | Version releases |
- github-cli
- gh
- git
- ai-agent
- skill
- cli-reference
- automation
- workflow
- commit-guidelines
- gh-cli skill: Based on GitHub CLI version 2.85.0 (January 2026)
- git-commit-push skill: Best practices from real-world error cases
Contributions are welcome! Please feel free to submit issues and pull requests.
This repository is provided as-is for use with AI agents. Refer to respective tool documentation for licensing details.