Skip to content

Commit f092033

Browse files
fsilvaortizclaude
andcommitted
fix: remove per-short-name number detection from specify prompt
The specify.md prompt instructed the AI to search for existing branches filtered by the exact short-name, causing every new feature to start at 001 since no branches matched the new short-name. The underlying create-new-feature.sh script already has correct global numbering logic via check_existing_branches() that searches ALL branches and spec directories. The fix removes the AI's flawed number-detection steps and tells it to NOT pass --number, letting the script auto-detect the next globally available number. Closes #1744 Closes #1468 🤖 Generated with [Claude Code](https://claude.com/code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 13dec1d commit f092033

1 file changed

Lines changed: 4 additions & 24 deletions

File tree

templates/commands/specify.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,13 @@ Given that feature description, do this:
3939
- "Create a dashboard for analytics" → "analytics-dashboard"
4040
- "Fix payment processing timeout bug" → "fix-payment-timeout"
4141

42-
2. **Check for existing branches before creating new one**:
42+
2. **Create the feature branch** by running the script with only `--short-name` (do NOT pass `--number` — the script auto-detects the next globally available number across all branches and spec directories):
4343

44-
a. First, fetch all remote branches to ensure we have the latest information:
45-
46-
```bash
47-
git fetch --all --prune
48-
```
49-
50-
b. Find the highest feature number across all sources for the short-name:
51-
- Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
52-
- Local branches: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
53-
- Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`
54-
55-
c. Determine the next available number:
56-
- Extract all numbers from all three sources
57-
- Find the highest number N
58-
- Use N+1 for the new branch number
59-
60-
d. Run the script `{SCRIPT}` with the calculated number and short-name:
61-
- Pass `--number N+1` and `--short-name "your-short-name"` along with the feature description
62-
- Bash example: `{SCRIPT} --json --number 5 --short-name "user-auth" "Add user authentication"`
63-
- PowerShell example: `{SCRIPT} -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
44+
- Bash example: `{SCRIPT} --json --short-name "user-auth" "Add user authentication"`
45+
- PowerShell example: `{SCRIPT} -Json -ShortName "user-auth" "Add user authentication"`
6446

6547
**IMPORTANT**:
66-
- Check all three sources (remote branches, local branches, specs directories) to find the highest number
67-
- Only match branches/directories with the exact short-name pattern
68-
- If no existing branches/directories found with this short-name, start with number 1
48+
- Do NOT pass `--number` — the script determines the correct next number automatically
6949
- You must only ever run this script once per feature
7050
- The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
7151
- The JSON output will contain BRANCH_NAME and SPEC_FILE paths

0 commit comments

Comments
 (0)