| name | managing-lifecycle |
| description | GitHub Issue CRUD and state management. TRIGGERS - create issue, close issue, update issue, bulk process issues. |
Issue Lifecycle Operations
Capability: Complete CRUD operations for GitHub Issues and PRs
When to use: Creating, reading, updating, deleting, commenting on issues/PRs
Create Operations
Create Issue
gh issue create --title "Bug: Login fails" --body "Steps to reproduce..."
gh issue create \
--title "Feature: Add dark mode" \
--body "User requested dark mode support" \
--label feature,ui \
--assignee username
gh issue create --title "API Documentation" --body-file doc.md
gh issue create
Create with Template
gh issue create \
--repo terrylica/claude-code-skills-github-issues \
--title "Claude Code: Using Plan Mode" \
--label claude-code,tips,how-to \
--body-file tip.md
Read Operations
View Issue
gh issue view 123 --web
gh issue view 123
gh issue view 123 --json title,body,state,labels,assignees,createdAt
List Issues
gh issue list
gh issue list --assignee @me
gh issue list --label bug --state open
gh issue list --limit 50
Update Operations
Modify Issue
gh issue edit 123 --title "New title"
gh issue edit 123 --body "Updated description"
gh issue edit 123 --add-label priority:high,bug
gh issue edit 123 --remove-label wontfix
gh issue edit 123 --add-assignee username
State Management
gh issue close 123
gh issue close 123 --comment "Fixed in commit abc123"
gh issue reopen 123
gh issue close 123 --reason completed
gh issue close 123 --reason "not planned"
Comment Operations
gh issue comment 123 --body "Thanks for reporting this!"
gh issue comment 123 --body-file response.md
gh api repos/owner/repo/issues/comments/COMMENT_ID \
--method PATCH \
--field body="Updated comment"
Delete Operations
gh issue delete 123
gh issue delete 123 --yes
Batch Operations
Close Multiple Issues
gh issue list --label wontfix --json number --jq '.[].number' | \
xargs -I {} gh issue close {} --reason "not planned"
gh search issues "is:open created:<2024-01-01" --json number --jq '.[].number' | \
xargs -I {} gh issue close {}
Bulk Label Updates
for issue in 101 102 103; do
gh issue edit $issue --add-label priority:high
done
Common Workflows
Knowledge Base Entry Workflow
gh issue create --title "Tip: Git worktrees" --body-file tip.md
gh issue edit 1 --add-label git,tips,how-to
gh issue view 1
Issue Triage Workflow
gh issue list --label needs-triage
gh issue edit 123 --add-label bug --remove-label needs-triage
gh issue edit 123 --add-assignee dev-team
JSON Output Fields (21 available)
Core: number, title, body, state, url
Metadata: labels, assignees, milestone, projectCards
Timestamps: createdAt, updatedAt, closedAt
Engagement: comments, reactions
Users: author, participants
Full list: gh issue view --help
Best Practices
- Prefer closing over deleting - Maintains audit trail
- Use labels for organization - Better than comments
- Atomic updates - One change per command for clarity
- JSON for automation - Script with
--json and --jq
- Batch carefully - Test on single issue first
Empirical Testing: 200+ test cases covering all CRUD operations
Full Operational Guide: AI_AGENT_OPERATIONAL_GUIDE.md