GitHub CLI
Use this skill to turn GitHub platform requests into ordered gh command workflows, preserve repository and enterprise identity context, and return pull request, issue, workflow, repository, API, or package evidence with URLs for created resources.
When to invoke
- "Manage a pull request with GitHub CLI."
- "Create, list, or close GitHub issues."
- "Run or inspect a GitHub Actions workflow."
- "Clone, view, or create a GitHub repository."
- "Use gh api or GitHub App setup for repository automation."
Prerequisites and context
- GitHub CLI installed and authenticated.
- Appropriate repository permissions.
- For GitHub Enterprise Managed Users, user accounts are governed by the enterprise IdP. Use GitHub App or token credentials for Backstage technical integration even when Backstage sign-in uses Microsoft Entra ID.
Procedure
- Confirm GitHub CLI authentication and the target repository before repository, issue, pull request, workflow, or API operations.
- Choose the command group that matches the requested GitHub object.
- Use
--json for scripting and URLs for human follow-up where available.
- Capture operation results and links for any created or modified resource.
- Return the result using the output template.
Authentication
# Check auth status
gh auth status
# Login
gh auth login
Repository operations
# Clone repository
gh repo clone <owner/repo>
# View repository
gh repo view
# Create repository
gh repo create <name> --public --description "Description"
Pull request operations
# Create PR
gh pr create --title "Title" --body "Description"
# List PRs
gh pr list
# View PR
gh pr view <number>
# Merge PR
gh pr merge <number> --merge
Workflow operations
# List workflows
gh workflow list
# Run workflow
gh workflow run <workflow-name>
# View workflow run
gh run view <run-id>
# Watch workflow run
gh run watch <run-id>
Issue operations
# Create issue
gh issue create --title "Title" --body "Description"
# List issues
gh issue list
# Close issue
gh issue close <number>
Best practices
- Use gh api for advanced operations.
- Set default repository with gh repo set-default.
- Use --json flag for scripting.
- Authenticate with tokens for CI/CD.
Output template
Return exactly this structure:
**Status:** PASS | FAIL | BLOCKED
**Summary:** One sentence describing the repository, pull request, issue, workflow, API, or package outcome.
### Details
1. Command executed: `<gh command>`
2. Repository context: `<owner/repo or default repository>`
3. Operation result: `<created, updated, listed, viewed, merged, triggered, watched, or failed>`
4. Resource URLs: `<PR, issue, run, repository, package, or none>`
5. Next steps: `<review, watch run, merge, close issue, or none>`
### Validation
- Authentication check: `<gh auth status evidence or reason not checked>`
- Command result: `<exit code or observed gh output>`
Limits
- Do not use this skill for Azure DevOps integration.
- Use
open-horizons-engineer (agent) instead when the task is implementing GitHub platform integration, GitHub Apps, org discovery, GHAS, Actions CI/CD, or Packages configuration.
- Do not use this skill for Terraform execution.
- Use
terraform-cli (skill) instead when the task is Terraform init, plan, apply, validate, fmt, state, import, module development, provider locks, or tfvars.
- Do not use this skill for Kubernetes commands.
- Use
kubectl-cli (skill) instead when the task is direct Kubernetes resource inspection, logs, events, or manifest application.
- Do not use this skill for pipeline failure analysis.
- Use
pipeline-diagnostics (skill) instead when the task is diagnosing GitHub Actions job or step failures.
Progressive disclosure and bundled resources
scripts/setup-github-app.sh: use when the GitHub task requires GitHub App setup automation.
Related primitives
| Name |
Type |
Use it when |
open-horizons-deployment-operator |
agent |
Coordinating approved GitHub operations as part of platform deployment. |
open-horizons-engineer |
agent |
Configuring GitHub Apps, organization discovery, GHAS, Actions, or Packages. |
pipeline-diagnostics |
skill |
Diagnosing workflow run failures and CI/CD errors. |
validation-scripts |
skill |
Running repository validation scripts after GitHub operations. |
prerequisites |
skill |
Checking whether gh and related tooling are installed and authenticated. |
Quality gate
1---2name: github-cli3description: GitHub CLI operations use gh commands and GitHub API workflows for repositories, issues, pull requests, Actions, packages, repository discovery, GitHub App setup, and pull request automation. Use this skill when working with gh repo, gh pr, gh issue, gh workflow, gh run, gh api, Actions checks, or package operations.4---56<!-- Generated from harness/github-copilot/plugins/open-horizons-platform/skills/github-cli/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# GitHub CLI910Use this skill to turn GitHub platform requests into ordered `gh` command workflows, preserve repository and enterprise identity context, and return pull request, issue, workflow, repository, API, or package evidence with URLs for created resources.1112## When to invoke1314- "Manage a pull request with GitHub CLI."15- "Create, list, or close GitHub issues."16- "Run or inspect a GitHub Actions workflow."17- "Clone, view, or create a GitHub repository."18- "Use gh api or GitHub App setup for repository automation."1920## Prerequisites and context2122- GitHub CLI installed and authenticated.23- Appropriate repository permissions.24- For GitHub Enterprise Managed Users, user accounts are governed by the enterprise IdP. Use GitHub App or token credentials for Backstage technical integration even when Backstage sign-in uses Microsoft Entra ID.2526## Procedure27281. Confirm GitHub CLI authentication and the target repository before repository, issue, pull request, workflow, or API operations.292. Choose the command group that matches the requested GitHub object.303. Use `--json` for scripting and URLs for human follow-up where available.314. Capture operation results and links for any created or modified resource.325. Return the result using the output template.3334### Authentication3536```bash37# Check auth status38gh auth status3940# Login41gh auth login42```4344### Repository operations4546```bash47# Clone repository48gh repo clone <owner/repo>4950# View repository51gh repo view5253# Create repository54gh repo create <name> --public --description "Description"55```5657### Pull request operations5859```bash60# Create PR61gh pr create --title "Title" --body "Description"6263# List PRs64gh pr list6566# View PR67gh pr view <number>6869# Merge PR70gh pr merge <number> --merge71```7273### Workflow operations7475```bash76# List workflows77gh workflow list7879# Run workflow80gh workflow run <workflow-name>8182# View workflow run83gh run view <run-id>8485# Watch workflow run86gh run watch <run-id>87```8889### Issue operations9091```bash92# Create issue93gh issue create --title "Title" --body "Description"9495# List issues96gh issue list9798# Close issue99gh issue close <number>100```101102### Best practices1031041. Use gh api for advanced operations.1052. Set default repository with gh repo set-default.1063. Use --json flag for scripting.1074. Authenticate with tokens for CI/CD.108109## Output template110111Return exactly this structure:112113```markdown114**Status:** PASS | FAIL | BLOCKED115**Summary:** One sentence describing the repository, pull request, issue, workflow, API, or package outcome.116117### Details1181. Command executed: `<gh command>`1192. Repository context: `<owner/repo or default repository>`1203. Operation result: `<created, updated, listed, viewed, merged, triggered, watched, or failed>`1214. Resource URLs: `<PR, issue, run, repository, package, or none>`1225. Next steps: `<review, watch run, merge, close issue, or none>`123124### Validation125- Authentication check: `<gh auth status evidence or reason not checked>`126- Command result: `<exit code or observed gh output>`127```128129## Limits130131- Do not use this skill for Azure DevOps integration.132- Use `open-horizons-engineer` (`agent`) instead when the task is implementing GitHub platform integration, GitHub Apps, org discovery, GHAS, Actions CI/CD, or Packages configuration.133- Do not use this skill for Terraform execution.134- Use `terraform-cli` (`skill`) instead when the task is Terraform init, plan, apply, validate, fmt, state, import, module development, provider locks, or tfvars.135- Do not use this skill for Kubernetes commands.136- Use `kubectl-cli` (`skill`) instead when the task is direct Kubernetes resource inspection, logs, events, or manifest application.137- Do not use this skill for pipeline failure analysis.138- Use `pipeline-diagnostics` (`skill`) instead when the task is diagnosing GitHub Actions job or step failures.139140## Progressive disclosure and bundled resources141142- `scripts/setup-github-app.sh`: use when the GitHub task requires GitHub App setup automation.143144## Related primitives145146| Name | Type | Use it when |147| --- | --- | --- |148| `open-horizons-deployment-operator` | `agent` | Coordinating approved GitHub operations as part of platform deployment. |149| `open-horizons-engineer` | `agent` | Configuring GitHub Apps, organization discovery, GHAS, Actions, or Packages. |150| `pipeline-diagnostics` | `skill` | Diagnosing workflow run failures and CI/CD errors. |151| `validation-scripts` | `skill` | Running repository validation scripts after GitHub operations. |152| `prerequisites` | `skill` | Checking whether `gh` and related tooling are installed and authenticated. |153154## Quality gate155156- [ ] `name` is `github-cli` and matches the parent directory.157- [ ] The target repository context is clear before running repository-scoped commands.158- [ ] The response includes URLs for created pull requests, issues, workflow runs, or repositories when available.159- [ ] `gh auth status` is checked or the reason for skipping it is stated.160- [ ] `--json` usage is reported when command output is intended for scripting.161- [ ] The bundled script path listed above exists before referring to it.