Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions templates/commands/clarify.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ Execution steps:

4. Sequential questioning loop (interactive):
- Present EXACTLY ONE question at a time.
- ALWAYS print the question itself before any recommendation, suggestion, or answer options.
- Format the question line as: `**Question:** <question text>`
- For multiple‑choice questions:
- **Analyze all options** and determine the **most suitable option** based on:
- Best practices for the project type
- Common patterns in similar implementations
- Risk reduction (security, performance, maintainability)
- Alignment with any explicit project goals or constraints visible in the spec
- Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
- After printing the question, present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
- Format as: `**Recommended:** Option [X] - <reasoning>`
- Then render all options as a Markdown table:

Expand All @@ -120,7 +122,7 @@ Execution steps:

- After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.`
- For short‑answer style (no meaningful discrete options):
- Provide your **suggested answer** based on best practices and context.
- After printing the question, provide your **suggested answer** based on best practices and context.
- Format as: `**Suggested:** <your proposed answer> - <brief reasoning>`
- Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.`
- After the user answers:
Expand Down
29 changes: 10 additions & 19 deletions templates/commands/specify.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,24 @@ Given that feature description, do this:
- "Create a dashboard for analytics" → "analytics-dashboard"
- "Fix payment processing timeout bug" → "fix-payment-timeout"

2. **Check for existing branches before creating new one**:
2. **Create the feature branch and spec scaffold exactly once**:

a. First, fetch all remote branches to ensure we have the latest information:
a. Run the script and let it assign the next globally unique feature number:

```bash
git fetch --all --prune
{SCRIPT} --short-name "your-short-name" "{ARGS}"
```
Comment on lines +44 to 48
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

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

The command example mixes {SCRIPT} (which is OS-specific and already includes --json "{ARGS}" / -Json "{ARGS}" from frontmatter) with a hard-coded bash-only flag (--short-name) and an extra "{ARGS}" argument. On Windows, create-new-feature.ps1 expects -ShortName (not --short-name), and appending {ARGS} here likely duplicates the feature description. Consider either: (1) changing the frontmatter scripts: to omit {ARGS} and keeping OS-specific bash/PowerShell examples with the correct flag names, or (2) keeping {ARGS} in scripts: and updating the body to run {SCRIPT} without re-specifying {ARGS}/flags that may not apply to both shells.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback


b. Find the highest feature number across all sources for the short-name:
- Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
- Local branches: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
- Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`
b. Do **not** pass `--number` unless the user explicitly asks for a specific feature number. Run the script once; if the script reports that the requested number collides with an existing feature, explain this to the user and ask them for a different number or permission to proceed without forcing one.

c. Determine the next available number:
- Extract all numbers from all three sources
- Find the highest number N
- Use N+1 for the new branch number

d. Run the script `{SCRIPT}` with the calculated number and short-name:
- Pass `--number N+1` and `--short-name "your-short-name"` along with the feature description
- Bash example: `{SCRIPT} --json --number 5 --short-name "user-auth" "Add user authentication"`
- PowerShell example: `{SCRIPT} -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
c. Read the JSON output from the script and use it as the source of truth for:
- `BRANCH_NAME`
- `SPEC_FILE`
- `FEATURE_NUM`

**IMPORTANT**:
- Check all three sources (remote branches, local branches, specs directories) to find the highest number
- Only match branches/directories with the exact short-name pattern
- If no existing branches/directories found with this short-name, start with number 1
- Feature numbers are globally unique across all feature branches and spec directories, not unique per short name
- Do not infer that a new short name should start at `001`; the script already checks existing branches and spec folders globally
- You must only ever run this script once per feature
- The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
- The JSON output will contain BRANCH_NAME and SPEC_FILE paths
Expand Down
Loading