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
| Type | Description | Example |
|---|---|---|
string | String variable | Project name, package name, port |
boolean | Boolean variable | Enable TypeScript or not |
select | Single choice variable | Select framework (React/Vue) |
multiselect | Multi-choice variable | Select 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.
| Hook | When It Runs | Purpose |
|---|---|---|
pre-generate | Before generating files | Validate parameters, prepare environment |
post-generate | After generating files | Install 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
| Tool | Description |
|---|---|
listTemplates | List all available templates |
getTemplateInfo | Get template details and variable definitions |
generateProject | Generate 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
- Install AgileBuilder - Get started with installation
- Quick Start (Local Edition) - Local edition 5-minute tutorial
- Quick Start (Online Edition) - Online edition 5-minute tutorial