Skip to content

Add GitHub Issue sync for task/PR number alignment#392

Open
bborn wants to merge 1 commit intomainfrom
task/1017-its-annoying-that-task-numbers-are-not-i
Open

Add GitHub Issue sync for task/PR number alignment#392
bborn wants to merge 1 commit intomainfrom
task/1017-its-annoying-that-task-numbers-are-not-i

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Feb 5, 2026

Summary

  • Adds a new "Sync GitHub Issues" option to project settings
  • When enabled, creates a GitHub Issue when a task starts, using that issue number for branch naming
  • This keeps task/issue/PR numbers closer together since they share the same numbering sequence

Problem

Currently, task IDs (auto-increment database IDs like #1017) diverge wildly from PR numbers (GitHub's numbering like #374), which can be confusing when tracking work.

Solution

By creating a GitHub Issue when a task is started, we get a number from GitHub's shared issue/PR numbering sequence. The branch is then named using that issue number (e.g., task/375-add-feature) instead of the internal task ID. When a PR is created from that branch, it will be the next number in the sequence (e.g., #376).

Changes

  • internal/db/tasks.go: Added IssueNumber and IssueURL fields to Task struct
  • internal/db/tasks.go: Added SyncGitHubIssues field to Project struct
  • internal/db/sqlite.go: Added database migrations for new columns
  • internal/github/issue.go: New file with GitHub Issue creation via gh CLI
  • internal/executor/executor.go: Modified worktree setup to create issues and use issue numbers for branch naming
  • internal/ui/settings.go: Added project setting toggle for GitHub Issue sync

Test plan

  • All existing tests pass
  • New tests added for issue.go
  • Manual testing: Enable "Sync GitHub Issues" on a project, create a task, verify issue is created and branch uses issue number

🤖 Generated with Claude Code

This feature allows task numbers to be synced with GitHub Issue numbers,
which addresses the confusing mismatch between task IDs (like #1017) and
PR numbers (like #374).

When a project has "Sync GitHub Issues" enabled:
- A GitHub Issue is automatically created when a task starts
- The issue number is used for branch naming (task/{issue#}-slug)
- PR numbers will be close to issue numbers since they share the same sequence

Changes:
- Add IssueNumber and IssueURL fields to Task struct
- Add SyncGitHubIssues field to Project struct
- Add database migrations for new columns
- Create internal/github/issue.go for issue creation via gh CLI
- Modify executor to create issues and use issue numbers for branches
- Update project settings UI to allow enabling GitHub Issue sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant