Create feature specification from description or PRD
Creates a structured feature specification file from a description or PRD document.
/plugin marketplace add adeonir/claude-code-extras/plugin install spec-driven@claude-code-extras<description> | @<file.md>Initialize a new feature with a structured specification file.
<description> - Text describing the feature@<file.md> - Path to PRD file to use as context--link <ID> - Associate current branch with existing featureArguments received: $ARGUMENTS
If --link <ID> provided:
.specs/spec.md frontmatter with branch: {current_branch}Scan .specs/ directory for existing features.
Find the highest ID number and increment by 1.
Example: If .specs/003-payment-flow/ exists, next ID is 004.
If .specs/ doesn't exist, start with 001.
If input is a file reference (@file.md):
If input is text:
If input is empty:
From the description, derive a short kebab-case name:
add-2fauser-registrationGet current git branch:
git branch --show-current
Ask user:
{branch}?" (Yes/No)If on main/master, suggest creating a new branch.
Create .specs/{ID}-{feature}/spec.md with frontmatter and content:
---
id: {ID}
feature: {feature-name}
status: draft
branch: {branch or empty}
created: {YYYY-MM-DD}
---
# Feature: {Feature Title}
## Overview
{brief_description}
## User Stories
- As a {user_type}, I want {goal} so that {benefit}
## Functional Requirements
- [ ] FR-001: {requirement}
- [ ] FR-002: {requirement}
## Acceptance Criteria
- [ ] AC-001: {criterion}
- [ ] AC-002: {criterion}
## Notes
{additional_context}
<!-- Items marked [NEEDS CLARIFICATION] require resolution before plan -->
For any unclear or underspecified items, add:
[NEEDS CLARIFICATION: specific question]
Inform the user:
{ID}-{feature}.specs/{ID}-{feature}/spec.md{branch} (or "none")/spec-driven:clarify to resolve ambiguities, or /spec-driven:plan if none