agentleFS
sordi-aisordi-ai/skill-everything/skills/github-cli/SKILL.md

github-cli

Skill20 starsChanged 7 months agoMITView on GitHub

Apply when using the gh CLI to manage pull requests, issues, releases, or CI workflows on GitHub.

  • Reads credentials
  • Commits and pushes

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use playwright-cli.

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.
  • MicrosoftSkill

    playwright-cli

    Automate browser interactions, test web pages and work with Playwright tests.

    Also in 3 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, 0 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

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

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

    Check auth scope before scripting: Before running gh in CI or scripts, always verify the required scopes are granted with gh auth status.

    line 25
  2. Very specific:

    Use token env var in CI: Always pass GH_TOKEN (or GITHUB_TOKEN) via environment variable in CI pipelines.

    line 26
  3. Very specific:

    Include all required labels on PR creation: Always pass --label for every gate-required label when running gh pr create.

    line 30
  4. Very specific:

    Set reviewer on creation: Always use --reviewer <handle> when creating PRs that require CODEOWNERS approval.

    line 31
  5. Very specific:

    Open as draft when work is incomplete: Use gh pr create --draft for PRs not yet ready for review.

    line 32
  6. Very specific:

    Link issues explicitly: Always include --body "Closes #<issue>" or --body "Fixes #<issue>" so GitHub auto-closes the linked issue on merge.

    line 33
  7. Very specific:

    Assign and label on creation: Use gh issue create --assignee @me --label <label> rather than creating bare issues and editing them in a …

    line 37
  8. Very specific:

    Use JSON output for scripting: Prefer gh issue list --json number,title,labels over parsing human-readable output.

    line 38
  9. Very specific:

    Trigger runs explicitly when needed: Use gh workflow run <workflow.yml> --ref <branch> to trigger a workflow rather than pushing an empty …

    line 42
  10. Very specific:

    Watch run status in scripts: After triggering a workflow, use gh run watch <run-id> or poll gh run view <run-id> --json conclusion rather …

    line 43
  11. Very specific:

    Create releases from tags, not branches: Always run gh release create <tag> --generate-notes after pushing the tag.

    line 47
  12. Very specific:

    Use gh api for endpoints not covered by subcommands: Prefer gh api repos/{owner}/{repo}/pulls --jq '.[].number' over raw curl with manual …

    line 48
  13. Very specific:

    Define aliases for repeated commands: Use gh alias set to capture long flag combinations used more than twice in a project.

    line 49

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

Sub-Skill: GitHub CLI (gh) Conventions

Purpose: Consistent, auditable use of the gh CLI for PRs, issues, releases, and CI — preventing gate bypasses and silent failures.


Rules

Authentication & Scopes

  1. Check auth scope before scripting. Before running gh in CI or scripts, always verify the required scopes are granted with gh auth status; missing scopes produce silent 404s rather than auth errors.
  2. Use token env var in CI. Always pass GH_TOKEN (or GITHUB_TOKEN) via environment variable in CI pipelines; never hard-code tokens or use gh auth login --with-token interactively in automated contexts.

Pull Requests

  1. Include all required labels on PR creation. Always pass --label for every gate-required label when running gh pr create; omitting a label silently bypasses automated approval gates. Reference: ERR-2026-023
  2. Set reviewer on creation. Always use --reviewer <handle> when creating PRs that require CODEOWNERS approval; adding reviewers after creation delays the review clock.
  3. Open as draft when work is incomplete. Use gh pr create --draft for PRs not yet ready for review; never open a ready-for-review PR on a branch with failing CI.
  4. Link issues explicitly. Always include --body "Closes #<issue>" or --body "Fixes #<issue>" so GitHub auto-closes the linked issue on merge; never rely on branch name alone for issue linkage.

Issues

  1. Assign and label on creation. Use gh issue create --assignee @me --label <label> rather than creating bare issues and editing them in a second step; unassigned, unlabelled issues fall out of triage queues.
  2. Use JSON output for scripting. Prefer gh issue list --json number,title,labels over parsing human-readable output; the --json flag is stable across gh versions, plain text is not.

CI / Workflows

  1. Trigger runs explicitly when needed. Use gh workflow run <workflow.yml> --ref <branch> to trigger a workflow rather than pushing an empty commit; empty commits pollute history.
  2. Watch run status in scripts. After triggering a workflow, use gh run watch <run-id> or poll gh run view <run-id> --json conclusion rather than sleeping for a fixed duration.

Releases & API

  1. Create releases from tags, not branches. Always run gh release create <tag> --generate-notes after pushing the tag; never target a branch directly, as branch-based releases produce non-reproducible artifacts.
  2. Use gh api for endpoints not covered by subcommands. Prefer gh api repos/{owner}/{repo}/pulls --jq '.[].number' over raw curl with manual auth headers; gh api inherits the active auth context automatically.
  3. Define aliases for repeated commands. Use gh alias set to capture long flag combinations used more than twice in a project; aliases are stored in ~/.config/gh/config.yml and are portable across machines via dotfiles.

See also

  • skills/git-conventions/SKILL.md
  • skills/error-log/SKILL.md

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.