{"id":"4a11f355-bc7a-42da-9d04-e88d2dbb7c9d","shortId":"qUAZJ8","kind":"skill","title":"create-agent-template","tagline":">-","description":"# Create Agent Template Skill\n\nGenerate Harness Agent Template files for AI-powered automation agents.\n\n## Instructions\n\n1. **Identify the agent's purpose** - What task should the agent automate (code review, security scanning, test generation, documentation)?\n2. **Define inputs and configuration** - What parameters does the agent need (repo, branch, connector, secrets)?\n3. **Generate three files** - metadata.json (template metadata), pipeline.yaml (v1 syntax), and wiki.MD (user documentation)\n4. **Validate consistency** - Ensure input references in pipeline.yaml match definitions in metadata.json\n\n## Overview\n\nAgent templates are modular pipeline definitions that encapsulate AI-powered automation. Each template produces three files:\n\n| File | Required | Purpose |\n|------|----------|---------|\n| `metadata.json` | Yes | Template name, description, version |\n| `pipeline.yaml` | Yes | Pipeline definition (v1 syntax) |\n| `wiki.MD` | Recommended | User-facing documentation |\n\n## Directory Structure\n\n```\ntemplates/<agent-name>/\n  metadata.json\n  pipeline.yaml\n  wiki.MD\n```\n\n## metadata.json\n\n```json\n{\n  \"name\": \"Agent Name\",\n  \"description\": \"Brief description of what this agent does (1-2 sentences)\",\n  \"version\": \"1.0.0\"\n}\n```\n\n**Rules:**\n- `name`: Sentence Case (`Code Review`, not `code-review`)\n- `description`: Under 200 characters, clear value proposition\n- `version`: Semantic versioning `MAJOR.MINOR.PATCH`\n\n## pipeline.yaml\n\n### Core Structure\n\n```yaml\nversion: 1\npipeline:\n  clone:\n    depth: 1\n    ref:\n      name: <+inputs.branch>\n      type: branch\n    repo: <+inputs.repo>\n    connector: \"<+inputs.gitConnector != null ? inputs.gitConnector.id : ''>\"\n\n  stages:\n    - name: <stage-name>\n      steps:\n        - name: <step-name>\n          run:\n            container:\n              image: <registry>/<image>:<tag>\n            with:\n              param: value\n            env:\n              SECRET_VAR: <+inputs.secretInput>\n      platform:\n        os: linux\n        arch: arm64\n\n  inputs:\n    repo:\n      type: string\n      required: true\n    branch:\n      type: string\n      default: main\n    llmConnector:\n      type: connector\n    gitConnector:\n      type: connector\n```\n\n### Clone Configurations\n\n**Branch clone:**\n\n```yaml\nclone:\n  depth: 1\n  ref:\n    name: <+inputs.branch>\n    type: branch\n  repo: <+inputs.repo>\n  connector: \"<+inputs.gitConnector != null ? inputs.gitConnector.id : ''>\"\n```\n\n**Pull request clone:**\n\n```yaml\nclone:\n  depth: 1000\n  ref:\n    type: pull-request\n    number: <+inputs.pullReq>\n  repo: <+inputs.repo>\n```\n\n### Input Types\n\n| Type | Usage | Example |\n|------|-------|---------|\n| `string` | Text values | repo name, branch, file paths |\n| `secret` | Sensitive values | API keys, tokens |\n| `connector` | Harness connectors | Git connector, LLM connector |\n\n```yaml\ninputs:\n  repo:\n    type: string\n    required: true\n  branch:\n    type: string\n    default: main\n    description: Branch to analyze\n  apiKey:\n    type: secret\n    default: account.my_secret\n  llmConnector:\n    type: connector\n    description: LLM provider connector\n  gitConnector:\n    type: connector\n    description: Git repository connector\n```\n\n### Step Types\n\n**Container plugin step:**\n\n```yaml\n- name: my-step\n  run:\n    container:\n      image: registry/image:tag\n    with:\n      plugin_param: value\n    env:\n      API_KEY: <+inputs.apiKey>\n```\n\n**Shell script step:**\n\n```yaml\n- name: shell-step\n  run:\n    shell: bash\n    script: |-\n      echo \"Running script\"\n      git add -A\n      git diff --cached\n    env:\n      MY_VAR: value\n```\n\n### Expression Syntax\n\n```yaml\n# Input references\n<+inputs.variableName>\n\n# Connector token\n<+inputs.connectorName.token>\n\n# Step outputs\n<+pipeline.stages.STAGE.steps.STEP.output.outputVariables.VAR>\n\n# Environment variables\n<+env.HARNESS_ACCOUNT_ID>\n<+env.HARNESS_ORG_ID>\n<+env.HARNESS_PROJECT_ID>\n\n# Alternative syntax for inputs in env blocks\n${{inputs.repo}}\n```\n\n## wiki.MD\n\n```markdown\n# Agent Name\n\n**Version:** 1.0.0\n**Name:** Agent Name\n\n## Overview\n\nWhat this agent does and why it is useful.\n\n---\n\n## Key Capabilities\n\n- **Capability 1**: Description\n- **Capability 2**: Description\n\n---\n\n## How It Works\n\n1. **Step 1**: Description\n2. **Step 2**: Description\n3. **Step 3**: Description\n\n## Required Inputs\n\n| Input | Type | Description | Default |\n|-------|------|-------------|---------|\n| `repo` | string | Repository identifier | -- |\n| `branch` | string | Branch to analyze | main |\n\n## Usage Example\n\n\\`\\`\\`yaml\ninputs:\n  repo: \"my-org/my-repo\"\n  branch: \"main\"\n\\`\\`\\`\n\n## Troubleshooting\n\n### Common Issue 1\nSolution description.\n```\n\n## Complete Examples and Common Patterns\n\nFor complete agent examples (Code Review, Security Scanner, Documentation Generator) and reusable patterns (SCM detection, coding agent, PR creation), consult references/agent-examples.md.\n\n## Examples\n\n### Create a code review agent\n\n```\n/create-agent-template\nCreate an agent template for code review that analyzes pull requests,\nprovides feedback, and posts review comments\n```\n\n### Create a security scanner agent\n\n```\n/create-agent-template\nGenerate a security scanner agent that finds vulnerabilities and\ncreates a report\n```\n\n### Create a documentation generator\n\n```\n/create-agent-template\nCreate an agent that analyzes a codebase and generates documentation,\nthen opens a PR with the results\n```\n\n### Create a test generator\n\n```\n/create-agent-template\nBuild an agent template that generates unit tests to improve code coverage\n```\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Invalid metadata | Missing name, description, or version | Include all three required fields |\n| Invalid version | Not semver format | Use `MAJOR.MINOR.PATCH` (e.g., `1.0.0`) |\n| Pipeline validation error | Invalid v1 YAML syntax | Verify pipeline structure follows v1 schema |\n| Connector not found | Referenced connector does not exist | Create the connector before running the agent |\n| Undefined input reference | `<+inputs.x>` used but `x` not defined in inputs | Add missing input definition |\n\n## Performance Notes\n\n- Validate all three generated files (metadata.json, pipeline.yaml, wiki.MD) are consistent with each other.\n- Ensure the pipeline YAML uses correct v1 syntax with lowercase types and ${{ }} expressions.\n- Test that all input references in the pipeline match the inputs defined in metadata.json.\n\n## Troubleshooting\n\n### Agent Not Executing\n\n1. Verify all `required: true` inputs have values\n2. Check connector inputs are valid and accessible\n3. Confirm container images exist and are accessible from the build infrastructure\n\n### SCM Provider Detection Failing\n\n1. Verify `DRONE_REPO_SCM` environment variable is available\n2. Check that connector tokens have correct permissions\n3. Test with a known SCM provider before adding multi-provider logic\n\n### PR Creation Failing\n\n1. Confirm git changes exist (`git diff --cached` is non-empty)\n2. Verify the token has write access to create branches and PRs\n3. Check that `PLUGIN_REPO` format matches the SCM provider expectations\n\n### Output Variables Not Available\n\n1. Write outputs using `echo \"KEY=value\" >> $DRONE_OUTPUT`\n2. Write secret outputs using `echo \"KEY=value\" >> $HARNESS_OUTPUT_SECRET_FILE`\n3. Reference with full path: `<+pipeline.stages.STAGE.steps.STEP.output.outputVariables.KEY>`\n\n## Best Practices\n\n- Never hardcode secrets -- use `type: secret` inputs\n- Use `type: connector` for authentication rather than raw tokens\n- Include meaningful descriptions on all inputs\n- Keep stages focused on single responsibilities\n- Always include the SCM detection pattern for multi-provider support\n- Store secret outputs with `$HARNESS_OUTPUT_SECRET_FILE`, not `$DRONE_OUTPUT`\n- Set `depth: 1000` for PR clones to ensure full diff history\n- Set `depth: 1` for branch clones to minimize clone time","tags":["create","agent","template","harness","skills","agent-skills","agents"],"capabilities":["skill","source-harness","skill-create-agent-template","topic-agent-skills","topic-agents"],"categories":["harness-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/harness/harness-skills/create-agent-template","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add harness/harness-skills","source_repo":"https://github.com/harness/harness-skills","install_from":"skills.sh"}},"qualityScore":"0.457","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 15 github stars · SKILL.md body (7,863 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:06:28.861Z","embedding":null,"createdAt":"2026-05-09T01:05:27.385Z","updatedAt":"2026-05-18T19:06:28.861Z","lastSeenAt":"2026-05-18T19:06:28.861Z","tsv":"'-2':140 '/create-agent-template':505,528,545,567 '/my-repo':464 '1':21,139,170,174,229,420,428,430,470,695,727,760,799,891 '1.0.0':143,403,605 '1000':247,880 '2':40,423,432,434,703,736,772,808 '200':156 '3':55,436,438,711,744,784,820 '4':69 'access':710,718,778 'account':382 'account.my':303 'ad':752 'add':358,645 'agent':3,6,11,19,24,31,49,82,129,137,400,405,410,480,494,504,508,527,533,548,570,633,692 'ai':16,91 'ai-pow':15,90 'altern':390 'alway':856 'analyz':298,454,514,550 'api':273,339 'apikey':299 'arch':203 'arm64':204 'authent':839 'autom':18,32,93 'avail':735,798 'bash':352 'best':826 'block':396 'branch':52,179,211,224,234,267,290,296,450,452,465,781,893 'brief':132 'build':568,721 'cach':362,767 'capabl':418,419,422 'case':147 'caus':583 'chang':763 'charact':157 'check':704,737,785 'clear':158 'clone':172,222,225,227,243,245,883,894,897 'code':33,148,152,482,493,502,511,578 'code-review':151 'codebas':552 'comment':522 'common':468,476 'complet':473,479 'configur':44,223 'confirm':712,761 'connector':53,182,218,221,237,276,278,280,282,307,311,314,318,373,619,623,629,705,739,837 'consist':71,660 'consult':497 'contain':191,321,330,713 'core':166 'correct':669,742 'coverag':579 'creat':2,5,500,506,523,538,541,546,563,627,780 'create-agent-templ':1 'creation':496,758 'default':214,293,302,445 'defin':41,642,688 'definit':78,87,111,648 'depth':173,228,246,879,890 'descript':106,131,133,154,295,308,315,421,424,431,435,439,444,472,589,846 'detect':492,725,860 'diff':361,766,887 'directori':120 'document':39,68,119,486,543,555 'drone':729,806,876 'e.g':604 'echo':354,803,813 'empti':771 'encapsul':89 'ensur':72,664,885 'env':196,338,363,395 'env.harness':381,384,387 'environ':379,732 'error':580,582,608 'exampl':261,457,474,481,499 'execut':694 'exist':626,715,764 'expect':794 'express':367,676 'face':118 'fail':726,759 'feedback':518 'field':596 'file':13,58,98,99,268,655,819,874 'find':535 'focus':852 'follow':616 'format':601,789 'found':621 'full':823,886 'generat':9,38,56,487,529,544,554,566,573,654 'git':279,316,357,360,762,765 'gitconnector':219,312 'handl':581 'har':10,277,816,871 'hardcod':829 'histori':888 'id':383,386,389 'identifi':22,449 'imag':192,331,714 'improv':577 'includ':592,844,857 'infrastructur':722 'input':42,73,205,257,284,370,393,441,442,459,635,644,647,680,687,700,706,834,849 'inputs.apikey':341 'inputs.branch':177,232 'inputs.connectorname.token':375 'inputs.gitconnector':183,238 'inputs.gitconnector.id':185,240 'inputs.pullreq':254 'inputs.repo':181,236,256,397 'inputs.secretinput':199 'inputs.variablename':372 'inputs.x':637 'instruct':20 'invalid':585,597,609 'issu':469 'json':127 'keep':850 'key':274,340,417,804,814 'known':748 'linux':202 'llm':281,309 'llmconnector':216,305 'logic':756 'lowercas':673 'main':215,294,455,466 'major.minor.patch':164,603 'markdown':399 'match':77,685,790 'meaning':845 'metadata':61,586 'metadata.json':59,80,102,123,126,656,690 'minim':896 'miss':587,646 'modular':85 'multi':754,864 'multi-provid':753,863 'my-org':461 'my-step':326 'name':105,128,130,145,176,187,189,231,266,325,346,401,404,406,588 'need':50 'never':828 'non':770 'non-empti':769 'note':650 'null':184,239 'number':253 'open':557 'org':385,463 'os':201 'output':377,795,801,807,811,817,869,872,877 'overview':81,407 'param':194,336 'paramet':46 'path':269,824 'pattern':477,490,861 'perform':649 'permiss':743 'pipelin':86,110,171,606,614,666,684 'pipeline.stages.stage.steps.step.output.outputvariables.key':825 'pipeline.stages.stage.steps.step.output.outputvariables.var':378 'pipeline.yaml':62,76,108,124,165,657 'platform':200 'plugin':322,335,787 'post':520 'power':17,92 'pr':495,559,757,882 'practic':827 'produc':96 'project':388 'proposit':160 'provid':310,517,724,750,755,793,865 'prs':783 'pull':241,251,515 'pull-request':250 'purpos':26,101 'rather':840 'raw':842 'recommend':115 'ref':175,230,248 'refer':74,371,636,681,821 'referenc':622 'references/agent-examples.md':498 'registry/image':332 'repo':51,180,206,235,255,265,285,446,460,730,788 'report':540 'repositori':317,448 'request':242,252,516 'requir':100,209,288,440,595,698 'respons':855 'result':562 'reusabl':489 'review':34,149,153,483,503,512,521 'rule':144 'run':190,329,350,355,631 'scan':36 'scanner':485,526,532 'schema':618 'scm':491,723,731,749,792,859 'script':343,353,356 'secret':54,197,270,301,304,810,818,830,833,868,873 'secur':35,484,525,531 'semant':162 'semver':600 'sensit':271 'sentenc':141,146 'set':878,889 'shell':342,348,351 'shell-step':347 'singl':854 'skill':8 'skill-create-agent-template' 'solut':471,584 'source-harness' 'stage':186,851 'step':188,319,323,328,344,349,376,429,433,437 'store':867 'string':208,213,262,287,292,447,451 'structur':121,167,615 'support':866 'syntax':64,113,368,391,612,671 'tag':333 'task':28 'templat':4,7,12,60,83,95,104,122,509,571 'test':37,565,575,677,745 'text':263 'three':57,97,594,653 'time':898 'token':275,374,740,775,843 'topic-agent-skills' 'topic-agents' 'troubleshoot':467,691 'true':210,289,699 'type':178,207,212,217,220,233,249,258,259,286,291,300,306,313,320,443,674,832,836 'undefin':634 'unit':574 'usag':260,456 'use':416,602,638,668,802,812,831,835 'user':67,117 'user-fac':116 'v1':63,112,610,617,670 'valid':70,607,651,708 'valu':159,195,264,272,337,366,702,805,815 'var':198,365 'variabl':380,733,796 'verifi':613,696,728,773 'version':107,142,161,163,169,402,591,598 'vulner':536 'wiki.md':66,114,125,398,658 'work':427 'write':777,800,809 'x':640 'yaml':168,226,244,283,324,345,369,458,611,667 'yes':103,109","prices":[{"id":"76b5e7bf-4985-4bd7-b882-3123cb4c96e8","listingId":"4a11f355-bc7a-42da-9d04-e88d2dbb7c9d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"harness","category":"harness-skills","install_from":"skills.sh"},"createdAt":"2026-05-09T01:05:27.385Z"}],"sources":[{"listingId":"4a11f355-bc7a-42da-9d04-e88d2dbb7c9d","source":"github","sourceId":"harness/harness-skills/create-agent-template","sourceUrl":"https://github.com/harness/harness-skills/tree/main/skills/create-agent-template","isPrimary":false,"firstSeenAt":"2026-05-09T01:05:27.385Z","lastSeenAt":"2026-05-18T19:06:28.861Z"}],"details":{"listingId":"4a11f355-bc7a-42da-9d04-e88d2dbb7c9d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"harness","slug":"create-agent-template","github":{"repo":"harness/harness-skills","stars":15,"topics":["agent-skills","agents"],"license":"apache-2.0","html_url":"https://github.com/harness/harness-skills","pushed_at":"2026-05-13T01:28:28Z","description":"A collection of structured AI agent skills that   enable Claude Code, Cursor, GitHub Copilot, and   other AI coding assistants to create, operate,   debug, and govern Harness CI/CD workflows through   natural language.","skill_md_sha":"be5f86e0e4a898dd2891dd68ad999b3c40c2e73f","skill_md_path":"skills/create-agent-template/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/harness/harness-skills/tree/main/skills/create-agent-template"},"layout":"multi","source":"github","category":"harness-skills","frontmatter":{"name":"create-agent-template","license":"Apache-2.0","description":">-","compatibility":"No MCP server required. Generates YAML files locally."},"skills_sh_url":"https://skills.sh/harness/harness-skills/create-agent-template"},"updatedAt":"2026-05-18T19:06:28.861Z"}}