Terraform
No scripts/.
Process skills that may load with this one: load-with list.
Iron law
State is sensitive. Plans are read. Secrets stay out of VCS.
Tooling / verify
terraform fmt -check
terraform validate
terraform plan
Read the plan. Do not apply in this skill.
Idioms a linter misses
- Remote state with locking when the project already has it.
- Pin
required_providersand Terraform version as the root module already does. for_eachovercountfor sets.- Variables for anything that changes by env. No copied prod IDs in a public file.
- Expand-contract for destructive destroys.
ignore_changesonly with a named reason.
Errors
- Failed plan is a stop. Do not
-auto-approveto hide it.
Testing
terraform planagainst the real backend is the default test.terraform plan -lock=falseis not a substitute.terraform test/ terratest only if the repo already has it.
PR review
- Plan attached or reproducible from the module.
- IAM not widened (
*actions). - No secrets in
.tf/ committed.tfvars. - State backend unchanged unless the ticket says so.
Security
- Least-privilege IAM. Do not widen
*. - No access keys in the tree.
- State contains secrets — treat backends as sensitive.
Always
fmt+validate+ a plan you read.
Ask first
- State migration.
- New cloud account or region.
- Destroy of existing resources.
Never
- Secrets in VCS.
applywithout a plan you read.- Force-unlock as a habit.
-auto-approveas the default path.
Red flags
- "I'll apply -auto-approve"
- "The secret is just a variable"
- "force-unlock, it's stuck"