Requirements Generator
Take a project idea, feature description, or user story and generate a structured requirements document with functional requirements, non-functional requirements, Gherkin acceptance criteria, edge cases, and out-of-scope items.
Instructions
Two modes:
- Description mode (default): user provides a free-form description or pastes a Jira/Confluence URL. Claude generates requirements from that.
- Interview mode (
/requirements-generator --interview): Claude asks a structured set of questions one at a time, then generates requirements from the answers.
Gather input. Ask the user what they want to build if no description has been provided. Accept any of:
- A pasted feature description or user story
- A Jira ticket URL or Confluence page URL (read via available MCP tools if present)
- A brief verbal description of the feature
Prompt: "Describe the feature or system you want to build. Include the user need it addresses and any known constraints."
If the user invoked with --interview, skip this prompt and proceed to the Interview Mode section below instead.
Understand the existing codebase (if one exists). Use Glob on * to detect the project structure. Read package.json, pyproject.toml, or go.mod to identify the tech stack. Read 3–5 representative files from src/ or app/ — entry points first (index.*, main.*, app.*), then one route/handler file and one model/schema file — to understand patterns and conventions. Do not read the whole source tree. This ensures requirements fit what already exists.
Check for existing requirements. Use Glob on docs/requirements/**/*.md. If matching files exist, read them to avoid duplicating requirements already captured. Note any related requirements in the new document.
Determine the feature name. Derive a kebab-case feature name from the description (e.g., "user authentication" → user-authentication). This becomes the output filename.
Generate the requirements document with the following sections:
Overview
One paragraph summarizing what is being built, the user need it addresses, and why it matters.
Stakeholders
A table of who uses this feature and what they need from it.
| Stakeholder |
Role |
Primary Need |
| End User |
... |
... |
Functional Requirements
Numbered list using the prefix FR-NNN (e.g., FR-001, FR-002). Each requirement must be:
- Specific and testable
- Implementation-agnostic (describe what, not how)
- Written in the form: "The system shall..."
Non-Functional Requirements
Cover all four dimensions:
- Performance: specific response time targets (e.g., "API responses under 200ms at p95")
- Security: authentication requirements, data sensitivity classification, encryption requirements
- Accessibility: WCAG AA compliance, keyboard navigation, screen reader support
- Scalability: expected concurrent users, request volume, data growth projections
Acceptance Criteria
Gherkin format (Given/When/Then) — one scenario per key functional requirement. Use this format exactly:
Scenario: <short description>
Given <precondition>
And <additional precondition if needed>
When <action>
Then <expected outcome>
And <additional outcome if needed>
Edge Cases & Error Scenarios
Bulleted list covering:
- Invalid or malformed input
- System failures (database down, third-party API timeout)
- Concurrent access and race conditions
- Boundary conditions (empty state, maximum limits)
- Unauthorized access attempts
Out of Scope
Explicitly list what this feature does NOT include. This prevents scope creep during implementation. Be specific.
Assumptions
List any assumptions made during requirements generation. For each:
- State the assumption clearly
- Note what would change if the assumption is wrong
Open Questions
List questions that require stakeholder input before implementation can begin. For each question, note:
- Who is the right person to answer it
- What the impact is if it is not answered before development starts
Write the document. Ensure docs/requirements/ exists (it may need to be created). Use Write to save the document to docs/requirements/<feature-name>-requirements.md.
Offer Jira/Confluence integration (if MCP tools for Atlassian are available in the session). Ask: "Would you like me to publish this to Confluence or create a Jira epic?" If yes, use the available MCP tools to do so.
Confirm completion. Tell the user the file path, how many functional requirements were generated, and how many acceptance criteria scenarios were written.
Interview Mode
When invoked with --interview, conduct a structured interview by asking each question below one at a time. Wait for the user's full answer before proceeding to the next question. Do not ask multiple questions at once.
Who is the primary user? "Describe the person or system that will use this feature. What is their role, technical level, and what are they trying to accomplish?"
What problem does this solve? "What is the user currently unable to do, or what pain point does this address? What happens today without this feature?"
What does success look like? "How will you know this feature is working correctly? What would a user be able to do that they couldn't before?"
What are the constraints? "Are there technology choices already made (language, framework, cloud provider)? Any performance requirements? Any compliance or regulatory constraints (GDPR, HIPAA, SOC2)?"
What is explicitly out of scope? "What are you deliberately NOT building in this version? What might people assume is included but isn't?"
What could go wrong? "What edge cases or error scenarios do you anticipate? What happens if the user provides invalid input? What if a dependency is unavailable?"
Who else is affected? "Are there other systems, teams, or users impacted by this change? Any backwards compatibility concerns?"
After collecting all answers, generate the full requirements document using the same format as description mode (FR-NNN requirements, NFRs, Gherkin scenarios, etc.), grounded in the interview answers. Include an Interview Summary section at the very top of the generated document (before Overview) that captures each answer in 1–2 sentences.
## Interview Summary
**Primary user:** ...
**Problem being solved:** ...
**Success criteria:** ...
**Constraints:** ...
**Out of scope:** ...
**Risk areas:** ...
**Other affected parties:** ...
Then continue with the standard sections (Overview, Stakeholders, Functional Requirements, etc.) as defined in the Output Format Reference.
Output Format Reference
# Requirements: <Feature Name>
**Version**: 1.0
**Date**: <today's date>
**Status**: Draft
---
## Overview
...
## Stakeholders
| Stakeholder | Role | Primary Need |
...
## Functional Requirements
**FR-001**: The system shall...
**FR-002**: The system shall...
## Non-Functional Requirements
### Performance
...
### Security
...
### Accessibility
...
### Scalability
...
## Acceptance Criteria
```gherkin
Scenario: ...
Given ...
When ...
Then ...
Edge Cases & Error Scenarios
Out of Scope
Assumptions
Open Questions
1---2name: requirements-generator3description: Generates structured requirements documents with functional and non-functional requirements, Gherkin acceptance criteria, edge cases, and out-of-scope items.4---56# Requirements Generator78Take a project idea, feature description, or user story and generate a structured requirements document with functional requirements, non-functional requirements, Gherkin acceptance criteria, edge cases, and out-of-scope items.910## Instructions1112**Two modes:**13- **Description mode** (default): user provides a free-form description or pastes a Jira/Confluence URL. Claude generates requirements from that.14- **Interview mode** (`/requirements-generator --interview`): Claude asks a structured set of questions one at a time, then generates requirements from the answers.15161. **Gather input.** Ask the user what they want to build if no description has been provided. Accept any of:17 - A pasted feature description or user story18 - A Jira ticket URL or Confluence page URL (read via available MCP tools if present)19 - A brief verbal description of the feature2021 Prompt: _"Describe the feature or system you want to build. Include the user need it addresses and any known constraints."_2223 If the user invoked with `--interview`, skip this prompt and proceed to the **Interview Mode** section below instead.24252. **Understand the existing codebase** (if one exists). Use Glob on `*` to detect the project structure. Read `package.json`, `pyproject.toml`, or `go.mod` to identify the tech stack. Read 3–5 representative files from `src/` or `app/` — entry points first (`index.*`, `main.*`, `app.*`), then one route/handler file and one model/schema file — to understand patterns and conventions. Do not read the whole source tree. This ensures requirements fit what already exists.26273. **Check for existing requirements.** Use Glob on `docs/requirements/**/*.md`. If matching files exist, read them to avoid duplicating requirements already captured. Note any related requirements in the new document.28294. **Determine the feature name.** Derive a kebab-case feature name from the description (e.g., "user authentication" → `user-authentication`). This becomes the output filename.30315. **Generate the requirements document** with the following sections:3233 ### Overview34 One paragraph summarizing what is being built, the user need it addresses, and why it matters.3536 ### Stakeholders3738 A table of who uses this feature and what they need from it.3940 | Stakeholder | Role | Primary Need |41 |-------------|------|-------------|42 | End User | ... | ... |4344 ### Functional Requirements45 Numbered list using the prefix `FR-NNN` (e.g., FR-001, FR-002). Each requirement must be:46 - Specific and testable47 - Implementation-agnostic (describe _what_, not _how_)48 - Written in the form: "The system shall..."4950 ### Non-Functional Requirements51 Cover all four dimensions:52 - **Performance**: specific response time targets (e.g., "API responses under 200ms at p95")53 - **Security**: authentication requirements, data sensitivity classification, encryption requirements54 - **Accessibility**: WCAG AA compliance, keyboard navigation, screen reader support55 - **Scalability**: expected concurrent users, request volume, data growth projections5657 ### Acceptance Criteria58 Gherkin format (Given/When/Then) — one scenario per key functional requirement. Use this format exactly:5960 ```gherkin61 Scenario: <short description>62 Given <precondition>63 And <additional precondition if needed>64 When <action>65 Then <expected outcome>66 And <additional outcome if needed>67 ```6869 ### Edge Cases & Error Scenarios70 Bulleted list covering:71 - Invalid or malformed input72 - System failures (database down, third-party API timeout)73 - Concurrent access and race conditions74 - Boundary conditions (empty state, maximum limits)75 - Unauthorized access attempts7677 ### Out of Scope78 Explicitly list what this feature does NOT include. This prevents scope creep during implementation. Be specific.7980 ### Assumptions81 List any assumptions made during requirements generation. For each:82 - State the assumption clearly83 - Note what would change if the assumption is wrong8485 ### Open Questions86 List questions that require stakeholder input before implementation can begin. For each question, note:87 - Who is the right person to answer it88 - What the impact is if it is not answered before development starts89906. **Write the document.** Ensure `docs/requirements/` exists (it may need to be created). Use Write to save the document to `docs/requirements/<feature-name>-requirements.md`.91927. **Offer Jira/Confluence integration** (if MCP tools for Atlassian are available in the session). Ask: _"Would you like me to publish this to Confluence or create a Jira epic?"_ If yes, use the available MCP tools to do so.93948. **Confirm completion.** Tell the user the file path, how many functional requirements were generated, and how many acceptance criteria scenarios were written.9596## Interview Mode9798When invoked with `--interview`, conduct a structured interview by asking each question below one at a time. Wait for the user's full answer before proceeding to the next question. Do not ask multiple questions at once.991001. **Who is the primary user?** "Describe the person or system that will use this feature. What is their role, technical level, and what are they trying to accomplish?"1011022. **What problem does this solve?** "What is the user currently unable to do, or what pain point does this address? What happens today without this feature?"1031043. **What does success look like?** "How will you know this feature is working correctly? What would a user be able to do that they couldn't before?"1051064. **What are the constraints?** "Are there technology choices already made (language, framework, cloud provider)? Any performance requirements? Any compliance or regulatory constraints (GDPR, HIPAA, SOC2)?"1071085. **What is explicitly out of scope?** "What are you deliberately NOT building in this version? What might people assume is included but isn't?"1091106. **What could go wrong?** "What edge cases or error scenarios do you anticipate? What happens if the user provides invalid input? What if a dependency is unavailable?"1111127. **Who else is affected?** "Are there other systems, teams, or users impacted by this change? Any backwards compatibility concerns?"113114After collecting all answers, generate the full requirements document using the same format as description mode (FR-NNN requirements, NFRs, Gherkin scenarios, etc.), grounded in the interview answers. Include an **Interview Summary** section at the very top of the generated document (before Overview) that captures each answer in 1–2 sentences.115116```markdown117## Interview Summary118119**Primary user:** ...120**Problem being solved:** ...121**Success criteria:** ...122**Constraints:** ...123**Out of scope:** ...124**Risk areas:** ...125**Other affected parties:** ...126```127128Then continue with the standard sections (Overview, Stakeholders, Functional Requirements, etc.) as defined in the Output Format Reference.129130## Output Format Reference131132```markdown133# Requirements: <Feature Name>134135**Version**: 1.0136**Date**: <today's date>137**Status**: Draft138139---140141## Overview142...143144## Stakeholders145| Stakeholder | Role | Primary Need |146...147148## Functional Requirements149150**FR-001**: The system shall...151**FR-002**: The system shall...152153## Non-Functional Requirements154155### Performance156...157158### Security159...160161### Accessibility162...163164### Scalability165...166167## Acceptance Criteria168169```gherkin170Scenario: ...171 Given ...172 When ...173 Then ...174```175176## Edge Cases & Error Scenarios177- ...178179## Out of Scope180- ...181182## Assumptions183- ...184185## Open Questions186- ...187```