version: 1
orchestration:
  canonical_command: orchestration
  legacy_aliases:
    - orchestrator
states:
  orchestration:
    - draft
    - in_progress
    - completed
  artifact:
    - pending
    - optional
    - draft
    - recorded
    - approved
    - skipped
    - in_progress
  tui_status:
    - pending
    - optional
    - in_progress
    - approved
    - skipped
    - unknown
validations:
  diagrams:
    allowed_markers:
      - "```mermaid"
      - ".excalidraw"
      - "assets/diagrams/*.html|*.svg"
      - "não aplicável"
      - "nao aplicavel"
  prompts_agent:
    task_id_patterns:
      - "^T-\\d{2,}$"
      - "^TSK-\\d{2,}$"
artifacts:
  project-discovery:
    gate: true
    aliases:
      - project-discovery
      - discovery
      - descoberta
    required_sections:
      - Rastreabilidade
      - Identidade do projeto
      - Estrutura observada
      - Inventário técnico detalhado
      - Comandos verificados
      - Arquitetura e padrões
      - Linguagem de domínio
      - Riscos do projeto
      - Regras para a pipeline
      - Recomendações de skills e regras
      - Capability map
      - Visualizações e documentação HTML
      - Contexto para próximos agentes
    semantic_validations:
      - traceability
  risk:
    gate: true
    aliases:
      - risk
      - risk-classification
      - classificacao-de-risco
      - classificação-de-risco
    required_sections:
      - Rastreabilidade
      - Classificação de risco
      - Fatores
      - Checkpoints
      - Evidências mínimas
    semantic_validations:
      - traceability
  idea:
    gate: true
    aliases:
      - idea
      - ideia
    required_sections:
      - Rastreabilidade
      - Problema
      - Objetivo
      - Usuários
      - Critérios de sucesso
    semantic_validations:
      - traceability
  prd:
    gate: true
    aliases:
      - prd
      - product-requirements
    required_sections:
      - Rastreabilidade
      - Resumo
      - Objetivos
      - Não objetivos
      - Usuários
      - Requisitos
      - Critérios de aceite
      - Métricas
      - Riscos
      - Diagramas
    semantic_validations:
      - traceability
      - diagrams
  techspec:
    gate: true
    aliases:
      - techspec
      - tech-spec
      - technical-spec
      - spec-tecnica
      - spec-técnica
    required_sections:
      - Rastreabilidade
      - Visão técnica
      - Arquitetura
      - Contratos
      - Dados
      - Segurança
      - Performance
      - Observabilidade
      - Testes
      - Riscos
      - Plano de implementação
      - Diagramas
    semantic_validations:
      - traceability
      - diagrams
  tasks:
    gate: true
    aliases:
      - tasks
      - task
      - backlog
    required_sections:
      - Rastreabilidade
      - Backlog
      - Dependências
      - Critérios de aceite
      - Definition of Done
      - Estratégia de testes
      - Ordem sugerida
      - Prompts Agent
    semantic_validations:
      - traceability
      - prompts-agent
  refinement:
    gate: true
    aliases:
      - refinement
      - refinamento
      - grooming
    required_sections:
      - Rastreabilidade
      - Resumo
      - Solução proposta
      - Pontos de observação
      - Checklist
      - Subtasks
      - Definition of Done
      - Flags e configurações
    semantic_validations:
      - traceability
  execution:
    gate: true
    aliases:
      - execution
      - execucao
      - execução
    required_sections:
      - Rastreabilidade
      - Tarefa
      - Resumo da implementação
      - Arquivos alterados
      - Testes e evidências
      - Riscos e pendências
    semantic_validations:
      - traceability
  adr:
    gate: true
    aliases:
      - adr
      - architecture-decision
      - decisao
      - decisão
    required_sections:
      - Rastreabilidade
      - Status
      - Contexto
      - Problema
      - Decisão
      - Alternativas consideradas
      - Consequências
      - Impactos e riscos
      - Plano de adoção
      - Plano de reversão
      - Evidências
      - Histórico de revisão
    semantic_validations:
      - traceability
  review:
    gate: true
    aliases:
      - review
      - code-review
      - revisao
      - revisão
    required_sections:
      - Rastreabilidade
      - Escopo revisado
      - Evidências
      - Achados
      - Testes
      - Veredito
    semantic_validations:
      - traceability
  memory:
    gate: true
    aliases:
      - memory
      - memoria
      - memória
    required_sections:
      - Estado final
      - Rastreabilidade
      - Decisões
      - Padrões úteis
      - Testes e comandos
      - Pendências
      - Contexto para o próximo agente
    semantic_validations:
      - traceability
  checkpoint:
    gate: true
    aliases:
      - checkpoint
      - gate
    required_sections:
      - Artefato
      - Origem
      - Decisão necessária
      - Evidências
      - Riscos pendentes
    semantic_validations:
      - decision-package
stages:
  - key: project-discovery
    command: discover
    label: Project Discovery
    order: 0
    phase: pre
    filename: 00-project-discovery.md
    optional: false
    guided: false
    board_visible: true
    board_lane: recorded
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: project-discovery
    aliases:
      - project-discovery
      - discover
      - discovery
      - descoberta
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from: []
  - key: risk
    command: risk
    label: Risk Classification
    order: 1
    phase: pre
    filename: 00-risk-classification.md
    optional: false
    guided: false
    board_visible: true
    board_lane: recorded
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: risk
    aliases:
      - risk
      - risk-classification
      - classificação
      - classificacao
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from: []
  - key: idea
    command: idea
    label: Idea
    order: 2
    phase: core
    filename: 01-idea.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: idea
    aliases:
      - idea
      - ideia
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - project-discovery
      - risk
  - key: prd
    command: prd
    label: PRD
    order: 3
    phase: core
    filename: 02-prd.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: true
    initial_state: pending
    artifact_type: prd
    aliases:
      - prd
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - idea
  - key: techspec
    command: techspec
    label: Tech Spec
    order: 4
    phase: core
    filename: 03-techspec.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: true
    initial_state: pending
    artifact_type: techspec
    aliases:
      - techspec
      - tech-spec
      - technical-spec
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - prd
  - key: tasks
    command: tasks
    label: Tasks
    order: 5
    phase: core
    filename: 04-tasks.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: tasks
    aliases:
      - tasks
      - task
      - backlog
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - techspec
  - key: refinement
    command: refinement
    label: Refinement
    order: 6
    phase: core
    filename: 05-refinement.md
    optional: true
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: true
    initial_state: optional
    artifact_type: refinement
    aliases:
      - refinement
      - refinamento
      - grooming
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - tasks
  - key: execution
    command: execution
    label: Execution
    order: 7
    phase: core
    filename: 06-execution.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: execution
    aliases:
      - execution
      - execucao
      - execução
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - tasks
      - refinement
  - key: adr
    command: adr
    label: ADR
    order: 8
    phase: post
    filename: 06-adr.md
    optional: false
    guided: false
    board_visible: true
    board_lane: recorded
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: adr
    aliases:
      - adr
      - architecture-decision
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - execution
  - key: review
    command: review
    label: Review
    order: 9
    phase: core
    filename: 07-review.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: true
    initial_state: pending
    artifact_type: review
    aliases:
      - review
      - revisao
      - revisão
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - execution
      - adr
  - key: memory
    command: memory
    label: Memory
    order: 10
    phase: core
    filename: 08-memory.md
    optional: false
    guided: true
    board_visible: true
    board_lane: guided
    requires_human_checkpoint: false
    initial_state: pending
    artifact_type: memory
    aliases:
      - memory
      - memoria
      - memória
    surfaces:
      - traceability-map
      - artifact-index
      - clients
      - plugin
      - tui
    traceability_from:
      - review
      - adr
