Skip to content

[Feature]: Support using existing branch (without auto branch creation) #1680

@fwonce

Description

@fwonce

Problem Statement

I really appreciate Spec Kit's well-thought-out design for Spec-Driven Development. The automatic branch creation with numbered prefixes (###-feature-name) and AI-generated feature names is a clever approach that ensures organization and traceability throughout the development process. This design aligns with the SDD philosophy of treating specifications as the primary artifact with clear versioning and isolation.

However, our team's actual workflow differs from the assumed pattern in one key aspect:

In current workflow, we normally create development branches through our CI/CD platform, with a core concept workitem, where:

  1. One or more work items/tickets are associated
  2. One or more code repositories are selected
  3. One or more new branches are created, or existing branches are selected, from the main branch
  4. Developers then check out and work on this branch
    This is a standard enterprise CI/CD pattern where branch creation is a formal, tracked operation external to the development workflow.

The Mismatch

When we check out an existing branch and run /speckit.plan, Spec Kit's current behavior creates friction:

Current expectation: Spec Kit expects you to run create-new-feature which will:

  • Auto-detect or prompt for a feature description
  • Generate a new branch name with pattern ###-feature-name
  • Create a new branch (via git checkout -b)
  • Set up the spec directory

Our reality: The branch already exists, created through our CI/CD platform with associated work items. We cannot create a new branch because:

  1. The branch already exists with CI/CD associations
  2. We want to work on the existing branch, not create a new one
  3. The branch name may not follow the ###-xxx pattern

Thank you for considering this request. I'm happy to contribute a PR if this aligns with Spec Kit's vision.

Proposed Solution

Add a flag (e.g., --use-current-branch) to create-new-feature.sh that:

  • Uses the current branch name (from git branch --show-current) as the feature identifier
  • Skips git checkout -b branch creation (since branch already exists)
  • Sets SPECIFY_FEATURE environment variable appropriately
  • Validates/creates the specs/[branch-name]/ directory structure
  • Generates the spec template file

Design considerations

I understand this somewhat deviates from the original SDD workflow design where:

  • Specifications are primary artifacts
  • Each feature gets isolated branch/number
  • Formal feature creation is a deliberate step

The proposed change doesn't abandon this philosophy—it simply adds flexibility for teams that have formalized branch creation as part of their CI/CD governance. The spec directory structure and all subsequent SDD workflows would remain unchanged.

Alternatives Considered

The documentation mentions SPECIFY_FEATURE environment variable as a way to override feature detection:

export SPECIFY_FEATURE="my-existing-branch-name"

This has several limitations according to my understanding of the code:

  1. Manual setup required: Must be set before each session or in shell profile, easy to break
  2. No spec directory setup: Doesn't create the specs/ directory structure automatically
  3. No validation: No signal that the spec directory actually exists or is valid

Component

CI/CD workflows

AI Agent (if applicable)

All agents

Use Cases

No response

Acceptance Criteria

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions