# AGENTS.md instructions for GitHub CLI for pull requests, issues, and repository automation

Use GitHub CLI for pull requests, issues, and repository automation only for: A highly agent-ready CLI for GitHub workflows with JSON output, scoped auth, and clear approval boundaries.

## Default behavior

- Prefer non-interactive commands and stable output formats: json.
- Start with read-only inspection commands before changing state.
- Show the exact command before destructive or deployment actions.
- Require explicit user approval for commands marked `requires-review` or `destructive`.

## Useful commands

- safe: `gh repo view owner/repo --json name,description,stargazerCount,defaultBranchRef` — Read-only repository context for agents.
- safe: `gh pr list --state open --json number,title,author,url,reviewDecision,mergeStateStatus,updatedAt` — Useful for triage, release checks, and review summaries.
- safe: `gh pr view 123 --json number,title,files,commits,reviews,statusCheckRollup,url` — Reads review and CI context before the agent summarizes risk.
- requires-review: `gh pr merge 123 --squash` — Changes repository state and must require human approval.

## Safety notes

- Treat repo view, issue list, pr list, and pr view as the default safe command set.
- Require approval before merge, close, delete, edit, release, or workflow-run commands.
- Prefer scoped or read-only tokens for agent sessions and always request JSON output where supported.