---
template_id: prd
template_name: Product Requirements Document
version: 2.0
variables:
  - name: title
    type: string
    required: true
    prompt: "Product/Feature title:"
  - name: version
    type: string
    required: true
    default: "1.0"
    prompt: "Document version:"
  - name: status
    type: choice
    required: true
    choices: [Draft, In Review, Approved, Deprecated]
    default: Draft
  - name: owner
    type: string
    required: true
    prompt: "Product owner name:"
  - name: stakeholders
    type: array
    required: false
    prompt: "Stakeholders (comma-separated):"
  - name: problem_statement
    type: text
    required: true
    prompt: "What problem does this solve?"
  - name: goals
    type: array
    required: true
    prompt: "Product goals (comma-separated):"
---

# {{title}}

**Version:** {{version}}
**Status:** {{status}}
**Owner:** {{owner}}
**Date:** {{formatDate now "YYYY-MM-DD"}}

---

## Stakeholders

{{#if stakeholders}}
{{#each stakeholders}}
- {{this}}
{{/each}}
{{else}}
_No stakeholders listed._
{{/if}}

---

## Problem Statement

{{problem_statement}}

---

## Goals

{{#each goals}}
- {{this}}
{{/each}}

{{#if non_goals}}
## Non-Goals

{{#each non_goals}}
- {{this}}
{{/each}}
{{/if}}

---

## User Stories

{{#if user_stories}}
{{#each user_stories}}
### {{add @index 1}}. {{this.persona}}

**As a** {{this.persona}},
**I want** {{this.want}},
**So that** {{this.so_that}}.

{{#if this.priority}}**Priority:** {{this.priority}}{{/if}}

{{/each}}
{{else}}
_User stories to be defined._
{{/if}}

---

## Functional Requirements

{{#if functional_requirements}}
| ID | Requirement | Priority |
|----|-------------|----------|
{{#each functional_requirements}}
| {{this.id}} | {{this.description}} | {{default this.priority "P1"}} |
{{/each}}

{{#each functional_requirements}}
{{#if this.acceptance_criteria}}
### {{this.id}}: Acceptance Criteria

{{#each this.acceptance_criteria}}
- [ ] {{this}}
{{/each}}
{{/if}}
{{/each}}
{{else}}
_Functional requirements to be defined._
{{/if}}

---

## Non-Functional Requirements

{{#if non_functional_requirements}}
| Category | Requirement | Metric |
|----------|-------------|--------|
{{#each non_functional_requirements}}
| {{this.category}} | {{this.requirement}} | {{default this.metric "N/A"}} |
{{/each}}
{{else}}
_Non-functional requirements to be defined._
{{/if}}

---

## Success Metrics

{{#if success_metrics}}
| Metric | Current | Target | Timeline |
|--------|---------|--------|----------|
{{#each success_metrics}}
| {{this.metric}} | {{default this.current "N/A"}} | {{this.target}} | {{default this.timeline "TBD"}} |
{{/each}}
{{else}}
_Success metrics to be defined._
{{/if}}

---

## Milestones

{{#if milestones}}
{{#each milestones}}
### {{this.name}}

{{this.description}}

{{#if this.deliverables}}
**Deliverables:**
{{#each this.deliverables}}
- {{this}}
{{/each}}
{{/if}}

{{/each}}
{{else}}
_Milestones to be defined._
{{/if}}

---

## Risks

{{#if risks}}
| Risk | Impact | Mitigation |
|------|--------|------------|
{{#each risks}}
| {{this.risk}} | {{default this.impact "Medium"}} | {{default this.mitigation "TBD"}} |
{{/each}}
{{else}}
_No risks identified._
{{/if}}

---

## Open Questions

{{#if open_questions}}
{{#each open_questions}}
- [ ] {{this}}
{{/each}}
{{else}}
_No open questions._
{{/if}}

---

**Generated by:** AIOX Template Engine v2.0
**Template Version:** prd-2.0
