{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "SddConfig",
  "description": "SDD project configuration for llmanspec.",
  "type": "object",
  "properties": {
    "schema": {
      "description": "Schema identifier. Must be \"spec-driven\".",
      "type": "string"
    },
    "locale": {
      "description": "Locale used for SDD templates and skills.",
      "type": "string",
      "default": "en"
    },
    "context": {
      "description": "Project context (tech stack, conventions, constraints). Replaces project.md.",
      "type": [
        "string",
        "null"
      ]
    },
    "rules": {
      "description": "Per-artifact rules. Map of artifact_id -> string[].",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "extra_skills": {
      "description": "Optional SDD skills to enable beyond the default set. Valid values: llman-sdd-new-change, llman-sdd-continue, llman-sdd-ff, llman-sdd-show, llman-sdd-sync, llman-sdd-validate, llman-sdd-verify.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "archive": {
      "description": "Archive behaviour settings (defer tracking, completion gates).",
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "strict_defer": {
          "description": "When true, unchecked tasks without a defer link are errors (not just warnings). Default: false (transition period).",
          "type": [
            "boolean",
            "null"
          ]
        },
        "min_completion_ratio": {
          "description": "Minimum task completion ratio (0.0–1.0) required for archiving. Default: none (disabled).",
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      }
    },
    "bdd": {
      "description": "BDD integration settings. When defined, enables feature_refs validation and BDD-aware verify prompts.",
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "framework": {
          "description": "BDD framework identifier.",
          "type": "string"
        },
        "feature_dir": {
          "description": "Root directory for .feature files, relative to project root.",
          "type": [
            "string",
            "null"
          ]
        },
        "default_language": {
          "description": "Gherkin parsing language code (e.g. 'en', 'zh-CN'). Default: 'en'.",
          "type": [
            "string",
            "null"
          ]
        },
        "run_command": {
          "description": "Custom test run command. Placeholders: {feature_dir}, {feature_name}, {feature_path}.",
          "type": [
            "string",
            "null"
          ]
        },
        "verify_prompt": {
          "description": "Extra prompt text injected during verify phase.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "framework"
      ]
    }
  },
  "required": [
    "schema"
  ]
}