agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/github-cli/SKILL.md

github-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform GitHub operations on GitHub using the gh CLI. Use for issues, pull requests, pipelines, repositories, and project management. ALSO use this skill when asked to review a GitHub PR — when a GitHub PR URL or PR ID is provided, use gh to fetch and review the diff instead of the code-review skill.

  • Installs packages

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Use the instance and rules below when constructing all gh commands.

    line 8
  2. Distinctive:

    If not already authenticated, inform the user that authentication is required and ask them to complete the following steps manually.

    line 16
  3. Distinctive:

    Run the following command to authenticate with GitHub:

    line 24
  4. Very specific:

    Always pass --repo <owner>/<repo> explicitly for any gh subcommand that accepts it (e.g., pr list, issue list, run list) — without it, the …

    line 36
  5. Very specific:

    When using gh api, use the path relative to https://api.github.com — e.g., gh api repos/<owner>/<repo>/pulls.

    line 37
  6. Distinctive:

    NEVER target any GitHub Enterprise instance unless the user explicitly provides the hostname and confirms it is correct.

    line 40

“Common” is measured: kept by at least 6 in 10 of the 19 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

GitHub CLI Skill

Use the instance and rules below when constructing all gh commands.

Instance

All gh CLI and git operations use host: github.com

Prerequisites (one-time setup by user)

If not already authenticated, inform the user that authentication is required and ask them to complete the following steps manually. Do not perform these steps yourself.

  1. Install the gh CLI if not already installed:
brew install gh
  1. Run the following command to authenticate with GitHub:
gh auth login

PR Code Review

When asked to review a GitHub PR (URL or PR ID provided), extract the <owner/repo> and <PR_ID> from the URL (ask the user if the repo is missing), then use gh api to fetch the PR metadata (repos/<owner>/<repo>/pulls/<PR_ID>) and its diff (repos/<owner>/<repo>/pulls/<PR_ID>/files --paginate). To fully understand the context and impact of all code changes, read the complete source branch codebase — the diff alone does not capture the surrounding logic, dependencies, or broader design that the changes interact with. Report the PR title, author, and branches, then review all changed files for: secrets/injection/XSS (security), inefficient algorithms/memory leaks (performance), code smells/dead code (quality), missing error handling, excessive or sensitive logging, and missing/outdated documentation. For each finding, include the file path, line number(s), the problematic snippet, and a suggested fix. If nothing is wrong, summarize what was reviewed and state it looks good.

Rules

  • Always pass --repo <owner>/<repo> explicitly for any gh subcommand that accepts it (e.g., pr list, issue list, run list) — without it, the command infers the repo from the current git directory, which may silently return wrong results.
  • When using gh api, use the path relative to https://api.github.com — e.g., gh api repos/<owner>/<repo>/pulls.
  • All gh api calls that return lists are paginated (default 30/page). Always pass --paginate to fetch all pages: gh api --paginate "repos/<owner>/<repo>/pulls".
  • For gh pr list, prefer explicit state flags: use --state closed for closed, --state merged for merged, or --state all for all states. Omitting --state returns open PRs by default.
  • NEVER target any GitHub Enterprise instance unless the user explicitly provides the hostname and confirms it is correct. If a URL references an unfamiliar hostname, stop and ask the user to confirm.

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.