{
  "$id": "https://plankit.com/pk.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "plankit's policy file. Every key is optional; an absent key means its default. Unknown keys are refused.",
  "properties": {
    "$schema": {
      "description": "The JSON Schema for this file; pk init writes it so an editor validates the file as it is typed.",
      "format": "uri",
      "type": "string"
    },
    "changelog": {
      "additionalProperties": false,
      "properties": {
        "hooks": {
          "additionalProperties": false,
          "properties": {
            "postVersion": {
              "description": "Runs after the version files are stamped and before CHANGELOG.md is written, with `$VERSION`.",
              "type": "string"
            },
            "preCommit": {
              "description": "Runs before the release commit, with `$VERSION`.",
              "type": "string"
            }
          },
          "type": "object"
        },
        "showScope": {
          "default": false,
          "description": "Includes each commit's scope in its changelog entry.",
          "type": "boolean"
        },
        "types": {
          "description": "Maps commit types to changelog sections; a hidden type is tracked and never listed; an empty list means the default table.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "hidden": {
                "type": "boolean"
              },
              "section": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "versionFiles": {
          "description": "JSON files whose root `version` field is stamped in place at release.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "path": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "type"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "guard": {
      "additionalProperties": false,
      "properties": {
        "branches": {
          "description": "The protected branches: a git mutation while one is checked out is judged by `guard.mode`.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "breaking": {
          "default": "ask",
          "description": "A commit whose message carries a breaking marker (`!` or `BREAKING CHANGE`) is questioned, or not.",
          "enum": [
            "ask",
            "off"
          ],
          "type": "string"
        },
        "mode": {
          "default": "block",
          "description": "A git mutation while a protected branch is checked out is denied, questioned, or ignored.",
          "enum": [
            "block",
            "ask",
            "off"
          ],
          "type": "string"
        },
        "push": {
          "default": "block",
          "description": "Any `git push`, on any branch, is denied, questioned, or ignored.",
          "enum": [
            "block",
            "ask",
            "off"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "preserve": {
      "additionalProperties": false,
      "properties": {
        "mode": {
          "default": "manual",
          "description": "An approved plan is committed at once, recorded for `/plankit:preserve` to commit, or ignored.",
          "enum": [
            "auto",
            "manual",
            "off"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "release": {
      "additionalProperties": false,
      "properties": {
        "branch": {
          "description": "The branch releases merge into; empty selects the trunk flow, which tags the default branch.",
          "type": "string"
        },
        "hooks": {
          "additionalProperties": false,
          "properties": {
            "prePush": {
              "description": "Runs after the tag exists and before the push, with `$VERSION` and `$TAG`.",
              "type": "string"
            },
            "preRelease": {
              "description": "Runs before the tag is created, with `$VERSION` and `$TAG`; `--dry-run` rehearses it.",
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    }
  },
  "title": ".pk.json",
  "type": "object"
}
