Skip to content

Feature request: option to auto-create feature branch for new proposals #332

Open

Description

@BobbyWang0120

Summary

It would be useful if OpenSpec could optionally create a new feature branch in the git repository whenever a new proposal is started through the /openspec-proposal slash command or equivalent. This behaviour is inspired by SpecKit’s branch workflow: each new change begins on its own branch with a numeric prefix and an AI-generated slug.

Motivation

Today, when starting a new proposal with OpenSpec, all changes are made in the current branch unless the user manually creates a feature branch. Creating a dedicated branch per feature makes it easier to manage work in progress, track history, and review pull requests. SpecKit implements this pattern by generating branch names like 001-add-profile-filters, 002-update-auth, etc. Bringing a similar capability to OpenSpec would improve developer ergonomics.

Proposal

  • Add a configuration option (e.g. in openspec/project.md or a CLI flag) that enables automatic branch creation when starting a new proposal.
  • When enabled, OpenSpec should:
    1. Determine the next sequence number (e.g. based on existing feature branches in the repo).
    2. Generate a human-readable branch name based on the proposal title (using AI to slugify).
    3. Create and check out the new branch before scaffolding the openspec/changes/<change>/ directory.
  • The user should still have the ability to disable this feature if they prefer to manage branches manually.

Benefits

  • Each feature or change lives in its own branch, making it easier to see the history of development.
  • Aligns with existing workflows in tools like SpecKit, making migration smoother.
  • Reduces manual steps and potential mistakes when starting a new feature.

Please consider adding this optional branch creation mechanism to OpenSpec to streamline the workflow.

Activity

  1. TabishB commented on Nov 24, 2025

    @TabishB
    Contributor

    We're experimenting with reworking a lot of the core internals and how this project works. This will come alongside that soon.

  2. BretJohnson commented on Feb 4, 2026

    @BretJohnson

    Weighing in here, I could see it working like this:

    • Have a setting in config.yaml to enable it, maybe starting with it off by default until early users are happy with it then enable by default. (I assume config.yaml is the right place for a setting like this these days - maybe project.md went away?)
    • Don't have the sequence number prefix, just use the kebab-case change name (unless that name isn't unique, then add a numeric suffix to make it unique). This one is debatable, but I don't know that the sequence numbers in SpecKit add much value and there's simplicity in not having to compute it.
    • Otherwise, is the same as @BobbyWang0120 suggests above.
  3. askpatrickw commented on Feb 5, 2026

    @askpatrickw

    I would definitely not prefer branches. As there is more and more desire to work simultaneously, on several features, git worktrees are starting to be more popular.

  4. BretJohnson commented on Feb 5, 2026

    @BretJohnson

    I would definitely not prefer branches. As there is more and more desire to work simultaneously, on several features, git worktrees are starting to be more popular.

    Don't worktrees and branches normally go hand in hand, where a particular worktree is tied to a particular branch? Branches seem like essentially a requirement to use worktrees.

    Given that I could see config settings something like this:

    • "useBranch" switch whether to create a branch automatically
    • "useWorktree" switch whether to checkout the branch in a separate worktree; only has an effect if useBranch is enabled
  5. c4jquick commented on Mar 21, 2026

    @c4jquick

    have also been comparing ralph for sdd which implements a simple git branching strategy (no worktrees) based on spec changes. the git commits are super helpful for tracking and undoing if things go wrong.

    https://github.com/snarktank/ralph

    it will create a feature branch named after the change during plan stage. when doing task implementation it will commit changes on each iteration (think openspec tasks) with helpful git comment about what it actually did. ie

    snarktank/ralph@800c221

    ralph will never merge it back into main (leaves it to humans)

    do you think something like this would be possible w/ openspec if i were to editing the current skills it installs?

  6. harveyhq commented on Sep 17, 2026

    @harveyhq

    Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    design-reviewNeeds product/design decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions