spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

[Feature request] Custom namespacing and branch naming conventions

Open ejaramillom opened this issue 11 months ago • 12 comments

Could not track other issues related to custom namespacing or naming conventions, close issue if any other related.

Context Currently, Spec Kit appears to enforce a strict numeric naming convention for feature branches and spec directories (e.g., 001-feature-name). While this works for linear histories, it becomes restrictive for larger projects organized by domain or module.

Problem Our project requires separating features by specific domains (e.g., "Manager" features vs. "User" features). The current logic restricts us to a flat numeric list (e.g., 001-*), which makes it difficult to group related specifications and leads to potential ID collisions or confusion as the number of specs grows.

Proposed Solution We request that the /speckit.specify command and associated scripts be updated to support custom, alphanumeric namespacing conventions. Ideally, this would be configurable via a regex pattern or a config file, allowing us to define our own prefixes.

Desired Behavior We would like to name our branches and folders using domain-specific prefixes.

• Current supported format: ◦ 001-paycheck-generation

• Desired supported formats: ◦ USR-001-profile-update (User domain) ◦ MNG-001-paycheck-generation (Manager domain) ◦ FIN-002-tax-calculation (Finance domain)

Acceptance Criteria

  1. The tool recognizes folders and branches starting with alphanumeric prefixes (e.g., MNG-, USR-) as valid spec contexts.
  2. Commands like /speckit.specify correctly parse these IDs to locate the corresponding spec.md files.

Impact This enhancement will significantly improve repository organization for teams using Domain-Driven Design (DDD) or working in monorepos with multiple distinct product lines.

ejaramillom avatar Dec 23 '25 21:12 ejaramillom

Agreed with this. We have rulesets that we apply to prefixes on branch names and this can slightly mess it up. We've got a workaround by creating a copilot space and ensuring standards are met, but having it native as an override option in spec kit would make this easier in future :)

jrcndlf avatar Jan 11 '26 10:01 jrcndlf

That would be lovely, it could also open up for using it with systems like jira.

saxjax avatar Jan 12 '26 21:01 saxjax

Same here.

XSKW11111 avatar Jan 24 '26 10:01 XSKW11111

I agree. Furthermore, the approach of using sequential numbers can easily lead to conflicts, so I'd like to have a setting that uses timestamps as well. (e.g., 202501291706-*)

sgrokym avatar Jan 29 '26 08:01 sgrokym

I have a set of local changes to make it use timestamps as an option, I can make this actual PR if the maintainers will allow it: https://github.com/github/spec-kit/compare/main...amweiss:spec-kit:feat/timestamp-branch-numbering?expand=1

amweiss avatar Mar 19 '26 17:03 amweiss

@amweiss I will be happy to take, but be aware that eventually we are going to spin off Git support into its own extension as it seems a lot of different opinions around branching, numbering and what not

mnriem avatar Mar 19 '26 17:03 mnriem

# Use timestamp-based branch numbering (useful for distributed teams)
specify init my-project --ai claude --branch-numbering timestamp

timestamp based branches are now merged to main and should be available in the next release.

if you have an existing init-options.json you can add:

  "branch_numbering": "timestamp",

amweiss avatar Mar 20 '26 15:03 amweiss

you can do something like this, in the time being

1. create your branch
2. /speckit.specify Using the current branch <define your spec>

cgondrovic-servpro avatar Mar 20 '26 20:03 cgondrovic-servpro

you can do something like this, in the time being

1. create your branch
2. /speckit.specify Using the current branch <define your spec>

That approach doesn't seem viable because the agent calls a script that creates the branch (deterministically).

bmcnaboe avatar Mar 22 '26 14:03 bmcnaboe

you can do something like this, in the time being

1. create your branch
2. /speckit.specify Using the current branch <define your spec>

That approach doesn't seem viable because the agent calls a script that creates the branch (deterministically).

Hmm you are correct it was working at one point for me but not it doesn't

cgondrovic-servpro avatar Mar 23 '26 16:03 cgondrovic-servpro

+1 on this. We hit the same thing, we use Spec Kit alongside another workflow that namespaces its branches under a folder prefix, and having Spec Kit branches flat at the top level gets messy fast. We ended up hardcoding a prefix locally in create-new-feature-branch.sh and stripping it in git-common.sh before path lookups. Works fine, but it'd be way better as a config option. Something like a branch_prefix key in git-config.yml would cover it:

branch_prefix: "speckit/"  # optional, default ""

Empty string = current behavior, no breaking change. The prefix just gets prepended to the branch name and stripped before directory lookups. This would also help with the monorepo scoping in #3081, each member project could set its own prefix.

yvonnedevlinrh avatar Jul 06 '26 15:07 yvonnedevlinrh

Update after the Git extension split-off and today's follow-up work: I'm closing this as I think it's now addressed on main.

#3293 (merged today) adds configurable branch namespacing to the git extension's git-config.yml:

  • branch_prefix — shorthand namespace, e.g. branch_prefix: "speckit" → speckit/001-feature. @yvonnedevlinrh, this is essentially the branch_prefix option you asked for above.
  • branch_template — full template with {author}, {app}, {number}, {slug} tokens. For domain grouping you can use e.g. MNG/{number}-{slug} → MNG/001-paycheck-generation, or for monorepos {author}/{app}/{number}-{slug} → jdoe/web/008-guided-tour.
  • Numbering is scope-aware, so each namespace maintains its own sequence and avoids the ID collisions raised here.
  • Timestamp numbering (branch_numbering: timestamp) was also added earlier for distributed teams.

One nuance vs. the original request: templates produce a path-segment namespace (USR/001-profile-update) rather than the hyphen-glued USR-001-profile-update, because the final branch segment must start with {number}- to stay a valid feature branch. The grouping/DDD/monorepo goals are covered, just with / instead of - as the separator.

Given that, I'm closing this as resolved by #3293. If the exact PREFIX-001-... single-segment format (or regex-based conventions / Jira ID linking) is a hard requirement for anyone, please open a separate focused issue against the git extension and we'll track it there.

mnriem avatar Jul 06 '26 22:07 mnriem