/infra-skills:terraform-conventionsfrom infra-skills
Use when writing or reviewing Terraform or OpenTofu. Defines staged-apply separation, provider and version pinning, variable structure, secret resolution at plan/apply time, and idempotent plan-before-apply discipline.
Ships in infra-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Split infrastructure into ordered stages when later resources depend on earlier ones (management plane before cluster VMs, DNS before services). Example naming:
infrastructure/terraform/
├── stage1-<foundation>/ # e.g. management VM provisioning + DNS
├── stage2-<cluster>/ # e.g. cluster VM provisioning
└── modules/ # Reusable Terraform modules
Stages must be applied in order: stage1 → stage2. Destroy in reverse. Each stage keeps its own state; a later stage reads an earlier one through outputs or data sources, never by copying values. If the project ships an infra CLI wrapper, it wraps the staging sequence (see below).
Which providers the project uses — compute, DNS, secrets — is an estate choice, recorded in the project's platform-conventions local skill, if it defines one. These conventions hold for any provider:
required_providers with a version constraint, and commit .terraform.lock.hcl. Upgrade deliberately, in its own change..tf or .tfvars.Secrets are resolved at plan/apply time and never written to disk in the repo. Two common shapes:
data "<secrets_provider>_item" "db" {
# reference only — the concrete store, item, and field come from the
# project's secret-paths local skill, if it defines one
}
Never hardcode secrets in .tf or .tfvars files. Mark secret-bearing variables and outputs sensitive = true, and remember that values read this way still land in state: the state backend must be encrypted and access-controlled. Which secrets backend, store names, and item paths the project uses belong in its secret-paths local skill, not here.
Centralized addresses: host and node addresses are defined once, in a typed map variable — never inline literal IPs in resources.
Shared non-sensitive config: a common.tfvars (or equivalent) holds infrastructure constants shared across stages (addresses, node names, DNS zone IDs). The concrete values are the project's topology.
# variables.tf
variable "nodes" {
type = map(object({
host = string
ip = string
}))
}
Give every variable a type and a description; add a validation block where a bad value would otherwise fail late, at apply.
All Terraform operations must be safe to run repeatedly. terraform plan on an already-applied state should show no diff for stable resources. A plan that always shows a diff is a bug to fix (usually a provider default to set explicitly, or a computed attribute for ignore_changes), not noise to accept. Run terraform plan before apply.
terraform fmt -check # Formatting
terraform validate # Syntax + schema check (no API calls)
terraform plan # Show what would change
If the project ships an infrastructure CLI wrapper, prefer it — it enforces stage ordering and confirmation prompts. Example shape:
<cli> infra plan stage1 # terraform plan for stage1
<cli> infra apply stage1 # terraform apply for stage1
<cli> infra plan stage2 # terraform plan for stage2
<cli> infra apply stage2 # terraform apply for stage2
<cli> infra destroy stage2 # Destroy stage2 resources (safe to repeat)
<cli> infra destroy stage1 # Destroy stage1 resources (requires confirmation)
Without a wrapper, run terraform plan / terraform apply per stage directory in the same order.
terraform fmt -check and terraform validate pass for every stage the change touches.tf or .tfvars; credentials resolve at plan/apply time through the project's secrets path (its secret-paths local skill names which)sensitive = truerequired_providers and .terraform.lock.hcl is committedWhat SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/ansible-conventionsUse when writing, changing or reviewing Ansible roles, playbooks, or inventory. Covers repository structure, runtime secret injection, Jinja2/bash delimiter traps, boot-only hardware services, and idempotent check-mode runs./github-actions-conventionsUse when writing or reviewing GitHub Actions workflows or CI. Covers workflow structure, action pinning, secret access, gh CLI usage, uv-based Python jobs, gitleaks scanning, and automated-commit patterns./go-public-reviewUse before making a GitHub repository public, or when reviewing a public one. Audits history, commit metadata and PR refs for exposed content, plus branch and tag rules, docs, public CI, security policy and licence; grades each finding./infra-seamsUse when a diff touches secret-sync objects, tolerations, storage classes, RBAC, or an LLM/tool gateway's access config. Detects infrastructure seam crossings, states the authority delta, seeds the seams registry./k8s-diagnosticsUse when running a Kubernetes health sweep or diagnosing a failing node, pod, GitOps sync or secret sync. Gives kubectl, GitOps-controller and secret-sync checks per sweep section; node-OS tooling defers to topology./k8s-kustomize-conventionsUse when writing, changing or reviewing Kubernetes manifests or Kustomize files. Defines base-and-overlay structure, patch patterns, manifest validation, image-transform limits, and how overlays map to GitOps sync targets.Other plugins' skills for the same job
npx claudepluginhub pixeloven/crew --plugin infra-skills