Skip to content

Conversation

Ray0907
Copy link

@Ray0907 Ray0907 commented Oct 4, 2025

Fixes #733

When users delete a branch and create a new one, the spec directory
name no longer matches the branch name, causing spec-kit to fail.

This fix adds automatic detection of mismatched spec directories and
provides clear instructions to fix the issue using git mv.

Changes:

  • Add check_and_fix_spec_directory_mismatch() function to common.sh
  • Integrate mismatch check into setup-plan.sh and check-prerequisites.sh
  • Handle three scenarios: single orphaned dir, multiple orphaned dirs, no dir
  • Provide actionable git mv commands in warning messages

  Fixes github#733

  When users delete a branch and create a new one, the spec directory
  name no longer matches the branch name, causing spec-kit to fail.

  This fix adds automatic detection of mismatched spec directories and
  provides clear instructions to fix the issue using git mv.

  Changes:
  - Add check_and_fix_spec_directory_mismatch() function to common.sh
  - Integrate mismatch check into setup-plan.sh and check-prerequisites.sh
  - Handle three scenarios: single orphaned dir, multiple orphaned dirs, no
  dir
  - Provide actionable git mv commands in warning messages
@Ray0907 Ray0907 requested a review from localden as a code owner October 4, 2025 06:31
@Copilot Copilot AI review requested due to automatic review settings October 4, 2025 06:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds automatic detection and warning for spec directory mismatches when branch names don't align with spec directory names, typically occurring after branch deletion and recreation. This prevents spec-kit failures by providing clear remediation instructions.

  • Implements check_and_fix_spec_directory_mismatch() function to detect orphaned spec directories
  • Integrates mismatch detection into both setup and prerequisite checking workflows
  • Provides actionable git mv commands to resolve directory naming conflicts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/bash/common.sh Adds core logic to detect spec directory mismatches and generate appropriate warning messages
scripts/bash/setup-plan.sh Integrates mismatch check into the setup workflow
scripts/bash/check-prerequisites.sh Adds mismatch check to prerequisite validation with paths-only mode support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check branch name while developing

1 participant