create-agent-template

生成用于AI驱动自动化代理的Harness代理模板文件。生成metadata.json、pipeline.yaml(v1语法)和wiki.MD文件。代理可自动化执行代码审查、安全扫描、测试生成和文档编写等任务。这是一项YAML生成技能。当被要求创建代理模板、构建AI代理、创建自动化代理、生成代理流水线文件或设置Harness代理时使用。触发短语:创建代理模板、代理模板、AI代理、自动化代理、构建代理、代码审查代理、安全扫描器代理、Harness代理。

仓库最近推送
GitHub Stars
138
Forks
30
Issues / PRs
4

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "create-agent-template":https://skillpi.com/zh/skills/deepskill-a2f3b22c8fba5355290f633cd4cfe16d61c6d20dd6580936b9b000d1aea5ebad。安装前核对上游来源和版本:https://github.com/harness/harness-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

生成用于AI驱动自动化代理的Harness代理模板文件。生成metadata.json、pipeline.yaml(v1语法)和wiki.MD文件。代理可自动化执行代码审查、安全扫描、测试生成和文档编写等任务。这是一项YAML生成技能。当被要求创建代理模板、构建AI代理、创建自动化代理、生成代理流水线文件或设置Harness代理时使用。触发短语:创建代理模板、代理模板、AI代理、自动化代理、构建代理、代码审查代理、安全扫描器代理、Harness代理。

0 下载

介绍来源: third_party · harness · 1.0.0 参考来源

SkillPi 解读

能完成的任务
来源文档未说明。
适合谁
来源文档未说明。
输入和输出
翻译待完成,请参阅来源文档。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
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
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

{
  "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

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

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 面向 AI 自动化代理开发,解决代码审查、安全扫描、测试生成等实际工程需求
  • 提供完整的 Harness Agent 模板生成能力,具有明确的实用价值
触发精准95/100

亮点

  • 触发词覆盖全面且精准,包含'创建代理模板'、'AI代理'、'Harness代理'等核心短语
  • description 完整且位置正确,边界清晰不易误触
结构规范95/100

亮点

  • 文档结构完整,包含清晰的 Instructions/Overview/语法说明/Error Handling/Best Practices
  • frontmatter 完整规范,提供多个端到端示例和最佳实践指导
执行可靠90/100

亮点

  • YAML v1 语法规范明确,参数定义清晰完整
  • Error Handling 和 Troubleshooting 章节覆盖主要异常场景
  • Best Practices 强调安全实践和可靠性保障
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 148, 171 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。