Skip to content

Tighter integration between GitHub Issues and Spec Kit created branches #1088

@ahmadabdalla

Description

@ahmadabdalla

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:

  1. Run /speckit.specify with a description
  2. Spec Kit creates a feature branch
  3. Work on the specification
  4. Raise a PR against main
  5. 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:

  1. Searches for existing issues based on user input text

    • Checks the repository for matching issues
    • Displays relevant matches for selection
  2. Prompts issue creation if no matching issue exists

    • Guides user through creating a well-structured issue
  3. Leverages /speckit.clarify during 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
  4. 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:

  1. 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
  2. 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
  3. 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
  4. 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

  1. Full Traceability: Complete lifecycle from issue → spec → PR, all tightly linked
  2. Better Documentation: Issues are clarified and improved before spec work begins
  3. Reduced Duplication: Search prevents creating duplicate issues for the same work
  4. Context Preservation: Issue discussions and requirements flow into the spec and PR
  5. Automated Linking: PR automatically references and closes the associated issue
  6. Project Management: Easy to track entire workflow through GitHub's native tools
  7. Team Collaboration: Team members can follow the entire journey from idea to implementation
  8. Zero Manual Linking: No need to manually add "Closes #1234567" or link issues to PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions