schema_version: "1.0"

extension:
  id: "docguard"
  name: "DocGuard — CDD Enforcement"
  version: "0.33.1"
  description: "Canonical-Driven Development enforcement as a true spec-kit extension. LLM-first design with automated validators, 4 AI behavior skills, spec-kit skill chaining, and workflow hooks. One pinned runtime dependency (@babel/parser); pure Node.js otherwise."
  author: "Ricardo Accioly"
  repository: "https://github.com/raccioly/docguard"
  license: "MIT"
  homepage: "https://www.npmjs.com/package/docguard-cli"

requires:
  speckit_version: ">=0.1.0"
  framework: "spec-kit"  # DocGuard builds on spec-kit conventions (.specify/, skills, constitution)
  tools:
    - name: "node"
      required: true
      version: ">=18.0.0"
    - name: "npx"
      required: true
    - name: "specify"
      required: false
      description: "Spec Kit CLI — enables auto-initialization of SDD workflow during docguard init"

provides:
  commands:
    - name: "speckit.docguard.guard"
      file: "commands/guard.md"
      description: "Run 19-validator quality gate with severity triage and remediation plan"

    - name: "speckit.docguard.fix"
      file: "commands/generate.md"
      description: "AI-driven documentation repair with codebase research and validation loops"

    - name: "speckit.docguard.review"
      file: "commands/diagnose.md"
      description: "Cross-document semantic consistency analysis (read-only)"

    - name: "speckit.docguard.score"
      file: "commands/score.md"
      description: "CDD maturity score with ROI-based improvement roadmap"

    - name: "speckit.docguard.diagnose"
      file: "commands/diagnose.md"
      description: "Diagnose all issues and generate a complete AI remediation plan"

    - name: "speckit.docguard.generate"
      file: "commands/generate.md"
      description: "Reverse-engineer canonical docs from existing codebase"

  # GitHub Actions workflow starters — copyable templates users drop into
  # .github/workflows/ for guard/fix/sync/score integration.
  workflows:
    - name: "docguard-guard"
      file: "templates/github-workflows/docguard-guard.yml"
      description: "Mandatory CI gate — runs all validators on PR + main push"
    - name: "docguard-autofix"
      file: "templates/github-workflows/docguard-autofix.yml"
      description: "PR-time auto-fix — applies mechanical doc fixes + comments summary"

  # Helper scripts for CI/CD and automation
  scripts:
    - name: "docguard-check-docs"
      file: "scripts/bash/docguard-check-docs.sh"
      description: "Discover project docs, return JSON inventory with metadata"

    - name: "docguard-suggest-fix"
      file: "scripts/bash/docguard-suggest-fix.sh"
      description: "Run guard, parse results, output prioritized fix suggestions"

    - name: "docguard-init-doc"
      file: "scripts/bash/docguard-init-doc.sh"
      description: "Initialize a new canonical document with metadata header"

hooks:
  after_implement:
    command: "speckit.docguard.guard"
    optional: true
    prompt: "Run DocGuard validation after implementation?"
    description: "Quality gate — ensures docs stay in sync with code"

  before_tasks:
    command: "speckit.docguard.review"
    optional: true
    prompt: "Review documentation consistency before generating tasks?"

  after_tasks:
    command: "speckit.docguard.score"
    optional: true
    prompt: "Show CDD maturity score after task generation?"

tags:
  - "documentation"
  - "validation"
  - "quality"
  - "cdd"
  - "spec-driven"
  - "traceability"
  - "ai-agents"
  - "enforcement"
  - "spec-kit"
