Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge Terraform Changes?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-terraform-changes)
---
name: forge-terraform-changes
description: "Plan and review Terraform/OpenTofu changes safely: state, plans, modules, drift and destructive changes"
---
<!-- Generated from catalog/skills/terraform-changes/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# Terraform changes
Use when editing `.tf` files.
## Workflow
1. `terraform fmt -recursive` and `terraform validate`.
2. `terraform plan -out=plan.tfplan` in the right workspace/environment, and read every change. Pay special attention to `-/+` (replace) and `-` (destroy) on stateful resources: databases, buckets, volumes, DNS.
3. Summarize the plan for the user: counts of create/update/replace/destroy and every destructive item by name.
4. Apply only the reviewed plan file, and only with explicit user approval. Never run `terraform apply -auto-approve` or `terraform destroy` on your own.
## Avoid surprise replacements
- Renaming a resource or moving it into a module destroys and recreates it unless you add a `moved` block.
- Changing a `for_each` key or `count` index moves resources; prefer `for_each` with stable keys.
- Some argument changes force replacement; the plan says `# forces replacement`. Find another way or plan a migration.
- Use `lifecycle { prevent_destroy = true }` on critical stateful resources.
## Hygiene
- Pin provider and module versions; commit `.terraform.lock.hcl`.
- Remote state with locking. Never edit state by hand; use `terraform state mv` / `import` blocks.
- No secrets in `.tf` or `.tfvars` committed to git; use variables marked `sensitive` fed from a secret store.
- Run `tflint` / `checkov` / `tfsec` if the repo configures them.
## Verify
`terraform fmt -check`, `terraform validate` and `terraform plan` run clean; the plan shows no unexpected destroy or replace on stateful resources.