Core Concepts

Understand AgileBuilder's core concepts and terminology

What is a Template

A template is the core asset in AgileBuilder. It's a directory containing project structure, configuration files, and code that renders into different project configurations through variables and conditional logic.

my-template/
├── agilebuilder.json      # Template configuration file
├── template/              # Template files directory
│   ├── src/
│   ├── package.json.hbs   # Uses Handlebars syntax
│   └── README.md.hbs
└── hooks/                 # Hook scripts (optional)
    ├── pre-generate.js
    └── post-generate.js

Variable System

Variables allow the same engineering pattern to adapt to different scenarios — this is what makes templates flexible.

Variable Types

TypeDescriptionExample
stringString variableProject name, package name, port
booleanBoolean variableEnable TypeScript or not
selectSingle choice variableSelect framework (React/Vue)
multiselectMulti-choice variableSelect feature modules

Conditional Rendering

Use Handlebars syntax for conditional rendering:

{{#if useTypeScript}}
"devDependencies": {
  "typescript": "^5.0.0"
}
{{/if}}

Loop Rendering

{{#each features}}
  "{{this}}": "latest",
{{/each}}

Hooks

Hooks let you run automation scripts before and after project generation.

HookWhen It RunsPurpose
pre-generateBefore generating filesValidate parameters, prepare environment
post-generateAfter generating filesInstall dependencies, initialize Git

Built-in Hooks

AgileBuilder provides commonly used built-in hooks:

  • @agilebuilder/install-deps - Automatically install dependencies
  • @agilebuilder/git-init - Initialize a Git repository

MCP

MCP (Model Context Protocol) is a standard protocol that allows AI tools (like Cursor, Claude Code) to interact with AgileBuilder.

MCP Tools

ToolDescription
listTemplatesList all available templates
getTemplateInfoGet template details and variable definitions
generateProjectGenerate a project from a template

Project Generation

Project generation is AgileBuilder's core capability. Based on templates and variables, it generates standardized project skeletons with a single command.

agilebuilder generate <template-name> <project-name>

For example:

agilebuilder generate react-starter my-app --var useTypeScript=true

Next Steps