{
    "$schema": "https://alexanderparker.github.io/instruction-template-specification/schema/v1.0/its-base-schema-v1.json",
    "version": "1.0.0",
    "extends": [
        "https://alexanderparker.github.io/instruction-template-specification/schema/v1.0/its-yaml-types-v1.json"
    ],
    "metadata": {
        "name": "CI Pipeline Configuration Template",
        "description": "A CI pipeline whose YAML structure is authored literally in the template, with YAML type placeholders filling the generated values",
        "author": "Alexander Parker",
        "tags": [
            "example",
            "yaml",
            "ci",
            "structured-output"
        ],
        "created": "2026-07-29T00:00:00Z"
    },
    "variables": {
        "projectName": "example-storefront",
        "repositoryUrl": "https://git.example.com/acme/example-storefront",
        "language": "node",
        "includeDeployStage": true
    },
    "content": [
        {
            "type": "text",
            "text": "# CI configuration for ${projectName}\n# Repository: ${repositoryUrl}\n\nimage: "
        },
        {
            "type": "placeholder",
            "id": "build_image",
            "instructionType": "yaml_value",
            "config": {
                "description": "a suitable container image for a ${language} project",
                "displayName": "Build Image",
                "valueType": "string"
            }
        },
        {
            "type": "text",
            "text": "\n\nstages:\n  - build\n  - test\n\nbuild:\n  stage: build\n  script:\n"
        },
        {
            "type": "placeholder",
            "id": "build_script",
            "instructionType": "yaml_list_items",
            "config": {
                "description": "commands that install dependencies and build ${projectName}",
                "displayName": "Build Script",
                "indentSpaces": 4
            }
        },
        {
            "type": "text",
            "text": "\n\ntest:\n  stage: test\n  script:\n"
        },
        {
            "type": "placeholder",
            "id": "test_script",
            "instructionType": "yaml_list_items",
            "config": {
                "description": "commands that run the ${projectName} test suite",
                "displayName": "Test Script",
                "indentSpaces": 4
            }
        },
        {
            "type": "conditional",
            "condition": "includeDeployStage == true",
            "content": [
                {
                    "type": "text",
                    "text": "\n\ndeploy:\n  stage: deploy\n  only:\n    - main\n"
                },
                {
                    "type": "placeholder",
                    "id": "deploy_job",
                    "instructionType": "yaml_block",
                    "config": {
                        "description": "the remaining fields of a deploy job for ${projectName} that depends on the test job",
                        "displayName": "Deploy Job Fields",
                        "indentSpaces": 2
                    }
                }
            ]
        }
    ]
}
