# Workflow configuration template - docs/workflow.yaml
kind: workflow
version: "1"
updated_at: "{{ today }}"

# Task Unit Definition
task_unit:
  id_pattern: "TASK-{role}-{seq}"
  required_fields:
    - id
    - description
    - role
    - status
  statuses:
    - TODO
    - IN_PROGRESS
    - REVIEW
    - DONE

# Standard Dialogue Flow
dialogue_protocol:
  on_start:
    read_files:
      - docs/CONTEXT.md
      - docs/DECISIONS.md
      - docs/ROADMAP.md
      - CONTRIBUTING_AI.md
    actions:
      - "Check current project phase in ROADMAP"
      - "Review git log for recent progress"
      - "Confirm dialogue goal with user"
  on_end:
    update_files:
      - docs/CONTEXT.md
      - docs/CHANGELOG.md
    git_commit: true
    insight_check: true
  standard_flow:
    - step: 1
      actor: human
      action: "Propose task / Ask question"
    - step: 2
      actor: ai
      action: "Confirm understanding / Ask clarifying questions"
      condition: "if requirements unclear"
    - step: 3
      actor: ai
      action: "Propose solution approach"
    - step: 4
      actor: human
      action: "Confirm / Modify approach"
    - step: 5
      actor: ai
      action: "Execute and report progress"
    - step: 6
      actor: human
      action: "Review and accept"

# Requirement Clarification Protocol
requirement_clarification:
  enabled: true
  trigger_conditions:
    - "Description is vague or incomplete"
    - "Missing specific acceptance criteria"
    - "Open to multiple interpretations"
    - "Involves S/A-level decisions"
  clarification_flow:
    - "Identify user intent, extract key information"
    - "Transform into structured requirement description"
    - "List assumptions and items to confirm"
    - "User confirms / corrects / supplements"
    - "Finalize the requirement document"

# Iteration Protocols
iteration_protocols:
  suggestion_management:
    enabled: true
    pm_review_flow:
      - "Collect -> Record in docs/ROADMAP.md Iteration Suggestion Pool"
      - "Review -> Analyze priority, conflicts, cost"
      - "Decide -> Include / Defer / Reject"
      - "Schedule -> Determine development order"
      - "Execute -> Convert to TASK"
  version_review:
    enabled: true
    review_dimensions:
      - "Test Performance"
      - "User Experience Feedback"
      - "Technical Debt"
      - "Iteration Suggestion Pool"
  build_protocol:
    enabled: true
    command: "npm run build"
    dist_entry: "dist/index.html"
    pre_acceptance_checklist:
      - "Run build command"
      - "Open dist entry to test"
      - "Confirm normal operation"
      - "Update instructions if new features added"
  config_level_iteration:
    enabled: true
    commit_prefix: "chore:"
    examples:
      - "Adjusting timeout values"
      - "Changing log levels"
      - "Updating configuration flags"

# QA Acceptance Protocol
qa_acceptance:
  enabled: true
  case_id_pattern: "TC-{module}-{seq}"
  test_case_file: "docs/QA_TEST_CASES.md"
  quick_acceptance_template:
    start_command: "npm run dev"
    items:
      - "Feature A: {operation} -> {expected}"
      - "Feature B: {operation} -> {expected}"
    reply_format:
      pass: "[PASS] All passed"
      issue: "[ISSUE] Problem: {describe the issue}"
