Agent skill
github
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/github
SKILL.md
GitHub API and CLI
Overview
Managing GitHub at scale requires moving beyond the web UI to the gh CLI and the REST API. This skill focuses on high-efficiency operations like bulk querying with pagination and managing API quotas.
When to Use
- Bulk Operations: Fetching all issues or PRs across a large repository.
- CI/CD Automation: Creating issues or comments programmatically.
- Compliance/Auditing: Checking rate limits or repository permissions.
Decision Tree
- Is it a standard task (e.g., creating a PR, checking issue status)?
- YES: Use
ghCLI commands.
- YES: Use
- Do you need custom data fields or specific API endpoints?
- YES: Use
gh apiwith--jq.
- YES: Use
- Are there more than 100 results?
- YES: Use
--paginateand--slurp.
- YES: Use
Workflows
1. Bulk Querying with Pagination
- Construct a
gh apicall to a list endpoint (e.g.,repos/{owner}/{repo}/issues). - Add the
--paginateflag to ensure all pages are fetched. - Use
--slurpto group results and--jqto filter for specific fields like.[] | {title, user: .user.login}.
2. Automated Issue Creation
- Run
gh auth loginto establish credentials. - Define the issue payload using
-f title="Bug Report"and-f body=@issue_template.md. - Execute the POST request to
repos/{owner}/{repo}/issuesusing theghCLI.
3. Handling API Rate Limits
- Query the rate limit status using
gh api rate_limit. - Inspect the
X-RateLimit-Resetheader in response objects to determine when the quota refreshes. - Implement exponential backoff in scripts when a 403 Forbidden (rate limited) status is encountered.
Non-Obvious Insights
- Magic Type Conversion: In the
ghCLI, the-F/--fieldflag automatically converts literals liketrue,false,null, and integers to their JSON types. - User-Agent Requirement: All direct REST API requests MUST include a valid
User-Agentheader, or GitHub will reject them. - Path Placeholders: Using
{owner},{repo}, and{branch}ingh apiarguments automatically pulls values from the local repository context.
Evidence
- "In --paginate mode, all pages of results will sequentially be requested until there are no more pages..." - gh CLI Docs
- "All API requests must include a valid User-Agent header... Requests with no User-Agent header will be rejected." - GitHub Docs
- "Placeholder values {owner}, {repo}, and {branch} in the endpoint argument will get replaced with values from the repository..." - gh CLI Docs
Scripts
scripts/github_tool.py: Python wrapper for rate limit checking and pagination.scripts/github_tool.js: Node.js script using theghCLI for bulk querying.
Dependencies
gh(GitHub CLI)jq(Recommended for processing JSON outputs)
References
- references/README.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?