tf-plan-reviewAnalyze Terraform plans for risk before you apply. Classifies every change as safe, moderate, dangerous, or critical. Detects destroys, IAM changes, data-los...
Install via ClawdBot CLI:
clawdbot install tkuehnl/tf-plan-reviewAnalyze terraform plan output and produce an AI-powered risk assessment of every infrastructure change — before you press apply.
This skill is STRICTLY READ-ONLY. It runs terraform plan and terraform validate to analyze changes, but it NEVER runs terraform apply, terraform destroy, terraform import, terraform taint, or any command that modifies infrastructure or state.
This skill activates when the user mentions:
permissions:
exec: true # Required to run terraform/tofu CLI
read: true # Read .tf files and plan output
write: false # NEVER writes — strictly read-only analysis
network: true # terraform plan needs provider API access
Understanding Terraform change types is critical for accurate risk assessment:
| Action | Meaning | Risk Profile |
|--------|---------|-------------|
| create | New resource being added | Generally safe (unless IAM/security) |
| update | Existing resource modified in-place | Moderate (depends on what's changing) |
| delete | Resource being permanently destroyed | DANGEROUS — data loss risk |
| replace (delete + create) | Resource must be destroyed and recreated | DANGEROUS — downtime + data loss |
| read | Data source being refreshed | Safe (read-only) |
| no-op | No changes needed | Safe |
Critical (🔴 CRITICAL):
Dangerous (🟠 DANGEROUS):
Moderate (🟡 MODERATE):
Safe (🟢 SAFE):
When Terraform says it must "replace" a resource, it means:
This is triggered when an immutable attribute changes (e.g., changing RDS engine_version, EC2 ami, changing a subnet's AZ). The agent should always flag replaces prominently because:
Follow this sequence exactly based on user intent:
bash <skill_dir>/scripts/tf-plan-review.sh plan <directory>
If no directory specified, use the current working directory.
The script outputs:
Parse the JSON output. Key fields:
{
"overall_risk": "🔴 CRITICAL | 🔴 HIGH | 🟡 MODERATE | 🟢 LOW",
"summary": {
"create": 5,
"update": 3,
"destroy": 1,
"replace": 0
},
"risk_breakdown": {
"critical": 1,
"dangerous": 0,
"moderate": 2,
"safe": 5
},
"resources": [
{
"address": "aws_iam_role.admin",
"action": "delete",
"risk": "🔴 CRITICAL"
}
]
}
Show the Markdown report from stderr. Then add your own AI analysis:
Tone guidance for critical plans:
prod-db. All data will be lost. Do you have a backup?"bash <skill_dir>/scripts/tf-plan-review.sh state "<filter>" <directory>
The filter is optional — it greps resource addresses. Examples:
bash /scripts/tf-plan-review.sh state "iam" . → all IAM resourcesbash /scripts/tf-plan-review.sh state "aws_instance" . → all EC2 instancesbash /scripts/tf-plan-review.sh state "" . → all resourcesbash <skill_dir>/scripts/tf-plan-review.sh validate <directory>
Reports configuration errors and warnings without running a plan.
| Variable | Default | Description |
|----------|---------|-------------|
| TF_BINARY | auto-detect | Override binary: terraform, tofu, or a path |
| TF_PLAN_TIMEOUT | 600 | Timeout for terraform plan in seconds |
The script auto-detects terraform first, then tofu. Set TF_BINARY=tofu to force OpenTofu.
| Situation | Behavior |
|-----------|----------|
| terraform/tofu not found | JSON error with install links for both |
| jq not found | JSON error with install link |
| No .tf files in directory | JSON error: "No Terraform configuration files found" |
| Not initialized | Auto-runs terraform init (for plan) or terraform init -backend=false (for validate) |
| Plan fails (provider errors) | Extracts error from plan JSON diagnostics, reports it |
| Plan timeout | Process killed after TF_PLAN_TIMEOUT seconds |
| State not found | JSON error explaining no state exists |
| Empty state | Reports "State is empty — no managed resources" |
terraform apply — not even with -auto-approve, not even with -target, not even "just this one resource". NEVER.terraform destroy — not under any circumstances.terraform import — this modifies state.terraform taint or terraform untaint — these modify state.terraform state mv, terraform state rm, or terraform state push — these modify state.(sensitive). Never try to reveal them.plan, show, state list, state show, validate, init, providers.If the user asks you to apply a plan, respond:
"I can analyze and assess Terraform plans, but I cannot apply them. Applying infrastructure changes requires human review and explicit execution. Based on my analysis, here's what you should verify before running terraform apply..."
Run the plan analysis. If overall_risk is 🟢 LOW:
"This plan looks safe. It creates X new resources with no destroys or security changes. The pre-apply checklist is straightforward."
If overall_risk is 🔴 CRITICAL:
"⚠️ This plan has CRITICAL risk. [Explain specific dangers]. I strongly recommend review by another team member before applying."
Run plan, then filter for action == "delete" or action == "replace". Present each with:
Run plan, then filter resources matching IAM patterns. For each:
Action: *)Run plan, identify all destroys/replaces, then explain:
When the conversation is happening in a Discord channel:
Show Critical ChangesShow Destroyed ResourcesShow Pre-Apply ChecklistTerraform plan JSON may contain sensitive values. The script does NOT extract resource attribute values — it only extracts resource addresses, types, and actions. However, when presenting results:
(sensitive) by TerraformGenerated Mar 1, 2026
A DevOps engineer prepares to apply a Terraform plan to update a production environment. The skill analyzes the plan, flags a critical IAM policy change and a database replace action, preventing a potential security misconfiguration and data loss. It provides a detailed risk breakdown and a clear 'DO NOT APPLY' recommendation with verification steps.
A security team uses the skill to review Terraform plans in a regulated industry (e.g., finance or healthcare) before deployment. It detects unauthorized IAM modifications or deletions of encryption keys, ensuring changes comply with internal policies and regulatory standards like HIPAA or PCI-DSS, and generates an audit-ready risk report.
An SRE investigates unexpected infrastructure behavior by running the skill to compare current state with configuration. It identifies drift, such as manually modified security group rules or deleted resources, classifying each change's risk to prioritize remediation without disrupting services, aiding in maintaining infrastructure consistency.
A team lead integrates the skill into a development workflow to mentor new engineers. When they submit a Terraform plan, the skill provides educational feedback on risk levels (e.g., why a replace action is dangerous), helping them learn best practices and avoid costly mistakes in non-production environments like staging.
A company using OpenTofu for multi-cloud infrastructure (e.g., AWS and Azure) applies the skill to review plans across providers. It assesses cross-resource dependencies and blast radius, flagging critical changes like VPC deletions that could cascade across clouds, ensuring safe and coordinated deployments.
Offer the skill as part of a paid SaaS platform where teams pay a monthly fee per user or project. It integrates with CI/CD pipelines and provides advanced features like historical risk tracking, team collaboration tools, and compliance reporting, generating recurring revenue from enterprises.
Provide professional services where experts use the skill to audit and review client Terraform deployments. This includes custom risk assessments, training workshops, and ongoing support contracts, leveraging the skill as a tool to deliver high-value consulting engagements.
Release a free version of the skill for individual developers with basic risk analysis. Monetize by offering premium tiers for teams, including features like automated policy enforcement, integration with enterprise tools (e.g., Jira, Slack), and priority support, driving upgrades from growing organizations.
💬 Integration Tip
Integrate the skill into CI/CD pipelines by triggering it automatically on pull requests with Terraform changes, providing immediate risk feedback before merging to prevent unsafe deployments.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.