code-gh

Routes GitHub CLI and GraphQL API tasks to detailed command and schema references.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/nseng-ai/ns --skill code-gh-nseng-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-gh
Source: https://github.com/nseng-ai/ns/tree/main/skills/internal/code/code-gh
Command: npx skills add https://github.com/nseng-ai/ns --skill code-gh-nseng-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with the GitHub CLI (gh) and GitHub's REST/GraphQL APIs requires knowing hundreds of commands, flags, rate limits, and schema details. This Skill acts as a router that loads the right reference for the task at hand, so answers are grounded in accurate documentation instead of guesswork. ## Core Features & Use Cases - Task-based routing: Directs standard work (PRs, issues, repos, releases, auth, scripting) to the gh command reference, and advanced work (Projects V2, Discussions, batch queries, edit history) to the GraphQL references. - API backend awareness: Includes a per-command audit of which backend (REST vs GraphQL) each gh command uses, plus rate-limit guidance (REST 5,000 req/hr, GraphQL 5,000 points/hr, Search 30 req/min). - GraphQL schema lookup: Provides core type definitions (PullRequest, Issue, ProjectV2, Discussion) for constructing exact queries and mutations. - Use Case: When asked to recover a mangled PR description, the Skill routes to the GraphQL reference covering the userContentEdits connection, which has no REST or porcelain equivalent. ## Quick Start Ask the agent to list open PRs with failing checks or to update a Projects V2 field, and it will load the matching reference before running gh commands.

Frequently Asked Questions about code-gh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between gh porcelain commands and the GraphQL API?

Use porcelain commands like gh pr and gh issue for standard tasks. Switch to gh api graphql only when porcelain cannot express the task, such as Projects V2, Discussions, batch multi-repo queries, or reading body edit history via userContentEdits.

What are the GitHub API rate limits for gh commands?

REST allows 5,000 requests per hour, GraphQL allows 5,000 points per hour based on query complexity, and Search allows 30 requests per minute. Check current status with gh api rate_limit --jq '.resources'.

Which gh commands use GraphQL versus REST internally?

gh pr, gh issue, gh project, and gh org use GraphQL, while gh run, gh workflow, gh gist, gh secret, and gh search use REST. Some families like gh repo, gh release, and gh label mix both backends depending on the subcommand.

Can I recover a previous version of a PR description?

Yes, but only through GraphQL. The userContentEdits connection on PullRequest returns revision history with editor and timestamp, where each diff field contains the full body text of that revision, ordered newest first.

Does this Skill work with Graphite-managed branches?

Yes, but with a constraint: in Graphite-backed repos you must not use generic git push or gh pr create to publish tracked branches. Use ns flow gt submit or gt submit --no-interactive so Graphite metadata stays synchronized.