Github Issue Workflow
Overview
Use gh to discover and inspect issues, then follow the repository's required issue-development flow.
Prefer deterministic commands and keep work aligned to branch and PR policy.
Scan And Inspect Issues
- List open issues:
gh issue list --state open --limit 200
- View one issue:
gh issue view <issue-number> --json number,title,body,state,labels,assignees,url
- View one issue with discussion:
gh issue view <issue-number> --comments
If gh is unavailable, ask the user to install/authenticate gh, then retry the same command.
Command Playbook
Run these in order for a new issue implementation.
- Sync
mainfirst:git checkout maingit pull --ff-only origin main
- Inspect and confirm target issue:
gh issue view <issue-number> --json number,title,body,state,labels,assignees,urlgh issue view <issue-number> --comments
- Create issue branch before edits:
git checkout -b issue-<issue-number>-<short-slug>
- Implement changes and run tests:
uv run --extra dev pytest -q
- Commit and push branch:
git add -Agit commit -m "<focused-change-message>"git push -u origin issue-<issue-number>-<short-slug>
- Open draft PR to
mainwith auto-close reference:gh pr create --base main --head issue-<issue-number>-<short-slug> --draft --title "<pr-title>" --body "fix #<issue-number>"
Start New Issue Checklist
- Confirm clean context:
- Check current branch and status with
git status -sb.
- Check current branch and status with
- Scan open issues:
- Run
gh issue list --state open --limit 200.
- Run
- Load issue details:
- Run both
gh issue view <n> --json ...andgh issue view <n> --comments.
- Run both
- Update
mainbefore branch work:- Run
git checkout mainandgit pull --ff-only origin main.
- Run
- Create issue branch before any edits:
- Use
git checkout -b issue-<n>-<slug>.
- Use
- Start implementation and open draft PR early:
- Push and create draft PR as soon as meaningful implementation starts.
Resume Existing Issue Checklist
- Verify issue branch exists and switch to it:
git checkout issue-<issue-number>-<short-slug>
- Refresh issue/PR context:
gh issue view <issue-number> --commentsgh pr status
- Sync from
mainif needed (merge/rebase per repo preference). - Continue implementation on issue branch only.
- Run tests before push:
uv run --extra dev pytest -q
- Push updates and keep PR draft until ready:
git push- Mark PR ready only after tests/review items are complete.
Policy Guardrails
- Do not implement issue work directly on
main. - Do not switch tools if a workflow command fails due to sandbox restrictions; rerun with proper escalation.
- Keep commits focused and descriptive.
- Avoid destructive git commands unless explicitly requested.
- Include issue-closing reference in PR description (for example
fix #123). - If sandbox/network blocks required update commands, request elevated execution and retry.
Reference
See references/agents-github-issue-workflow.md for the extracted source policy text from this repository's AGENTS.md.