{"id":"635adbea-ec9e-4cc4-831c-6fab3d8f28d3","shortId":"CXKdEF","kind":"skill","title":"create-service","tagline":">-","description":"# Create Service\n\nGenerate Harness Service YAML and push to Harness via MCP.\n\n## Instructions\n\n1. **Detect service type from codebase** (if source code is available) - Scan the project for deployment manifests to auto-select the correct `serviceDefinition.type` and manifest configuration:\n   - `k8s/`, `kubernetes/`, `manifests/` with YAML files → `Kubernetes` with `K8sManifest`\n   - `kustomization.yaml` → `Kubernetes` with `Kustomize`\n   - `Chart.yaml`, `charts/`, `helm/` → `NativeHelm` with `HelmChart`\n   - `task-definition.json` → `ECS` with `EcsTaskDefinition`\n   - `serverless.yml` / `template.yaml` (SAM) → `ServerlessAwsLambda`\n   - `function.json` (Azure) → `AzureWebApp`\n   - `.NET` + Windows → `WinRm`\n   - Traditional app (JAR/WAR) without containers → `Ssh`\n   - See `create-pipeline/references/codebase-analysis.md` Step 4 for the full decision tree\n2. **Detect artifact source** - Match Dockerfile registry references to artifact source type:\n   - Docker Hub → `DockerRegistry`\n   - `*.dkr.ecr.*.amazonaws.com` → `Ecr`\n   - `gcr.io` / `*-docker.pkg.dev` → `Gcr`\n   - `*.azurecr.io` → `Acr`\n3. **Confirm with user** - Present detected service type, manifest type, and artifact source for confirmation\n4. **Generate YAML** following the structure below\n5. **Create via MCP** using `harness_create` with resource_type `service`\n\n## Service Structure\n\n```yaml\nservice:\n  name: My Service\n  identifier: my_service\n  orgIdentifier: default\n  projectIdentifier: my_project\n  serviceDefinition:\n    type: Kubernetes        # Kubernetes, NativeHelm, ECS, ServerlessAwsLambda, Ssh, WinRm, AzureWebApp, AzureFunction, CustomDeployment\n    spec:\n      artifacts:\n        primary:\n          primaryArtifactRef: docker_image\n          sources:\n            - identifier: docker_image\n              type: DockerRegistry\n              spec:\n                connectorRef: dockerhub\n                imagePath: myorg/myimage\n                tag: <+input>\n      manifests:\n        - manifest:\n            identifier: k8s_manifest\n            type: K8sManifest\n            spec:\n              store:\n                type: Github\n                spec:\n                  connectorRef: github_connector\n                  repoName: my-manifests\n                  branch: main\n                  paths: [manifests/]\n      variables:\n        - name: replicas\n          type: String\n          value: \"3\"\n```\n\n## Deployment Types\n\n### Kubernetes Service\n```yaml\nserviceDefinition:\n  type: Kubernetes\n  spec:\n    artifacts:\n      primary:\n        primaryArtifactRef: main_image\n        sources:\n          - identifier: main_image\n            type: DockerRegistry\n            spec:\n              connectorRef: dockerhub\n              imagePath: myorg/api\n              tag: <+input>\n    manifests:\n      - manifest:\n          identifier: manifests\n          type: K8sManifest\n          spec:\n            store:\n              type: Github\n              spec:\n                connectorRef: github\n                repoName: k8s-manifests\n                branch: main\n                paths: [deploy/]\n```\n\n### Helm Service\n```yaml\nserviceDefinition:\n  type: NativeHelm\n  spec:\n    artifacts:\n      primary:\n        primaryArtifactRef: chart\n        sources:\n          - identifier: chart\n            type: DockerRegistry\n            spec:\n              connectorRef: dockerhub\n              imagePath: myorg/api\n              tag: <+input>\n    manifests:\n      - manifest:\n          identifier: helm_chart\n          type: HelmChart\n          spec:\n            store:\n              type: Http\n              spec:\n                connectorRef: helm_repo\n            chartName: my-chart\n            chartVersion: <+input>\n            helmVersion: V3\n```\n\n### Kustomize Service\n```yaml\nserviceDefinition:\n  type: Kubernetes\n  spec:\n    artifacts:\n      primary:\n        primaryArtifactRef: main_image\n        sources:\n          - identifier: main_image\n            type: DockerRegistry\n            spec:\n              connectorRef: dockerhub\n              imagePath: myorg/api\n              tag: <+input>\n    manifests:\n      - manifest:\n          identifier: kustomize\n          type: Kustomize\n          spec:\n            store:\n              type: Github\n              spec:\n                connectorRef: github\n                repoName: k8s-config\n                branch: main\n                folderPath: overlays/production\n            pluginPath: \"\"\n```\n\n### ECS Service\n```yaml\nserviceDefinition:\n  type: ECS\n  spec:\n    artifacts:\n      primary:\n        primaryArtifactRef: ecr_image\n        sources:\n          - identifier: ecr_image\n            type: Ecr\n            spec:\n              connectorRef: aws_connector\n              region: us-east-1\n              imagePath: my-image\n              tag: <+input>\n    manifests:\n      - manifest:\n          identifier: task_def\n          type: EcsTaskDefinition\n          spec:\n            store:\n              type: Github\n              spec:\n                connectorRef: github\n                repoName: ecs-config\n                branch: main\n                paths: [task-definition.json]\n```\n\n### Serverless Lambda Service\n```yaml\nserviceDefinition:\n  type: ServerlessAwsLambda\n  spec:\n    artifacts:\n      primary:\n        primaryArtifactRef: s3_artifact\n        sources:\n          - identifier: s3_artifact\n            type: AmazonS3\n            spec:\n              connectorRef: aws_connector\n              region: us-east-1\n              bucketName: my-deployments\n              filePath: serverless-app.zip\n    manifests:\n      - manifest:\n          identifier: serverless_manifest\n          type: ServerlessAwsLambda\n          spec:\n            store:\n              type: Github\n              spec:\n                connectorRef: github\n                repoName: serverless-config\n                branch: main\n                paths: [serverless.yml]\n```\n\n## Artifact Source Types\n\n- `DockerRegistry` - Docker Hub (connectorRef, imagePath, tag)\n- `Ecr` - AWS ECR (connectorRef, region, imagePath, tag)\n- `Gcr` - Google GCR (connectorRef, registryHostname, imagePath, tag)\n- `GoogleArtifactRegistry` - Google Artifact Registry (connectorRef, region, repositoryName, package, version)\n- `Acr` - Azure ACR (connectorRef, subscriptionId, registry, repository, tag)\n- `ArtifactoryRegistry` - JFrog Artifactory (connectorRef, repository, artifactPath, repositoryFormat, tag)\n- `Nexus3Registry` - Nexus (connectorRef, repository, artifactPath, repositoryFormat, tag)\n- `GithubPackageRegistry` - GitHub Packages (connectorRef, packageType, org, packageName, version)\n- `AmazonS3` - S3 (connectorRef, region, bucketName, filePath)\n- `GoogleCloudStorage` - GCS (connectorRef, project, bucket, artifactPath)\n- `CustomArtifact` - Custom source (scripts, delegateSelectors, version)\n\n## Creating via MCP\n\n```\nCall MCP tool: harness_create\nParameters:\n  resource_type: \"service\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n  body: <service YAML>\n```\n\nList existing services:\n```\nCall MCP tool: harness_list\nParameters:\n  resource_type: \"service\"\n  org_id: \"<organization>\"\n  project_id: \"<project>\"\n```\n\n## Examples\n\n- \"Create a K8s service with Docker Hub artifact\" - Kubernetes type with DockerRegistry source\n- \"Create a Helm service\" - NativeHelm type with HelmChart manifest\n- \"Create an ECS service with ECR\" - ECS type with Ecr artifact source\n\n## Performance Notes\n\n- Verify that referenced connectors exist before creating the service definition.\n- Ensure the deployment type matches the infrastructure type that will be used in the pipeline.\n- For artifact sources, confirm the image path and registry are accessible.\n- Quality of service configuration is more important than speed.\n\n## Troubleshooting\n\n- `CONNECTOR_NOT_FOUND` - Create connector first or fix connectorRef\n- `DUPLICATE_IDENTIFIER` - Service exists; use `harness_update`\n- Artifact tag `<+input>` means the tag is provided at runtime","tags":["create","service","harness","skills","agent-skills","agents"],"capabilities":["skill","source-harness","skill-create-service","topic-agent-skills","topic-agents"],"categories":["harness-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/harness/harness-skills/create-service","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,946 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.731Z","embedding":null,"createdAt":"2026-05-09T01:05:28.427Z","updatedAt":"2026-05-18T19:06:29.731Z","lastSeenAt":"2026-05-18T19:06:29.731Z","tsv":"'/references/codebase-analysis.md':87 '1':17,394,450 '2':95 '3':118,226 '4':89,133 '5':140 'access':665 'acr':117,511,513 'amazonaws.com':111 'amazons3':441,542 'app':78 'artifact':97,104,129,179,236,282,328,375,431,435,439,479,504,601,626,656,692 'artifactori':521 'artifactoryregistri':519 'artifactpath':524,531,553 'auto':36 'auto-select':35 'avail':27 'aw':388,444,489 'azur':72,512 'azurecr.io':116 'azurefunct':176 'azurewebapp':73,175 'bodi':576 'branch':216,271,363,419,475 'bucket':552 'bucketnam':451,546 'call':563,580 'chart':58,285,288,302,316 'chart.yaml':57 'chartnam':313 'chartvers':317 'code':25 'codebas':22 'config':362,418,474 'configur':43,669 'confirm':119,132,658 'connector':211,389,445,633,676,680 'connectorref':191,209,248,265,292,310,340,357,387,413,443,469,485,491,498,506,514,522,529,537,544,550,684 'contain':81 'correct':39 'creat':2,4,85,141,146,560,567,594,607,616,636,679 'create-pipelin':84 'create-servic':1 'custom':555 'customartifact':554 'customdeploy':177 'decis':93 'def':405 'default':162 'definit':639 'delegateselector':558 'deploy':32,227,274,454,642 'detect':18,96,123 'dkr.ecr':110 'docker':107,182,186,483,599 'docker.pkg.dev':114 'dockerfil':100 'dockerhub':192,249,293,341 'dockerregistri':109,189,246,290,338,482,605 'duplic':685 'east':393,449 'ec':64,171,368,373,417,618,622 'ecr':112,378,382,385,488,490,621,625 'ecs-config':416 'ecstaskdefinit':66,407 'ensur':640 'exampl':593 'exist':578,634,688 'file':49 'filepath':455,547 'first':681 'fix':683 'folderpath':365 'follow':136 'found':678 'full':92 'function.json':71 'gcr':115,495,497 'gcr.io':113 'gcs':549 'generat':6,134 'github':207,210,263,266,355,358,411,414,467,470,535 'githubpackageregistri':534 'googl':496,503 'googleartifactregistri':502 'googlecloudstorag':548 'har':7,13,145,566,583,690 'helm':59,275,301,311,609 'helmchart':62,304,614 'helmvers':319 'http':308 'hub':108,484,600 'id':573,575,590,592 'identifi':158,185,199,242,256,287,300,334,348,381,403,437,459,686 'imag':183,187,240,244,332,336,379,383,398,660 'imagepath':193,250,294,342,395,486,493,500 'import':672 'infrastructur':646 'input':196,253,297,318,345,400,694 'instruct':16 'jar/war':79 'jfrog':520 'k8s':44,200,269,361,596 'k8s-config':360 'k8s-manifests':268 'k8smanifest':52,203,259 'kubernet':45,50,54,168,169,229,234,326,602 'kustom':56,321,349,351 'kustomization.yaml':53 'lambda':424 'list':577,584 'main':217,239,243,272,331,335,364,420,476 'manifest':33,42,46,126,197,198,201,215,219,254,255,257,270,298,299,346,347,401,402,457,458,461,615 'match':99,644 'mcp':15,143,562,564,581 'mean':695 'my-chart':314 'my-deploy':452 'my-imag':396 'my-manifest':213 'myorg/api':251,295,343 'myorg/myimage':194 'name':155,221 'nativehelm':60,170,280,611 'net':74 'nexus':528 'nexus3registry':527 'note':629 'org':539,572,589 'orgidentifi':161 'overlays/production':366 'packag':509,536 'packagenam':540 'packagetyp':538 'paramet':568,585 'path':218,273,421,477,661 'perform':628 'pipelin':86,654 'pluginpath':367 'present':122 'primari':180,237,283,329,376,432 'primaryartifactref':181,238,284,330,377,433 'project':30,165,551,574,591 'projectidentifi':163 'provid':699 'push':11 'qualiti':666 'refer':102 'referenc':632 'region':390,446,492,507,545 'registri':101,505,516,663 'registryhostnam':499 'replica':222 'repo':312 'reponam':212,267,359,415,471 'repositori':517,523,530 'repositoryformat':525,532 'repositorynam':508 'resourc':148,569,586 'runtim':701 's3':434,438,543 'sam':69 'scan':28 'script':557 'see':83 'select':37 'serverless':423,460,473 'serverless-app.zip':456 'serverless-config':472 'serverless.yml':67,478 'serverlessawslambda':70,172,429,463 'servic':3,5,8,19,124,150,151,154,157,160,230,276,322,369,425,571,579,588,597,610,619,638,668,687 'servicedefinit':166,232,278,324,371,427 'servicedefinition.type':40 'skill' 'skill-create-service' 'sourc':24,98,105,130,184,241,286,333,380,436,480,556,606,627,657 'source-harness' 'spec':178,190,204,208,235,247,260,264,281,291,305,309,327,339,352,356,374,386,408,412,430,442,464,468 'speed':674 'ssh':82,173 'step':88 'store':205,261,306,353,409,465 'string':224 'structur':138,152 'subscriptionid':515 'tag':195,252,296,344,399,487,494,501,518,526,533,693,697 'task':404 'task-definition.json':63,422 'template.yaml':68 'tool':565,582 'topic-agent-skills' 'topic-agents' 'tradit':77 'tree':94 'troubleshoot':675 'type':20,106,125,127,149,167,188,202,206,223,228,233,245,258,262,279,289,303,307,325,337,350,354,372,384,406,410,428,440,462,466,481,570,587,603,612,623,643,647 'updat':691 'us':392,448 'us-east':391,447 'use':144,651,689 'user':121 'v3':320 'valu':225 'variabl':220 'verifi':630 'version':510,541,559 'via':14,142,561 'window':75 'winrm':76,174 'without':80 'yaml':9,48,135,153,231,277,323,370,426","prices":[{"id":"a3614bab-b91e-4abf-a2cc-47625b165eca","listingId":"635adbea-ec9e-4cc4-831c-6fab3d8f28d3","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.427Z"}],"sources":[{"listingId":"635adbea-ec9e-4cc4-831c-6fab3d8f28d3","source":"github","sourceId":"harness/harness-skills/create-service","sourceUrl":"https://github.com/harness/harness-skills/tree/main/skills/create-service","isPrimary":false,"firstSeenAt":"2026-05-09T01:05:28.427Z","lastSeenAt":"2026-05-18T19:06:29.731Z"}],"details":{"listingId":"635adbea-ec9e-4cc4-831c-6fab3d8f28d3","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"harness","slug":"create-service","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":"9274773ccb3331842fa3a68d765e91b5c82218fa","skill_md_path":"skills/create-service/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/harness/harness-skills/tree/main/skills/create-service"},"layout":"multi","source":"github","category":"harness-skills","frontmatter":{"name":"create-service","license":"Apache-2.0","description":">-","compatibility":"Requires Harness MCP v2 server (harness-mcp-v2)"},"skills_sh_url":"https://skills.sh/harness/harness-skills/create-service"},"updatedAt":"2026-05-18T19:06:29.731Z"}}