{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json",
  "title": "Workflow Catalog Template Schema",
  "cuddler": {
    "specVersion": "1.0.0",
    "documentTypeId": "workflow-catalog",
    "schemaVersion": "1.0.0",
    "dataSchema": {
      "uri": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/data.schema.json"
    },
    "output": {
      "primaryContentType": "text/html",
      "supportedContentTypes": [
        "text/html",
        "application/pdf"
      ]
    },
    "profile": {
      "id": "workflow-catalog",
      "version": "1.0.0",
      "for-ai": [
        {
          "instruction": "Explain what this Cuddler schema profile governs so AI consumers understand when to use this schema family.",
          "input": "",
          "output": "Workflow Catalog data-and-template schema family for publishing markdown-compliant workflow catalog reports."
        }
      ]
    },
    "schemaLinks": [
      {
        "rel": "related",
        "targetSchema": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/data.schema.json",
        "targetDocumentTypeId": "workflow-catalog",
        "for-ai": [
          {
            "instruction": "Explain why this related schema is linked here and when an AI consumer should follow it.",
            "input": "",
            "output": "Use the paired Workflow Catalog data schema when validating the source workflow facts that later inform the markdown template document governed by this template schema."
          }
        ]
      }
    ],
    "artifactType": "Workflow Catalog",
    "status": "Public normative publication",
    "publisher": "TrackThat Inc.",
    "sourceUrl": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json",
    "attributionNotice": "© 2026 TrackThat. This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). See https://www.cuddler.dev/license/ for the site license summary. You are free to share, use, adapt, and modify this material, including for commercial purposes, provided you give appropriate attribution and include a link to the original source URL and the CC BY 4.0 license at https://creativecommons.org/licenses/by/4.0/.",
    "governingDomainSpecification": {
      "title": "Process Document Role",
      "url": "https://www.cuddler.dev/standards/document-role/process/v1.0.0/"
    },
    "governingArtifactSpecification": {
      "title": "Cuddler Artifact Specification",
      "version": "1.0.0",
      "url": "https://www.cuddler.dev/standards/artifact-specification/v1.0.0/"
    }
  },
  "allOf": [
    {
      "$ref": "https://www.cuddler.dev/standards/document-role/template/v1.0.0/commonmark-gfm-markdig.schema.1.0.0.json"
    },
    {
      "type": "object",
      "required": [
        "$schema",
        "type",
        "options",
        "children"
      ],
      "properties": {
        "$schema": {
          "const": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Canonical schema identity for Workflow Catalog template instances."
            }
          ]
        },
        "type": {
          "const": "document"
        },
        "options": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "renderer",
            "flavor",
            "gfmTagFilterOnHtmlRender"
          ],
          "properties": {
            "renderer": {
              "const": "Markdig"
            },
            "flavor": {
              "const": "CommonMark+GFM"
            },
            "gfmTagFilterOnHtmlRender": {
              "const": true
            },
            "preferReferenceLinks": {
              "type": "boolean"
            }
          },
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Render the workflow catalog report through Markdig using the CommonMark plus GFM feature surface and keep HTML tag filtering enabled."
            }
          ]
        },
        "children": {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/WorkflowCatalogChildren",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Publish the workflow catalog as one ordered markdown document: title, summary, catalog-metrics table, workflow summary table, and authoring guidance list."
            }
          ]
        }
      }
    }
  ],
  "$defs": {
    "TextNode": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "text"
      ],
      "properties": {
        "type": {
          "const": "text"
        },
        "text": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "InlineChildren": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "https://www.cuddler.dev/standards/document-role/template/v1.0.0/commonmark-gfm-markdig.schema.1.0.0.json#/$defs/inlineNode"
      }
    },
    "SingleTextChildren": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/TextNode"
      }
    },
    "SimpleParagraph": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "const": "paragraph"
        },
        "children": {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/InlineChildren"
        }
      }
    },
    "OrderedListItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "const": "listItem"
        },
        "children": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/SimpleParagraph"
          }
        }
      }
    },
    "OrderedList": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "ordered",
        "children",
        "syntax"
      ],
      "properties": {
        "type": {
          "const": "list"
        },
        "ordered": {
          "const": true
        },
        "tight": {
          "type": "boolean"
        },
        "start": {
          "type": "integer",
          "minimum": 1
        },
        "syntax": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "orderedDelimiter"
          ],
          "properties": {
            "orderedDelimiter": {
              "enum": [
                ".",
                ")"
              ]
            }
          }
        },
        "children": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/OrderedListItem"
          }
        }
      }
    },
    "HeadingLevelOne": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "level",
        "children"
      ],
      "properties": {
        "type": {
          "const": "heading"
        },
        "level": {
          "const": 1
        },
        "children": {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/SingleTextChildren"
        }
      }
    },
    "CatalogSummaryHeading": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "level",
        "children"
      ],
      "properties": {
        "type": {
          "const": "heading"
        },
        "level": {
          "const": 2
        },
        "children": {
          "const": [
            {
              "type": "text",
              "text": "Catalog Summary"
            }
          ]
        }
      }
    },
    "WorkflowsHeading": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "level",
        "children"
      ],
      "properties": {
        "type": {
          "const": "heading"
        },
        "level": {
          "const": 2
        },
        "children": {
          "const": [
            {
              "type": "text",
              "text": "Workflows"
            }
          ]
        }
      }
    },
    "AuthoringGuidanceHeading": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "level",
        "children"
      ],
      "properties": {
        "type": {
          "const": "heading"
        },
        "level": {
          "const": 2
        },
        "children": {
          "const": [
            {
              "type": "text",
              "text": "Authoring Guidance"
            }
          ]
        }
      }
    },
    "TableCell": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "children"
      ],
      "properties": {
        "type": {
          "const": "tableCell"
        },
        "children": {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/InlineChildren"
        }
      }
    },
    "CatalogMetricsRow": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "cells"
      ],
      "properties": {
        "type": {
          "const": "tableRow"
        },
        "cells": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/TableCell"
          }
        }
      }
    },
    "WorkflowSummaryRow": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "cells"
      ],
      "properties": {
        "type": {
          "const": "tableRow"
        },
        "cells": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/TableCell"
          }
        }
      }
    },
    "CatalogMetricsTable": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "header",
        "align",
        "rows"
      ],
      "properties": {
        "type": {
          "const": "table"
        },
        "header": {
          "const": {
            "type": "tableRow",
            "cells": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "text": "Metric"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "text": "Value"
                  }
                ]
              }
            ]
          }
        },
        "align": {
          "const": [
            "left",
            "left"
          ]
        },
        "rows": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/CatalogMetricsRow"
          }
        }
      }
    },
    "WorkflowSummaryTable": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "header",
        "align",
        "rows"
      ],
      "properties": {
        "type": {
          "const": "table"
        },
        "header": {
          "const": {
            "type": "tableRow",
            "cells": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "text": "Workflow"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "text": "Description"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "text": "Step Count"
                  }
                ]
              }
            ]
          }
        },
        "align": {
          "const": [
            "left",
            "left",
            "right"
          ]
        },
        "rows": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/WorkflowSummaryRow"
          }
        }
      }
    },
    "WorkflowCatalogChildren": {
      "type": "array",
      "minItems": 8,
      "maxItems": 8,
      "prefixItems": [
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/HeadingLevelOne"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/SimpleParagraph"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/CatalogSummaryHeading"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/CatalogMetricsTable"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/WorkflowsHeading"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/WorkflowSummaryTable"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/AuthoringGuidanceHeading"
        },
        {
          "$ref": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json#/$defs/OrderedList"
        }
      ],
      "items": false
    }
  },
  "for-ai": [
    {
      "instruction": "Use this guidance when preparing a valid value for this schema node.",
      "input": "",
      "output": "Strict v1.0.0 Workflow Catalog Template Schema that validates a markdown-compliant template document JSON using the CommonMark plus GFM Markdig AST. Publish the final reader-visible catalog template structure instead of a binding graph or component tree."
    }
  ]
}


