agentleFS
MorningStar0709MorningStar0709/trae-agent-enhancements/skills/gh-cli/SKILL.md

gh-cli

Skill17 starsChanged 7 months agoMITView on GitHub

Operate GitHub repositories, pull requests, issues, and releases via the `gh` CLI. Use when the user asks to push, create PR, manage issues, edit repo metadata, view repo, or any GitHub workflow operation, including Chinese requests such as “推送”“提 PR”“创建 issue”“改仓库描述”“查看仓库信息”.

  • Commits and pushes

35 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use glab-cli, mermaid-visualizer and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • DataKnifeAISkill

    glab-cli

    Uses the GitLab CLI (`glab`) for merge requests, issues, CI/CD, releases, and GitLab API access from the terminal. Apply when the remote is GitLab (GitLab.com or self-managed) or when the user mentions MRs, pipelines, or GitLab projects.

    Also in 3 projects that use this

  • BCS1037Skill

    mermaid-visualizer

    Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, create flowcharts, or make diagrams from text. Supports process flows, system architectures, comparisons, mindmaps, and more with built-in syntax error prevention.

    Also in 3 projects that use this

  • lsyamsiarSkill

    devops-engineer

    Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates. Handles deployment automation, GitOps configuration, incident response runbooks, and internal developer platform tooling. Use when setting up CI/CD pipelines, containerizing applications, managing infrastructure as code, deploying to Kubernetes clusters, configuring cloud platforms, automating releases, or responding to production incidents. Invoke for pipelines, Docker, Kubernetes, GitOps, Terraform, GitHub Actions, on-call, or platform engineering.

    Also in 3 projects that use this

  • jaydubya818Skill

    observability-and-instrumentation

    Add or review logs, metrics, traces, and actionable alerts.

    Also in 3 projects that use this

  • VercelSkill

    agent-browser

    Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

    Also in 5 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use gh CLI for GitHub operations.

    line 8
  2. Distinctive:

    Create / list / view / close issues or pull requests

    line 13
  3. Distinctive:

    Search across repos for issues, PRs, code, or users

    line 15
  4. Distinctive:

    No specific repo: Use git remote from cwd. If no remote found, ask user.

    line 36
  5. Very specific:

    Ambiguous intent: Run gh <command> --help to clarify options.

    line 38
  6. Very specific:

    Use structured output: Always prefer --json + --jq over parsing human-readable text.

    line 47
  7. Distinctive:

    Execute and validate: Run the command. If it fails, interpret the error and retry with adjusted parameters.

    line 50
  8. Very specific:

    Run with --json and no field list to see available fields first.

    line 57
  9. Very specific:

    When typed commands don't expose the data you need.

    line 76
  10. Very specific:

    When not sure about flags or available fields, run gh <command> --help before searching elsewhere.

    line 82
  11. Distinctive:

    API rate limited: Wait and retry, or inform user if limit is exceeded.

    line 105
  12. Distinctive:

    When using this skill, include in your response:

    line 112
  13. Distinctive:

    If failed, the exact error and suggested next step

    line 115

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gh CLI

Use gh CLI for GitHub operations.

Use This Skill

  • Push, commit, or any git remote operation needing GitHub interaction
  • Create / list / view / close issues or pull requests
  • Edit repository metadata (description, topics, homepage)
  • Search across repos for issues, PRs, code, or users
  • View repository details or authentication status
  • "推送" / "提 PR" / "创建 issue" / "改仓库描述" / "查看仓库信息"

Do Not Use

  • Operations that do not involve GitHub (local git, other forges)
  • Raw git operations that do not need GitHub API interaction
  • Managing Agent Skills (use gh skill subcommand, not this skill)

Input Contract

Required Inputs:

  • A GitHub operation intent (create PR, list issues, edit repo, etc.)

Optional Inputs:

  • Target repo (owner/repo) — if omitted, inferred from cwd's git remotes
  • Issue or PR number
  • Flags specific to the operation

Missing input handling:

  • No specific repo: Use git remote from cwd. If no remote found, ask user.
  • No PR/issue number for view: List recent items first, then ask which one.
  • Ambiguous intent: Run gh <command> --help to clarify options.

Execution Protocol

  1. Verify authentication: gh auth status. If unauthenticated, report and stop.
  2. Choose the right command path:
    • Typed commands (gh pr, gh issue, gh repo) for standard operations.
    • gh search for cross-repo queries.
    • gh api for anything typed commands do not expose.
  3. Use structured output: Always prefer --json + --jq over parsing human-readable text.
  4. Handle pagination: Pass -L N to control result count. For totalCount, use gh api graphql.
  5. Target repo: Override with --repo OWNER/REPO (-R) when not operating on cwd's repo.
  6. Execute and validate: Run the command. If it fails, interpret the error and retry with adjusted parameters.

Core Patterns

Structured output

  • --json field1,field2,... for structured JSON.
  • Run with --json and no field list to see available fields first.
  • --jq '<expr>' for filtering inline, no separate jq pipe.
  • --template '<go-template>' for shaped text output.

Pagination

List commands cap results. Default is usually 30. Pass -L N (--limit N) to control count. gh issue list / gh pr list do not expose totalCount via --json. For a true total, use gh api graphql. For raw API pagination: gh api --paginate <path> + --jq + optionally --slurp.

Repo targeting

gh infers repo from cwd's git remotes. Override with --repo OWNER/REPO (-R).

Search vs list

  • gh search issues|prs|code|repos|commits|users — cross-repo, full search syntax. Prefer for cross-repo or author/label filtering.
  • gh issue list --search "..." / gh pr list --search "..." — same syntax but scoped to one repo.

Fall back to gh api

When typed commands don't expose the data you need. {owner}/{repo} placeholders auto-filled from repo remotes.

Interactivity

In non-TTY contexts gh already skips the pager, strips ANSI, and errors with clear messages instead of prompting.

When not sure about flags or available fields, run gh <command> --help before searching elsewhere.

Common Operations

gh repo edit <owner/repo> — edit metadata. Flags: --description, --homepage, --add-topic, --remove-topic, --default-branch. gh repo view <owner/repo> — view details.

gh pr create — create. Flags: --title, --body, --draft, --base. gh pr list — list. Flags: --state open/closed/merged, --author, --assignee, --draft, -L. gh pr view <number> — view details. --comments for issue-level comments. gh pr diff <number> — read diff without switching branches. gh pr checkout <number> — switch to PR branch locally.

gh issue create — create. Flags: --title, --body, --label, --assignee. gh issue list — list. Flags: --state, --label, --author, --assignee, -L, --search. gh issue view <number> — view details. gh issue close <number> — close. gh issue reopen <number> — reopen.

Failure Handling

  • Not authenticated: gh auth status fails. Report to user and ask them to run gh auth login.
  • 404 / not found: Repo or resource does not exist. Verify owner/repo spelling and user's access.
  • API rate limited: Wait and retry, or inform user if limit is exceeded.
  • Command not found: gh not installed. Ask user to install GitHub CLI.
  • Network error: Report the exact error. Do not guess the output.
  • Ambiguous result from no field list: Re-run with explicit fields.

Output Contract

When using this skill, include in your response:

  • What command was executed (or attempted)
  • The structured result (key fields, not raw JSON dump)
  • If failed, the exact error and suggested next step

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.