Skip to content

Schema Overview

PRISM uses a JSON schema to define the structure of documents. The schema is auto-generated from Go types, ensuring consistency between the library and documentation.

Document Structure

{
  "$schema": "https://github.com/grokify/prism/schema/prism.schema.json",
  "metadata": { ... },
  "metrics": [ ... ],
  "maturity": { ... }
}

Top-Level Fields

Field Type Required Description
$schema string No JSON Schema URL for validation
metadata object No Document metadata
metrics array Yes List of metrics
maturity object No Maturity model configuration
okrs array No OKR mappings
initiatives array No Related initiatives

Classification Hierarchy

PRISM organizes metrics in a three-level hierarchy:

Domain (security, operations)
  └── Stage (design, build, test, runtime, response)
       └── Category (prevention, detection, response, reliability, efficiency, quality)

Schema Files

File Description
schema/prism.schema.json Full JSON Schema
schema/embed.go Go embed directives
schema/generate.go Schema generator

Generating the Schema

The schema is auto-generated from Go types:

cd schema
go run generate.go

Using the Schema

In JSON Files

{
  "$schema": "https://github.com/grokify/prism/schema/prism.schema.json",
  "metrics": [...]
}

In Go Code

import "github.com/grokify/prism/schema"

schemaJSON := schema.PRISMSchemaJSON()