agentleFS
thixpinthixpin/claude-config/skills/terraform-review/SKILL.md

terraform-review

Skill8 starsChanged 4 months agoMITView on GitHub

Method for reviewing Terraform/OpenTofu infrastructure-as-code changes for blast radius, state safety, and drift before apply. Use when reviewing a Terraform plan or diff, writing or changing .tf files, restructuring modules, or before running terraform apply. Reviews the implementation of a design — designing the infrastructure itself belongs to infra-design; for IAM/secret depth also use security-audit; for application architecture use architecture-review.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    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:

    If the plan shows a destroy/replace the diff doesn't obviously explain, stop and ask before running apply — do not assume it's safe because …

    line 35
  2. Distinctive:

    If the project already has an established module structure or naming scheme that differs from general best practice, follow the project's …

    line 37
  3. Very specific:

    If the review reveals the *design* is wrong — a component with no justifying requirement, a missing reliability or cost consideration — …

    line 38

“Common” is measured: kept by at least 6 in 10 of the 4 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 Review

Judge infrastructure changes by blast radius and reversibility, not by diff size. A one-line change can destroy a database; a hundred-line module refactor can be a no-op.

Scope

Reviews the implementation — the Terraform/OpenTofu code and plan that realize an infrastructure design.

Use for Terraform/OpenTofu changes: resources, modules, state, providers, variables/outputs, and plan review before apply.

Do not use for:

  • Designing the infrastructure or weighing architecture trade-offs (topology, managed versus self-hosted, capacity) — use infra-design. This skill takes the design as given and reviews how the code realizes it.
  • Application code security review — use security-audit. IAM policies and secrets inside Terraform are the exception: apply both skills together.
  • Multi-service system structure not expressed in Terraform — use architecture-review.
  • CI/CD pipeline logic, unless the pipeline itself is defined as Terraform resources.

Method

  1. Read the plan, not just the diff. terraform plan output reveals the actual blast radius — a diff can look like a rename but the plan shows destroy + create because the resource's identity changed.
  2. Flag every destroy or replace on stateful resources — databases, volumes, DNS records, anything holding data or an external dependency. Call these out explicitly and check for lifecycle { prevent_destroy = true } or a migration plan before data is lost.
  3. Verify state safety — remote backend with locking; no local .tfstate committed to git; no hardcoded paths that only work on one machine.
  4. Check module boundaries — reusable logic factored into modules with explicit inputs and outputs; no module reaching into another's resources or provider configuration.
  5. Audit secrets and IAM — no plaintext secrets in tracked files; credential variables marked sensitive = true (masks output, not state); secrets via secret-manager reference, never literals — and since secret values can still land in state, keep them out where possible and restrict state-backend access; no wildcard Action: "*" / Resource: "*" IAM without explicit justification. Deeper security analysis belongs to security-audit.
  6. Confirm version pinning — required_version, required_providers, and module sources pinned to a version or commit, never a floating branch (?ref=main), so the next apply cannot silently change behavior.
  7. Check naming and tagging consistency — resources follow the project's existing convention (environment, owner, cost-center) so cost and ownership stay traceable.
  8. Flag drift risk — configuration that depends on state mutated outside Terraform (manual console changes, imperative scripts) is fragile; note it even if out of scope to fix now.

Judgment calls

  • If the plan shows a destroy/replace the diff doesn't obviously explain, stop and ask before running apply — do not assume it's safe because the source change looked small.
  • Changes touching production state require explicit confirmation before apply, per CLAUDE.md's Safety section — this skill identifies the risk; it does not authorize proceeding past it.
  • If the project already has an established module structure or naming scheme that differs from general best practice, follow the project's pattern instead of imposing a new one.
  • If the review reveals the design is wrong — a component with no justifying requirement, a missing reliability or cost consideration — hand that finding to infra-design rather than redesigning inside the review.

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.