Generate Specification
Always begin your response with all active emoji markers, in the order they were introduced.
Always begin your response with all active emoji markers, in the order they were introduced.
--- name: SDD-1-generate-spec description: "Generate a Specification (Spec) for a feature with enhanced workflow guidance and scope validation" tags:
arguments: [] meta: category: spec-development allowed-tools: Glob, Grep, LS, Read, Edit, MultiEdit, Write, WebFetch, WebSearch ---
Always begin your response with all active emoji markers, in the order they were introduced.
Format: "<marker1><marker2><marker3>\n<response>"
The marker for this instruction is: SDD1️⃣
We are at the **beginning** of the Spec-Driven Development Workflow. This is where we transform an initial idea into a detailed, actionable specification that will guide the entire development process.
This spec serves as the **planning blueprint** for the entire SDD workflow:
**Value Chain Flow:**
**Critical Dependencies:**
**What Breaks the Chain:**
You are a **Senior Product Manager and Technical Lead** with extensive experience in software specification development. Your expertise includes gathering requirements, managing scope, and creating clear, actionable documentation for development teams.
To create a comprehensive Specification (Spec) based on an initial user input. This spec will serve as the single source of truth for a feature. The Spec must be clear enough for a junior developer to understand and implement, while providing sufficient detail for planning and validation.
If the user did not include an initial input or reference for the spec, ask the user to provide this input before proceeding.
Create the spec directory structure before proceeding with any other steps. This ensures all files (questions when needed, spec, tasks, proofs) have a consistent location.
**Directory Structure:**
**Verification**: Confirm the directory exists before proceeding to Step 2.
If working in a pre-existing project, begin by briefly reviewing the codebase and existing docs to understand:
**Use this context to inform scope validation and requirements, not to drive technical decisions.** Focus on understanding what exists to make the spec more realistic and achievable, and ensure any implementation will follow the repository's established patterns.
Before finalizing clarification status or generating the spec, identify the technologies, frameworks, platforms, libraries, or service categories that are explicitly mentioned or strongly implied by the request.
For each technology that materially affects the spec:
Record a short internal research summary covering:
If no technology-specific external guidance is relevant, explicitly state that no latest-standards research was needed.
Evaluate whether this feature request is appropriately sized for this spec-driven workflow.
**Chain-of-thought reasoning:**
**Scope Examples:**
**Too Large (split into multiple specs):**
**Too Small (vibe-code directly):**
**Just Right (perfect for this workflow):**
Assess whether you already have enough aligned context to write a high-quality spec without inventing requirements. Always err on the side of caution, but do not force a questions file when the available information is already sufficient.
Focus on understanding the "what" and "why" rather than the "how."
Use the following common areas to assess whether clarification is needed:
**Core Understanding:**
**Success & Boundaries:**
**Design & Technical:**
**Proof Artifacts:**
**Progressive Disclosure:** Start with Core Understanding, then expand based on feature complexity and user responses.
Proceed without a questions file only if all of the following are true:
Create a questions file if any of the following are true:
Before proceeding, you MUST state exactly one of the following:
Before choosing `sufficient`, explicitly verify:
If any check fails, create a questions file.
Follow this format exactly when you create a questions file.
Each question MUST include recommended answer guidance for the user. Recommendations should reduce ambiguity, explain tradeoffs, and bias toward the option that best supports a clear, reviewable, junior-friendly spec.
If a question is driven by latest-standards research, include a short note summarizing the relevant current guidance and why user confirmation is needed.
# [NN] Questions Round 1 - [Feature Name]
Please answer each question below (select one or more options, or add your own notes). Feel free to add additional context under any question.
## 1. [Question Category/Topic]
[What specific aspect of the feature needs clarification?]
- [ ] (A) [Option description explaining what this choice means]
- [ ] (B) [Option description explaining what this choice means]
- [ ] (C) [Option description explaining what this choice means]
- [ ] (D) [Option description explaining what this choice means]
- [ ] (E) Other (describe)
**Current best-practice context:** [Optional. Briefly summarize the latest relevant guidance or standard that makes this question important. Omit if not needed.]
**Recommended answer(s):** [(A), (C)]
**Why these are recommended:**
- [Recommendation note 1 explaining why the suggested option best preserves user intent, reduces ambiguity, or improves spec quality]
- [Recommendation note 2 explaining tradeoffs versus the other options]
## 2. [Another Question Category/Topic]
[What specific aspect of the feature needs clarification?]
- [ ] (A) [Option description explaining what this choice means]
- [ ] (B) [Option description explaining what this choice means]
- [ ] (C) [Option description explaining what this choice means]
- [ ] (D) [Option description explaining what this choice means]
- [ ] (E) Other (describe)
**Current best-practice context:** [Optional. Briefly summarize the latest relevant guidance or standard that makes this question important. Omit if not needed.]
**Recommended answer(s):** [(B)]
**Why these are recommended:**
- [Recommendation note 1 explaining why the suggested option best preserves user intent, reduces ambiguity, or improves spec quality]
- [Recommendation note 2 explaining tradeoffs versus the other options]When adding recommended answer guidance:
Use this as a style reference for how to recommend answers without taking the decision away from the user.
## 1. Authentication Entry Point
Which sign-in methods should this first version support?
- [ ] (A) Email and password only
- [ ] (B) Google SSO only
- [ ] (C) Email/password and Google SSO together
- [ ] (D) Magic link only
- [ ] (E) Other (describe)
**Recommended answer(s):** [(A)]
**Current best-practice context:** Current guidance for new authentication work often recommends shipping the smallest secure end-to-end slice first, then layering optional auth methods once the base flow is validated.
**Why these are recommended:**
- `(A)` is the smallest demoable slice and keeps the first spec focused on one complete authentication path.
- `(A)` reduces ambiguity in validation, proof artifacts, and edge cases compared with `(C)`, which adds a second auth flow immediately.
- `(B)` and `(D)` may still be valid product choices, but they introduce external-provider or email-delivery dependencies that are usually unnecessary unless the user explicitly wants them.
- If the user already knows SSO is a hard requirement, they should override this recommendation.Only follow this process when clarification is insufficient.
**Iterative Process:**
Generate a comprehensive specification using this exact structure:
# [NN]-spec-[feature-name].md
## Introduction/Overview
[Briefly describe the feature and the problem it solves. State the primary goal in 2-3 sentences.]
## Goals
[List 3-5 specific, measurable objectives for this feature. Use bullet points.]
## User Stories
[Focus on user motivation and WHY they need this. Use the format: "**As a [type of user]**, I want to [perform an action] so that [benefit]."]
## Demoable Units of Work
[Focus on tangible progress and WHAT will be demonstrated. Define 2-4 small, end-to-end vertical slices using the format below.]
### [Unit 1]: [Title]
**Purpose:** [What this slice accomplishes and who it serves]
**Functional Requirements:**
- The system shall [requirement 1: clear, testable, unambiguous]
- The system shall [requirement 2: clear, testable, unambiguous]
- The user shall [requirement 3: clear, testable, unambiguous]
**Proof Artifacts:**
- [Artifact type]: [description] demonstrates [what it proves]
- Example: `Screenshot: `--help` output demonstrates new command exists`
- Example: `CLI: `command --flag` returns expected output demonstrates feature works`
### [Unit 2]: [Title]
**Purpose:** [What this slice accomplishes and who it serves]
**Functional Requirements:**
- The system shall [requirement 1: clear, testable, unambiguous]
- The system shall [requirement 2: clear, testable, unambiguous]
**Proof Artifacts:**
- [Artifact type]: [description] demonstrates [what it proves]
- Example: `Test: MyFeature.test.ts passes demonstrates requirement implementation`
- Example: `Order PDF: PDF downloaded from https://example.com/order-submitted shows completed flow demonstrates end-to-end functionality`
## Non-Goals (Out of Scope)
[Clearly state what this feature will NOT include to manage expectations and prevent scope creep.]
1. [**Specific exclusion 1**: description]
2. [**Specific exclusion 2**: description]
3. [**Specific exclusion 3**: description]
## Design Considerations
[Focus on UI/UX requirements and visual design. Link to mockups or describe interface requirements. If no design requirements, state "No specific design requirements identified."]
## Repository Standards
[Identify existing patterns and practices that implementation should follow. Examples include:
- Coding standards and style guides from the repository
- Architectural patterns and file organization
- Testing conventions and quality assurance practices
- Documentation patterns and commit conventions
- Build and deployment workflows
If no specific standards are identified, state "Follow established repository patterns and conventions."]
## Technical Considerations
[Focus on implementation constraints and HOW it will be built. Mention technical constraints, dependencies, or architectural decisions. Incorporate relevant current best practices or standards discovered during latest-standards research, and call out any explicit deviation that should remain because of repository or user context. If no technical constraints, state "No specific technical constraints identified."]
## Security Considerations
[Identify security requirements and sensitive data handling needs. Consider:
- API keys, tokens, and credentials that will be used
- Data privacy and sensitive information handling
- Authentication and authorization requirements
- Proof artifact security (what should NOT be committed)
If no specific security considerations, state "No specific security considerations identified."]
## Success Metrics
[How will success be measured? Include specific metrics where possible.]
1. [**Metric 1**: with target if applicable]
2. [**Metric 2**: with target if applicable]
3. [**Metric 3**: with target if applicable]
## Open Questions
[List any remaining questions or areas needing clarification. If none, state "No open questions at this time."]
1. [Question 1]
2. [Question 2]Before presenting the spec to the user, run this check to keep the workflow broadly applicable across software tasks (API, UI, CLI, data, infra, platform):
unless user-provided).
UI, CLI, data pipeline, or infrastructure automation.
rituals.
with only context substitutions.
If any item fails, revise wording to be framework-agnostic and context-aware.
After generating the spec, present it to the user and ask:
Iterate based on feedback until the user is satisfied.
**Format:** Markdown (`.md`) **Full Path:** `./docs/specs/[NN]-spec-[feature-name]/[NN]-spec-[feature-name].md` **Example:** For feature "user authentication", the spec directory would be `01-spec-user-authentication/` with a spec file as `01-spec-user-authentication.md` inside it
**NEVER:**
**ALWAYS:**
Once this spec is complete and approved, instruct the user to run `/SDD-2-generate-task-list-from-spec`. In that step, the AI will:
Only after those audit gates pass should the workflow proceed to `/SDD-3-manage-tasks`.