Learn to create instruction templates
ITS templates are JSON files that define content with placeholders. These placeholders become instructions for AI systems to generate specific types of content.
Hello {{name}}
+ data → Hello John
Hello [name placeholder]
→ AI instruction → AI-generated content
Every ITS template has this structure:
{
"$schema": "https://alexanderparker.github.io/.../its-base-schema-v1.json",
"version": "1.0.0",
"extends": [
"https://alexanderparker.github.io/.../its-standard-types-v1.json"
],
"content": [
// Your content elements here
]
}
$schema
reference enables validation and autocompletion in editors that support JSON Schema.Content is an array of elements. There are three types:
{
"type": "text",
"text": "This text appears exactly as written."
}
{
"type": "placeholder",
"id": "my_list",
"instructionType": "list",
"config": {
"description": "list 5 programming languages",
"displayName": "Programming Languages",
"format": "bullet_points"
}
}
{
"type": "conditional",
"condition": "audience == 'technical'",
"content": [
{"type": "text", "text": "Technical details: "}
],
"else": [
{"type": "text", "text": "General overview: "}
]
}
Create a simple template for a product description:
{
"$schema": "https://alexanderparker.github.io/.../its-base-schema-v1.json",
"version": "1.0.0",
"extends": [
"https://alexanderparker.github.io/.../its-standard-types-v1.json"
],
"metadata": {
"name": "Product Description Template",
"description": "Basic template for product descriptions",
"author": "Your Name"
},
"content": [
{
"type": "text",
"text": "# "
},
{
"type": "placeholder",
"id": "product_name",
"instructionType": "title",
"config": {
"description": "Create a product name for a smart water bottle",
"displayName": "Product Name",
"style": "descriptive",
"length": "short"
}
},
{
"type": "text",
"text": "\n\n"
},
{
"type": "placeholder",
"id": "description",
"instructionType": "paragraph",
"config": {
"description": "Write a description of a smart water bottle that tracks hydration",
"displayName": "Product Description",
"tone": "professional",
"length": "medium"
}
},
{
"type": "text",
"text": "\n\n## Key Features\n\n"
},
{
"type": "placeholder",
"id": "features",
"instructionType": "list",
"config": {
"description": "List 4 features of a smart water bottle",
"displayName": "Features List",
"format": "bullet_points",
"itemCount": 4
}
}
]
}
Your template compiles into an AI prompt with three sections:
You are an AI assistant that fills in content templates. Follow the instructions exactly and replace each placeholder with appropriate content based on the user prompts provided. Respond only with the transformed content.
1. Replace each placeholder marked with << >> with generated content
2. The user's content request is wrapped in ([{< >}]) to distinguish it from instructions
3. Follow the format requirements specified after each user prompt
4. Maintain the existing structure and formatting of the template
5. Only replace the placeholders - do not modify any other text
6. Generate content that matches the tone and style requested
7. Respond only with the transformed content - do not include any explanations or additional text
# <}]). Format requirements: Create a descriptive title that is short in length.>>
<}]). Format requirements: Use professional tone and medium length (2-4 sentences).>>
## Key Features
<}]). Format requirements: Use bullet_points formatting with each item on a new line. Create exactly 4 items.>>
([{<...>}])
to prevent parsing conflicts with special characters.
Variables make templates reusable. Define them at the template level and reference with ${variableName}
:
{
"variables": {
"productType": "smart water bottle",
"features": 4,
"tone": "professional"
},
"content": [
{
"type": "text",
"text": "Introducing our new ${productType}!\n\n"
},
{
"type": "placeholder",
"id": "feature_list",
"instructionType": "list",
"config": {
"description": "List ${features} features of a ${productType}",
"format": "bullet_points",
"itemCount": "${features}"
}
}
]
}
"productType": "headphones"
"price": 99.99
"includeWarranty": true
"brand": {"name": "TechCo", "slogan": "Innovation First"}
"categories": ["audio", "premium", "wireless"]
${brand.name}
or array indices: ${categories[0]}
Use conditionals to include or exclude content based on variables:
{
"variables": {
"audienceLevel": "technical",
"includeSpecs": true
},
"content": [
{
"type": "conditional",
"condition": "audienceLevel == 'technical' && includeSpecs == true",
"content": [
{
"type": "text",
"text": "## Technical Specifications\n\n"
},
{
"type": "placeholder",
"instructionType": "table",
"config": {
"description": "Create a technical specs table",
"format": "markdown",
"columns": 2,
"rows": 5
}
}
],
"else": [
{
"type": "text",
"text": "## Why You'll Love It\n\n"
},
{
"type": "placeholder",
"instructionType": "list",
"config": {
"description": "List user benefits in simple terms",
"format": "bullet_points"
}
}
]
}
]
}
==
, !=
>
, <
, >=
, <=
&&
(AND), ||
(OR), !
(NOT)in
for arrays/stringsThe standard library includes these instruction types:
See the specification for detailed documentation of each type and their configuration options.
Validate your templates using JSON Schema tools:
$schema
property.Online validation:
Command line validation:
# Using ajv-cli
npm install -g ajv-cli
ajv validate -s schema-url -d your-template.json