agentleFS
Rikinshah787Rikinshah787/agent-skills-production-skills/skills/terraform/SKILL.md

terraform

Skill2 starsChanged 4 months agoMITView on GitHub

Use to manage cloud infrastructure as code — declare resources in HCL, preview with plan, provision with apply, and store state remotely.

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ansible, kubernetes and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • KubementatSkill

    ansible

    Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.

    Also in 3 projects that use this

  • mjunaidcaSkill

    kubernetes

    Production-grade Kubernetes manifests and debugging for containerized applications. This skill should be used when users ask to deploy to Kubernetes, create K8s manifests, containerize for K8s, set up Deployments/Services/Jobs/StatefulSets/CronJobs, create namespaces with resource quotas, set up multi-team isolation, configure ResourceQuota/ LimitRange, secure with RBAC (ServiceAccount, Role, RoleBinding), configure init containers (model download, db wait, migrations), set up sidecars (logging, metrics), or debug pods (CrashLoopBackOff, logs, exec, describe, events). Auto-detects from Dockerfile/code, generates hardened manifests with educational comments. CKAD-aligned.

    Also in 3 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 4 projects that use this

  • VercelSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when: provisioning cloud resources (compute, DBs, DNS, buckets) reproducibly across environments.

    line 19
  2. Distinctive:

    Use when: you want peer-reviewed, version-controlled infra changes instead of clicking in a console.

    line 20
  3. Distinctive:

    Don't use for: app-level deploys that a PaaS already handles, or one-off throwaway experiments.

    line 21
  4. Distinctive:

    Use short-lived/OIDC credentials for the provider in CI rather than long-lived access keys.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “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

Terraform — Skillship

Declare infrastructure as code in HCL, preview changes with plan, and provision them with apply. The core loop is Write → Plan → Apply, with state tracking what exists.

🧭 When to use this skill

  • Use when: provisioning cloud resources (compute, DBs, DNS, buckets) reproducibly across environments.
  • Use when: you want peer-reviewed, version-controlled infra changes instead of clicking in a console.
  • Don't use for: app-level deploys that a PaaS already handles, or one-off throwaway experiments.

⚡ Quickstart

1. Write config — main.tf

terraform {
  required_version = ">= 1.9"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"          # pin the provider major version
    }
  }
}

provider "aws" {
  region = var.region
}

variable "region" {
  type    = string
  default = "us-east-1"
}

resource "aws_s3_bucket" "assets" {
  bucket = "my-unique-assets-bucket-2026"
}

output "bucket_name" {
  value = aws_s3_bucket.assets.bucket
}

2. The core workflow

terraform init      # download providers, set up the backend
terraform fmt       # format
terraform validate  # static checks
terraform plan      # preview changes (dry run)
terraform apply     # provision after confirmation (type "yes")
terraform destroy   # tear everything down

🧩 Common recipes

Recipe: Remote state with locking (S3 + native locking)

terraform {
  backend "s3" {
    bucket       = "my-tf-state"
    key          = "prod/terraform.tfstate"
    region       = "us-east-1"
    encrypt      = true
    use_lockfile = true          # state locking to prevent concurrent applies
  }
}

Recipe: Pass secrets via env vars (not committed)

export TF_VAR_db_password="$DB_PASSWORD"   # populates variable "db_password"
terraform apply
variable "db_password" {
  type      = string
  sensitive = true               # keeps it out of CLI/plan output
}

Recipe: Save & apply an exact plan (CI-safe)

terraform plan -out=tfplan
terraform apply tfplan           # applies exactly what was reviewed

Recipe: Workspaces for environments

terraform workspace new staging
terraform workspace select staging

🚀 Ship to production

  • Remote state with locking + encryption (S3/GCS/HCP Terraform) — never local state for teams.
  • .tfstate, .tfvars with secrets, and .terraform/ are gitignored.
  • Provider and module versions pinned; terraform.lock.hcl committed.
  • Every change goes through plan review in a PR before apply.
  • Secrets injected via TF_VAR_*/secret manager and marked sensitive = true — not hardcoded.
  • Apply runs in CI with least-privilege credentials (prefer OIDC over static keys).

🔐 Security & secrets

  • State files contain resource attributes in plaintext (including some secrets) — store state encrypted, access-controlled.
  • Mark sensitive variables/outputs sensitive = true; never commit *.tfvars holding secrets.
  • Use short-lived/OIDC credentials for the provider in CI rather than long-lived access keys.

🐛 Common errors & fixes

SymptomLikely causeFix
Error acquiring the state lockConcurrent/failed applyWait, or terraform force-unlock <ID> if truly stuck
Team overwrites each other's stateLocal stateConfigure a remote backend with locking
Provider version drift breaks planUnpinned providerPin version, commit .terraform.lock.hcl
Secret leaked in output/logsNot marked sensitiveAdd sensitive = true; avoid output-ing secrets
apply did something unexpectedApplied without reviewing planUse plan -out then apply tfplan

📚 Sources

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.