Define requirements and user stories for a new feature
Creates a detailed specification document for a new feature with requirements, user stories, and acceptance criteria. Use this when starting development on a new feature to establish clear scope and planning foundation.
/plugin marketplace add retsohuang/retso-marketplace/plugin install spec-kit@retso-marketplaceclaude-opus-4-5Define detailed requirements, user stories, and acceptance criteria for a new feature. This creates a specification document that serves as the foundation for planning and implementation.
/spec-kit:specify <feature-name>
Example:
/spec-kit:specify user-authentication
The feature name should be short, descriptive, and kebab-case (e.g., "user-auth", "payment-flow", "admin-dashboard").
Check if spec-kit is initialized:
if [ ! -d .claude/spec-kit ]; then
echo "❌ Spec-kit not initialized. Run: /spec-kit:init"
exit 1
fi
Use the CLI to create the feature with sequential numbering:
node ${CLAUDE_PLUGIN_ROOT}/scripts/dist/cli.js create-feature <feature-name> --plugin-root ${CLAUDE_PLUGIN_ROOT}
This will:
.claude/spec-kit/specs/{NNN}-{feature-name}/progress.ymlThe CLI outputs JSON with the spec ID, feature directory, and feature number.
Read the project constitution to understand guiding principles:
cat .claude/spec-kit/memory/constitution.md
Keep these principles in mind when creating the spec.
Have a conversation with the user to understand:
Ask clarifying questions to ensure you understand the full scope.
Load the spec template from the CLI:
node ${CLAUDE_PLUGIN_ROOT}/scripts/dist/cli.js template spec-template --plugin-root ${CLAUDE_PLUGIN_ROOT}
Create .claude/spec-kit/specs/{NNN}-{feature-name}/spec.md with:
Overview Section:
User Stories:
Requirements:
Additional Sections:
Ensure the spec aligns with the project constitution:
Display what was created:
Specification Created!
Feature: {NNN}-{feature-name}
Location: .claude/spec-kit/specs/{NNN}-{feature-name}/spec.md
Current Spec: Set in progress.yml
Sections Completed:
- Overview (problem, solution, goals)
- User Stories ({count} stories, {count} acceptance criteria)
- Requirements (FR: {count}, NFR: {count}, TR: {count})
- Data Models ({count} models)
- Success Metrics ({count} metrics)
Next Steps:
1. Review and refine: .claude/spec-kit/specs/{NNN}-{feature-name}/spec.md
2. Resolve ambiguities: /spec-kit:clarify
3. Create implementation plan: /spec-kit:plan
Tip: Run /spec-kit:clarify to identify and resolve any unclear requirements.
Good:
Users currently have to manually copy data between systems, which takes 30 minutes daily per user and is error-prone. We're seeing 15% error rate in data entry.
Bad:
We need better data management.
Good:
As a customer service rep I want to search orders by customer email So that I can quickly find order history during support calls
Acceptance Criteria:
- Search returns results in <2 seconds
- Shows orders from past 2 years
- Displays order ID, date, status, and total
Bad:
Users should be able to search orders.
Good:
FR-1: Order Search
- Description: System must allow searching orders by email, order ID, or date range
- Priority: High
- Dependencies: None
Bad:
Need search feature.
Good:
NFR-1: Search Performance
- Description: Search queries must return results quickly
- Metric: P95 response time
- Target: <2 seconds for 95% of queries
Bad:
Should be fast.
/spec-kit:init/specifyCreate a comprehensive specification from a brief description. Manages specification workflow including directory creation, README tracking, and phase transitions.