# Story Definition of Done Checklist

This checklist validates that a story is truly complete before marking it as "Done". Used by the Developer Agent in the final step of the develop-story workflow.

## Required Documents
- The story file being validated
- All files listed in the story's File List
- Test results and coverage reports

## LLM Instructions
Execute this checklist systematically, checking each item against the actual story implementation. Mark each item with the appropriate status and provide specific evidence or reasons for the assessment.

## Section 1: Functional Completeness Validation

**LLM Prompt:** "Review the story's acceptance criteria and verify each one has been implemented and is demonstrable. Check the code and tests to confirm functionality."

### Acceptance Criteria Implementation
- [ ] **All acceptance criteria met and verified**
  - Evidence: List each AC and confirm implementation
  - Testing: Verify each AC has associated test coverage
  
- [ ] **All tasks and subtasks completed**  
  - Evidence: Check story file for all checkboxes marked [x]
  - Validation: Verify each task resulted in actual code/test changes
  
- [ ] **Integration requirements satisfied**
  - Evidence: Confirm integration points work correctly
  - Testing: Integration tests pass and cover key scenarios
  
- [ ] **Existing functionality regression tested**
  - Evidence: Existing tests still pass
  - Validation: No degradation in existing feature performance

**Section 1 Pass Criteria:** All items must be checked to pass this section.

## Section 2: Code Quality Standards

**LLM Prompt:** "Evaluate the code quality against the project's established standards and patterns. Focus on maintainability, readability, and adherence to existing conventions."

### Code Standards Compliance
- [ ] **Code follows existing patterns and standards**
  - Evidence: Code style consistent with existing codebase
  - Validation: Linting rules pass, naming conventions followed
  
- [ ] **All tests pass (existing and new)**
  - Evidence: Full test suite execution results
  - Coverage: New code has appropriate test coverage
  
- [ ] **Code reviewed by QA agent**
  - Evidence: QA Results section completed in story file
  - Status: Final Status shows "Approved - Ready for Done"
  
- [ ] **Security considerations addressed**
  - Evidence: No security vulnerabilities introduced
  - Validation: Security-related acceptance criteria met

**Section 2 Pass Criteria:** All items must be checked, with special attention to QA approval.

## Section 3: Documentation and Integration

**LLM Prompt:** "Verify that all documentation is updated and the story integrates properly with the existing system without breaking changes."

### Documentation Requirements
- [ ] **File List complete and accurate**
  - Evidence: All created/modified/deleted files listed
  - Accuracy: File List matches actual code changes
  
- [ ] **Documentation updated if applicable**
  - Evidence: README, API docs, or user guides updated as needed
  - Relevance: Updates reflect new functionality accurately
  
- [ ] **Integration points working correctly**
  - Evidence: All integration points tested and functional
  - Validation: No breaking changes to existing integrations

### System Integration
- [ ] **No breaking changes to existing APIs**
  - Evidence: Existing API contracts maintained
  - Testing: API compatibility tests pass
  
- [ ] **Database changes are backward compatible**
  - Evidence: Migration scripts handle existing data properly
  - Testing: Database migration tested with real data

**Section 3 Pass Criteria:** All documentation and integration items must be verified.

## Section 4: Deployment Readiness

**LLM Prompt:** "Assess whether the story changes are ready for deployment to production, considering all operational aspects."

### Production Readiness
- [ ] **Build process completes successfully**
  - Evidence: Build scripts execute without errors
  - Validation: All dependencies resolved correctly
  
- [ ] **Performance impact assessed**
  - Evidence: No significant performance degradation
  - Testing: Performance tests pass within acceptable thresholds
  
- [ ] **Rollback plan documented and tested**
  - Evidence: Clear rollback procedure exists
  - Testing: Rollback procedure has been verified

### Final Validation
- [ ] **Story status ready to change to "Done"**
  - Evidence: All previous sections pass
  - Confirmation: All stakeholders have approved
  
- [ ] **No blocking issues remain**
  - Evidence: All identified issues resolved or mitigated
  - Status: Dev Agent Record shows successful completion

**Section 4 Pass Criteria:** All deployment readiness items must be satisfied.

## Final Assessment

### Overall Completion Status
**Pass Criteria:** All 4 sections must achieve 100% pass rate.

### Summary Report Template
```
## Story DOD Validation Results

**Story:** [Story Title]
**Validation Date:** [Date]
**Validated By:** Developer Agent

### Section Pass Rates
- Section 1 (Functional): ___/4 items (___%)
- Section 2 (Quality): ___/4 items (___%)  
- Section 3 (Documentation): ___/5 items (___%)
- Section 4 (Deployment): ___/4 items (___%)

**Overall Status:** [PASS/FAIL]

### Failed Items (if any)
[List any items that did not pass with specific reasons]

### Recommendations
[Any recommendations for improvement or next steps]

### Final Decision
[✓ Story Ready for Done] / [✗ Story Requires Additional Work]
```

## Usage Notes
- This checklist is executed by the Developer Agent as the final step in develop-story workflow
- All items must pass before story status can be changed to "Done"
- Any failing items must be addressed before re-running this checklist
- The checklist results should be documented in the story's Dev Agent Record section