{"id":"b8cb384e-8c7a-430e-9b56-12d33f2d9350","shortId":"ANREfK","kind":"skill","title":"create-template","tagline":">-","description":"# Create Template\n\nGenerate Harness v0 Template YAML for reusable components and push via MCP.\n\n## Instructions\n\n1. **Determine template type** - Step, Stage, Pipeline, or StepGroup\n2. **Identify reusable parameters** - Mark configurable fields with `<+input>` for runtime inputs\n3. **Generate YAML** using the structure below with a unique `versionLabel`\n4. **Create via MCP** using `harness_create` with resource_type `template`\n5. **Verify creation** using `harness_list` with resource_type `template`\n\n## Template Types\n\n- **Step** - Reusable step definitions\n- **Stage** - Reusable stage definitions\n- **Pipeline** - Complete reusable pipelines\n- **StepGroup** - Groups of related steps\n\n## Template Structure\n\n```yaml\ntemplate:\n  name: My Template\n  identifier: my_template\n  versionLabel: \"1.0.0\"\n  type: Step           # Step, Stage, Pipeline, StepGroup\n  orgIdentifier: default\n  projectIdentifier: my_project\n  tags: {}\n  spec: ...            # Content depends on type\n```\n\n## Step Template\n\n```yaml\ntemplate:\n  name: Docker Build Push\n  identifier: docker_build_push\n  versionLabel: \"1.0.0\"\n  type: Step\n  spec:\n    type: BuildAndPushDockerRegistry\n    spec:\n      connectorRef: <+input>\n      repo: <+input>\n      tags: <+input>\n      dockerfile: Dockerfile\n      context: .\n    timeout: 15m\n```\n\n## Stage Template\n\n```yaml\ntemplate:\n  name: K8s Deploy Stage\n  identifier: k8s_deploy_stage\n  versionLabel: \"1.0.0\"\n  type: Stage\n  spec:\n    type: Deployment\n    spec:\n      deploymentType: Kubernetes\n      service:\n        serviceRef: <+input>\n      environment:\n        environmentRef: <+input>\n        infrastructureDefinitions:\n          - identifier: <+input>\n      execution:\n        steps:\n          - step:\n              identifier: rollout\n              name: Rollout\n              type: K8sRollingDeploy\n              spec:\n                skipDryRun: false\n              timeout: 10m\n        rollbackSteps:\n          - step:\n              identifier: rollback\n              name: Rollback\n              type: K8sRollingRollback\n              spec: {}\n              timeout: 10m\n    failureStrategies:\n      - onFailure:\n          errors: [AllErrors]\n          action:\n            type: StageRollback\n```\n\n## Pipeline Template\n\n```yaml\ntemplate:\n  name: Standard CI/CD\n  identifier: standard_cicd\n  versionLabel: \"1.0.0\"\n  type: Pipeline\n  spec:\n    stages:\n      - stage:\n          identifier: build\n          name: Build\n          type: CI\n          spec:\n            cloneCodebase: true\n            platform:\n              os: Linux\n              arch: Amd64\n            runtime:\n              type: Cloud\n              spec: {}\n            execution:\n              steps:\n                - step:\n                    identifier: build\n                    name: Build\n                    type: Run\n                    spec:\n                      shell: Bash\n                      command: <+input>\n```\n\n## StepGroup Template\n\n```yaml\ntemplate:\n  name: Test Suite\n  identifier: test_suite\n  versionLabel: \"1.0.0\"\n  type: StepGroup\n  spec:\n    steps:\n      - step:\n          identifier: unit_tests\n          name: Unit Tests\n          type: Run\n          spec:\n            shell: Bash\n            command: <+input>\n      - step:\n          identifier: integration_tests\n          name: Integration Tests\n          type: Run\n          spec:\n            shell: Bash\n            command: <+input>\n```\n\n## Using Runtime Inputs\n\nMark configurable fields with `<+input>` so users provide values when using the template:\n\n```yaml\nspec:\n  connectorRef: <+input>          # User selects connector\n  repo: <+input>                   # User provides repo name\n  tags:\n    - <+input>                     # User provides tag\n    - <+pipeline.sequenceId>       # Fixed value\n```\n\n## Creating via MCP\n\n```\nCall MCP tool: harness_create\nParameters:\n  resource_type: \"template\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n  body: <the template YAML>\n```\n\nTo update a template version:\n\n```\nCall MCP tool: harness_update\nParameters:\n  resource_type: \"template\"\n  resource_id: \"<template_identifier>\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n  body: <updated template YAML with new versionLabel>\n```\n\nTo list existing templates:\n\n```\nCall MCP tool: harness_list\nParameters:\n  resource_type: \"template\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n```\n\n## Referencing Templates in Pipelines\n\n```yaml\n- stage:\n    identifier: deploy\n    name: Deploy\n    template:\n      templateRef: k8s_deploy_stage\n      versionLabel: \"1.0.0\"\n      templateInputs:\n        type: Deployment\n        spec:\n          service:\n            serviceRef: my_service\n          environment:\n            environmentRef: prod\n```\n\n## Examples\n\n- \"Create a Docker build and push step template\" - Generate Step template with BuildAndPushDockerRegistry\n- \"Create a reusable K8s deployment stage\" - Generate Stage template with Deployment type\n- \"Make a standard CI/CD pipeline template\" - Generate Pipeline template with CI + CD stages\n\n## Performance Notes\n\n- Mark all configurable fields with `<+input>` to maximize template reusability.\n- Verify the versionLabel is unique for each template update.\n- Test template references in a pipeline before distributing to other teams.\n\n## Troubleshooting\n\n### Template Creation Errors\n- `DUPLICATE_IDENTIFIER` - Template exists; update with new versionLabel\n- `INVALID_VERSION` - versionLabel must be unique per template\n- Identifiers must match `^[a-zA-Z_][0-9a-zA-Z_]{0,127}$`\n\n### Template Usage Errors\n- `TEMPLATE_NOT_FOUND` - Check templateRef and scope (account/org/project)\n- `VERSION_NOT_FOUND` - Verify versionLabel exists\n- Missing templateInputs - Provide all `<+input>` values","tags":["create","template","harness","skills","agent-skills","agents"],"capabilities":["skill","source-harness","skill-create-template","topic-agent-skills","topic-agents"],"categories":["harness-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/harness/harness-skills/create-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 (5,730 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:29.819Z","embedding":null,"createdAt":"2026-05-09T01:05:28.515Z","updatedAt":"2026-05-18T19:06:29.819Z","lastSeenAt":"2026-05-18T19:06:29.819Z","tsv":"'-9':526 '0':525,531 '1':19 '1.0.0':102,133,164,225,274,415 '10m':195,206 '127':532 '15m':150 '2':28 '3':40 '4':51 '5':62 'a-za-z':521,527 'account/org/project':543 'action':211 'allerror':210 'amd64':244 'arch':243 'bash':260,290,304 'bodi':360,381 'build':126,130,232,234,253,255,431 'buildandpushdockerregistri':138,440 'call':347,366,386 'cd':464 'check':539 'ci':236,463 'ci/cd':220,456 'cicd':223 'clonecodebas':238 'cloud':247 'command':261,291,305 'complet':83 'compon':13 'configur':33,311,470 'connector':329 'connectorref':140,325 'content':116 'context':148 'creat':2,4,52,57,344,351,428,441 'create-templ':1 'creation':64,500 'default':110 'definit':77,81 'depend':117 'deploy':157,161,169,406,408,412,418,445,451 'deploymenttyp':171 'determin':20 'distribut':494 'docker':125,129,430 'dockerfil':146,147 'duplic':502 'environ':176,424 'environmentref':177,425 'error':209,501,535 'exampl':427 'execut':182,249 'exist':384,505,549 'failurestrategi':207 'fals':193 'field':34,312,471 'fix':342 'found':538,546 'generat':6,41,436,447,459 'group':87 'har':7,56,66,350,369,389 'id':357,359,376,378,380,396,398 'identifi':29,98,128,159,180,185,198,221,231,252,270,280,294,405,503,518 'infrastructuredefinit':179 'input':36,39,141,143,145,175,178,181,262,292,306,309,314,326,331,337,473,554 'instruct':18 'integr':295,298 'invalid':510 'k8s':156,160,411,444 'k8srollingdeploy':190 'k8srollingrollback':203 'kubernet':172 'linux':242 'list':67,383,390 'make':453 'mark':32,310,468 'match':520 'maxim':475 'mcp':17,54,346,348,367,387 'miss':550 'must':513,519 'name':95,124,155,187,200,218,233,254,267,283,297,335,407 'new':508 'note':467 'onfailur':208 'org':356,377,395 'orgidentifi':109 'os':241 'paramet':31,352,371,391 'per':516 'perform':466 'pipelin':25,82,85,107,214,227,402,457,460,492 'pipeline.sequenceid':341 'platform':240 'prod':426 'project':113,358,379,397 'projectidentifi':111 'provid':317,333,339,552 'push':15,127,131,433 'refer':489 'referenc':399 'relat':89 'repo':142,330,334 'resourc':59,69,353,372,375,392 'reusabl':12,30,75,79,84,443,477 'rollback':199,201 'rollbackstep':196 'rollout':186,188 'run':257,287,301 'runtim':38,245,308 'scope':542 'select':328 'servic':173,420,423 'serviceref':174,421 'shell':259,289,303 'skill' 'skill-create-template' 'skipdryrun':192 'source-harness' 'spec':115,136,139,167,170,191,204,228,237,248,258,277,288,302,324,419 'stage':24,78,80,106,151,158,162,166,229,230,404,413,446,448,465 'stagerollback':213 'standard':219,222,455 'step':23,74,76,90,104,105,120,135,183,184,197,250,251,278,279,293,434,437 'stepgroup':27,86,108,263,276 'structur':45,92 'suit':269,272 'tag':114,144,336,340 'team':497 'templat':3,5,9,21,61,71,72,91,94,97,100,121,123,152,154,215,217,264,266,322,355,364,374,385,394,400,409,435,438,449,458,461,476,485,488,499,504,517,533,536 'templateinput':416,551 'templateref':410,540 'test':268,271,282,285,296,299,487 'timeout':149,194,205 'tool':349,368,388 'topic-agent-skills' 'topic-agents' 'troubleshoot':498 'true':239 'type':22,60,70,73,103,119,134,137,165,168,189,202,212,226,235,246,256,275,286,300,354,373,393,417,452 'uniqu':49,482,515 'unit':281,284 'updat':362,370,486,506 'usag':534 'use':43,55,65,307,320 'user':316,327,332,338 'v0':8 'valu':318,343,555 'verifi':63,478,547 'version':365,511,544 'versionlabel':50,101,132,163,224,273,414,480,509,512,548 'via':16,53,345 'yaml':10,42,93,122,153,216,265,323,403 'z':524,530 'za':523,529","prices":[{"id":"484a20f5-128d-4728-a1c0-5f72df5676a9","listingId":"b8cb384e-8c7a-430e-9b56-12d33f2d9350","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:28.515Z"}],"sources":[{"listingId":"b8cb384e-8c7a-430e-9b56-12d33f2d9350","source":"github","sourceId":"harness/harness-skills/create-template","sourceUrl":"https://github.com/harness/harness-skills/tree/main/skills/create-template","isPrimary":false,"firstSeenAt":"2026-05-09T01:05:28.515Z","lastSeenAt":"2026-05-18T19:06:29.819Z"}],"details":{"listingId":"b8cb384e-8c7a-430e-9b56-12d33f2d9350","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"harness","slug":"create-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":"11e6c5bea73abbcc3720e7e07f6f21ba72ea504c","skill_md_path":"skills/create-template/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/harness/harness-skills/tree/main/skills/create-template"},"layout":"multi","source":"github","category":"harness-skills","frontmatter":{"name":"create-template","license":"Apache-2.0","description":">-","compatibility":"Requires Harness MCP v2 server (harness-mcp-v2)"},"skills_sh_url":"https://skills.sh/harness/harness-skills/create-template"},"updatedAt":"2026-05-18T19:06:29.819Z"}}