spec-kit-aider — Prompts
Excerpt 1: speckit.specify Command — Feature Numbering + Script Integration
Source: templates/commands/specify.md
Prompting technique: Numbered step procedure; script invocation with structured JSON output; explicit multi-source branch-number deduplication logic.
## Outline
Given that feature description, do this:
1. **Generate a concise short name** (2-4 words) for the branch:
- Analyze the feature description and extract the most meaningful keywords
- Create a 2-4 word short name that captures the essence of the feature
- Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
- Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
- Examples:
- "I want to add user authentication" → "user-auth"
- "Implement OAuth2 integration for the API" → "oauth2-api-integration"
2. **Check for existing branches before creating new one**:
a. First, fetch all remote branches: `git fetch --all --prune`
b. Find the highest feature number across all sources:
- Remote: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
- Local: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
- Specs: Check for directories matching `specs/[0-9]+-<short-name>`
c. Use N+1 for the new branch number
d. Run the script with the calculated number and short-name:
- Bash: `{SCRIPT} --json --number 5 --short-name "user-auth" "Add user authentication"`
- PowerShell: `{SCRIPT} -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
**IMPORTANT**: You must only ever run this script once per feature
Source: spec-driven.md
Prompting technique: Explicit format specification (EARS syntax); bidirectional feedback loop framing.
## Streamlining SDD with Commands
### The `/speckit.specify` Command
This command transforms a simple feature description (the user-prompt) into a complete, structured specification:
1. **Automatic Feature Numbering**: Scans existing specs to determine the next feature number (e.g., 001, 002, 003)
2. **Branch Creation**: Generates a semantic branch name from your description and creates it automatically
3. **Template-Based Generation**: Copies and customizes the feature specification template with your requirements
4. **Directory Structure**: Creates the proper `specs/[branch-name]/` structure for all related documents
Source: templates/commands/specify.md
Prompting technique: YAML front-matter with handoffs, scripts, description — machine-readable metadata for cross-agent routing.
---
description: Create or update the feature specification from a natural language feature description.
handoffs:
- label: Build Technical Plan
agent: speckit.plan
prompt: Create a plan for the spec. I am building with...
- label: Clarify Spec Requirements
agent: speckit.clarify
prompt: Clarify specification requirements
send: true
scripts:
sh: scripts/bash/create-new-feature.sh --json "{ARGS}"
ps: scripts/powershell/create-new-feature.ps1 -Json "{ARGS}"
---