-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Tighter integration between GitHub Issues and Spec Kit created branches #1088
Description
Overview
Enhance Spec Kit with native GitHub issue integration to create better traceability and enable issue-driven specification workflows.
Current Behavior
Today, the Spec Kit workflow operates as follows:
- Run
/speckit.specifywith a description - Spec Kit creates a feature branch
- Work on the specification
- Raise a PR against
main - Merge after review
The Problem: There's no connection to GitHub issues, so:
- No automatic issue tracking
- Manual effort to link specs to issues
- Missing context from existing issue discussions
- Harder to trace specs back to original requirements
Suggestion
New /speckit.issue Command
Add a new /speckit.issue command that:
-
Searches for existing issues based on user input text
- Checks the repository for matching issues
- Displays relevant matches for selection
-
Prompts issue creation if no matching issue exists
- Guides user through creating a well-structured issue
-
Leverages
/speckit.clarifyduring issue creation to:- Categorize the issue type (feature, bug, enhancement, documentation, etc.)
- Add structured context and details
- Improve clarity of the issue description
- Ensure all necessary information is captured
-
Returns a GitHub issue URL for use in subsequent commands
As is /speckit.specify Command
Run /speckit.specify and pass the GitHub issue URL:
- Automatically pull context from the issue
- Use issue title/description to populate spec metadata
- Create feature branch with issue number in the name (e.g.,
spec/123-feature-name) - Link the spec to the GitHub issue
- Continue with existing spec generation workflow (e.g. clarify .. )
New /speckit.pullrequest Command
Add a new /speckit.pullrequest command that:
-
Detects the associated GitHub issue from the current branch
- Reads issue number from branch name (e.g.,
spec/123-feature-name→ issue #1234567) - Falls back to stored metadata from
/speckit.specify
- Reads issue number from branch name (e.g.,
-
Creates a pull request with smart defaults:
- PR title pulled from the issue title
- PR description includes:
- Link to the associated issue (e.g., "Closes #1234567" or "Fixes #1234567")
- Summary of changes from the implemented plan.
- Any additional context
-
Automatically links the PR to the issue:
- Uses GitHub keywords (Closes, Fixes, Resolves) to auto-close issue on merge
- Adds PR reference to the issue timeline
-
Optional parameters:
- Custom PR title/description
- Target branch (defaults to
main) - Draft PR flag
- Reviewers assignment
Suggested User Flow
Complete Workflow: Issue → Spec → PR
/speckit.issue "Add user authentication feature"
↓ (searches GitHub for existing issues about authentication)
↓ (no match found)
↓ (runs /speckit.clarify to improve the issue description)
↓ (creates GitHub issue #1234567)
↓ (returns: "Created issue #1234567: https://github.com/org/repo/issues/123")
/speckit.specify https://github.com/org/repo/issues/123
↓ (pulls context from issue #1234567)
↓ (creates branch: spec/123-user-authentication)
↓ (generates spec with issue context)
[Work on your specification...]
/speckit.pullrequest
↓ (detects issue #1234567 from branch name)
↓ (creates PR with title from issue #1234567)
↓ (adds "Closes #1234567" to PR description)
↓ (links PR to issue automatically)
✅ PR created and ready for review!
Benefits
- Full Traceability: Complete lifecycle from issue → spec → PR, all tightly linked
- Better Documentation: Issues are clarified and improved before spec work begins
- Reduced Duplication: Search prevents creating duplicate issues for the same work
- Context Preservation: Issue discussions and requirements flow into the spec and PR
- Automated Linking: PR automatically references and closes the associated issue
- Project Management: Easy to track entire workflow through GitHub's native tools
- Team Collaboration: Team members can follow the entire journey from idea to implementation
- Zero Manual Linking: No need to manually add "Closes #1234567" or link issues to PRs