Variables Reference

Complete AgileBuilder variable types reference

Overview

This document is the complete reference for all variable types supported by AgileBuilder.


Variable Types

string

String variables, used for project names, package names, ports, etc.

{
  "name": "projectName",
  "type": "string",
  "description": "Project name",
  "required": true,
  "default": "my-app",
  "pattern": "^[a-z][a-z0-9-]*$",
  "patternMessage": "Project name must start with a letter and contain only lowercase letters, numbers, and hyphens"
}
PropertyTypeDescription
namestringVariable name, required
typestringFixed value: "string"
descriptionstringVariable description
requiredbooleanWhether required, defaults to false
defaultstringDefault value
patternstringRegex validation pattern
patternMessagestringMessage when validation fails

boolean

Boolean variables, used to enable or disable certain features.

{
  "name": "useTypeScript",
  "type": "boolean",
  "description": "Enable TypeScript",
  "default": true
}
PropertyTypeDescription
namestringVariable name, required
typestringFixed value: "boolean"
descriptionstringVariable description
defaultbooleanDefault value

select

Single-select variable, choose one from predefined options.

{
  "name": "framework",
  "type": "select",
  "description": "Select frontend framework",
  "options": ["react", "vue", "svelte"],
  "default": "react"
}
PropertyTypeDescription
namestringVariable name, required
typestringFixed value: "select"
descriptionstringVariable description
optionsstring[]List of options, required
defaultstringDefault option
requiredbooleanWhether required, defaults to false

multiselect

Multi-select variable, choose multiple from predefined options.

{
  "name": "features",
  "type": "multiselect",
  "description": "Select feature modules",
  "options": ["eslint", "prettier", "husky", "jest", "cypress"],
  "default": ["eslint", "prettier"]
}
PropertyTypeDescription
namestringVariable name, required
typestringFixed value: "multiselect"
descriptionstringVariable description
optionsstring[]List of options, required
defaultstring[]Default options list
minnumberMinimum selections
maxnumberMaximum selections

JSON Schema

Complete variable definition JSON Schema:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "definitions": {
    "baseVariable": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "description": { "type": "string" },
        "required": { "type": "boolean" }
      },
      "required": ["name"]
    },
    "stringVariable": {
      "allOf": [
        { "$ref": "#/definitions/baseVariable" },
        {
          "type": "object",
          "properties": {
            "type": { "const": "string" },
            "default": { "type": "string" },
            "pattern": { "type": "string" },
            "patternMessage": { "type": "string" }
          }
        }
      ]
    },
    "booleanVariable": {
      "allOf": [
        { "$ref": "#/definitions/baseVariable" },
        {
          "type": "object",
          "properties": {
            "type": { "const": "boolean" },
            "default": { "type": "boolean" }
          }
        }
      ]
    },
    "selectVariable": {
      "allOf": [
        { "$ref": "#/definitions/baseVariable" },
        {
          "type": "object",
          "properties": {
            "type": { "const": "select" },
            "options": {
              "type": "array",
              "items": { "type": "string" }
            },
            "default": { "type": "string" }
          },
          "required": ["options"]
        }
      ]
    },
    "multiselectVariable": {
      "allOf": [
        { "$ref": "#/definitions/baseVariable" },
        {
          "type": "object",
          "properties": {
            "type": { "const": "multiselect" },
            "options": {
              "type": "array",
              "items": { "type": "string" }
            },
            "default": {
              "type": "array",
              "items": { "type": "string" }
            },
            "min": { "type": "number" },
            "max": { "type": "number" }
          },
          "required": ["options"]
        }
      ]
    }
  }
}

Usage Examples

Complete Configuration Example

{
  "variables": [
    {
      "name": "projectName",
      "type": "string",
      "description": "Project name (used for directory and package names)",
      "required": true,
      "pattern": "^[a-z][a-z0-9-]*$",
      "patternMessage": "Only lowercase letters, numbers, and hyphens allowed"
    },
    {
      "name": "framework",
      "type": "select",
      "description": "Select frontend framework",
      "options": ["react", "vue", "svelte"],
      "default": "react"
    },
    {
      "name": "useTypeScript",
      "type": "boolean",
      "description": "Enable TypeScript",
      "default": true
    },
    {
      "name": "extraFeatures",
      "type": "multiselect",
      "description": "Additional features",
      "options": ["eslint", "prettier", "husky", "jest"],
      "default": ["eslint", "prettier"]
    }
  ]
}

Next Steps