Template Variables
Complete reference of all template variables available in Nenjo prompt templates.
Template variables use the {{ variable }} syntax (double curly braces with spaces). They are replaced with runtime values when the prompt is rendered before each agent execution.
Syntax
{{ task.title }} -- standard form (with spaces)
{{task.title}} -- compact form (no spaces, also supported)
\{{ task.title }} -- escaped form (renders as literal {{ task.title }})Both {{ name }} and {{name}} forms are supported. To include literal curly braces in your prompt, prefix with a backslash: \{{ name }} renders as {{ name }} without substitution.
Variable Reference
Task
Available in task_task and gate_eval templates.
| Variable | Description |
|---|---|
{{ task.id }} | Unique task UUID |
{{ task.title }} | Short summary of the work item |
{{ task.description }} | Full description with requirements |
{{ task.acceptance_criteria }} | Conditions for completion |
{{ task.tags }} | Comma-separated labels |
{{ task.source }} | Origin -- user for human-created tasks, or a role name (e.g. reviewer) when routed from a gate |
{{ task.status }} | Current status: open, ready, in_progress, done |
{{ task.priority }} | Priority level: low, medium, high, critical |
{{ task.type }} | Work type: bug, feature, task |
{{ task.slug }} | URL-safe task identifier |
{{ task.complexity }} | Estimated complexity score |
Project
Available in all templates.
| Variable | Description |
|---|---|
{{ project.id }} | Project UUID |
{{ project.name }} | Display name of the project |
{{ project.description }} | Project overview and goals |
{{ project.working_dir }} | Absolute path to the project workspace directory |
{{ project.metadata }} | Custom key-value metadata from project settings (rendered as XML) |
Chat
Available in chat_task templates.
| Variable | Description |
|---|---|
{{ chat.message }} | Current user message |
{{ message }} | Legacy alias for {{ chat.message }} |
Gate
Available in gate_eval templates.
| Variable | Description |
|---|---|
{{ gate.criteria }} | The evaluation criteria for the gate step |
{{ gate.previous_output }} | Output from the preceding agent step to evaluate |
{{ criteria }} | Legacy alias for {{ gate.criteria }} |
{{ previous_output }} | Legacy alias for {{ gate.previous_output }} |
Routine
Available in all templates when running inside a routine.
| Variable | Description |
|---|---|
{{ routine.name }} | Name of the active routine |
{{ routine.step }} | Current step name within the routine |
{{ step.metadata }} | Arbitrary JSON metadata from the step's config |
Role
Available in all templates.
| Variable | Description |
|---|---|
{{ role_local.name }} | Name of the executing role |
{{ role_local.description }} | Description of the role's purpose |
Agent
Available in all templates.
| Variable | Description |
|---|---|
{{ agent.name }} | Name of the executing agent |
{{ agent.model }} | LLM model name (e.g. claude-sonnet-4-20250514, gpt-4o) |
Git
Available in task_task and gate_eval templates when the project has a linked repository.
| Variable | Description |
|---|---|
{{ git.branch }} | Current working branch (e.g. agent/<run>/<slug>) |
{{ git.target_branch }} | Target branch for merges/PRs (from project settings) |
{{ git.work_dir }} | Absolute path to the worktree directory for this execution |
Global
Available in all templates.
| Variable | Description |
|---|---|
{{ global.timestamp }} | Current UTC timestamp (ISO 8601) |
{{ global.run_id }} | Unique ID for the current execution run |
Ability
Available during the ability sub-loop when an agent has active abilities.
| Variable | Description |
|---|---|
{{ ability.name }} | Name of the active ability |
{{ ability.prompt }} | Prompt/guidance of the active ability |
Context Blocks
These variables expand into pre-built XML structures. They are editable templates that only render when data is present. See Context Blocks for details on what each block contains.
| Variable | Description |
|---|---|
{{ context.available_agents }} | Available agents with id, name, description, and model |
{{ context.available_abilities }} | Available abilities with name and activation condition |
{{ context.available_routines }} | Active routines with id, name, and description |
{{ context.available_skills }} | Available skills with name and instructions |
{{ context.available_domains }} | Available domains with name, command, description, and category |
{{ context.available_mcp_servers }} | External MCP servers and the agent's platform scopes |
{{ context.current_project }} | Current project with id, name, description, working dir, git info, and documents |
{{ context.current_task }} | Current task with all task fields (id, slug, title, description, etc.) |
{{ context.current_gate }} | Gate evaluation criteria and previous output |
{{ context.current_cron }} | Scheduled execution timestamp and nested task context |
{{ context.memory }} | Relevant memories from past interactions |
Council Subtask
Available when an agent is executing a council-delegated subtask.
| Variable | Description |
|---|---|
{{ parent_task }} | The parent task that spawned this subtask |
{{ subtask_description }} | Description of the specific subtask to complete |
Template Examples
Task Task
You are working on the following task in project {{ project.name }}.
## Task
- **Title**: {{ task.title }}
- **Description**: {{ task.description }}
- **Acceptance Criteria**: {{ task.acceptance_criteria }}
- **Priority**: {{ task.priority }}
- **Type**: {{ task.type }}
## Git Context
Branch: {{ git.branch }}
Target: {{ git.target_branch }}
Working directory: {{ git.work_dir }}
## Available Context
{{ context.current_project }}
{{ context.memory }}
{{ context.available_agents }}Chat Task
Respond to the user's message in the context of project {{ project.name }}.
{{ context.memory }}
User message: {{ chat.message }}Gate Evaluation
Evaluate the following output against the acceptance criteria.
## Task Context
- **Title**: {{ task.title }}
- **Acceptance Criteria**: {{ task.acceptance_criteria }}
## Criteria
{{ gate.criteria }}
## Output to Evaluate
{{ gate.previous_output }}Variable Resolution
Variables are resolved at prompt render time from the RenderContext, which is populated from:
- Task data -- Task fields, chat message, or gate criteria (from
TaskType) - Agent/Role metadata -- Name, model, description (from
AgentInstance) - Routine context -- Routine name, step name, execution run ID (from
RoutineContext) - Project data -- Name, description, working directory (from bootstrap)
- Git state -- Branch, target branch, worktree path (from execution setup)
- Context blocks -- Pre-built XML strings (computed by
AgentInstance.build_prompts()) - Global values -- Timestamp (computed at render time), run ID (from routine)
If a variable has no value at render time, it renders as an empty string. Undefined variables are silently omitted from the output.