Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:07:55 +08:00
commit e04084c903
11 changed files with 1597 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
# Close GitHub Issue with Verification
Properly close a GitHub issue with summary comment and verification.
## Instructions
1. **Identify the issue**:
- Ask: "Which issue number do you want to close?"
- Or search if user provides keywords: `gh issue list --search "keyword"`
2. **View the issue**:
```bash
gh issue view {number} --json title,body,labels,state,number,author,assignees
```
- Show issue details to user
- Confirm this is the correct issue to close
3. **Verify resolution**:
- Ask: "What was done to resolve this?"
- Ask: "Any follow-up tasks needed?"
- If follow-up: Suggest creating new issues with `/gh-create-issue`
4. **Add closing comment**:
```bash
gh issue comment {number} --body "Resolution summary here
-cc"
```
- **CRITICAL**: Always include "-cc" signature on its own line
- Include what was done, how it was tested, and any relevant details
5. **Close the issue**:
```bash
gh issue close {number}
```
6. **Verify closure**:
```bash
gh issue view {number} --json title,state,number
```
- Confirm status is "CLOSED"
- Show closing comment to user
## Important Reminders
- **NEVER** forget the "-cc" signature in comments
- **ALWAYS** add a closing comment before closing (documents resolution)
- **VERIFY** the issue is truly resolved before closing
- **CREATE** follow-up issues if needed before closing
## Definition of Done
- [ ] Correct issue identified and viewed
- [ ] Resolution verified with user
- [ ] Closing comment added with summary
- [ ] Comment includes "-cc" signature
- [ ] Issue status changed to CLOSED
- [ ] Closure verified with `gh issue view --json`
- [ ] Follow-up tasks created if needed
- [ ] User sees confirmation of closure

View File

@@ -0,0 +1,53 @@
# Create GitHub Issue with Guided Workflow
Help the user create a well-structured GitHub issue with proper priority and metadata.
## Instructions
1. **Gather information**:
- Ask: "What type of issue? (bug/feature/task/question)"
- Ask: "What's the title?" (should be descriptive and action-oriented)
- Ask: "Describe the issue or request"
- If bug: Ask for steps to reproduce, expected vs actual behavior
- If feature: Ask for acceptance criteria
2. **Assess priority**:
- Check if priority labels exist: `gh label list`
- If missing, create them (P1, P2, P3):
```bash
gh label create P1 --description "Critical priority - blocks core functionality" --color d73a4a
gh label create P2 --description "High priority - significant impact" --color fbca04
gh label create P3 --description "Normal priority - standard workflow" --color 0e8a16
```
- Ask: "What's the priority?" or suggest based on description:
- P1: Blocking, security, affects all users
- P2: Significant impact but has workaround
- P3: Normal workflow items
3. **Additional metadata**:
- Ask: "Any labels to add?" (bug, enhancement, documentation, etc.)
- Ask: "Assign to anyone?"
- Ask: "Link to milestone or project?"
4. **Create the issue**:
```bash
gh issue create \
--title "descriptive title" \
--body "detailed description" \
--label "P1,bug" \
--assignee "@user"
```
5. **Confirm creation**:
- Show the issue number and URL
- Verify priority label is applied
- Suggest next steps
## Definition of Done
- [ ] Issue created with descriptive title
- [ ] Issue body is complete and clear
- [ ] Priority label assigned (P1/P2/P3)
- [ ] Additional labels added as appropriate
- [ ] User sees issue number and URL
- [ ] User understands next steps

View File

@@ -0,0 +1,110 @@
# Generate GitHub Issues Status Report
Create a comprehensive report of current issue status across the repository.
## Instructions
1. **Gather data**:
```bash
# Get all open issues with details
gh issue list --state open --json number,title,labels,assignees,createdAt --limit 100
# Get recently closed issues
gh issue list --state closed --limit 10 --json number,title,closedAt
# Get repository name
gh repo view --json nameWithOwner
```
2. **Organize by priority**:
- Count issues by priority label:
- P1 issues (critical)
- P2 issues (high)
- P3 issues (normal)
- Unlabeled issues (need triage)
3. **Identify key metrics**:
- Total open issues
- Issues without assignees
- Oldest open issues (>30 days)
- Recent activity (closed this week)
4. **Generate report**:
Format as markdown with the following structure:
```markdown
# GitHub Issues Status Report
**Repository**: {repo-name}
**Generated**: {current-date}
## Summary
- **Total Open**: X issues
- **P1 (Critical)**: X issues
- **P2 (High)**: X issues
- **P3 (Normal)**: X issues
- **Needs Triage**: X issues (no priority label)
- **Unassigned**: X issues
## Critical Issues (P1)
- #42: Authentication fails for SSO users (assigned to @alice, opened 2 days ago)
- #38: Database connection timeout (unassigned, opened 5 days ago)
## High Priority Issues (P2)
- #45: Export feature slow for large datasets (assigned to @bob, opened 1 week ago)
- #41: Mobile UI alignment issues (unassigned, opened 3 days ago)
## Normal Priority Issues (P3)
{Count only, list if <5 issues}
## Needs Triage
- #47: Feature request for dark mode (no priority, opened today)
## Recently Closed
- #40: Fixed login redirect loop (closed today)
- #39: Updated documentation for API endpoints (closed yesterday)
## Aging Issues (>30 days old)
- #12: Performance optimization for dashboard (P2, opened 45 days ago)
## Action Items
- [ ] Review and address P1 issues immediately
- [ ] Triage X unlabeled issues
- [ ] Assign X unassigned P1/P2 issues
- [ ] Review aging issues for closure or priority adjustment
```
5. **Present to user**:
- Display the formatted report
- **Highlight urgent items** (P1 issues, unassigned critical items)
- Suggest immediate next actions
- Offer to drill down into specific sections if needed
## Report Customization Options
Ask the user if they want to customize the report:
- Include/exclude closed issues
- Filter by assignee
- Filter by label
- Adjust time window for "recent" activity
- Export to file vs display in terminal
## Definition of Done
- [ ] All data gathered from gh CLI
- [ ] Issues counted and organized by priority
- [ ] Key metrics calculated (unassigned, aging, etc.)
- [ ] Report formatted as clean markdown
- [ ] Priority breakdown included with issue lists
- [ ] Action items generated based on findings
- [ ] Report presented to user
- [ ] Urgent items highlighted
- [ ] User offered follow-up actions

108
commands/gh-triage.md Normal file
View File

@@ -0,0 +1,108 @@
# Triage Open Issues by Priority
Review open issues and ensure all have appropriate priority labels.
## Instructions
1. **Check for priority labels**:
```bash
gh label list
```
- If P1, P2, P3 labels don't exist, create them:
```bash
gh label create P1 --description "Critical priority - blocks core functionality" --color d73a4a
gh label create P2 --description "High priority - significant impact" --color fbca04
gh label create P3 --description "Normal priority - standard workflow" --color 0e8a16
```
2. **List all open issues**:
```bash
gh issue list --state open --limit 100
```
- Show count of total open issues
3. **Identify issues without priority labels**:
- Filter the list to find issues missing P1/P2/P3 labels
- Show these to the user for triage
4. **For each unlabeled issue**:
- Show issue details: `gh issue view {number} --json title,body,labels,state,number,author,assignees`
- Assess priority based on:
- **Impact scope**: How many users are affected?
- **Severity**: How broken is the functionality?
- **Urgency**: How time-sensitive is this?
- **Business criticality**: Does this block revenue or key workflows?
- Suggest priority level to user:
- **P1**: Blocking, security vulnerabilities, affects all users, data loss
- **P2**: Significant impact but has workaround, affects some users
- **P3**: Nice-to-have, minor bugs, feature requests
- Apply label after user confirms:
```bash
gh issue edit {number} --add-label "P2"
```
5. **Generate priority summary**:
```bash
gh issue list --label P1 --state open
gh issue list --label P2 --state open
gh issue list --label P3 --state open
```
6. **Report findings**:
- Show count by priority:
- P1 (Critical): X issues
- P2 (High): X issues
- P3 (Normal): X issues
- Unlabeled: X issues (should be 0 after triage)
- **Highlight P1 issues** that need immediate attention
- List any unassigned P1/P2 issues
- Suggest action items:
- Assign critical issues
- Create PRs for P1 items
- Schedule P2 items
- When presenting a list of issues, include links to the issues. Expect that the terminal app will make them clickable for the user.
## Priority Assessment Guidelines
### P1 - Critical Priority
- System is down or unusable
- Security vulnerabilities
- Data loss or corruption
- Blocks all users from core functionality
- Production outage
### P2 - High Priority
- Significant feature broken but workaround exists
- Performance degradation
- Affects subset of users
- Important feature request with clear business value
### P3 - Normal Priority
- Minor bugs with minimal impact
- UI/UX improvements
- Feature requests
- Technical debt
- Documentation updates
## Definition of Done
- [ ] Priority labels verified to exist (or created)
- [ ] All open issues listed and reviewed
- [ ] Every open issue has a priority label (P1/P2/P3)
- [ ] Priority distribution report generated
- [ ] P1 issues highlighted for immediate action
- [ ] Unassigned critical issues noted
- [ ] Action items suggested to user
- [ ] User understands priority breakdown