What problem does it solve?
Detect and resolve infrastructure drift where Terraform configuration diverges from remote state, avoiding accidental resource destruction or unsynchronized configurations. It automates discovery, plan-based analysis, and safe code alignment so repositories remain the single source of truth.
Core Features & Use Cases
- Module Discovery: Locate Terraform root modules in a git repository and prompt the user to select a module when multiple are present.
- Plan-based Detection & Classification: Run terraform plan (with an automatic init fallback when required) and categorize changes as destructive, risky, or safe, summarizing impacted resources in plain operational language.
- Safe Alignment Workflow: Generate before/after .tf file diffs without applying changes, gate destructive deletions with explicit user choices, apply approved edits, run terraform fmt and validate, re-run plan for re-verification, and commit only after successful verification.
- Use Case: A developer discovers that infrastructure was modified externally; use this skill to identify destructive deletions, choose whether to remove or recreate resources, and align code with remote state with an auditable commit.
Quick Start
Run the terraform drift skill on a repository module path to detect drift, review proposed diffs, and apply approved code alignment.