{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/ss0923/limb/main/schemas/limb.schema.json",
  "title": ".limb.toml",
  "description": "Per-repo configuration for the limb CLI.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "worktrees": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "shared": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "description": "Files to symlink into each worktree (relative to shared_source)."
        },
        "shared_source": {
          "type": "string",
          "minLength": 1,
          "description": "Directory containing shared files. Defaults to <repo>/.shared/"
        },
        "base_dir": {
          "type": "string",
          "minLength": 1,
          "description": "Where to place new worktrees. Absolute, or relative to the current repo workdir. Default: '..'"
        }
      }
    },
    "templates": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "base_branch": {
            "type": "string",
            "minLength": 1,
            "description": "Branch to start new worktrees from (equivalent to --from)."
          },
          "name_pattern": {
            "type": "string",
            "minLength": 1,
            "description": "Pattern for the worktree name. {slug} is replaced with the positional argument."
          },
          "hooks": { "$ref": "#/definitions/hooks" }
        }
      }
    },
    "hooks": { "$ref": "#/definitions/hooks" }
  },
  "definitions": {
    "hooks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "pre_add": { "$ref": "#/definitions/scriptPath" },
        "post_add": { "$ref": "#/definitions/scriptPath" },
        "pre_remove": { "$ref": "#/definitions/scriptPath" },
        "post_remove": { "$ref": "#/definitions/scriptPath" }
      }
    },
    "scriptPath": {
      "type": "string",
      "minLength": 1,
      "description": "Path to an executable script. Relative paths resolve from the repo root (where .limb.toml lives). Environment: LIMB_WORKTREE_PATH, LIMB_WORKTREE_NAME."
    }
  }
}
