Documentation Creation Criteria
Templates
- prd-template.md - Product Requirements Document template
- adr-template.md - Architecture Decision Record template
- design-template.md - Technical Design Document template
- plan-template.md - Work Plan template
- task-template.md - Task file template for implementation tasks
Creation Decision Matrix
| Condition |
Required Documents |
Creation Order |
| New Feature Addition |
PRD → [ADR] → Design Doc → Work Plan |
After PRD approval |
| ADR Conditions Met (see below) |
ADR → Design Doc → Work Plan |
Start immediately |
| 6+ Files |
ADR → Design Doc → Work Plan (Required) |
Start immediately |
| 3-5 Files |
Design Doc → Work Plan (Recommended) |
Start immediately |
| 1-2 Files |
None |
Direct implementation |
ADR Creation Conditions (Required if Any Apply)
1. Contract System Changes
- Adding nested contracts with 3+ levels:
Contract A { Contract B { Contract C { field: T } } }
- Rationale: Deep nesting has high complexity and wide impact scope
- Changing/deleting contracts used in 3+ locations
- Rationale: Multiple location impacts require careful consideration
- Contract responsibility changes (e.g., DTO→Entity, Request→Domain)
- Rationale: Conceptual model changes affect design philosophy
2. Data Flow Changes
- Storage location changes (DB→File, Memory→Cache)
- Processing order changes with 3+ steps
- Example: "Input→Validation→Save" to "Input→Save→Async Validation"
- Data passing method changes (parameter passing→shared state, direct reference→event-based communication)
3. Architecture Changes
- Layer addition, responsibility changes, component relocation
4. External Dependency Changes
- Library/framework/external API introduction or replacement
5. Complex Implementation Logic (Regardless of Scale)
- Managing 3+ states
- Coordinating 5+ asynchronous processes
Detailed Document Definitions
PRD (Product Requirements Document)
Purpose: Define business requirements and user value
Includes:
- Business requirements and user value
- Success metrics and KPIs (measurable format)
- User stories and use cases
- MoSCoW prioritization (Must/Should/Could/Won't)
- MVP and Future phase separation
- User journey diagram (required)
- Scope boundary diagram (required)
Excludes:
- Technical implementation details (→Design Doc)
- Technical selection rationale (→ADR)
- Implementation phases (→Work Plan)
- Task breakdown (→Work Plan)
ADR (Architecture Decision Record)
Purpose: Record technical decision rationale and background
Includes:
- Decision (what was selected)
- Rationale (why that selection was made)
- Option comparison (minimum 3 options) and trade-offs
- Architecture impact
- Principled implementation guidelines (e.g., "Use dependency injection")
Excludes:
- Implementation schedule, duration (→Work Plan)
- Detailed implementation procedures (→Design Doc)
- Specific code examples (→Design Doc)
- Resource assignments (→Work Plan)
Design Document
Purpose: Define technical implementation methods in detail
Includes:
- Existing codebase analysis (required)
- Implementation path mapping (both existing and new)
- Integration point clarification (connection points with existing code even for new implementations)
- Technical implementation approach (vertical/horizontal/hybrid)
- Technical dependencies and implementation constraints (required implementation order)
- Interface and contract definitions
- Data flow and component design
- E2E verification procedures at integration points
- Acceptance criteria (measurable format)
- Change impact map (clearly specify direct impact/indirect impact/no ripple effect)
- Complete enumeration of integration points
- Data contract clarification
- Agreement checklist (agreements with stakeholders)
- Prerequisite ADRs (including common ADRs)
Required Structural Elements:
Change Impact Map:
Change Target: [Component/Feature]
Direct Impact: [Files/Functions]
Indirect Impact: [Data format/Processing time]
No Ripple Effect: [Unaffected features]
Interface Change Matrix:
Existing: [Function/method/operation name]
New: [Function/method/operation name]
Conversion Required: [Yes/No]
Compatibility Method: [Approach]
Excludes:
- Why that technology was chosen (→Reference ADR)
- When to implement, duration (→Work Plan)
- Who will implement (→Work Plan)
Work Plan
Purpose: Implementation task management and progress tracking
Includes:
- Task breakdown and dependencies (maximum 2 levels)
- Schedule and duration estimates
- Copy E2E verification procedures from Design Doc (cannot delete, can add)
- Phase 4 Quality Assurance Phase (required)
- Progress records (checkbox format)
Excludes:
- Technical rationale (→ADR)
- Design details (→Design Doc)
Phase Division Criteria:
- Phase 1: Foundation Implementation - Contract definitions, interfaces/signatures, test preparation
- Phase 2: Core Feature Implementation - Business logic, unit tests
- Phase 3: Integration Implementation - External connections, presentation layer
- Phase 4: Quality Assurance (Required) - Acceptance criteria achievement, all tests passing, quality checks
Three Elements of Task Completion Definition:
- Implementation Complete: Code is functional
- Quality Complete: Tests, static checks, linting pass
- Integration Complete: Verified connection with other components
Creation Process
- Problem Analysis: Change scale assessment, ADR condition check
- ADR Option Consideration (ADR only): Compare 3+ options, specify trade-offs
- Creation: Use templates, include measurable conditions
- Approval: "Accepted" after review enables implementation
Storage Locations
| Document |
Path |
Naming Convention |
Template |
| PRD |
docs/prd/ |
[feature-name]-prd.md |
prd-template.md |
| ADR |
docs/adr/ |
ADR-[4-digits]-[title].md |
adr-template.md |
| Design Doc |
docs/design/ |
[feature-name]-design.md |
design-template.md |
| Work Plan |
docs/plans/ |
YYYYMMDD-{type}-{description}.md |
plan-template.md |
| Task File |
docs/plans/tasks/ |
{plan-name}-task-{number}.md |
task-template.md |
*Note: Work plans are excluded by .gitignore
ADR Status
Proposed → Accepted → Deprecated/Superseded/Rejected
AI Automation Rules
- 5+ files: Suggest ADR creation
- Contract/data flow change detected: ADR mandatory
- Check existing ADRs before implementation
Diagram Requirements
Required diagrams for each document (using mermaid notation):
| Document |
Required Diagrams |
Purpose |
| PRD |
User journey diagram, Scope boundary diagram |
Clarify user experience and scope |
| ADR |
Option comparison diagram (when needed) |
Visualize trade-offs |
| Design Doc |
Architecture diagram, Data flow diagram |
Understand technical structure |
| Work Plan |
Phase structure diagram, Task dependency diagram |
Clarify implementation order |
Common ADR Relationships
- At creation: Identify common technical areas (logging, error handling, async processing, etc.), reference existing common ADRs
- When missing: Consider creating necessary common ADRs
- Design Doc: Specify common ADRs in "Prerequisite ADRs" section
- Compliance check: Verify design aligns with common ADR decisions
1---2name: documentation-criteria-33description: Documentation creation criteria including PRD, ADR, Design Doc, and Work Plan requirements with templates. Use when creating or reviewing technical documents, or determining which documents are required.4---5
6# Documentation Creation Criteria
7
8## Templates
9
10- **[prd-template.md](references/prd-template.md)** - Product Requirements Document template
11- **[adr-template.md](references/adr-template.md)** - Architecture Decision Record template
12- **[design-template.md](references/design-template.md)** - Technical Design Document template
13- **[plan-template.md](references/plan-template.md)** - Work Plan template
14- **[task-template.md](references/task-template.md)** - Task file template for implementation tasks
15
16## Creation Decision Matrix
17
18| Condition | Required Documents | Creation Order |
19|-----------|-------------------|----------------|
20| New Feature Addition | PRD → [ADR] → Design Doc → Work Plan | After PRD approval |
21| ADR Conditions Met (see below) | ADR → Design Doc → Work Plan | Start immediately |
22| 6+ Files | ADR → Design Doc → Work Plan (Required) | Start immediately |
23| 3-5 Files | Design Doc → Work Plan (Recommended) | Start immediately |
24| 1-2 Files | None | Direct implementation |
25
26## ADR Creation Conditions (Required if Any Apply)
27
28### 1. Contract System Changes
29- **Adding nested contracts with 3+ levels**: `Contract A { Contract B { Contract C { field: T } } }`
30 - Rationale: Deep nesting has high complexity and wide impact scope
31- **Changing/deleting contracts used in 3+ locations**
32 - Rationale: Multiple location impacts require careful consideration
33- **Contract responsibility changes** (e.g., DTO→Entity, Request→Domain)
34 - Rationale: Conceptual model changes affect design philosophy
35
36### 2. Data Flow Changes
37- **Storage location changes** (DB→File, Memory→Cache)
38- **Processing order changes with 3+ steps**
39 - Example: "Input→Validation→Save" to "Input→Save→Async Validation"
40- **Data passing method changes** (parameter passing→shared state, direct reference→event-based communication)
41
42### 3. Architecture Changes
43- Layer addition, responsibility changes, component relocation
44
45### 4. External Dependency Changes
46- Library/framework/external API introduction or replacement
47
48### 5. Complex Implementation Logic (Regardless of Scale)
49- Managing 3+ states
50- Coordinating 5+ asynchronous processes
51
52## Detailed Document Definitions
53
54### PRD (Product Requirements Document)
55
56**Purpose**: Define business requirements and user value
57
58**Includes**:
59- Business requirements and user value
60- Success metrics and KPIs (measurable format)
61- User stories and use cases
62- MoSCoW prioritization (Must/Should/Could/Won't)
63- MVP and Future phase separation
64- User journey diagram (required)
65- Scope boundary diagram (required)
66
67**Excludes**:
68- Technical implementation details (→Design Doc)
69- Technical selection rationale (→ADR)
70- **Implementation phases** (→Work Plan)
71- **Task breakdown** (→Work Plan)
72
73### ADR (Architecture Decision Record)
74
75**Purpose**: Record technical decision rationale and background
76
77**Includes**:
78- Decision (what was selected)
79- Rationale (why that selection was made)
80- Option comparison (minimum 3 options) and trade-offs
81- Architecture impact
82- Principled implementation guidelines (e.g., "Use dependency injection")
83
84**Excludes**:
85- Implementation schedule, duration (→Work Plan)
86- Detailed implementation procedures (→Design Doc)
87- Specific code examples (→Design Doc)
88- Resource assignments (→Work Plan)
89
90### Design Document
91
92**Purpose**: Define technical implementation methods in detail
93
94**Includes**:
95- **Existing codebase analysis** (required)
96 - Implementation path mapping (both existing and new)
97 - Integration point clarification (connection points with existing code even for new implementations)
98- Technical implementation approach (vertical/horizontal/hybrid)
99- **Technical dependencies and implementation constraints** (required implementation order)
100- Interface and contract definitions
101- Data flow and component design
102- **E2E verification procedures at integration points**
103- **Acceptance criteria (measurable format)**
104- Change impact map (clearly specify direct impact/indirect impact/no ripple effect)
105- Complete enumeration of integration points
106- Data contract clarification
107- **Agreement checklist** (agreements with stakeholders)
108- **Prerequisite ADRs** (including common ADRs)
109
110**Required Structural Elements**:
111```yaml
112Change Impact Map:
113 Change Target: [Component/Feature]
114 Direct Impact: [Files/Functions]
115 Indirect Impact: [Data format/Processing time]
116 No Ripple Effect: [Unaffected features]
117
118Interface Change Matrix:
119 Existing: [Function/method/operation name]
120 New: [Function/method/operation name]
121 Conversion Required: [Yes/No]
122 Compatibility Method: [Approach]
123```
124
125**Excludes**:
126- Why that technology was chosen (→Reference ADR)
127- When to implement, duration (→Work Plan)
128- Who will implement (→Work Plan)
129
130### Work Plan
131
132**Purpose**: Implementation task management and progress tracking
133
134**Includes**:
135- Task breakdown and dependencies (maximum 2 levels)
136- Schedule and duration estimates
137- **Copy E2E verification procedures from Design Doc** (cannot delete, can add)
138- **Phase 4 Quality Assurance Phase (required)**
139- Progress records (checkbox format)
140
141**Excludes**:
142- Technical rationale (→ADR)
143- Design details (→Design Doc)
144
145**Phase Division Criteria**:
1461. **Phase 1: Foundation Implementation** - Contract definitions, interfaces/signatures, test preparation
1472. **Phase 2: Core Feature Implementation** - Business logic, unit tests
1483. **Phase 3: Integration Implementation** - External connections, presentation layer
1494. **Phase 4: Quality Assurance (Required)** - Acceptance criteria achievement, all tests passing, quality checks
150
151**Three Elements of Task Completion Definition**:
1521. **Implementation Complete**: Code is functional
1532. **Quality Complete**: Tests, static checks, linting pass
1543. **Integration Complete**: Verified connection with other components
155
156## Creation Process
157
1581. **Problem Analysis**: Change scale assessment, ADR condition check
1592. **ADR Option Consideration** (ADR only): Compare 3+ options, specify trade-offs
1603. **Creation**: Use templates, include measurable conditions
1614. **Approval**: "Accepted" after review enables implementation
162
163## Storage Locations
164
165| Document | Path | Naming Convention | Template |
166|----------|------|------------------|----------|
167| PRD | `docs/prd/` | `[feature-name]-prd.md` | [prd-template.md](references/prd-template.md) |
168| ADR | `docs/adr/` | `ADR-[4-digits]-[title].md` | [adr-template.md](references/adr-template.md) |
169| Design Doc | `docs/design/` | `[feature-name]-design.md` | [design-template.md](references/design-template.md) |
170| Work Plan | `docs/plans/` | `YYYYMMDD-{type}-{description}.md` | [plan-template.md](references/plan-template.md) |
171| Task File | `docs/plans/tasks/` | `{plan-name}-task-{number}.md` | [task-template.md](references/task-template.md) |
172
173*Note: Work plans are excluded by `.gitignore`
174
175## ADR Status
176`Proposed` → `Accepted` → `Deprecated`/`Superseded`/`Rejected`
177
178## AI Automation Rules
179- 5+ files: Suggest ADR creation
180- Contract/data flow change detected: ADR mandatory
181- Check existing ADRs before implementation
182
183## Diagram Requirements
184
185Required diagrams for each document (using mermaid notation):
186
187| Document | Required Diagrams | Purpose |
188|----------|------------------|---------|
189| PRD | User journey diagram, Scope boundary diagram | Clarify user experience and scope |
190| ADR | Option comparison diagram (when needed) | Visualize trade-offs |
191| Design Doc | Architecture diagram, Data flow diagram | Understand technical structure |
192| Work Plan | Phase structure diagram, Task dependency diagram | Clarify implementation order |
193
194## Common ADR Relationships
1951. **At creation**: Identify common technical areas (logging, error handling, async processing, etc.), reference existing common ADRs
1962. **When missing**: Consider creating necessary common ADRs
1973. **Design Doc**: Specify common ADRs in "Prerequisite ADRs" section
1984. **Compliance check**: Verify design aligns with common ADR decisions