# Quality Checklist - R.O.C.K.E.T. Framework
# 4-Level validation system for Mission → Story → Task → Agent cascade

quality_checklist:
  version: "1.0"
  framework: "R.O.C.K.E.T."
  description: "Comprehensive quality validation for cascade workflow"
  
  # Level 1: Mission Quality Gate
  mission_quality:
    threshold: 4.0  # Minimum 4 stars required
    max_score: 5.0
    
    criteria:
      role:
        weight: 1.0
        description: "Clear mission role and purpose definition"
        checkpoints:
          - "Mission role clearly defined"
          - "Purpose statement is specific"
          - "Scope boundaries established"
          - "Accountability assigned"
        
      objective:
        weight: 2.0  # Higher weight for objectives
        description: "Well-defined goals and measurable outcomes"
        checkpoints:
          - "Objective is specific and measurable"
          - "Success criteria are quantifiable"
          - "Timeline is realistic and defined"
          - "Business value is clear"
        
      context:
        weight: 1.0
        description: "Sufficient background and requirements"
        checkpoints:
          - "Business context provided"
          - "Requirements documented"
          - "Constraints identified"
          - "Dependencies mapped"
        
      key_instructions:
        weight: 1.5
        description: "Actionable guidance and execution plan"
        checkpoints:
          - "Execution strategy defined"
          - "Resource requirements specified"
          - "Team assignments appropriate"
          - "Risk mitigation planned"
        
      examples:
        weight: 0.5
        description: "Reference examples and benchmarks"
        checkpoints:
          - "Success examples provided"
          - "Benchmarks established"
          - "Best practices referenced"
          - "Lessons learned included"
        
      tone:
        weight: 1.0
        description: "Consistent voice and communication style"
        checkpoints:
          - "Brand voice maintained"
          - "Tone appropriate for audience"
          - "Messaging consistent"
          - "Communication clear"

  # Level 2: Story Quality Gate  
  story_quality:
    threshold: 4.0
    max_score: 5.0
    
    criteria:
      role:
        weight: 1.0
        description: "Story role within mission context" 
        checkpoints:
          - "Story role in mission clear"
          - "Narrative purpose defined"
          - "Contribution to mission obvious"
          - "Story boundaries established"
        
      objective:
        weight: 2.0
        description: "Specific story outcomes and deliverables"
        checkpoints:
          - "Story objectives measurable"
          - "Deliverables clearly defined"
          - "Acceptance criteria specified"
          - "Definition of done established"
        
      context:
        weight: 1.0
        description: "Story context and background"
        checkpoints:
          - "Mission context maintained"
          - "User perspective included"
          - "Technical context provided"
          - "Business impact clear"
        
      key_instructions:
        weight: 1.5
        description: "Task breakdown and execution plan"
        checkpoints:
          - "Tasks properly defined"
          - "Execution sequence logical"
          - "Agent assignments optimal"
          - "Quality gates implemented"
        
      examples:
        weight: 0.5
        description: "Story examples and references"
        checkpoints:
          - "Similar stories referenced"
          - "Success patterns identified"
          - "Templates provided"
          - "Reference materials linked"
        
      tone:
        weight: 1.0
        description: "Story voice and narrative style"
        checkpoints:
          - "Narrative voice consistent"
          - "Story engaging and clear"
          - "Technical details appropriate"
          - "User perspective maintained"

  # Level 3: Task Quality Gate
  task_quality:
    threshold: 4.0
    max_score: 5.0
    
    criteria:
      role:
        weight: 1.0
        description: "Task role within story context"
        checkpoints:
          - "Task purpose crystal clear"
          - "Contribution to story obvious"
          - "Scope appropriately sized"
          - "Dependencies identified"
        
      objective:
        weight: 2.0
        description: "Specific task outputs and criteria"
        checkpoints:
          - "Outputs clearly specified"
          - "Quality criteria defined"
          - "Completion criteria measurable"
          - "Success metrics established"
        
      context:
        weight: 1.0
        description: "Task context and requirements"
        checkpoints:
          - "Input requirements clear"
          - "Technical constraints known"
          - "Business rules understood"
          - "User needs considered"
        
      key_instructions:
        weight: 1.5
        description: "Execution instructions and guidance"
        checkpoints:
          - "Step-by-step instructions clear"
          - "Agent capabilities matched"
          - "Tools and resources specified"
          - "Quality validation built-in"
        
      examples:
        weight: 0.5
        description: "Task examples and templates"
        checkpoints:
          - "Input examples provided"
          - "Output examples shown"
          - "Templates available"
          - "Reference implementations linked"
        
      tone:
        weight: 1.0
        description: "Task communication and style"
        checkpoints:
          - "Instructions clear and actionable"
          - "Tone appropriate for agent"
          - "Technical level appropriate"
          - "Feedback mechanisms defined"

  # Level 4: Agent Quality Gate
  agent_quality:
    threshold: 4.0
    max_score: 5.0
    
    criteria:
      role:
        weight: 1.0
        description: "Agent role and capabilities alignment"
        checkpoints:
          - "Agent expertise matches task"
          - "Role boundaries respected"
          - "Capabilities sufficient"
          - "Specialization appropriate"
        
      objective:
        weight: 2.0
        description: "Task completion and output quality"
        checkpoints:
          - "All outputs delivered"
          - "Quality criteria met"
          - "Specifications followed"
          - "Acceptance criteria satisfied"
        
      context:
        weight: 1.0
        description: "Context understanding and application"
        checkpoints:
          - "Context properly understood"
          - "Requirements addressed"
          - "Constraints respected"
          - "Integration considered"
        
      key_instructions:
        weight: 1.5
        description: "Instruction following and execution"
        checkpoints:
          - "Instructions followed precisely"
          - "Best practices applied"
          - "Quality processes used"
          - "Validation performed"
        
      examples:
        weight: 0.5
        description: "Example usage and pattern following"
        checkpoints:
          - "Examples properly referenced"
          - "Patterns correctly applied"
          - "Templates used appropriately"
          - "Standards maintained"
        
      tone:
        weight: 1.0
        description: "Communication and brand consistency"
        checkpoints:
          - "Brand voice maintained"
          - "Tone consistent with requirements"
          - "Communication clear"
          - "Feedback provided appropriately"

  # Cascade Integration Rules
  cascade_rules:
    mission_to_story:
      validation_required: true
      handoff_criteria:
        - "Mission quality >= 4.0 stars"
        - "Stories properly spawned"
        - "Team assignments confirmed"
        - "Resource allocation approved"
      
    story_to_task:
      validation_required: true
      handoff_criteria:
        - "Story quality >= 4.0 stars"
        - "Tasks properly defined"
        - "Agent assignments optimal"
        - "Quality gates implemented"
      
    task_to_agent:
      validation_required: true
      handoff_criteria:
        - "Task quality >= 4.0 stars"
        - "Agent capabilities matched"
        - "Instructions complete"
        - "Success criteria clear"
      
    agent_completion:
      validation_required: true
      completion_criteria:
        - "Agent quality >= 4.0 stars"
        - "All outputs delivered"
        - "Quality standards met"
        - "Integration verified"

  # Automated Quality Assurance
  automation:
    enabled: true
    
    auto_checks:
      - "R.O.C.K.E.T. component presence"
      - "Content length validation"
      - "Required field completion"
      - "Template compliance"
      - "Brand consistency"
      - "Ontology compliance"
    
    quality_gates:
      - level: "mission"
        auto_advance: false  # Requires manual approval
        notifications: ["mission-commander", "project-lead"]
        
      - level: "story"
        auto_advance: true   # Can auto-advance if quality met
        notifications: ["story-teller", "team-lead"]
        
      - level: "task"
        auto_advance: true
        notifications: ["task-master", "agent-coordinator"]
        
      - level: "agent"
        auto_advance: true
        notifications: ["quality-guardian", "completion-tracker"]
    
    reporting:
      frequency: "real-time"
      dashboards: ["quality-metrics", "cascade-progress", "agent-performance"]
      alerts: ["quality-failures", "cascade-blocks", "completion-delays"]

# Quality Improvement
continuous_improvement:
  learning_enabled: true
  
  feedback_loops:
    - "Quality score trending analysis"
    - "Common failure pattern identification"
    - "Best practice propagation"
    - "Template optimization"
  
  optimization:
    - "Criteria weight adjustment based on outcomes"
    - "Threshold tuning based on performance"
    - "Automation rule refinement"
    - "Checklist evolution based on usage"