{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/gobing-ai/spur/schemas/task-batch.schema.json",
    "title": "Task Batch Create Input",
    "description": "Editor/CI aid for spur task batch-create --file input — the contract gating LLM decomposition output before any write. Every item is validated; any failure means nothing is written. RUNTIME SOURCE OF TRUTH is the Zod taskBatchSchema in @gobing-ai/spur-domain (packages/domain/src/planning/schema.ts); keep this file in sync with it.",
    "type": "array",
    "minItems": 1,
    "items": {
        "type": "object",
        "required": ["name"],
        "properties": {
            "name": {
                "type": "string",
                "minLength": 1,
                "description": "Task title — used in slug and heading."
            },
            "background": {
                "type": "string",
                "description": "Context and motivation for the task."
            },
            "requirements": {
                "type": "string",
                "description": "Pre-filled ### Requirements body: one R-item per line, exactly `- [ ] R1. <text>` (checkbox + `R<n>.`); any other form fails `spur task check`."
            },
            "design": {
                "type": "string",
                "description": "Pre-filled ### Design body (WHAT/WHY decision record). Default for plan/decompose unless --skip-design."
            },
            "plan": {
                "type": "string",
                "description": "Pre-filled ### Plan body (ordered checklist)."
            },
            "acceptance_criteria": {
                "type": "string",
                "description": "Pre-filled ### Acceptance Criteria body: items numbered AC1, AC2, … (never R<n>, the Requirements namespace): `- [ ] AC1 — <feature scenario title without its R-number>` bullets or `Scenario: AC1 — <title>` blocks (L4.uncovered-task-scenario matches the title after the prefix); `(req: R<n>)` binds a task requirement; task-only checks go in prose after the bullets."
            },
            "feature_id": {
                "type": "string",
                "pattern": "^[A-Z][1-9]*$",
                "description": "Feature ID for traceability and Goal→Background derivation (DD-14)."
            },
            "parent_wbs": {
                "type": "string",
                "pattern": "^\\d{4}$",
                "description": "Parent WBS for sub-task grouping (the single sub-task convention, X02)."
            },
            "priority": {
                "type": "string",
                "enum": ["P0", "P1", "P2", "P3"],
                "description": "Task priority aligned with the feature priority scale."
            },
            "tags": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Free-form filtering tags."
            },
            "template": {
                "type": "string",
                "enum": ["feature-impl", "issue", "review", "meta"],
                "description": "Template variant for section structure (default: the standard template)."
            },
            "estimate_hours": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "Size estimate in hours — persisted to frontmatter; the inline pipeline driver's dispatch floor reads it (at/below floor → host-inline, no subagent dispatch)."
            }
        },
        "additionalProperties": false
    }
}
