Skip to content
Skills Library
AI & agents · Building & coding

create-agent-template

/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.

Licence
Apache-2.0
Last repository change
12.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

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.

Original author 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.

How it works

  1. Instructions
  2. Overview
  3. Directory Structure
  4. metadata.json
  5. pipeline.yaml
  6. wiki.MD
  7. Complete Examples and Common Patterns
  8. Examples
  9. Error Handling
  10. Performance Notes
Original SKILL.md headings · 330 lines, 1,024 words
SKILL.md preview
---
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

1. **Identify the agent's purpose** - What task should the agent automate (code review, security scanning, test generation, documentation)?
2. **Define inputs and configuration** - What parameters does the agent need (repo, branch, connector, secrets)?
3. **Generate three files** - metadata.json (template metadata), pipeline.yaml (v1 syntax), and wiki.MD (user documentation)
4. **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

```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`, not `code-review`)
- `description`: Under 200 characters, clear value proposition
- `version`: Semantic versioning `MAJOR.MINOR.PATCH`

## pipeline.yaml

### Core Structure

```yaml
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:**

```yaml
clone:
  depth: 1
  ref:
    name: <+inputs.branch>
    type: branch
  repo: <+inputs.repo>
  connector: "<+inputs.gitConnector != null ? inputs.gitConnector.id : ''>"
```

**Pull request clone:**

```yaml
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 |

```yaml
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:**

```yaml
- name: my-step
  run:
    container:
      image: registry/image:tag
    with:
      plugin_param: value
    env:
      API_KEY: <+inputs.apiKey>
```

**Shell script step:**

```yaml
- name: shell-step
  run:
    shell: bash
    script: |-
      echo "Running script"
      git add -A
      git diff --cached
    env:
      MY_VAR: value
```

### Expression Syntax

```yaml
# 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

```markdown
# 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
Generate a security scanner agent that finds vulnerabilities and
creates a report
```

### Create a documentation generator

```
/create-agent-template
Create an agent that analyzes a codebase and generates documentation,
then opens a PR with the results
```

### Create a test generator

```
/create-agent-template
Build an agent template that generates unit tests to improve code coverage
```

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Invalid metadata | Missing name, description, or version | Include all three required fields |
| Invalid version | Not semver format | Use `MAJOR.MINOR.PATCH` (e.g., `1.0.0`) |
| Pipeline validation error | Invalid v1 YAML syntax | Verify pipeline structure follows v1 schema |
| Connector not found | Referenced connector does not exist | Create the connector before running the agent |
| Undefined input reference | `<+inputs.x>` used but `x` not defined in inputs | Add missing input definition |

## Performance Notes

- Validate all three generated files (metadata.json, pipeline.yaml, wiki.MD) are consistent with each other.
- Ensure the pipeline YAML uses correct v1 syntax with lowercase types and ${{ }} expressions.
- Test that all input references in the pipeline match the inputs defined in metadata.json.

## Troubleshooting

### Agent Not Executing

1. Verify all `required: true` inputs have values
2. Check connector inputs are valid and accessible
3. Confirm container images exist and are accessible from the build infrastructure

### SCM Provider Detection Failing

1. Verify `DRONE_REPO_SCM` environment variable is available
2. Check that connector tokens have correct permissions
3. Test with a known SCM provider before adding multi-provider logic

### PR Creation Failing

1. Confirm git changes exist (`git diff --cached` is non-empty)
2. Verify the token has write access to create branches and PRs
3. Check that `PLUGIN_REPO` format matches the SCM provider expectations

### Output Variables Not Available

1. Write outputs using `echo "KEY=value" >> $DRONE_OUTPUT`
2. Write secret outputs using `echo "KEY=value" >> $HARNESS_OUTPUT_SECRET_FILE`
3. Reference with full path: `<+pipeline.stages.STAGE.steps.STEP.output.outputVariables.KEY>`

## Best Practices

- Never hardcode secrets -- use `type: secret` inputs
- Use `type: connector` for authentication rather than raw tokens
- Include meaningful descriptions on all inputs
- Keep stages focused on single responsibilities
- Always include the SCM detection pattern for multi-provider support
- Store secret outputs with `$HARNESS_OUTPUT_SECRET_FILE`, not `$DRONE_OUTPUT`
- Set `depth: 1000` for PR clones to ensure full diff history
- Set `depth: 1` for branch clones to minimize clone time
Files in this package (2)
  • SKILL.md 9 KB
  • references/agent-examples.md 10 KB

Versions

RepositoryScoreLicence
This page · harness/harness-skills100Apache-2.0
rerun-build/rerun100AGPL-3.0

Database snapshot: 13.11.2026 · package version 799b7067ccf7 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100create-template
    Generate Harness v0 Template YAML for reusable pipeline components (Step, Stage, Pipeline, StepGroup) and create them via MCP. Use when asked to create a template, build a step template, stage template, pipeline template, or reusable step. Do NOT use for checking template usage…
  • 100create-agent
    Create and update Harness AI agent instances - standalone templates for agentic workflows in pipelines. Use when asked to create agent, update agent, modify agent spec, build autonomous systems, or work with AI agents.
  • 100skill-authoring
    Creates and structures SKILL.md files for AI coding agents, including YAML frontmatter, trigger phrases, directive instructions, decision trees, code examples, and verification checklists. Use when the user asks to write a new skill, create a skill file, author agent…
  • 100agent-template
    Generate custom agent from template. Use when creating a new subagent from scratch, or scaffolding an agent file with correct frontmatter.
  • 100create-agent
    MUST be used whenever scaffolding a new Atlas agent project. Creates agent.yaml, README.md, and a starter eval/cases.yaml with the correct structure, tool definitions, and instructions. Do NOT manually write agent.yaml from scratch — this skill handles the full scaffold.…
  • 90coding-agent-harness
    搭建 Coding Agent 或设计 Agent 护栏时使用——当你要构建能自主读写代码、跑测试、自我纠错的编码 Agent,或为已有 Agent 系统补约束/验证/纠正机制、设计执行边界与验收基线、判断某类任务是否适合交给 Agent、优化 Harness 提示词与工具集时使用。覆盖 Harness 四组件、任务四象限、四条设计原则与业界实践。

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.