Add GitHub Issue sync for task/PR number alignment#392
Open
Conversation
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>
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.
Summary
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: AddedIssueNumberandIssueURLfields to Task structinternal/db/tasks.go: AddedSyncGitHubIssuesfield to Project structinternal/db/sqlite.go: Added database migrations for new columnsinternal/github/issue.go: New file with GitHub Issue creation viaghCLIinternal/executor/executor.go: Modified worktree setup to create issues and use issue numbers for branch naminginternal/ui/settings.go: Added project setting toggle for GitHub Issue syncTest plan
🤖 Generated with Claude Code