{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/releasekit/latest.json",
  "title": "ReleaseKit Configuration",
  "description": "Configuration schema for ReleaseKit - Automated versioning, changelog generation, and publishing",
  "x-lintel": {
    "source": "https://goosewobbler.github.io/releasekit/schema.json",
    "sourceSha256": "14259fcecf86b3a08222a3fb27cc6aa026e22a28ea63f985d63e5c7e3e7fe655",
    "fileMatch": [
      "releasekit.config.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON schema reference URL"
    },
    "git": {
      "type": "object",
      "description": "Git configuration",
      "properties": {
        "remote": {
          "type": "string",
          "default": "origin",
          "description": "Git remote name"
        },
        "branch": {
          "type": "string",
          "default": "main",
          "description": "Default branch name"
        },
        "pushMethod": {
          "type": "string",
          "enum": [
            "auto",
            "ssh",
            "https"
          ],
          "default": "auto",
          "description": "Method for pushing to remote"
        },
        "push": {
          "type": "boolean",
          "description": "Whether to push changes to remote"
        },
        "httpsTokenEnv": {
          "type": "string",
          "description": "Environment variable name containing a GitHub token for HTTPS pushes"
        },
        "skipHooks": {
          "type": "boolean",
          "description": "Skip Git hooks when committing"
        }
      },
      "additionalProperties": false
    },
    "monorepo": {
      "type": "object",
      "description": "Monorepo configuration",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "root",
            "packages",
            "both"
          ],
          "description": "Changelog aggregation mode"
        },
        "rootPath": {
          "type": "string",
          "description": "Path to root changelog"
        },
        "packagesPath": {
          "type": "string",
          "description": "Path to packages directory"
        },
        "mainPackage": {
          "type": "string",
          "description": "Main package name for versioning"
        }
      },
      "additionalProperties": false
    },
    "version": {
      "type": "object",
      "description": "Versioning configuration",
      "properties": {
        "tagTemplate": {
          "type": "string",
          "default": "${prefix}${version}",
          "description": "Template for Git tags. Available variables: ${version} (version number), ${prefix} (versionPrefix value, e.g. 'v'), ${packageName} (sanitized package name, e.g. 'scope-pkg'). Example: \"${packageName}-${prefix}${version}\" produces \"scope-pkg-v1.2.3\"."
        },
        "packageSpecificTags": {
          "type": "boolean",
          "default": false,
          "description": "Enable package-specific tagging"
        },
        "preset": {
          "type": "string",
          "default": "conventional",
          "description": "Commit convention preset"
        },
        "sync": {
          "type": "boolean",
          "default": true,
          "description": "Sync versions across packages"
        },
        "packages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [],
          "description": "Packages to include in versioning"
        },
        "mainPackage": {
          "type": "string",
          "description": "Package to use for version determination"
        },
        "updateInternalDependencies": {
          "type": "string",
          "enum": [
            "major",
            "minor",
            "patch",
            "no-internal-update"
          ],
          "default": "minor",
          "description": "How to bump internal dependencies"
        },
        "skip": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Packages to exclude from versioning"
        },
        "commitMessage": {
          "type": "string",
          "description": "Template for release commit messages"
        },
        "versionStrategy": {
          "type": "string",
          "enum": [
            "branchPattern",
            "commitMessage"
          ],
          "default": "commitMessage",
          "description": "Strategy for determining version bumps"
        },
        "branchPatterns": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "pattern": {
                "type": "string"
              },
              "releaseType": {
                "type": "string",
                "enum": [
                  "major",
                  "minor",
                  "patch",
                  "prerelease"
                ]
              }
            },
            "required": [
              "pattern",
              "releaseType"
            ]
          },
          "description": "Branch name patterns for version determination"
        },
        "defaultReleaseType": {
          "type": "string",
          "enum": [
            "major",
            "minor",
            "patch",
            "prerelease"
          ],
          "description": "Default release type when no pattern matches"
        },
        "mismatchStrategy": {
          "type": "string",
          "enum": [
            "error",
            "warn",
            "ignore",
            "prefer-package",
            "prefer-git"
          ],
          "default": "warn",
          "description": "How to handle version mismatches"
        },
        "versionPrefix": {
          "type": "string",
          "default": "",
          "description": "Prefix for version tags"
        },
        "prereleaseIdentifier": {
          "type": "string",
          "description": "Identifier for prerelease versions (e.g., 'alpha', 'beta')"
        },
        "baseBranch": {
          "type": "string",
          "description": "Base branch for versioning"
        },
        "strictReachable": {
          "type": "boolean",
          "default": false,
          "description": "Only use reachable tags"
        },
        "cargo": {
          "type": "object",
          "description": "Cargo/Rust configuration",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable Cargo.toml version handling"
            },
            "paths": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Directories to search for Cargo.toml files"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "publish": {
      "type": "object",
      "description": "Publishing configuration",
      "properties": {
        "git": {
          "type": "object",
          "description": "Git publishing options",
          "properties": {
            "push": {
              "type": "boolean",
              "default": true,
              "description": "Push tags and commits to remote"
            },
            "pushMethod": {
              "type": "string",
              "enum": [
                "auto",
                "ssh",
                "https"
              ],
              "description": "Push method override"
            },
            "remote": {
              "type": "string",
              "description": "Remote name override"
            },
            "branch": {
              "type": "string",
              "description": "Branch name override"
            },
            "httpsTokenEnv": {
              "type": "string",
              "description": "Environment variable name containing a GitHub token for HTTPS pushes"
            },
            "skipHooks": {
              "type": "boolean",
              "description": "Skip Git hooks when committing"
            }
          }
        },
        "npm": {
          "type": "object",
          "description": "NPM publishing configuration",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable NPM publishing"
            },
            "auth": {
              "type": "string",
              "enum": [
                "auto",
                "oidc",
                "token"
              ],
              "default": "auto",
              "description": "Authentication method"
            },
            "provenance": {
              "type": "boolean",
              "default": true,
              "description": "Enable npm provenance attestation"
            },
            "access": {
              "type": "string",
              "enum": [
                "public",
                "restricted"
              ],
              "default": "public",
              "description": "Package access level"
            },
            "registry": {
              "type": "string",
              "default": "https://registry.npmjs.org",
              "description": "NPM registry URL"
            },
            "copyFiles": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [
                "LICENSE"
              ],
              "description": "Files to copy to package before publishing"
            },
            "tag": {
              "type": "string",
              "default": "latest",
              "description": "NPM dist tag"
            }
          },
          "additionalProperties": false
        },
        "cargo": {
          "type": "object",
          "description": "Cargo publishing configuration",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false,
              "description": "Enable Cargo publishing"
            },
            "noVerify": {
              "type": "boolean",
              "default": false,
              "description": "Skip verification before publish"
            },
            "publishOrder": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [],
              "description": "Order in which to publish packages"
            },
            "clean": {
              "type": "boolean",
              "default": false,
              "description": "Clean before publishing"
            }
          },
          "additionalProperties": false
        },
        "githubRelease": {
          "type": "object",
          "description": "GitHub Release configuration",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable GitHub releases"
            },
            "draft": {
              "type": "boolean",
              "default": true,
              "description": "Create as draft release"
            },
            "perPackage": {
              "type": "boolean",
              "default": true,
              "description": "Create separate release per package"
            },
            "prerelease": {
              "oneOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "auto"
                  ]
                }
              ],
              "default": "auto",
              "description": "Mark as prerelease"
            },
            "body": {
              "type": "string",
              "enum": [
                "auto",
                "releaseNotes",
                "changelog",
                "generated",
                "none"
              ],
              "default": "auto",
              "description": "Source for GitHub release body. 'auto': use release notes if enabled, else changelog, else GitHub auto. 'releaseNotes': use LLM-generated release notes. 'changelog': use changelog entries. 'generated': GitHub auto-generated. 'none': no body."
            },
            "titleTemplate": {
              "type": "string",
              "default": "${packageName}: ${version}",
              "description": "Template for the GitHub release title when a package name is resolved. Available variables: ${packageName} (original scoped name, e.g. '@scope/pkg'), ${version} (e.g. 'v1.0.0'). Version-only tags always use the tag string directly."
            }
          },
          "additionalProperties": false
        },
        "verify": {
          "type": "object",
          "description": "Registry verification configuration",
          "properties": {
            "npm": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": true,
                  "description": "Verify NPM publish"
                },
                "maxAttempts": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 5,
                  "description": "Maximum verification attempts"
                },
                "initialDelay": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 15000,
                  "description": "Initial delay in milliseconds"
                },
                "backoffMultiplier": {
                  "type": "number",
                  "minimum": 1,
                  "default": 2,
                  "description": "Exponential backoff multiplier"
                }
              },
              "additionalProperties": false
            },
            "cargo": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": true,
                  "description": "Verify Cargo publish"
                },
                "maxAttempts": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 10,
                  "description": "Maximum verification attempts"
                },
                "initialDelay": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 30000,
                  "description": "Initial delay in milliseconds"
                },
                "backoffMultiplier": {
                  "type": "number",
                  "minimum": 1,
                  "default": 2,
                  "description": "Exponential backoff multiplier"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "notes": {
      "type": "object",
      "description": "Changelog and release notes configuration",
      "properties": {
        "changelog": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ],
              "description": "Set to false to disable changelog generation"
            },
            {
              "type": "object",
              "description": "Changelog file configuration",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "root",
                    "packages",
                    "both"
                  ],
                  "description": "Where to write changelog files. root: repo root only. packages: per-package (monorepos). both: repo root and per-package. When omitted entirely (no changelog config), defaults to root."
                },
                "file": {
                  "type": "string",
                  "description": "Changelog file name override (default: CHANGELOG.md)"
                },
                "templates": {
                  "type": "object",
                  "description": "Template configuration for changelog",
                  "properties": {
                    "path": {
                      "type": "string",
                      "description": "Path to custom template"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "handlebars",
                        "liquid",
                        "ejs"
                      ],
                      "description": "Template engine"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "releaseNotes": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ],
              "description": "Set to false to disable release notes"
            },
            {
              "type": "object",
              "description": "Release notes configuration",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "root",
                    "packages",
                    "both"
                  ],
                  "description": "Where to write release notes file. Omit to skip file output (LLM still runs if configured)."
                },
                "file": {
                  "type": "string",
                  "description": "Release notes file name override (default: RELEASE_NOTES.md)"
                },
                "templates": {
                  "type": "object",
                  "description": "Template configuration for release notes",
                  "properties": {
                    "path": {
                      "type": "string",
                      "description": "Path to custom template"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "handlebars",
                        "liquid",
                        "ejs"
                      ],
                      "description": "Template engine"
                    }
                  },
                  "additionalProperties": false
                },
                "llm": {
                  "type": "object",
                  "description": "LLM configuration for release notes",
                  "required": [
                    "provider",
                    "model"
                  ],
                  "properties": {
                    "provider": {
                      "type": "string",
                      "description": "LLM provider"
                    },
                    "model": {
                      "type": "string",
                      "description": "Model identifier"
                    },
                    "baseURL": {
                      "type": "string",
                      "description": "Custom API base URL"
                    },
                    "apiKey": {
                      "type": "string",
                      "description": "API key"
                    },
                    "options": {
                      "type": "object",
                      "properties": {
                        "timeout": {
                          "type": "integer",
                          "description": "Request timeout in ms"
                        },
                        "maxTokens": {
                          "type": "integer",
                          "description": "Max tokens to generate"
                        },
                        "temperature": {
                          "type": "number",
                          "description": "Sampling temperature"
                        }
                      },
                      "additionalProperties": false
                    },
                    "concurrency": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Concurrent LLM requests"
                    },
                    "tasks": {
                      "type": "object",
                      "properties": {
                        "summarize": {
                          "type": "boolean",
                          "description": "Enable summarization"
                        },
                        "enhance": {
                          "type": "boolean",
                          "description": "Enable entry enhancement"
                        },
                        "categorize": {
                          "type": "boolean",
                          "description": "Enable categorization"
                        },
                        "releaseNotes": {
                          "type": "boolean",
                          "description": "Enable release note generation"
                        }
                      },
                      "additionalProperties": false
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "description"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "style": {
                      "type": "string",
                      "description": "Writing style for LLM"
                    },
                    "scopes": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "restricted",
                            "packages",
                            "none",
                            "unrestricted"
                          ],
                          "default": "unrestricted"
                        },
                        "rules": {
                          "type": "object",
                          "properties": {
                            "allowed": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "caseSensitive": {
                              "type": "boolean",
                              "default": false
                            },
                            "invalidScopeAction": {
                              "type": "string",
                              "enum": [
                                "remove",
                                "keep",
                                "fallback"
                              ],
                              "default": "remove"
                            },
                            "fallbackScope": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "retry": {
                      "type": "object",
                      "properties": {
                        "maxAttempts": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Maximum number of attempts"
                        },
                        "initialDelay": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Initial delay in ms"
                        },
                        "maxDelay": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Maximum delay in ms"
                        },
                        "backoffFactor": {
                          "type": "number",
                          "minimum": 1,
                          "description": "Delay multiplier per attempt"
                        }
                      },
                      "additionalProperties": false
                    },
                    "prompts": {
                      "type": "object",
                      "properties": {
                        "instructions": {
                          "type": "object",
                          "description": "Per-task instruction overrides",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "templates": {
                          "type": "object",
                          "description": "Per-task prompt template overrides",
                          "additionalProperties": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "updateStrategy": {
          "type": "string",
          "enum": [
            "prepend",
            "regenerate"
          ],
          "description": "How to update existing changelog files. 'prepend' adds new entries to the top; 'regenerate' rewrites the file from scratch."
        }
      },
      "additionalProperties": false
    },
    "ci": {
      "type": "object",
      "description": "CI automation configuration for release triggers, PR previews, and label management",
      "properties": {
        "releaseStrategy": {
          "type": "string",
          "enum": [
            "manual",
            "direct",
            "standing-pr",
            "scheduled"
          ],
          "default": "direct",
          "description": "How releases are delivered. 'direct': release on merge to main. 'manual': releases triggered manually (e.g. workflow_dispatch). 'standing-pr': changes accumulate in a release PR. 'scheduled': releases triggered on a schedule."
        },
        "releaseTrigger": {
          "type": "string",
          "enum": [
            "commit",
            "label"
          ],
          "default": "label",
          "description": "What triggers a release. 'label': a PR bump label (bump:patch/minor/major) is required. 'commit': conventional commits drive the bump automatically; every merge can trigger a release."
        },
        "prPreview": {
          "type": "boolean",
          "default": true,
          "description": "Enable PR preview comments showing what would be released if the PR is merged. Set to false to disable."
        },
        "autoRelease": {
          "type": "boolean",
          "default": false,
          "description": "Automatically trigger a release when CI conditions are met, without manual intervention."
        },
        "skipPatterns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [
            "chore: release "
          ],
          "description": "Commit message prefixes that suppress a release. The default matches the release commit template to prevent release loops."
        },
        "minChanges": {
          "type": "integer",
          "minimum": 1,
          "default": 1,
          "description": "Minimum number of packages with releasable changes required to trigger a release."
        },
        "labels": {
          "type": "object",
          "description": "PR label names used for release control. Override to match your repository's label conventions.",
          "properties": {
            "stable": {
              "type": "string",
              "default": "release:stable",
              "description": "Label to graduate a prerelease to stable"
            },
            "prerelease": {
              "type": "string",
              "default": "release:prerelease",
              "description": "Label to create a prerelease"
            },
            "skip": {
              "type": "string",
              "default": "release:skip",
              "description": "Label to suppress a release on this PR"
            },
            "major": {
              "type": "string",
              "default": "bump:major",
              "description": "Label to force a major bump"
            },
            "minor": {
              "type": "string",
              "default": "bump:minor",
              "description": "Label to force a minor bump"
            },
            "patch": {
              "type": "string",
              "default": "bump:patch",
              "description": "Label to force a patch bump"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "release": {
      "type": "object",
      "description": "Release pipeline automation configuration",
      "properties": {
        "steps": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "notes",
              "publish"
            ]
          },
          "minItems": 1,
          "description": "Which steps to run by default. Omitting a step is equivalent to --skip-<step>."
        },
        "ci": {
          "type": "object",
          "description": "CI-specific automation settings",
          "properties": {
            "skipPatterns": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "description": "Commit message prefixes that prevent a release (e.g. 'chore(deps):', 'ci:')"
            },
            "minChanges": {
              "type": "integer",
              "minimum": 1,
              "description": "Minimum number of packages with releasable changes required to trigger a release"
            },
            "githubRelease": {
              "type": "boolean",
              "enum": [
                false
              ],
              "description": "Set to false to disable GitHub release creation in CI"
            },
            "notes": {
              "type": "boolean",
              "enum": [
                false
              ],
              "description": "Set to false to disable changelog generation in CI"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
