diff --git a/docs/issue-triage.md b/docs/issue-triage.md index 6b0bc266..de6ac38f 100644 --- a/docs/issue-triage.md +++ b/docs/issue-triage.md @@ -4,7 +4,7 @@ **Automatically triage issues when they are created or reopened** -The [Issue Triage workflow](../workflows/issue-triage.md?plain=1) runs when issues are created or reopened to analyze content, check related items, categorize, add labels, and post triage comments. +The [Issue Triage workflow](../workflows/issue-triage.md?plain=1) runs when issues are created or reopened to analyze content, check related items, set issue type, add labels, detect duplicates, and post structured triage reports. ## Installation @@ -22,11 +22,11 @@ This walks you through adding the workflow to your repository. ```mermaid graph LR - A[Issue Created/Reopened] --> B[Analyze Content] - B --> C[Check Related Items] - C --> D[Categorize Issue] - D --> E[Add Labels] - E --> F[Post Triage Comment] + A[Issue Created/Reopened] --> B[Gather Context] + B --> C[Spam & Quality Check] + C --> D[Triage: Type, Labels] + D --> E[Detect Duplicates] + E --> F[Post Triage Report] ``` The workflow may search for relevant documentation, error messages, or similar issues online to assist with triage. @@ -41,8 +41,8 @@ This workflow requires no configuration and works out of the box. You can custom After editing run `gh aw compile` to update the workflow and commit all changes to the default branch. -### Human in the Loop +### Human in the loop -- Review triage comments for accuracy -- Validate label assignments and priority assessments +- Review triage reports for accuracy +- Validate label, type, and field assignments - Override or adjust triage decisions when needed diff --git a/workflows/issue-triage.md b/workflows/issue-triage.md index 28c96ce9..94667744 100644 --- a/workflows/issue-triage.md +++ b/workflows/issue-triage.md @@ -1,10 +1,10 @@ --- description: | Intelligent issue triage assistant that processes new and reopened issues. - Analyzes issue content, selects appropriate labels, detects spam, gathers context - from similar issues, and provides analysis notes including debugging strategies, - reproduction steps, and resource links. Helps maintainers quickly understand and - prioritize incoming issues. + Analyzes issue content, detects spam and incomplete reports, selects appropriate + labels, sets issue type, detects duplicates, and provides structured + triage reports with debugging strategies and resource links. Helps maintainers + quickly understand and prioritize incoming issues. on: issues: @@ -23,11 +23,17 @@ safe-outputs: add-labels: max: 5 add-comment: + set-issue-type: + max: 1 + close-issue: + target: "triggering" + state-reason: "not_planned" + max: 1 tools: web-fetch: github: - toolsets: [issues] + toolsets: [issues, labels] min-integrity: none # This workflow is allowed to examine and comment on any issues timeout-minutes: 10 @@ -37,54 +43,108 @@ timeout-minutes: 10 -You're a triage assistant for GitHub issues. Your task is to analyze issue #${{ github.event.issue.number }} and perform some initial triage tasks related to that issue. +You are a triage assistant for GitHub issues. Your task is to analyze issue #${{ github.event.issue.number }}, categorize it with the right metadata, and help maintainers act quickly. Your triage comments are written for maintainers reviewing the triage, not for the issue author. -1. Select appropriate labels for the issue from the provided list. +Do not make assumptions beyond what the issue content supports. Do not invent missing context. -2. Retrieve the issue content using the `get_issue` tool. If the issue is obviously spam, or generated by bot, or something else that is not an actual issue to be worked on, then add an issue comment to the issue with a one-sentence analysis and exit the workflow. +## Step 1: Gather context -3. Next, use the GitHub tools to gather additional context about the issue: +1. Retrieve the issue content using the `get_issue` tool. +2. Fetch any comments on the issue using the `get_issue_comments` tool. +3. Fetch the list of labels available in this repository using the `list_label` tool. +4. Search for similar issues using the `search_issues` tool. - - Fetch the list of labels available in this repository. Use 'gh label list' bash command to fetch the labels. This will give you the labels you can use for triaging issues. - - Fetch any comments on the issue using the `get_issue_comments` tool - - Find similar issues if needed using the `search_issues` tool - - List the issues to see other open issues in the repository using the `list_issues` tool +## Step 2: Spam and quality check -4. Analyze the issue content, considering: +**Spam and invalid issues:** If the issue is obviously spam, bot-generated, gibberish, or a test issue: +- Apply the `invalid` or `spam` label if one exists in the repository. +- Close the issue as "not planned" with a one-sentence reason (e.g., "Closing as spam."). No triage report, no assessment table. +- Do not apply any other metadata. **Stop here; do not continue to Steps 3 or 4.** - - The issue title and description - - The type of issue (bug report, feature request, question, etc.) - - Technical areas mentioned - - Severity or priority indicators - - User impact - - Components affected +**Incomplete issues:** If the issue lacks enough detail for meaningful triage, add a comment that politely asks the author to provide the missing information: +- For bugs: steps to reproduce, expected vs actual behavior, logs/errors, environment details. +- For other issue types: equivalent details that would make the report actionable. +- Apply a `needs-info` or `question` label if one exists in the repository. -5. Write notes, ideas, nudges, resource links, debugging strategies and/or reproduction steps for the team to consider relevant to the issue. +Be specific about what is missing and why it is needed. Do not attempt to apply type or other labels to incomplete issues. -6. Select appropriate labels from the available labels list provided above: +If the issue has sufficient detail, proceed to Step 3. - - Choose labels that accurately reflect the issue's nature - - Be specific but comprehensive - - Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority) - - Consider platform labels (android, ios) if applicable - - Search for similar issues, and if you find similar issues consider using a "duplicate" label if appropriate. Only do so if the issue is a duplicate of another OPEN issue. - - Only select labels from the provided list above - - It's okay to not add any labels if none are clearly applicable +## Step 3: Triage -7. Apply the selected labels: +### 3a: Set issue type - - Use the `update_issue` tool to apply the labels to the issue - - DO NOT communicate directly with users - - If no labels are clearly applicable, do not apply any labels +- If the issue already has a type set, do not change it. +- Otherwise, determine the single best issue type (e.g., Bug, Feature, Task). +- If no type is clearly supported by the issue content, leave it unset and note what is missing. -8. If very confident, add an issue comment to the issue with your analysis: - - Start with "🎯 Agentic Issue Triage" - - Provide a brief summary of the issue - - Mention any relevant details that might help the team understand the issue better - - Include any debugging strategies or reproduction steps if applicable - - Suggest resources or links that might be helpful for resolving the issue or learning skills related to the issue or the particular area of the codebase affected by it - - Mention any nudges or ideas that could help the team in addressing the issue - - If you have possible reproduction steps, include them in the comment - - If you have any debugging strategies, include them in the comment - - If appropriate break the issue down to sub-tasks and write a checklist of things to do. - - Use collapsed-by-default sections in the GitHub markdown to keep the comment tidy. Collapse all sections except the short main summary at the top. +### 3b: Select labels + +- Be cautious with labels; they can trigger automation in many repositories. +- Choose labels that accurately reflect the issue's nature from the repository's available labels. +- Select priority labels if you can determine urgency (high-priority, med-priority, low-priority). +- Consider platform labels (android, ios) if applicable. +- Do not apply labels that do not exist in the repository. +- If no labels are clearly applicable, do not apply any. +- It is better to under-label than to speculatively add labels. + +### 3c: Detect duplicates and related issues + +- Review the similar issues found in Step 1. +- Classify matches as: + - **Duplicate** (high confidence): the issue describes the same problem as an existing open issue. Include up to 3. + - **Related**: similar domain or adjacent problem, but not a duplicate. Include up to 3. +- If a high-confidence duplicate is found and the repository has a `duplicate` label, apply it. +- If no similar issues are found, state that explicitly in your report. + +### 3e: Assess coding agent suitability + +Assess whether the issue is suitable for automated coding agent assignment: +- **Suitable**: clear requirements, sufficient context, well-defined success criteria, self-contained scope. +- **Needs more info**: potentially suitable but missing details needed to start. +- **Not suitable**: requires investigation, design decisions, extensive coordination, or policy/architectural choices. + +### 3f: Additional analysis + +- Write notes, debugging strategies, and/or reproduction steps relevant to the issue. +- Search the web for relevant documentation, error messages, or known solutions if applicable. +- Suggest resources or links that might help resolve the issue. +- If appropriate, break the issue down into sub-tasks with a checklist. + +## Step 4: Apply results + +Apply all triage results: +- Use `set_issue_type` to set the issue type (if determined). +- Use `update_issue` to apply labels. +- Use `close_issue` to close the issue if it is spam (state reason: "not planned"). +- Add an issue comment with your triage report using the format below. + +## Comment format + +Use this structure for the triage comment. Use collapsed sections to keep it tidy. + +```markdown +## 🎯 Triage report + +{2-3 sentence summary to help a maintainer quickly grasp the issue.} + +### 📊 Assessment + +| Dimension | Value | Reasoning | +|---|---|---| +| **Type** | [value or "unchanged"] | [brief] | +| **Labels** | [values or "none"] | [brief] | +| **Coding agent** | [Suitable / Needs more info / Not suitable] | [brief] | + +### 🔗 Similar issues + +- issue-url (duplicate/related) — [brief explanation] + +
💡 Notes and suggestions + +{Debugging strategies, reproduction steps, resource links, sub-task checklists, nudges for the team.} + +
+``` + +If no similar issues were found, omit the "Similar issues" section. If there are no notes to add, omit the collapsed section.