Commit fd42fb1
authored
fix(taskstoissues): skip tasks that already have a GitHub issue (#2992)
* fix(taskstoissues): skip tasks that already have a GitHub issue
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 #2968
* fix(taskstoissues): correct list_issues usage and issue title format
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 ...').
* fix(taskstoissues): match task IDs anywhere in titles and define one 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.
* fix(taskstoissues): use word-boundary task ID match and request perPage 100
Address Copilot review:
- match issue titles against \bT\d{3}\b so tokens like ST001 or T0010
are not matched by mistake (task IDs are T + 3 digits).
- request perPage: 100 on list_issues to reduce pagination calls.
* fix(taskstoissues): bound issue pagination to the tasks being processed
Address Copilot review: extract the task IDs from tasks.md first, then
paginate list_issues only until every task ID has been matched (or pages
run out), instead of fetching the repo's entire issue history. Keeps the
call count bounded on repos with large issue backlogs.1 parent a17a658 commit fd42fb1
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
0 commit comments