Note: This repo will eventually be moved into harness/
This repository stores all system agent templates for Harness agents.
- Overview
- Template Structure
- Adding a New Template
- Template Registration
- File Format Reference
- Best Practices
Agent templates are modular pipeline definitions that encapsulate:
- Pipeline configuration (stages, steps, containers, inputs)
- Metadata (name, description, version)
- Documentation (usage guides, capabilities, examples)
The Agents service automatically discovers and registers templates from this repository, making them available for deployment and execution.
Each template must be organized in its own directory under templates/ with the following files:
templates/
└── <template-name>/
├── metadata.json # Template metadata and versioning (required)
├── pipeline.yaml # Pipeline definition and configuration (required)
├── wiki.MD # User-facing documentation (optional)
└── logo.svg # Template logo/icon (optional)
templates/
└── autofix/
├── metadata.json
├── pipeline.yaml
├── wiki.MD
└── logo.svg
Follow these steps to add a new agent template:
Create a new directory under templates/ with your agent's name (use lowercase, hyphen-separated names):
mkdir -p templates/my-agentDefine your template's metadata:
{
"name": "my-agent",
"description": "Brief description of what this agent does",
"version": "1.0.0"
}Define your pipeline configuration with inputs, stages, and steps:
pipeline:
clone:
depth: 1
ref:
name: <+inputs.branch>
type: branch
repo:
name: <+inputs.repo>
stages:
- name: my-agent-stage
steps:
- name: my-agent-step
run:
container:
image: your-registry/your-image:tag
env:
PLUGIN_CONFIG_VAR: <+inputs.configVar>
API_KEY: <+inputs.apiKey>
platform:
os: linux
arch: amd64
inputs:
apiKey:
type: secret
configVar:
type: string
default: "default-value"
repo:
type: string
branch:
type: string
default: mainCreate comprehensive documentation for your agent:
# My Agent
## Overview
Brief description of what the agent does and why it's useful.
## Key Capabilities
- Feature 1
- Feature 2
- Feature 3
## Usage
How to use this agent, including:
- Prerequisites
- Configuration requirements
- Example workflows
## Inputs
| Input | Type | Required | Default | Description |
| --------- | ------ | -------- | --------------- | -------------------------- |
| apiKey | secret | Yes | - | API key for authentication |
| configVar | string | No | "default-value" | Configuration parameter |
## Examples
Practical examples of using the agent.Provide an SVG logo for your agent to enhance visual identification in the UI:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<!-- Your logo design here -->
<circle cx="50" cy="50" r="40" fill="#0066cc"/>
</svg>Logo Guidelines:
- Use SVG format for scalability
- Keep dimensions square (e.g., 100x100, 200x200)
- Use simple, recognizable designs
- Avoid overly complex graphics
git add templates/my-agent/
git commit -m "Add my-agent template"
git push origin mainThe Agents service automatically discovers and registers templates through the following process:
- Repository Polling: The service periodically scans the
templates/directory in this repository - Validation: Each template directory is validated for required files (
metadata.json,pipeline.yaml) - Metadata Extraction: Template metadata is parsed from
metadata.json - Optional Files: If present,
wiki.MDandlogo.svgare loaded for enhanced documentation and UI display - Registration: Valid templates are registered in the service catalog
- Availability: Registered templates become available for deployment via API/UI
For successful registration, templates must:
- ✅ Have required files:
metadata.jsonandpipeline.yaml - ✅ Use valid JSON in
metadata.json - ✅ Use valid YAML in
pipeline.yaml - ✅ Include a unique template name (no duplicates)
- ✅ Follow semantic versioning (e.g.,
1.0.0,2.1.3)
Optional enhancements:
- 📝 Include
wiki.MDfor detailed documentation - 🎨 Include
logo.svgfor visual branding in the UI
- Version Changes: Update the
versionfield inmetadata.jsonwhen making changes - Backward Compatibility: Avoid breaking changes to existing inputs/outputs
- Deprecation: Mark deprecated versions in the wiki documentation before removal
Required fields:
{
"name": "string", // Template identifier (lowercase, alphanumeric, hyphens)
"description": "string", // Brief description (1-2 sentences)
"version": "string" // Semantic version (MAJOR.MINOR.PATCH)
}The pipeline configuration follows the Harness CI pipeline v1 YAML format:
Provides user-facing documentation for the agent template. When present, this is displayed in the UI and helps users understand how to use the agent.
Recommended sections:
- Overview: What the agent does and its purpose
- Key Capabilities: Main features and functionality
- Usage: How to deploy and run the agent
- Inputs: Detailed input parameter documentation
- Outputs: Expected outputs and artifacts
- Examples: Real-world usage examples
- Troubleshooting: Common issues and solutions
- ✅ Use lowercase with hyphens:
my-agent,code-scanner - ❌ Avoid:
MyAgent,my_agent,MYAGENT
- Write clear, concise descriptions
- Include practical examples
- Document all inputs with types and defaults
- Explain expected behavior and outputs
- Never hardcode secrets or credentials
- Use
type: secretfor sensitive inputs - Follow principle of least privilege
- Document security requirements in wiki