This repository stores all system agent templates for Harness agents.
- Overview
- Available Templates
- 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.
The following agent templates are currently available in this repository:
| Template Name | Description | Version |
|---|---|---|
| autofix | Automatically identifies and fixes bugs, errors, and issues in codebases | 1.0.0 |
| code_coverage | AI-powered agent that automatically analyzes codebases and generates comprehensive unit tests to increase coverage | 1.0.0 |
| codereview | Automated code review agent that analyzes pull requests and provides feedback | 1.0.0 |
| ffcleanup | Feature flag cleanup agent that identifies and removes unused feature flags | 1.0.0 |
| manifest_remediator | Remediates issues in Kubernetes manifests and deployment configurations | 1.0.0 |
| onboarding | Onboarding agent that imports repositories into Harness Code and auto-generates CI pipelines using AI analysis | 1.0.0 |
| react_upgrade | AI-powered coding agent that automates React upgrades and code modifications using custom prompts | 1.0.0 |
| zero_day_remediation | Automatically identifies and remediates critical vulnerabilities in your software supply chain by proposing fixes and creating pull requests | 1.0.0 |
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, underscore-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, underscores)
"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 underscores:
code_coverage,react_upgrade,zero_day_remediation,manifest_remediator - β Avoid:
MyAgent,my-agent,MYAGENT,Code-Coverage,codeScanner
- 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