Skip to content

feat: add speckit/ folder prefix to Speckit branches - #328

Merged
yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/speckit-branch-prefix
Jul 15, 2026
Merged

yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/speckit-branch-prefix

Conversation

@yvonnedevlinrh

Copy link
Copy Markdown
Contributor

Summary

Add a speckit/ folder prefix to new Speckit feature branches, changing the naming convention from NNN-<name> to speckit/NNN-<name>. This organizes Speckit branches under a folder in the git branch namespace, matching the pattern already used by OpenSpec (opsx/).

All branch detection is backward-compatible — legacy NNN-<name> branches continue to work without modification. Existing remote branches are not renamed. Spec directories on disk remain specs/NNN-<name>/.

Fixes #149

How to Test

Verify the shell script changes by dry-running branch creation:

bash .specify/scripts/bash/create-new-feature.sh --short-name "test-prefix" "Test the prefix" --json
# Expected: BRANCH_NAME starts with speckit/

Verify backward compatibility — common.sh should strip the speckit/ prefix:

source .specify/scripts/bash/common.sh
# get_current_branch on a speckit/* branch returns NNN-<name>
# without the prefix

Run the full test suite:

make check

How to Demo

After merging, the next time /speckit.specify creates a new feature branch, it will be named speckit/NNN-<name> instead of NNN-<name>. Run git branch to see the organized folder structure. Existing branches like 031-unleash-openspec continue to work normally.

Key Files Changed

Core logic:

  • .specify/scripts/bash/create-new-feature.sh — Branch name construction now prepends speckit/; filesystem path strips prefix
  • .specify/scripts/bash/common.sh — get_current_branch() strips prefix; validation and path lookup accept both patterns

Commands (8 files):

  • unleash.md, review-council.md, finale.md, address-feedback.md, agent-brief.md, cobalt-crush.md, workflow-status.md, workflow-advance.md — Branch detection patterns, error messages, and examples updated

Skills (1 file):

  • review-context/SKILL.md — Branch-to-spec mapping table

Documentation (3 files):

  • AGENTS.md, docs/usage.md, docs/architecture.md

Scaffold assets (7 files):

  • Synchronized with live command/skill files

OpenSpec artifacts (4 new files):

  • openspec/changes/speckit-branch-prefix/ — proposal, design, specs, tasks

This PR was generated by /finale (AI-assisted).

New Speckit branches are created as speckit/NNN-<name> instead
of flat NNN-<name>, organizing them under a folder in the git
branch namespace for parity with OpenSpec's opsx/ prefix.

- Update create-new-feature.sh to prepend speckit/ prefix
- Update common.sh to strip prefix for filesystem path mapping
  and SPECIFY_FEATURE env var consistency
- Update 8 command files with backward-compatible detection
- Update review-context skill branch-to-spec mapping table
- Update AGENTS.md, docs/usage.md, docs/architecture.md
- Sync scaffold assets with live command/skill files
- Add OpenSpec change artifacts (proposal, design, specs, tasks)

Detection is backward-compatible: both speckit/NNN-<name> and
legacy NNN-<name> branches are accepted. Existing branches are
not renamed. Spec directories on disk remain as specs/NNN-<name>/.

Fixes: unbound-force#149

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin <[email protected]>
@yvonnedevlinrh
yvonnedevlinrh force-pushed the opsx/speckit-branch-prefix branch from de03b80 to 340481a Compare July 6, 2026 15:48
@yvonnedevlinrh yvonnedevlinrh moved this to In Review 👀 in Unbound Force Planning Jul 6, 2026
@yvonnedevlinrh
yvonnedevlinrh requested a review from em-redhat July 6, 2026 15:48

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: #328 — feat: add speckit/ folder prefix to Speckit branches

CI: All checks pass. Scaffold sync: All 7 scaffold assets updated in sync with live files.
Alignment: Code changes match spec FR-001–FR-004 and linked issue #149.
Security: No issues. Constitution: No issues.

Two MEDIUM findings on code clarity — see inline comments.

This review was generated by /review-pr (AI-assisted).

Comment thread .specify/scripts/bash/common.sh Resolved
Comment thread .specify/scripts/bash/common.sh Resolved
The function returns the spec feature name (NNN-<name>), not the
git branch ref, after the speckit/ prefix stripping was added.
Rename function, variable (CURRENT_BRANCH -> CURRENT_FEATURE),
and all callers to match the actual behavior.

Also remove unreachable (speckit/)? regex group from
check_feature_branch — the input is already stripped by
get_current_feature(), so the group could never match.

Addresses PR unbound-force#328 review feedback from @em-redhat.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin <[email protected]>
@yvonnedevlinrh

Copy link
Copy Markdown
Contributor Author

Hey @em-redhat, I made changes to remediate the medium findings that were found. If you wouldn't mind giving it another quick review

@yvonnedevlinrh
yvonnedevlinrh requested a review from em-redhat July 15, 2026 11:53

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

Speckit branches should be in a folder

2 participants