Correction (updated): the original premise — that branch creation is skipped — was wrong. Verified end-to-end on main (487af97): in a normally-installed project the branch is created in the shared root repo. This issue has been re-scoped to the actual residual; see the correction comment below.
Summary
In a monorepo with one Git repository at the root and Spec Kit projects in subdirectories (e.g. apps/web/.specify/), feature-branch creation works — the branch is created/switched in the shared root repository. The residual is that all member projects share that single branch namespace, while feature numbering is per-project, so feature numbers are not unique across the monorepo and branches from different member projects interleave in one namespace.
Why
create-new-feature-branch.sh resolves REPO_ROOT to the member project (the directory containing .specify/) and, in a normal install, detects Git via git -C "$REPO_ROOT" rev-parse --is-inside-work-tree (core common.sh does not define has_git). That walks up to the enclosing work tree, so the branch lands in the root repo. Feature numbering comes from the member project's own specs/.
Impact
- Two member projects can each produce a
001-… branch in the same repo; numbers carry no monorepo-wide meaning.
- There is no way to scope branches per member project short of initializing a separate Git repo per project.
Possible direction
Per-project / custom branch namespacing for monorepos. Closely related to #1382.
Related
(Disclosure: AI-assisted investigation and drafting; reviewed by me.)
Summary
In a monorepo with one Git repository at the root and Spec Kit projects in subdirectories (e.g.
apps/web/.specify/), feature-branch creation works — the branch is created/switched in the shared root repository. The residual is that all member projects share that single branch namespace, while feature numbering is per-project, so feature numbers are not unique across the monorepo and branches from different member projects interleave in one namespace.Why
create-new-feature-branch.shresolvesREPO_ROOTto the member project (the directory containing.specify/) and, in a normal install, detects Git viagit -C "$REPO_ROOT" rev-parse --is-inside-work-tree(corecommon.shdoes not definehas_git). That walks up to the enclosing work tree, so the branch lands in the root repo. Feature numbering comes from the member project's ownspecs/.Impact
001-…branch in the same repo; numbers carry no monorepo-wide meaning.Possible direction
Per-project / custom branch namespacing for monorepos. Closely related to #1382.
Related
(Disclosure: AI-assisted investigation and drafting; reviewed by me.)