# AGENTS.md instructions for PR、Issue、リポジトリ自動化のための GitHub CLI

Use PR、Issue、リポジトリ自動化のための GitHub CLI only for: 安定した JSON 出力と成熟した認証を備えた、Agent に適した GitHub CLI。

## 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.