version: 2
capabilities:
  - id: orchestration-skill
    category: skill
    title: Orchestration skill portável
    stages: [project-discovery, risk, idea, prd, techspec, tasks, refinement, execution, adr, review, memory]
    trigger: Fluxo SDD completo, etapas isoladas, artifact store, checkpoints e portabilidade entre clients.
    canonical_source: templates/client-skills/orchestration.md
    adapters:
      codex:
        path: .agents/skills/orchestration/SKILL.md
        kind: skill
      claude-code:
        path: .claude/skills/orchestration/SKILL.md
        kind: skill
      cursor:
        path: .cursor/skills/orchestration/SKILL.md
        kind: skill
      devin:
        path: .devin/skills/orchestration/SKILL.md
        kind: skill
      antigravity:
        path: .agents/skills/orchestration/SKILL.md
        kind: skill
      trae:
        path: .trae/skills/orchestration/SKILL.md
        kind: skill
    fallback: Se o client não carregar skills, invoque `sdd orchestration` pelo shell e salve artefatos com `sdd artifact save`.
    validation: [canonical-command, legacy-alias, checkpoints, artifact-store, preserve-pt-br, skill-frontmatter]
    docs:
      - https://developers.openai.com/codex/codex-manual.md
      - https://code.claude.com/docs/en/skills
      - https://opencode.ai/docs/skills/
      - https://cursor.com/docs/skills
  - id: orchestration-command
    category: command
    title: Slash command fino para orchestration
    stages: [project-discovery, risk, idea, prd, techspec, tasks, refinement, execution, adr, review, memory]
    trigger: Entrada slash command/workflow que deve delegar ao harness `sdd`.
    canonical_source: templates/client-skills/orchestration.md
    adapters:
      claude-code:
        path: .claude/commands/orchestration.md
        kind: command
      cursor:
        path: .cursor/commands/orchestration.md
        kind: command
      opencode:
        path: .opencode/commands/orchestration.md
        kind: command
      devin:
        path: .devin/workflows/orchestration.md
        kind: workflow
      trae:
        path: .trae/commands/orchestration.md
        kind: command
    fallback: Rode `sdd orchestration "<ideia>"` diretamente no terminal do projeto.
    validation: [canonical-command, delegates-to-cli]
    docs:
      - https://code.claude.com/docs/en/commands
      - https://opencode.ai/docs/commands/
      - https://docs.devin.ai/product-guides/creating-playbooks
  - id: clients-doctor
    category: command
    title: Doctor de superfícies de clients
    stages: [project-discovery, review]
    trigger: Verificar cobertura de `.codex`, `.claude`, `.cursor`, `.opencode`, `.trae`, `.devin` e `.agents`.
    canonical_source: clients/README.md
    adapters:
      cli:
        command: sdd clients doctor
        kind: cli
      cursor:
        path: .cursor/commands/sdd.md
        command: sdd clients doctor
        kind: command
      devin:
        path: .devin/workflows/sdd.md
        command: sdd clients doctor
        kind: workflow
    fallback: Inspecione os paths listados em `clients/README.md` e rode `sdd clients sync --targets all`.
    validation: [adapter-command, delegates-to-cli]
    docs:
      - clients/README.md
  - id: sdd-mcp-observability
    category: mcp
    title: MCP read-only para artifacts, contexto e traces
    stages: [project-discovery, techspec, execution, review, memory]
    trigger: Consultar contexto SDD, artifacts, traces, execução de agentes e cobertura de clients a partir de um client MCP.
    canonical_source: clients/README.md
    adapters:
      codex:
        path: .mcp.json
        command: sdd mcp serve --root .
        kind: mcp
      claude-code:
        path: .claude/settings.json
        command: sdd mcp serve --root .
        kind: permission
      cursor:
        path: .cursor/mcp.json
        command: sdd mcp serve --root .
        kind: mcp
    fallback: Use `sdd trace list|show|summary|doctor`, `sdd artifact status` e `sdd context build` pelo terminal.
    validation: [mcp-server]
    docs:
      - clients/README.md
  - id: providers-doctor
    category: command
    title: Diagnóstico de provider e login
    stages: [project-discovery, execution, review]
    trigger: Diagnosticar provider/modelo, sessão deslogada, credenciais e fallback offline/provider-neutral.
    canonical_source: clients/README.md
    adapters:
      cli:
        command: sdd providers doctor
        kind: cli
      codex:
        path: clients/codex.md
        command: sdd providers doctor
        kind: doc
      claude-code:
        path: clients/claude-code.md
        command: sdd providers doctor
        kind: doc
      cursor:
        path: clients/cursor.md
        command: sdd providers doctor
        kind: doc
      opencode:
        path: clients/opencode.md
        command: sdd providers doctor
        kind: doc
      devin:
        path: clients/devin.md
        command: sdd providers doctor
        kind: doc
      antigravity:
        path: clients/antigravity.md
        command: sdd providers doctor
        kind: doc
      trae:
        path: clients/trae.md
        command: sdd providers doctor
        kind: doc
    fallback: Use artifact store local, registre provider resolvido e siga com modo offline quando credenciais estiverem ausentes.
    validation: [provider-fallback]
    docs:
      - clients/README.md
  - id: context-recommend
    category: context
    title: Recomendações de skills e rules por projeto
    stages: [project-discovery, techspec, execution, review]
    trigger: Após discovery ou quando a stack mudar, recomendar skills/rules/MCP/hooks específicos do projeto.
    canonical_source: templates/project-discovery.md
    adapters:
      cli:
        command: sdd context recommend
        kind: cli
      codex:
        path: .agents/skills/project-discovery/SKILL.md
        command: sdd context recommend
        kind: skill
      claude-code:
        path: .claude/skills/project-discovery/SKILL.md
        command: sdd context recommend
        kind: skill
    fallback: Gere recomendações manualmente a partir de manifests, CI, comandos, docs e arquivos de agentes do repo.
    validation: [adapter-command, delegates-to-cli, preserve-pt-br]
    docs:
      - templates/project-discovery.md
  - id: team-techspec
    category: command
    title: Agent Team para Tech Spec
    stages: [techspec]
    trigger: Tech Spec complexa, cross-layer, arriscada ou brownfield.
    canonical_source: .claude/commands/team-techspec.md
    adapters:
      claude-code:
        path: .claude/commands/team-techspec.md
        kind: command
      antigravity:
        path: .agents/skills/orchestration-plugin/commands/team-techspec.md
        kind: command
    fallback: Rode as lentes architecture/security/data/test sequencialmente no agente atual e sintetize uma Tech Spec única.
    validation: [preserve-pt-br]
    docs:
      - https://code.claude.com/docs/en/sub-agents
  - id: team-execution
    category: command
    title: Agent Team para Execution
    stages: [execution]
    trigger: Tasks independentes com ownership de arquivos claro.
    canonical_source: .claude/commands/team-execution.md
    adapters:
      claude-code:
        path: .claude/commands/team-execution.md
        kind: command
      antigravity:
        path: .agents/skills/orchestration-plugin/commands/team-execution.md
        kind: command
    fallback: Execute uma task por vez com `execution-discipline`, ownership explícito e verificação fresca.
    validation: [preserve-pt-br]
    docs:
      - https://code.claude.com/docs/en/sub-agents
  - id: team-review
    category: command
    title: Agent Team para Review
    stages: [review]
    trigger: PR não trivial, mudança cross-layer, risco de segurança/performance/dados ou release importante.
    canonical_source: .claude/commands/team-review.md
    adapters:
      claude-code:
        path: .claude/commands/team-review.md
        kind: command
      antigravity:
        path: .agents/skills/orchestration-plugin/commands/team-review.md
        kind: command
    fallback: Rode checklist sequencial de segurança, performance, testes, arquitetura e contratos de dados em modo read-only.
    validation: [preserve-pt-br]
    docs:
      - https://code.claude.com/docs/en/sub-agents
  - id: automation
    category: automation
    title: Automação de PR, CI, deploy, checkpoints e memória
    stages: [review, memory]
    trigger: Acompanhar eventos externos, polling temporário, follow-up de PR/CI/deploy ou checkpoint pendente.
    canonical_source: .claude/commands/automation.md
    adapters:
      claude-code:
        path: .claude/commands/automation.md
        kind: command
      antigravity:
        path: .agents/skills/orchestration-plugin/commands/automation.md
        kind: command
    fallback: Registre evento, prompt, critério de parada e execute acompanhamento manual via `sdd artifact status`.
    validation: [preserve-pt-br]
    docs:
      - https://developers.openai.com/codex/codex-manual.md
  - id: hooks-guardrails
    category: hook
    title: Guardrails de hooks SDD
    stages: [execution, review]
    trigger: Bloquear escrita perigosa, auditar subagents, validar artifact gate e registrar trace local.
    canonical_source: .agents/skills/orchestration-plugin/hooks/hooks.json
    adapters:
      claude-code:
        path: .claude/settings.json
        kind: settings
      antigravity:
        path: .agents/skills/orchestration-plugin/hooks/hooks.json
        kind: hook
    fallback: Rode `sdd hook <nome>` manualmente no harness ou registre a evidência esperada no artifact store.
    validation: [hooks]
    docs:
      - https://code.claude.com/docs/en/hooks
      - https://developers.openai.com/codex/codex-manual.md
  - id: model-routing
    category: routing
    title: Roteamento de modelo por stage
    stages: [project-discovery, risk, idea, prd, techspec, tasks, refinement, execution, adr, review, memory]
    trigger: Selecionar modelo/esforço por etapa sem acoplar o contrato SDD a um provider.
    canonical_source: .codex/sdd-model-routing.toml
    adapters:
      codex:
        path: .codex/sdd-model-routing.toml
        kind: config
      cursor:
        path: .cursor/model-routing.yaml
        kind: config
      opencode:
        path: .opencode/model-routing.yaml
        kind: config
    fallback: Use `sdd providers list` e overrides em `sdd.config.yaml`.
    validation: []
    docs:
      - clients/README.md
