{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cuddler.dev/standards/document-role/template/v1.0.0/cuddler.template.lint.rules.1.0.0.json",
  "title": "Cuddler Template Lint Rules",
  "description": "Stable lint-rule catalog for Cuddler Template v1.0.0.",
  "specVersion": "1.0.0",
  "rules": [
    {
      "id": "CUDDLER-TPL-001",
      "severity": "error",
      "appliesTo": "specification-document",
      "summary": "Missing BCP 14 boilerplate",
      "condition": "The published Template Document Role omits the normative keyword interpretation clause.",
      "remediation": "Add the RFC 2119 / RFC 8174 boilerplate near the start of the specification."
    },
    {
      "id": "CUDDLER-TPL-010",
      "severity": "error",
      "appliesTo": "template-file|template-schema",
      "summary": "Legacy output metadata names used",
      "condition": "A template file or Template Schema uses primaryOutput or supportedOutputs instead of primaryContentType and supportedContentTypes.",
      "remediation": "Rename legacy output metadata fields to the canonical names and keep instance-level values aligned with schema-level output metadata."
    },
    {
      "id": "CUDDLER-TPL-011",
      "severity": "error",
      "appliesTo": "template-schema",
      "summary": "Template instance $schema is not constrained to schema $id",
      "condition": "A Template Schema allows template-instance $schema values other than the schema $id.",
      "remediation": "Constrain the template-instance $schema field with const equal to the Template Schema $id."
    },
    {
      "id": "CUDDLER-TPL-014",
      "severity": "error",
      "appliesTo": "template-schema",
      "summary": "Instance-visible property missing substantive for-ai guidance",
      "condition": "An instance-visible property lacks a non-empty for-ai Alpaca array or only repeats the field name or type without explaining document intent.",
      "remediation": "Publish well-informed for-ai Alpaca entries that describe the authored markdown role, the expected reader-visible content, and notable exclusions."
    },
    {
      "id": "CUDDLER-TPL-018",
      "severity": "error",
      "appliesTo": "template-schema",
      "summary": "Template schema is not anchored to the published markdown AST",
      "condition": "A document-type Template Schema does not anchor its instance contract to the CommonMark plus GFM Markdig schema or the equivalent MarkdownDocument definition from the report base definitions bundle.",
      "remediation": "Reference the published commonmark-gfm-markdig schema in allOf and then narrow that markdown document shape to the artifact family's exact headings, paragraphs, tables, lists, block quotes, and other allowed markdown nodes."
    },
    {
      "id": "CUDDLER-TPL-021",
      "severity": "error",
      "appliesTo": "template-file|template-schema",
      "summary": "Markdown renderer options drift from the normative profile",
      "condition": "A template document declares renderer or flavor values other than Markdig and CommonMark+GFM, or treats those options as open-ended free text.",
      "remediation": "Constrain options.renderer to Markdig and options.flavor to CommonMark+GFM whenever the template document publishes renderer options."
    },
    {
      "id": "CUDDLER-TPL-041",
      "severity": "error",
      "appliesTo": "template-file",
      "summary": "GFM table alignment count does not match the header width",
      "condition": "A markdown table declares an align array whose length differs from header.cells length.",
      "remediation": "Keep align.length equal to header.cells.length for every markdown table."
    },
    {
      "id": "CUDDLER-TPL-042",
      "severity": "error",
      "appliesTo": "template-file",
      "summary": "GFM table row width does not match the header width",
      "condition": "A markdown table body row has a cell count that differs from the header row cell count.",
      "remediation": "Keep every table body row width aligned to the header width."
    },
    {
      "id": "CUDDLER-TPL-043",
      "severity": "error",
      "appliesTo": "template-file",
      "summary": "Reference-style markdown link or image is unresolved",
      "condition": "A reference-style link or image uses referenceId that does not match any linkReferenceDefinition identifier in the same markdown document.",
      "remediation": "Declare a matching linkReferenceDefinition or switch the link or image to inline style."
    },
    {
      "id": "CUDDLER-TPL-070",
      "severity": "error",
      "appliesTo": "template-file|template-schema",
      "summary": "Paired-schema metadata mismatch",
      "condition": "Template metadata conflicts with the aligned Data Schema or with schema-level cuddler metadata.",
      "remediation": "Keep documentTypeId, schemaVersion, dataSchemaUri, and content-type declarations aligned across paired artifacts."
    },
    {
      "id": "CUDDLER-TPL-080",
      "severity": "warning",
      "appliesTo": "validator",
      "summary": "Format assertion behavior not documented",
      "condition": "A validator claims conformance but does not document how required format assertions are enforced.",
      "remediation": "Declare format-assertion mode or publish equivalent semantic checks."
    }
  ]
}


