ProSkillsLibraryFreePassScan
DevOps & Cloud

DevOps & Cloud · agent skill

Terraform Reviewer

Reads the plan before it destroys something.

What it does

Loads when it is needed

Your agent loads it when a diff touches Terraform or OpenTofu, or the user shares a plan. It carries 5 rules and reads a profile.md with your details before it starts, so the output matches your brand and project.

Same prompt, with and without

Review plan that moves the DB

Prompt · Can you review this plan before I merge? It's supposed to just move the orders DB into the data module and let CloudFront read the assets bucket.

# plan for commit 9c41e07, env production
# aws_db_instance.orders will be destroyed (not in configuration)
- resource "aws_db_instance" "orders" { identifier = "orders-prod"  storage_encrypted = true }
# module.data.aws_db_instance.orders will be created
+ resource "aws_db_instance" "orders" { identifier = "orders-prod"  storage_encrypted = false  skip_final_snapshot = true }
# aws_s3_bucket_policy.assets will be updated in-place
~ Principal = { Service = "cloudfront.amazonaws.com" } -> "*"
Plan: 1 to add, 1 to change, 1 to destroy.

# modules/data/main.tf
10 resource "aws_db_instance" "orders" {
11   identifier          = "orders-prod"
12   storage_encrypted   = false
13   skip_final_snapshot = true
14   # no deletion_protection, no lifecycle block
15 }
# versions.tf
3 required_providers { aws = { source = "hashicorp/aws" } }   # no version

Profile used: AWS, ECS Fargate, GitHub Actions; staging, production

Without the skill
Do not merge this. It would destroy and recreate your production database. 1. The plan destroys aws_db_instance.orders and creates a new one under module.data. Moving a resource into a module needs a moved block, otherwise Terraform sees delete + create. Add: moved { from = aws_db_instance.orders to = module.data.aws_db_instance.orders } The plan should then show no change for the DB. 2. The module sets storage_encrypted = false while the existing DB is true. Encryption can't be changed in place, so this also forces replacement, and it's a security regression. Set it to true. 3. skip_final_snapshot = true means the destroy takes no final snapshot, so the data is gone. Set it to false with a final_snapshot_identifier, add deletion_protection = true, and add lifecycle { prevent_destroy = true }. Take a manual snapshot before applying anything. 4. The assets bucket policy Principal changes from the CloudFront service principal to "*". That makes the bucket readable by anyone. Keep Service = cloudfront.amazonaws.com and add a condition on AWS:SourceArn matching your distribution (this is the OAC pattern). 5. The aws provider has no version constraint. Pin it (for example ~> 5.0) so plans stay reproducible. Expected result after fixes: plan shows 0 add / 0 destroy for the DB (just the move), and 1 change for the bucket policy. Check it in staging first.
With the skill
Terraform review: move orders DB into data module Plan: 1 to add, 1 to change, 1 to destroy (commit 9c41e07) Env: production Verdict: Request changes (3 blockers, 2 should-fix). Nothing applied or planned by me. [blocker] modules/data/main.tf:10 The resource moved into the module with no moved block, so the plan destroys aws_db_instance.orders and creates an empty module.data.aws_db_instance.orders with the same identifier. That is the production database, deleted. Fix: in the root module add moved { from = aws_db_instance.orders, to = module.data.aws_db_instance.orders } and re-plan until the DB shows no destroy. [blocker] modules/data/main.tf:12 storage_encrypted = false while the live instance is true. Once moved, that is a replacement ("forces replacement") and unencrypts production data. Fix: storage_encrypted = true. [blocker] aws_s3_bucket_policy.assets (file not in what you sent) Principal goes from the CloudFront service to "*": the assets bucket becomes world-readable. Fix: keep the service principal and add Condition StringEquals AWS:SourceArn = the distribution ARN; confirm aws_s3_bucket_public_access_block is on. [should-fix] modules/data/main.tf:13 skip_final_snapshot = true, no deletion_protection, no prevent_destroy on a production DB. Fix: deletion_protection = true, skip_final_snapshot = false with a final_snapshot_identifier, lifecycle { prevent_destroy = true }. [should-fix] versions.tf:3 aws provider has no version; a new major changes plans. Fix: version = "~> 5.40", commit .terraform.lock.hcl. Re-run the plan after fixes: this one is for 9c41e07 only.

Both answers from the same model (Claude sonnet), 2026-10-16. The one without the skill was written in a separate session that never saw it. Shortened where marked with …

Install

One command, in your project

It detects your agent; add --agent all for every agent.

npx proskills-cli add terraform-reviewer --order <order id from your receipt>

Or copy the skill folder (the one holding SKILL.md) into the directory your agent reads, then restart it or start a new session.

AgentThis projectEvery project
Claude Code.claude/skills/~/.claude/skills/
Cursor.agents/skills/ (or .cursor/skills/)~/.cursor/skills/
Codex.agents/skills/~/.agents/skills/
Gemini CLI.agents/skills/ (or .gemini/skills/)~/.gemini/skills/

Changelog

What changed

  • v1.0.0 · 2026-10-16
    • First versioned release: Reads the plan before it destroys something.
    • Scanned 100/100 before release.

Keep it current with npx proskills-cli update; your profile.md is never touched. Everyone who bought it gets the update free and an email when it lands.

Same collection

More from DevOps & Cloud

The scan checks spec compliance, token cost, clarity and security patterns. A clean scan is not a guarantee: static scanners can be evaded. Scan any skill yourself.