fix(taskstoissues): skip tasks that already have a GitHub issue#2992
Open
Quratulain-bilal wants to merge 3 commits into
Open
fix(taskstoissues): skip tasks that already have a GitHub issue#2992Quratulain-bilal wants to merge 3 commits into
Quratulain-bilal wants to merge 3 commits into
Conversation
Re-running /speckit-taskstoissues created a duplicate issue for every task because the command never checked for existing ones. Add a deduplication step before issue creation: list the repo's issues (state all) via the GitHub MCP server, collect the task IDs already present in issue titles, and skip any task that already has a matching issue. Issue titles are now prefixed with the task ID (e.g. T001:) so they can be matched on later runs, and list_issues is added to the command's MCP tools. Fixes github#2968
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the taskstoissues command template to avoid creating duplicate GitHub issues when the command is re-run, by introducing an explicit “fetch existing issues + skip already-created task IDs” step.
Changes:
- Adds
github/github-mcp-server/list_issuesto the command’s allowed MCP tools. - Adds an outline step to fetch existing issues and deduplicate by task ID before creating new issues.
- Updates issue-title guidance to include a task ID prefix for future matching.
Show a summary per file
| File | Description |
|---|---|
| templates/commands/taskstoissues.md | Adds MCP tooling and outline instructions for listing issues and deduplicating task-to-issue creation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
Collaborator
|
Please address Copilot feedback |
Address Copilot review: - list_issues has no 'all' state; omitting state returns both open and closed issues. Use cursor-based pagination (after/endCursor) to fetch every page before building the dedup set. - task lines already start with their ID, so reuse the task text as the issue title instead of prefixing the ID again (which produced 'T001: T001 ...').
mnriem
requested changes
Jun 17, 2026
mnriem
left a comment
Collaborator
There was a problem hiding this comment.
Please address Copilot feedback
…canonical title Address follow-up Copilot review: - task lines start with a markdown checkbox (- [ ] T001 ...), so the creation step now strips the checkbox and [P]/[US#] markers and writes a single canonical title 'T001: <description>'. - dedup now scans each issue title for a T<digits> token anywhere in the title, so existing issues titled 'T001 ...', 'T001: ...' or '[T001] ...' are all matched.
| > ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL | ||
|
|
||
| 1. For each task in the list, use the GitHub MCP server to create a new issue in the repository that is representative of the Git remote. | ||
| 1. **Fetch existing issues for deduplication**: Before creating anything, use the GitHub MCP server's `list_issues` tool to list the repository's issues. Do not pass a `state` value, since omitting it makes the tool return both open and closed issues. The tool uses cursor-based pagination, so keep requesting pages with the `after` parameter (using the `endCursor` from the previous response) until all issues have been fetched. Build a set of task IDs that already have an issue by scanning each issue title for a task ID token (the pattern `T` followed by digits, e.g. `T001`) anywhere in the title, so titles written as `T001 ...`, `T001: ...` or `[T001] ...` are all matched. This prevents duplicate issues when the command is re-run after `tasks.md` is regenerated or the skill is re-invoked. |
Collaborator
|
Please address Copilot feedback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2968
Re-running /speckit-taskstoissues created a duplicate issue for every task because the command never checked whether an
issue already existed.
This adds a dedup step before issue creation: it lists the repo's issues (state all, so closed ones count too) via the
GitHub MCP server, pulls the task IDs already present in issue titles, and skips any task that already has a matching
issue. New issue titles are prefixed with the task ID (e.g. T001:) so they can be matched on later runs. list_issues is
added to the command's MCP tools for the read.
Single template change, no behavior change on a first run — only re-runs are affected.
This PR was authored with AI assistance (Claude Code), reviewed by me.