agentleFS
thisrohanguptathisrohangupta/harness-skills/skills/create-infrastructure/SKILL.md

create-infrastructure

Skill2 starsChanged 7 months agoApache-2.0Archived repositoryView on GitHub

Generate Harness Infrastructure Definition YAML for deployment targets and create via MCP. Use when user says "create infrastructure", "infrastructure definition", "k8s cluster config", "deployment target", or wants to configure where workloads run.

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify the referenced connector and environment exist before creating the infrastructure definition.

    line 179
  2. Distinctive:

    Ensure namespace and cluster names are accurate — typos will cause deployment failures.

    line 180
  3. Very specific:

    Use <+INFRA_KEY_SHORT_ID> in releaseName to guarantee uniqueness across deployments.

    line 181

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Infrastructure

Generate Harness Infrastructure Definition YAML and push via MCP.

Instructions

  1. Identify infrastructure type - KubernetesDirect, KubernetesGcp (GKE), KubernetesAzure (AKS), ECS, or ServerlessAwsLambda
  2. Ensure prerequisites exist - The environment and cloud/cluster connector must be created first
  3. Generate YAML using the templates below, referencing the correct connector and environment
  4. Create via MCP using harness_create with resource_type infrastructure

Infrastructure Types

KubernetesDirect

infrastructureDefinition:
  name: K8s Production
  identifier: k8s_prod
  orgIdentifier: default
  projectIdentifier: my_project
  environmentRef: prod
  deploymentType: Kubernetes
  type: KubernetesDirect
  spec:
    connectorRef: k8s_connector
    namespace: my-app-prod
    releaseName: release-<+INFRA_KEY_SHORT_ID>
  allowSimultaneousDeployments: false

KubernetesGcp (GKE)

infrastructureDefinition:
  name: GKE Cluster
  identifier: gke_prod
  environmentRef: prod
  deploymentType: Kubernetes
  type: KubernetesGcp
  spec:
    connectorRef: gcp_connector
    cluster: my-gke-cluster
    namespace: my-app
    releaseName: release-<+INFRA_KEY_SHORT_ID>

KubernetesAzure (AKS)

infrastructureDefinition:
  name: AKS Cluster
  identifier: aks_prod
  environmentRef: prod
  deploymentType: Kubernetes
  type: KubernetesAzure
  spec:
    connectorRef: azure_connector
    subscriptionId: <subscription_id>
    resourceGroup: my-rg
    cluster: my-aks-cluster
    namespace: my-app
    releaseName: release-<+INFRA_KEY_SHORT_ID>

ECS

infrastructureDefinition:
  name: ECS Fargate
  identifier: ecs_prod
  environmentRef: prod
  deploymentType: ECS
  type: ECS
  spec:
    connectorRef: aws_connector
    region: us-east-1
    cluster: my-ecs-cluster

ServerlessAwsLambda

infrastructureDefinition:
  name: Lambda
  identifier: lambda_prod
  environmentRef: prod
  deploymentType: ServerlessAwsLambda
  type: ServerlessAwsLambda
  spec:
    connectorRef: aws_connector
    region: us-east-1
    stage: prod

AzureWebApp

infrastructureDefinition:
  name: Azure Web App
  identifier: azure_webapp_prod
  environmentRef: prod
  deploymentType: AzureWebApp
  type: AzureWebApp
  spec:
    connectorRef: azure_connector
    subscriptionId: <subscription_id>
    resourceGroup: my-rg

Asg (Auto Scaling Group)

infrastructureDefinition:
  name: ASG Production
  identifier: asg_prod
  environmentRef: prod
  deploymentType: Asg
  type: Asg
  spec:
    connectorRef: aws_connector
    region: us-east-1

GoogleCloudFunctions

infrastructureDefinition:
  name: Cloud Functions
  identifier: gcf_prod
  environmentRef: prod
  deploymentType: GoogleCloudFunctions
  type: GoogleCloudFunctions
  spec:
    connectorRef: gcp_connector
    region: us-central1
    project: my-gcp-project

Pdc (Physical Data Center)

infrastructureDefinition:
  name: On-Prem Servers
  identifier: pdc_prod
  environmentRef: prod
  deploymentType: Ssh
  type: Pdc
  spec:
    connectorRef: pdc_connector
    hosts:
      - host1.example.com
      - host2.example.com

Creating via MCP

Call MCP tool: harness_create
Parameters:
  resource_type: "infrastructure"
  org_id: "<organization>"
  project_id: "<project>"
  body: <infrastructure YAML>

Examples

  • "Create a K8s infrastructure for prod" - KubernetesDirect with prod namespace
  • "Set up GKE infrastructure" - KubernetesGcp with GCP connector
  • "Create ECS Fargate infrastructure" - ECS type with AWS connector
  • "Create Azure Web App infrastructure" - AzureWebApp type with subscription and resource group
  • "Set up on-prem infrastructure" - Pdc type with host list for SSH deployments

Performance Notes

  • Verify the referenced connector and environment exist before creating the infrastructure definition.
  • Ensure namespace and cluster names are accurate — typos will cause deployment failures.
  • Use <+INFRA_KEY_SHORT_ID> in releaseName to guarantee uniqueness across deployments.

Troubleshooting

  • CONNECTOR_NOT_FOUND - Create the cloud/K8s connector first
  • ENVIRONMENT_NOT_FOUND - Create the environment first
  • releaseName must be unique per deployment; use <+INFRA_KEY_SHORT_ID>
  • deploymentType must match the service definition's type (e.g., Kubernetes service needs KubernetesDirect infra)
  • allowSimultaneousDeployments: false is the default; set to true only if concurrent deploys are safe

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.