kiro-spec-requirements Skill
Core Mission
- Success Criteria:
- Create complete requirements document aligned with steering context
- Follow the project's EARS patterns and constraints for all acceptance criteria
- Focus on core functionality without implementation details
- Make inclusion/exclusion boundaries explicit when scope could otherwise be misread
- Update metadata to track generation status
Execution Steps
Step 1: Gather Context
If steering/spec context is already available from conversation, skip redundant file reads.
Otherwise, load all necessary context:
- Read
.kiro/specs/{feature}/spec.json for language and metadata
- Read
.kiro/specs/{feature}/brief.md if it exists (discovery context: problem, approach, scope decisions, boundary candidates)
- Read
.kiro/specs/{feature}/requirements.md for project description
- Core steering context:
product.md, tech.md, structure.md
- Additional steering files only when directly relevant to feature scope, user personas, business/domain rules, compliance/security constraints, operational constraints, or existing product boundaries
- Relevant local agent skills or playbooks only when they clearly match the feature's host environment or use case and contain domain terminology or workflow rules that shape user-observable requirements
Step 2: Read Guidelines
- Read
rules/ears-format.md from this skill's directory for EARS syntax rules
- Read
rules/requirements-review-gate.md from this skill's directory for pre-write review criteria
- Read
.kiro/settings/templates/specs/requirements.md for document structure
Parallel Research (subagent dispatch)
The following research areas are independent. Decide the optimal decomposition based on project complexity -- split, merge, add, or skip subagents as needed.
Delegate to subagent via Agent tool (keeps exploration out of main context):
- Codebase hints (brownfield projects): Dispatch a subagent to explore existing implementations that inform requirement scope. Example prompt: "Explore this codebase for existing features related to [feature area]. Summarize: (1) what already exists, (2) relevant interfaces/APIs, (3) patterns that new requirements should align with. Return a summary under 150 lines."
- Domain research (when external knowledge is needed): Dispatch a subagent for WebSearch/WebFetch to research domain-specific requirements, standards, or best practices. Return a concise findings summary.
- Additional steering and playbooks: If many steering files or local agent playbooks exist, dispatch a subagent to scan them and return only the sections relevant to this feature.
For greenfield projects with minimal codebase, skip subagent dispatch and load context directly.
After all research completes, synthesize findings in main context before generating requirements.
Step 3: Generate Requirements Draft
- Create initial requirements draft based on project description
- Group related functionality into logical requirement areas
- Apply EARS format to all acceptance criteria
- Use language specified in spec.json
- Preserve terminology continuity across phases:
- discovery =
Boundary Candidates
- requirements = explicit inclusion/exclusion and adjacent expectations when needed
- design =
Boundary Commitments
- tasks =
_Boundary:_
- If scope could be misread, add lightweight boundary context without introducing implementation or architecture ownership detail
- Keep this as a draft until the review gate passes; do not write
requirements.md yet
Step 4: Review Requirements Draft
- Run the
Requirements Review Gate from rules/requirements-review-gate.md
- Review coverage, EARS compliance, ambiguity, adjacent expectations, and scope boundaries before finalizing
- If issues are local to the draft, repair the requirements and review again
- Keep the review bounded to at most 2 repair passes
- If the draft exposes a real scope ambiguity or contradiction, stop and ask the user to clarify instead of writing guessed requirements
Step 5: Finalize and Update Metadata
- Write
.kiro/specs/{feature}/requirements.md only after the requirements review gate passes
- Set
phase: "requirements-generated"
- Set
approvals.requirements.generated: true
- Update
updated_at timestamp
Important Constraints
Requirements Scope: WHAT, not HOW
Requirements describe user-observable behavior, not implementation. Use this to decide what belongs here vs. in design:
Ask the user about (requirements scope):
- Functional scope — what is included and what is excluded
- User-observable behavior — "when X happens, what should the user see/experience?"
- Business rules and edge cases — limits, error conditions, special cases
- Non-functional requirements visible to users — response time expectations, availability, security level
- Adjacent expectations only when they change user-visible behavior or operator expectations — what this feature relies on, and what it explicitly does not own
Do not ask about (design scope — defer to design phase):
- Technology stack choices (database, framework, language)
- Architecture patterns (microservices, monolith, event-driven)
- API design, data models, internal component structure
- How to achieve non-functional requirements (caching strategy, scaling approach)
- Internal ownership mapping, component seams, or implementation boundaries that belong in design
Litmus test: If an EARS acceptance criterion can be written without mentioning any technology, it belongs in requirements. If it requires a technology choice, it belongs in design.
Other Constraints
- Each requirement must be testable and unambiguous. If the project description leaves room for multiple interpretations on scope, behavior, or boundary conditions, ask the user to clarify before generating that requirement. Ask as many questions as needed; do not generate requirements that contain your own assumptions.
- Choose appropriate subject for EARS statements (system/service name for software)
- Requirement headings in requirements.md MUST include a leading numeric ID only (for example: "Requirement 1", "1.", "2 Feature ..."); do not use alphabetic IDs like "Requirement A".
Output Description
Provide output in the language specified in spec.json with:
- Generated Requirements Summary: Brief overview of major requirement areas (3-5 bullets)
- Document Status: Confirm requirements.md updated and spec.json metadata updated
- Review Gate: Confirm the requirements review gate passed
- Next Steps: Guide user on how to proceed (approve and continue, or modify)
Format Requirements:
- Use Markdown headings for clarity
- Include file paths in code blocks
- Keep summary concise (under 300 words)
Safety & Fallback
Error Scenarios
- Missing Project Description: If requirements.md lacks project description, ask user for feature details
- Template Missing: If template files don't exist, use inline fallback structure with warning
- Language Undefined: Default to English (
en) if spec.json doesn't specify language
- Incomplete Requirements: After generation, explicitly ask user if requirements cover all expected functionality
- Steering Directory Empty: Warn user that project context is missing and may affect requirement quality
- Non-numeric Requirement Headings: If existing headings do not include a leading numeric ID (for example, they use "Requirement A"), normalize them to numeric IDs and keep that mapping consistent (never mix numeric and alphabetic labels).
Next Phase: Design Generation
If Requirements Approved:
- Optional Gap Analysis (for existing codebases):
- Run
/kiro-validate-gap {feature} to analyze implementation gap
- Recommended for brownfield projects; skip for greenfield
- Run
/kiro-spec-design {feature} to proceed to design phase
- Or
/kiro-spec-design {feature} -y to auto-approve requirements and proceed directly
If Modifications Needed:
- Provide feedback and re-run
/kiro-spec-requirements {feature}
1---2name: kiro-spec-requirements3description: Generate EARS-format requirements based on project description and steering context. Use when generating requirements from project description.4---56# kiro-spec-requirements Skill78## Core Mission910- **Success Criteria**:11 - Create complete requirements document aligned with steering context12 - Follow the project's EARS patterns and constraints for all acceptance criteria13 - Focus on core functionality without implementation details14 - Make inclusion/exclusion boundaries explicit when scope could otherwise be misread15 - Update metadata to track generation status1617## Execution Steps1819### Step 1: Gather Context2021If steering/spec context is already available from conversation, skip redundant file reads.22Otherwise, load all necessary context:2324- Read `.kiro/specs/{feature}/spec.json` for language and metadata25- Read `.kiro/specs/{feature}/brief.md` if it exists (discovery context: problem, approach, scope decisions, boundary candidates)26- Read `.kiro/specs/{feature}/requirements.md` for project description27- Core steering context: `product.md`, `tech.md`, `structure.md`28- Additional steering files only when directly relevant to feature scope, user personas, business/domain rules, compliance/security constraints, operational constraints, or existing product boundaries29- Relevant local agent skills or playbooks only when they clearly match the feature's host environment or use case and contain domain terminology or workflow rules that shape user-observable requirements3031### Step 2: Read Guidelines3233- Read `rules/ears-format.md` from this skill's directory for EARS syntax rules34- Read `rules/requirements-review-gate.md` from this skill's directory for pre-write review criteria35- Read `.kiro/settings/templates/specs/requirements.md` for document structure3637#### Parallel Research (subagent dispatch)3839The following research areas are independent. Decide the optimal decomposition based on project complexity -- split, merge, add, or skip subagents as needed.4041**Delegate to subagent via Agent tool** (keeps exploration out of main context):4243- **Codebase hints** (brownfield projects): Dispatch a subagent to explore existing implementations that inform requirement scope. Example prompt: "Explore this codebase for existing features related to [feature area]. Summarize: (1) what already exists, (2) relevant interfaces/APIs, (3) patterns that new requirements should align with. Return a summary under 150 lines."44- **Domain research** (when external knowledge is needed): Dispatch a subagent for WebSearch/WebFetch to research domain-specific requirements, standards, or best practices. Return a concise findings summary.45- **Additional steering and playbooks**: If many steering files or local agent playbooks exist, dispatch a subagent to scan them and return only the sections relevant to this feature.4647For greenfield projects with minimal codebase, skip subagent dispatch and load context directly.4849After all research completes, synthesize findings in main context before generating requirements.5051### Step 3: Generate Requirements Draft5253- Create initial requirements draft based on project description54- Group related functionality into logical requirement areas55- Apply EARS format to all acceptance criteria56- Use language specified in spec.json57- Preserve terminology continuity across phases:58 - discovery = `Boundary Candidates`59 - requirements = explicit inclusion/exclusion and adjacent expectations when needed60 - design = `Boundary Commitments`61 - tasks = `_Boundary:_`62- If scope could be misread, add lightweight boundary context without introducing implementation or architecture ownership detail63- Keep this as a draft until the review gate passes; do not write `requirements.md` yet6465### Step 4: Review Requirements Draft6667- Run the `Requirements Review Gate` from `rules/requirements-review-gate.md`68- Review coverage, EARS compliance, ambiguity, adjacent expectations, and scope boundaries before finalizing69- If issues are local to the draft, repair the requirements and review again70- Keep the review bounded to at most 2 repair passes71- If the draft exposes a real scope ambiguity or contradiction, stop and ask the user to clarify instead of writing guessed requirements7273### Step 5: Finalize and Update Metadata7475- Write `.kiro/specs/{feature}/requirements.md` only after the requirements review gate passes76- Set `phase: "requirements-generated"`77- Set `approvals.requirements.generated: true`78- Update `updated_at` timestamp7980## Important Constraints8182### Requirements Scope: WHAT, not HOW8384Requirements describe user-observable behavior, not implementation. Use this to decide what belongs here vs. in design:8586**Ask the user about (requirements scope):**8788- Functional scope — what is included and what is excluded89- User-observable behavior — "when X happens, what should the user see/experience?"90- Business rules and edge cases — limits, error conditions, special cases91- Non-functional requirements visible to users — response time expectations, availability, security level92- Adjacent expectations only when they change user-visible behavior or operator expectations — what this feature relies on, and what it explicitly does not own9394**Do not ask about (design scope — defer to design phase):**9596- Technology stack choices (database, framework, language)97- Architecture patterns (microservices, monolith, event-driven)98- API design, data models, internal component structure99- How to achieve non-functional requirements (caching strategy, scaling approach)100- Internal ownership mapping, component seams, or implementation boundaries that belong in design101102**Litmus test**: If an EARS acceptance criterion can be written without mentioning any technology, it belongs in requirements. If it requires a technology choice, it belongs in design.103104### Other Constraints105106- Each requirement must be testable and unambiguous. If the project description leaves room for multiple interpretations on scope, behavior, or boundary conditions, ask the user to clarify before generating that requirement. Ask as many questions as needed; do not generate requirements that contain your own assumptions.107- Choose appropriate subject for EARS statements (system/service name for software)108- Requirement headings in requirements.md MUST include a leading numeric ID only (for example: "Requirement 1", "1.", "2 Feature ..."); do not use alphabetic IDs like "Requirement A".109110## Output Description111112Provide output in the language specified in spec.json with:1131141. **Generated Requirements Summary**: Brief overview of major requirement areas (3-5 bullets)1152. **Document Status**: Confirm requirements.md updated and spec.json metadata updated1163. **Review Gate**: Confirm the requirements review gate passed1174. **Next Steps**: Guide user on how to proceed (approve and continue, or modify)118119**Format Requirements**:120121- Use Markdown headings for clarity122- Include file paths in code blocks123- Keep summary concise (under 300 words)124125## Safety & Fallback126127### Error Scenarios128129- **Missing Project Description**: If requirements.md lacks project description, ask user for feature details130- **Template Missing**: If template files don't exist, use inline fallback structure with warning131- **Language Undefined**: Default to English (`en`) if spec.json doesn't specify language132- **Incomplete Requirements**: After generation, explicitly ask user if requirements cover all expected functionality133- **Steering Directory Empty**: Warn user that project context is missing and may affect requirement quality134- **Non-numeric Requirement Headings**: If existing headings do not include a leading numeric ID (for example, they use "Requirement A"), normalize them to numeric IDs and keep that mapping consistent (never mix numeric and alphabetic labels).135136### Next Phase: Design Generation137138**If Requirements Approved**:139140- **Optional Gap Analysis** (for existing codebases):141 - Run `/kiro-validate-gap {feature}` to analyze implementation gap142 - Recommended for brownfield projects; skip for greenfield143- Run `/kiro-spec-design {feature}` to proceed to design phase144- Or `/kiro-spec-design {feature} -y` to auto-approve requirements and proceed directly145146**If Modifications Needed**:147148- Provide feedback and re-run `/kiro-spec-requirements {feature}`