From 740c4be9e4b82a72f87399919e778d00454f764b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:19:01 +0000 Subject: [PATCH 1/4] Initial plan From 925f6e174ffc1533effd8e1f89a32397f478c2ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:21:33 +0000 Subject: [PATCH 2/4] docs: add Issue Duplicator documentation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --- README.md | 1 + docs/issue-duplicator.md | 52 +++++++++++++++++++++++++ workflows/issue-duplication-detector.md | 1 + 3 files changed, 54 insertions(+) create mode 100644 docs/issue-duplicator.md create mode 100644 workflows/issue-duplication-detector.md diff --git a/README.md b/README.md index 7e045bf..b6c5243 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ A sample family of reusable [GitHub Agentic Workflows](https://githubnext.github ### Depth Triage & Analysis Workflows - [🏷️ Issue Triage](docs/issue-triage.md) - Triage issues and pull requests +- [🔁 Issue Duplicator](docs/issue-duplicator.md) - Detect and comment on duplicate issues automatically - [🏥 CI Doctor](docs/ci-doctor.md) - Monitor CI workflows and investigate failures automatically - [🔍 Repo Ask](docs/repo-ask.md) - Intelligent research assistant for repository questions and analysis - [🔍 Daily Accessibility Review](docs/daily-accessibility-review.md) - Review application accessibility by automatically running and using the application diff --git a/docs/issue-duplicator.md b/docs/issue-duplicator.md new file mode 100644 index 0000000..8b27783 --- /dev/null +++ b/docs/issue-duplicator.md @@ -0,0 +1,52 @@ +1. # 🔁 Issue Duplicator +2. +3. > For an overview of all available workflows, see the [main README](../README.md). +4. +5. The [Issue Duplication Detector workflow](../.github/workflows/issue-duplication-detector.md?plain=1) automatically scans for newly created or recently updated issues every 5 minutes and flags likely duplicates with a helpful comment. +6. +7. ## Installation +8. +9. ```bash +10. # Install the 'gh aw' extension +11. gh extension install githubnext/gh-aw +12. +13. # Add the Issue Duplicator workflow to your repository +14. gh aw add githubnext/agentics/issue-duplication-detector --pr +15. ``` +16. +17. This creates a pull request to add the workflow to your repository. +18. +19. You must also [choose a coding agent](https://githubnext.github.io/gh-aw/reference/engines/) and add an API key secret for the agent to your repository. +20. +21. After merging the PR and syncing to main, you can run the workflow manually if desired: +22. +23. ```bash +24. gh aw run issue-duplication-detector +25. ``` +26. +27. ## Configuration +28. +29. This workflow works out of the box. You can customize detection strictness, comment tone, or batching window via a local config file at `.github/workflows/agentics/issue-duplication-detector.config.md`. +30. +31. After editing run `gh aw compile` to update the workflow and commit all changes to the default branch. +32. +33. ## What it reads from GitHub +34. +35. - Repository issues (open and closed) +36. - Recent issues created or updated in the last 10 minutes +37. +38. ## What it creates +39. +40. - Adds comments to issues that appear to be duplicates, including links to the matching issues +41. - Requires `issues: write` permission +42. +43. ## Human in the loop +44. +45. - Review duplicate comments for accuracy and tone +46. - Close or link issues as appropriate +47. - Disable or uninstall the workflow if it is not valuable +48. +49. ## Activity duration +50. +51. - By default this workflow will trigger for at most 30 days, after which it will stop triggering. +52. - This allows you to experiment with the workflow for a limited time before deciding whether to keep it active. diff --git a/workflows/issue-duplication-detector.md b/workflows/issue-duplication-detector.md new file mode 100644 index 0000000..4a0e43f --- /dev/null +++ b/workflows/issue-duplication-detector.md @@ -0,0 +1 @@ +1. ../.github/workflows/issue-duplication-detector.md From 26bbfc7b77a8624bcbbee05744ce6a9d997fc11f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:23:10 +0000 Subject: [PATCH 3/4] docs: fix Issue Duplication Detector naming Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --- README.md | 2 +- docs/{issue-duplicator.md => issue-duplication-detector.md} | 4 ++-- workflows/issue-duplication-detector.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename docs/{issue-duplicator.md => issue-duplication-detector.md} (95%) diff --git a/README.md b/README.md index b6c5243..1676e87 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ A sample family of reusable [GitHub Agentic Workflows](https://githubnext.github ### Depth Triage & Analysis Workflows - [🏷️ Issue Triage](docs/issue-triage.md) - Triage issues and pull requests -- [🔁 Issue Duplicator](docs/issue-duplicator.md) - Detect and comment on duplicate issues automatically +- [🔁 Issue Duplication Detector](docs/issue-duplication-detector.md) - Detect and comment on duplicate issues automatically - [🏥 CI Doctor](docs/ci-doctor.md) - Monitor CI workflows and investigate failures automatically - [🔍 Repo Ask](docs/repo-ask.md) - Intelligent research assistant for repository questions and analysis - [🔍 Daily Accessibility Review](docs/daily-accessibility-review.md) - Review application accessibility by automatically running and using the application diff --git a/docs/issue-duplicator.md b/docs/issue-duplication-detector.md similarity index 95% rename from docs/issue-duplicator.md rename to docs/issue-duplication-detector.md index 8b27783..99096b3 100644 --- a/docs/issue-duplicator.md +++ b/docs/issue-duplication-detector.md @@ -1,4 +1,4 @@ -1. # 🔁 Issue Duplicator +1. # 🔁 Issue Duplication Detector 2. 3. > For an overview of all available workflows, see the [main README](../README.md). 4. @@ -10,7 +10,7 @@ 10. # Install the 'gh aw' extension 11. gh extension install githubnext/gh-aw 12. -13. # Add the Issue Duplicator workflow to your repository +13. # Add the Issue Duplication Detector workflow to your repository 14. gh aw add githubnext/agentics/issue-duplication-detector --pr 15. ``` 16. diff --git a/workflows/issue-duplication-detector.md b/workflows/issue-duplication-detector.md index 4a0e43f..43ae86f 100644 --- a/workflows/issue-duplication-detector.md +++ b/workflows/issue-duplication-detector.md @@ -1 +1 @@ -1. ../.github/workflows/issue-duplication-detector.md +../.github/workflows/issue-duplication-detector.md From 47da493d926a698a3bd1a0da3ad4a14ca3785bdb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:25:03 +0000 Subject: [PATCH 4/4] docs: correct Issue Duplication Detector doc links and content Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --- docs/issue-duplication-detector.md | 104 ++++++++++++------------ workflows/issue-duplication-detector.md | 103 ++++++++++++++++++++++- 2 files changed, 154 insertions(+), 53 deletions(-) diff --git a/docs/issue-duplication-detector.md b/docs/issue-duplication-detector.md index 99096b3..7a3a4d3 100644 --- a/docs/issue-duplication-detector.md +++ b/docs/issue-duplication-detector.md @@ -1,52 +1,52 @@ -1. # 🔁 Issue Duplication Detector -2. -3. > For an overview of all available workflows, see the [main README](../README.md). -4. -5. The [Issue Duplication Detector workflow](../.github/workflows/issue-duplication-detector.md?plain=1) automatically scans for newly created or recently updated issues every 5 minutes and flags likely duplicates with a helpful comment. -6. -7. ## Installation -8. -9. ```bash -10. # Install the 'gh aw' extension -11. gh extension install githubnext/gh-aw -12. -13. # Add the Issue Duplication Detector workflow to your repository -14. gh aw add githubnext/agentics/issue-duplication-detector --pr -15. ``` -16. -17. This creates a pull request to add the workflow to your repository. -18. -19. You must also [choose a coding agent](https://githubnext.github.io/gh-aw/reference/engines/) and add an API key secret for the agent to your repository. -20. -21. After merging the PR and syncing to main, you can run the workflow manually if desired: -22. -23. ```bash -24. gh aw run issue-duplication-detector -25. ``` -26. -27. ## Configuration -28. -29. This workflow works out of the box. You can customize detection strictness, comment tone, or batching window via a local config file at `.github/workflows/agentics/issue-duplication-detector.config.md`. -30. -31. After editing run `gh aw compile` to update the workflow and commit all changes to the default branch. -32. -33. ## What it reads from GitHub -34. -35. - Repository issues (open and closed) -36. - Recent issues created or updated in the last 10 minutes -37. -38. ## What it creates -39. -40. - Adds comments to issues that appear to be duplicates, including links to the matching issues -41. - Requires `issues: write` permission -42. -43. ## Human in the loop -44. -45. - Review duplicate comments for accuracy and tone -46. - Close or link issues as appropriate -47. - Disable or uninstall the workflow if it is not valuable -48. -49. ## Activity duration -50. -51. - By default this workflow will trigger for at most 30 days, after which it will stop triggering. -52. - This allows you to experiment with the workflow for a limited time before deciding whether to keep it active. +# 🔁 Issue Duplication Detector + +> For an overview of all available workflows, see the [main README](../README.md). + +The [Issue Duplication Detector workflow](../workflows/issue-duplication-detector.md?plain=1) automatically scans for newly created or recently updated issues every 5 minutes and flags likely duplicates with a helpful comment. + +## Installation + +```bash +# Install the 'gh aw' extension +gh extension install githubnext/gh-aw + +# Add the Issue Duplication Detector workflow to your repository +gh aw add githubnext/agentics/issue-duplication-detector --pr +``` + +This creates a pull request to add the workflow to your repository. + +You must also [choose a coding agent](https://githubnext.github.io/gh-aw/reference/engines/) and add an API key secret for the agent to your repository. + +After merging the PR and syncing to main, you can run the workflow manually if desired: + +```bash +gh aw run issue-duplication-detector +``` + +## Configuration + +This workflow works out of the box. You can customize detection strictness, comment tone, or batching window via a local config file at `.github/workflows/agentics/issue-duplication-detector.config.md`. + +After editing run `gh aw compile` to update the workflow and commit all changes to the default branch. + +## What it reads from GitHub + +- Repository issues (open and closed) +- Recent issues created or updated in the last 10 minutes + +## What it creates + +- Adds comments to issues that appear to be duplicates, including links to the matching issues +- Requires `issues: write` permission + +## Human in the loop + +- Review duplicate comments for accuracy and tone +- Close or link issues as appropriate +- Disable or uninstall the workflow if it is not valuable + +## Activity duration + +- By default this workflow will trigger for at most 30 days, after which it will stop triggering. +- This allows you to experiment with the workflow for a limited time before deciding whether to keep it active. diff --git a/workflows/issue-duplication-detector.md b/workflows/issue-duplication-detector.md index 43ae86f..39bb4de 100644 --- a/workflows/issue-duplication-detector.md +++ b/workflows/issue-duplication-detector.md @@ -1 +1,102 @@ -../.github/workflows/issue-duplication-detector.md +--- +description: Detect duplicate issues and suggest next steps (batched every 5 minutes) +on: + schedule: + - cron: "*/5 * * * *" # Every 5 minutes + workflow_dispatch: + +permissions: read-all + +tools: + github: + toolsets: [default] + bash: + - "*" + +safe-outputs: + add-comment: + max: 10 # Allow multiple comments in batch mode + +timeout-minutes: 15 +--- + +# Issue Duplication Detector + +You are an AI agent that detects duplicate issues in the repository `${{ github.repository }}`. + +## Your Task + +Analyze recently created or updated issues to determine if they are duplicates of existing issues. This workflow runs every 5 minutes to batch-process issues, providing cost control and natural request batching. + +## Instructions + +1. **Find recent issues to check**: + - Use GitHub tools to search for issues in this repository that were created or updated in the last 10 minutes + - Query: `repo:${{ github.repository }} is:issue updated:>=$(date -u -d '10 minutes ago' +%Y-%m-%dT%H:%M:%SZ)` + - This captures any issues that might have been created or edited since the last run + - If no recent issues are found, exit successfully without further action + +2. **For each recent issue found**: + - Fetch the full issue details using GitHub tools + - Note the issue number, title, and body content + +3. **Search for duplicate issues**: + - For each recent issue, use GitHub tools to search for similar existing issues + - Search using keywords from the issue's title and body + - Look for issues that describe the same problem, feature request, or topic + - Consider both open and closed issues (closed issues might have been resolved) + - Focus on semantic similarity, not just exact keyword matches + - Exclude the current issue itself from the duplicate search + +4. **Analyze and compare**: + - Review the content of potentially duplicate issues + - Determine if they are truly duplicates or just similar topics + - A duplicate means the same underlying problem, request, or discussion + - Consider that different wording might describe the same issue + +5. **For issues with duplicates found**: + - Use the `output.add-comment` safe output to post a comment on the issue + - In your comment: + - Politely inform that this appears to be a duplicate + - List the duplicate issue(s) with their numbers and titles using markdown links (e.g., "This appears to be a duplicate of #123") + - Provide a brief explanation of why they are duplicates + - Suggest next steps, such as: + - Reviewing the existing issue(s) to see if they already address the concern + - Adding any new information to the existing issue if this one has additional context + - Closing this issue as a duplicate if appropriate + - Keep the tone helpful and constructive + +6. **For issues with no duplicates**: + - Do not add any comment + - The issue is unique and can proceed normally + +## Important Guidelines + +- **Batch processing**: Process multiple issues in a single run when available +- **Read-only analysis**: You are only analyzing and commenting, not modifying issues +- **Be thorough**: Search comprehensively to avoid false negatives +- **Be accurate**: Only flag clear duplicates to avoid false positives +- **Be helpful**: Provide clear reasoning and actionable suggestions +- **Use safe-outputs**: Always use `output.add-comment` for commenting, never try to use GitHub write APIs directly +- **Cost control**: The 5-minute batching window provides a natural upper bound on costs + +## Example Comment Format + +When you find duplicates, structure your comment like this: + +```markdown +👋 Hi! It looks like this issue might be a duplicate of existing issue(s): + +- #123 - [Title of duplicate issue] + +Both issues describe [brief explanation of the common problem/request]. + +**Suggested next steps:** +- Review issue #123 to see if it addresses your concern +- If this issue has additional context not covered in #123, consider adding it there +- If they are indeed the same, this issue can be closed as a duplicate + +Let us know if you think this assessment is incorrect! +``` + +Remember: Only comment if you have high confidence that duplicates exist.