create-agent-template
Generate Harness Agent Template files for AI-powered automation agents. Produces metadata.json, pipeline.yaml (v1 syntax), and wiki.MD files. Agents automate tasks like code review, security scanning, test generation, and documentation. This is a YAML generation skill. Use when asked to create an agent template, build an AI agent, create an automation agent, generate agent pipeline files, or set up a Harness agent. Trigger phrases: create agent template, agent template, AI agent, automation agent, build agent, code review agent, security scanner agent, Harness agent.
Harness · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add harness/harness-skills --skill create-agent-template技能说明
name: create-agent-template description: >- Generate Harness Agent Template files for AI-powered automation agents. Produces metadata.json, pipeline.yaml (v1 syntax), and wiki.MD files. Agents automate tasks like code review, security scanning, test generation, and documentation. This is a YAML generation skill. Use when asked to create an agent template, build an AI agent, create an automation agent, generate agent pipeline files, or set up a Harness agent. Trigger phrases: create agent template, agent template, AI agent, automation agent, build agent, code review agent, security scanner agent, Harness agent. metadata: author: Harness mcp-server: harness-mcp-v2 version: 1.0.0 summary: Generate AI agent templates (metadata.json, pipeline.yaml, wiki.MD) license: Apache-2.0 compatibility: No MCP server required. Generates YAML files locally.
Create Agent Template Skill
Generate Harness Agent Template files for AI-powered automation agents.
Instructions
- Identify the agent's purpose - What task should the agent automate (code review, security scanning, test generation, documentation)?
- Define inputs and configuration - What parameters does the agent need (repo, branch, connector, secrets)?
- Generate three files - metadata.json (template metadata), pipeline.yaml (v1 syntax), and wiki.MD (user documentation)
- Validate consistency - Ensure input references in pipeline.yaml match definitions in metadata.json
Overview
Agent templates are modular pipeline definitions that encapsulate AI-powered automation. Each template produces three files:
| File | Required | Purpose |
|---|---|---|
metadata.json | Yes | Template name, description, version |
pipeline.yaml | Yes | Pipeline definition (v1 syntax) |
wiki.MD | Recommended | User-facing documentation |
Directory Structure
templates/<agent-name>/
metadata.json
pipeline.yaml
wiki.MD
metadata.json
{
"name": "Agent Name",
"description": "Brief description of what this agent does (1-2 sentences)",
"version": "1.0.0"
}
Rules:
name: Sentence Case (Code Review, notcode-review)description: Under 200 characters, clear value propositionversion: Semantic versioningMAJOR.MINOR.PATCH
pipeline.yaml
Core Structure
version: 1
pipeline:
clone:
depth: 1
ref:
name: <+inputs.branch>
type: branch
repo: <+inputs.repo>
connector: "<+inputs.gitConnector != null ? inputs.gitConnector.id : ''>"
stages:
- name: <stage-name>
steps:
- name: <step-name>
run:
container:
image: <registry>/<image>:<tag>
with:
param: value
env:
SECRET_VAR: <+inputs.secretInput>
platform:
os: linux
arch: arm64
inputs:
repo:
type: string
required: true
branch:
type: string
default: main
llmConnector:
type: connector
gitConnector:
type: connector
Clone Configurations
Branch clone:
clone:
depth: 1
ref:
name: <+inputs.branch>
type: branch
repo: <+inputs.repo>
connector: "<+inputs.gitConnector != null ? inputs.gitConnector.id : ''>"
Pull request clone:
clone:
depth: 1000
ref:
type: pull-request
number: <+inputs.pullReq>
repo: <+inputs.repo>
Input Types
| Type | Usage | Example |
|---|---|---|
string | Text values | repo name, branch, file paths |
secret | Sensitive values | API keys, tokens |
connector | Harness connectors | Git connector, LLM connector |
inputs:
repo:
type: string
required: true
branch:
type: string
default: main
description: Branch to analyze
apiKey:
type: secret
default: account.my_secret
llmConnector:
type: connector
description: LLM provider connector
gitConnector:
type: connector
description: Git repository connector
Step Types
Container plugin step:
- name: my-step
run:
container:
image: registry/image:tag
with:
plugin_param: value
env:
API_KEY: <+inputs.apiKey>
Shell script step:
- name: shell-step
run:
shell: bash
script: |-
echo "Running script"
git add -A
git diff --cached
env:
MY_VAR: value
Expression Syntax
# Input references
<+inputs.variableName>
# Connector token
<+inputs.connectorName.token>
# Step outputs
<+pipeline.stages.STAGE.steps.STEP.output.outputVariables.VAR>
# Environment variables
<+env.HARNESS_ACCOUNT_ID>
<+env.HARNESS_ORG_ID>
<+env.HARNESS_PROJECT_ID>
# Alternative syntax for inputs in env blocks
${{inputs.repo}}
wiki.MD
# Agent Name
**Version:** 1.0.0
**Name:** Agent Name
## Overview
What this agent does and why it is useful.
---
## Key Capabilities
- **Capability 1**: Description
- **Capability 2**: Description
---
## How It Works
1. **Step 1**: Description
2. **Step 2**: Description
3. **Step 3**: Description
## Required Inputs
| Input | Type | Description | Default |
|-------|------|-------------|---------|
| `repo` | string | Repository identifier | -- |
| `branch` | string | Branch to analyze | main |
## Usage Example
\`\`\`yaml
inputs:
repo: "my-org/my-repo"
branch: "main"
\`\`\`
## Troubleshooting
### Common Issue 1
Solution description.
Complete Examples and Common Patterns
For complete agent examples (Code Review, Security Scanner, Documentation Generator) and reusable patterns (SCM detection, coding agent, PR creation), consult references/agent-examples.md.
Examples
Create a code review agent
/create-agent-template
Create an agent template for code review that analyzes pull requests,
provides feedback, and posts review comments
Create a security scanner agent
/create-agent-template
Gener
阅读完整来源 ↗