User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
The text the user typed after /speckit.specify in the triggering message is the feature description. Assume you always have it available in this conversation even if $ARGUMENTS appears literally below. Do not ask the user to repeat it unless they provided an empty command.
Given that feature description, do this:
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.)
- Keep it concise but descriptive enough to understand the feature at a glance
- Examples:
- "I want to add user authentication" → "user-auth"
- "Implement OAuth2 integration for the API" → "oauth2-api-integration"
- "Create a dashboard for analytics" → "analytics-dashboard"
- "Fix payment processing timeout bug" → "fix-payment-timeout"
Check for existing specs before creating new one:
a. First, find all existing specs:
- Specs directories: Check for directories matching
specs/[0-9]+-<short-name>
b. Find the highest feature number and determine the next available number:
- Extract all numbers of existing specs and find the highest number N
- Use N+1 for the new branch number or
001 for the first spec
- adding prefix-zeros if N+1 has less than three numbers, e.g.,
001, 025, 146
c. Create GitHub Feature Issue:
d. Initialize the spec:
- Checkout to a new branch
<N+1>-<short-name>.
- Create a new spec directory
specs/<N+1>-<short-name>.
- Copy the template
templates/spec-template.md to the feature directory as specs/<N+1>-<short-name>/spec.md and understand required sections.
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
- You must only ever run this script once per feature
Follow this execution flow:
- Parse user description from Input
If empty: ERROR "No feature description provided"
- Extract key concepts from description
Identify: actors, actions, data, constraints
- For unclear aspects:
- Make informed guesses based on context and industry standards
- Only mark with [NEEDS CLARIFICATION: specific question] if:
- The choice significantly impacts feature scope or user experience
- Multiple reasonable interpretations exist with different implications
- No reasonable default exists
- LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total
- Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
- Fill User Scenarios & Testing section
If no clear user flow: ERROR "Cannot determine user scenarios"
- Generate Functional Requirements
Each requirement must be testable
Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
- Define Success Criteria
Create measurable, technology-agnostic outcomes
Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
Each criterion must be verifiable without implementation details
- Identify Key Entities (if data involved)
- Return: SUCCESS (spec ready for planning)
Write the specification to spec.md using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
Spec Review. The generated spec file requires human review. Ask users whether they want to review the spec in the workspace or on the GitHub. We provide the following steps to push the spec to the GitHub. Ask for permission to execute and wait for response.
- Commit generated files and push this
spec branch to the remote.
- Create another new issue on the GitHub. This issue has the label
Spec. The title is [<N+1>-<short-name>][Spec] <description>, e.g., [001-add-frontend][Spec] add spec for the frontend. The body is about this spec.
- Make this
spec issue as the sub-issue of the feature issue. The command is:
gh api graphql -f query='mutation { addSubIssue(input: {issueId: "xxx", subIssueId: "xxx"}) { issue { id title } subIssue { id title } } }'
- Create a Pull Request that merge the current spec branch to main. The first line of the body should be "fix #[spec-issue-number]" to link to the
spec issue.
- Update the
feature issue that add the spec issue id in the body, e.g., - [ ] Specify: #10.
- List all contributors and ask users to choose the reviewers. Note the PR author (i.e., me) cannot be reviewers.
Report completion with branch name, spec file path, checklist results, and readiness for the next phase (/speckit.clarify or /speckit.plan).
NOTE: The script creates and checks out the new branch and initializes the spec file before writing.
General Guidelines
Quick Guidelines
- Focus on WHAT users need and WHY.
- Avoid HOW to implement (no tech stack, APIs, code structure).
- Written for business stakeholders, not developers.
- DO NOT create any checklists that are embedded in the spec. That will be a separate command.
Section Requirements
- Mandatory sections: Must be completed for every feature
- Optional sections: Include only when relevant to the feature
- When a section doesn't apply, remove it entirely (don't leave as "N/A")
For AI Generation
When creating this spec from a user prompt:
- Make informed guesses: Use context, industry standards, and common patterns to fill gaps
- Document assumptions: Record reasonable defaults in the Assumptions section
- Limit clarifications: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
- Significantly impact feature scope or user experience
- Have multiple reasonable interpretations with different implications
- Lack any reasonable default
- Prioritize clarifications: scope > security/privacy > user experience > technical details
- Think like a tester: Every vague requirement should fail the "testable and unambiguous" checklist item
- Common areas needing clarification (only if no reasonable default exists):
- Feature scope and boundaries (include/exclude specific use cases)
- User types and permissions (if multiple conflicting interpretations possible)
- Security/compliance requirements (when legally/financially significant)
Examples of reasonable defaults (don't ask about these):
- Data retention: Industry-standard practices for the domain
- Performance targets: Standard web/mobile app expectations unless specified
- Error handling: User-friendly messages with appropriate fallbacks
- Authentication method: Standard session-based or OAuth2 for web apps
- Integration patterns: RESTful APIs unless specified otherwise
Success Criteria Guidelines
Success criteria must be:
- Measurable: Include specific metrics (time, percentage, count, rate)
- Technology-agnostic: No mention of frameworks, languages, databases, or tools
- User-focused: Describe outcomes from user/business perspective, not system internals
- Verifiable: Can be tested/validated without knowing implementation details
Good examples:
- "Users can complete checkout in under 3 minutes"
- "System supports 10,000 concurrent users"
- "95% of searches return results in under 1 second"
- "Task completion rate improves by 40%"
Bad examples (implementation-focused):
- "API response time is under 200ms" (too technical, use "Users see results instantly")
- "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
- "React components render efficiently" (framework-specific)
- "Redis cache hit rate above 80%" (technology-specific)
1---2name: speckit-specify3description: Create or update the feature specification from a natural language feature description.4---56## User Input78```text9$ARGUMENTS10```1112You **MUST** consider the user input before proceeding (if not empty).1314## Outline1516The text the user typed after `/speckit.specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.1718Given that feature description, do this:19201. **Generate a concise short name** (2-4 words) for the branch:21 - Analyze the feature description and extract the most meaningful keywords22 - Create a 2-4 word short name that captures the essence of the feature23 - Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")24 - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)25 - Keep it concise but descriptive enough to understand the feature at a glance26 - Examples:27 - "I want to add user authentication" → "user-auth"28 - "Implement OAuth2 integration for the API" → "oauth2-api-integration"29 - "Create a dashboard for analytics" → "analytics-dashboard"30 - "Fix payment processing timeout bug" → "fix-payment-timeout"31322. **Check for existing specs before creating new one**:33 34 a. First, find all existing specs:35 - Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`36 37 b. Find the highest feature number and determine the next available number:38 - Extract all numbers of existing specs and find the highest number N39 - Use N+1 for the new branch number or `001` for the first spec40 - adding prefix-zeros if N+1 has less than three numbers, e.g., `001`, `025`, `146`4142 c. Create GitHub `Feature Issue`:43 - Create an `feature issue` on the GitHub44 - This issue name is: `[<N+1>-<short-name>] <description>`, e.g., `[001-add-frontend] add frontend for biagent`45 - The issue body is:46 ```47 # Feature4849 [Use 3-5 sentences to describe this feature.]5051 # Process5253 - [ ] Specify54 - [ ] Plan55 - [ ] Task56 - [ ] Implement57 ```58 d. Initialize the spec:59 - Checkout to a new branch `<N+1>-<short-name>`.60 - Create a new spec directory `specs/<N+1>-<short-name>`.61 - Copy the template `templates/spec-template.md` to the feature directory as `specs/<N+1>-<short-name>/spec.md` and understand required sections.62 63 **IMPORTANT**:64 - Check all three sources (remote branches, local branches, specs directories) to find the highest number65 - Only match branches/directories with the exact short-name pattern66 - You must only ever run this script once per feature67684. Follow this execution flow:6970 1. Parse user description from Input71 If empty: ERROR "No feature description provided"72 2. Extract key concepts from description73 Identify: actors, actions, data, constraints74 3. For unclear aspects:75 - Make informed guesses based on context and industry standards76 - Only mark with [NEEDS CLARIFICATION: specific question] if:77 - The choice significantly impacts feature scope or user experience78 - Multiple reasonable interpretations exist with different implications79 - No reasonable default exists80 - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**81 - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details82 4. Fill User Scenarios & Testing section83 If no clear user flow: ERROR "Cannot determine user scenarios"84 5. Generate Functional Requirements85 Each requirement must be testable86 Use reasonable defaults for unspecified details (document assumptions in Assumptions section)87 6. Define Success Criteria88 Create measurable, technology-agnostic outcomes89 Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)90 Each criterion must be verifiable without implementation details91 7. Identify Key Entities (if data involved)92 8. Return: SUCCESS (spec ready for planning)93946. Write the specification to `spec.md` using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.95967. **Spec Review.** The generated spec file requires human review. Ask users whether they want to review the spec in the workspace or on the GitHub. We provide the following steps to push the spec to the GitHub. Ask for permission to execute and wait for response.9798 1. Commit generated files and push this `spec` branch to the remote.99 2. Create another new issue on the GitHub. This issue has the label `Spec`. The title is `[<N+1>-<short-name>][Spec] <description>`, e.g., `[001-add-frontend][Spec] add spec for the frontend`. The body is about this spec.100 3. Make this `spec issue` as the sub-issue of the `feature issue`. The command is:101 ```102 gh api graphql -f query='mutation { addSubIssue(input: {issueId: "xxx", subIssueId: "xxx"}) { issue { id title } subIssue { id title } } }'103 ```104 4. Create a Pull Request that merge the current spec branch to main. The first line of the body should be "fix #[spec-issue-number]" to link to the `spec issue`.105 5. Update the `feature issue` that add the `spec issue` id in the body, e.g., `- [ ] Specify: #10`.106 6. List all contributors and ask users to choose the reviewers. Note the PR author (i.e., me) cannot be reviewers.1071089. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).109110**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.111112## General Guidelines113114## Quick Guidelines115116- Focus on **WHAT** users need and **WHY**.117- Avoid HOW to implement (no tech stack, APIs, code structure).118- Written for business stakeholders, not developers.119- DO NOT create any checklists that are embedded in the spec. That will be a separate command.120121### Section Requirements122123- **Mandatory sections**: Must be completed for every feature124- **Optional sections**: Include only when relevant to the feature125- When a section doesn't apply, remove it entirely (don't leave as "N/A")126127### For AI Generation128129When creating this spec from a user prompt:1301311. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps1322. **Document assumptions**: Record reasonable defaults in the Assumptions section1333. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:134 - Significantly impact feature scope or user experience135 - Have multiple reasonable interpretations with different implications136 - Lack any reasonable default1374. **Prioritize clarifications**: scope > security/privacy > user experience > technical details1385. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item1396. **Common areas needing clarification** (only if no reasonable default exists):140 - Feature scope and boundaries (include/exclude specific use cases)141 - User types and permissions (if multiple conflicting interpretations possible)142 - Security/compliance requirements (when legally/financially significant)143144**Examples of reasonable defaults** (don't ask about these):145146- Data retention: Industry-standard practices for the domain147- Performance targets: Standard web/mobile app expectations unless specified148- Error handling: User-friendly messages with appropriate fallbacks149- Authentication method: Standard session-based or OAuth2 for web apps150- Integration patterns: RESTful APIs unless specified otherwise151152### Success Criteria Guidelines153154Success criteria must be:1551561. **Measurable**: Include specific metrics (time, percentage, count, rate)1572. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools1583. **User-focused**: Describe outcomes from user/business perspective, not system internals1594. **Verifiable**: Can be tested/validated without knowing implementation details160161**Good examples**:162163- "Users can complete checkout in under 3 minutes"164- "System supports 10,000 concurrent users"165- "95% of searches return results in under 1 second"166- "Task completion rate improves by 40%"167168**Bad examples** (implementation-focused):169170- "API response time is under 200ms" (too technical, use "Users see results instantly")171- "Database can handle 1000 TPS" (implementation detail, use user-facing metric)172- "React components render efficiently" (framework-specific)173- "Redis cache hit rate above 80%" (technology-specific)