GitHub CLI Safe Skill
Purpose
Interact with GitHub through the gh CLI in non-interactive mode.
Scoped to PR/issue operations, workflow dispatch, and status checks.
Preconditions
ghCLI installed- Authenticated via
gh auth status - Repository context available (inside a git repo or
--repospecified)
Allowed operations
Read-only
gh pr list,gh pr view,gh pr checksgh issue list,gh issue viewgh run list,gh run viewgh api repos/<owner>/<repo>/...(GET)gh repo view
Controlled write
gh pr create,gh pr merge(with review)gh issue create,gh issue closegh workflow run(trigger dispatch)gh pr comment,gh issue commentgh release create(tagged release)
Disallowed operations
gh repo delete— destructivegh release delete— destructivegit push --forcevia gh — destructivegh auth login— bootstrap onlygh repo create— use through separate workflow
Output contract
- Use
--jsonflag for structured output where available - Prefer
gh apiwith-q(jq filter) for complex queries
Verification contract
# After PR creation:
gh pr view <number> --json state,url --jq '.state'
# Expected: "OPEN"
# After workflow dispatch:
gh run list --workflow <name> --limit 1 --json status --jq '.[0].status'
# Expected: "in_progress" or "completed"