Prevent Terraform/OpenTofu hallucinations by diagnosing and fixing failure modes: identity churn, secret exposure, blast-radius mistakes, CI drift, and compliance gate gaps. Use when generating, reviewing, refactoring, or migrating IaC and when building delivery/testing pipelines.
Use the terrashark skill to review my Terraform file at `<path-to-main.tf>` for security issues. I am using `<terraform-or-tofu>` version `<exact-version>` with `<providers>`, targeting `<platform>`, with `<state-backend>` through `<local-CLI-or-CI-path>` in a `<dev-shared-or-prod>` environment. State any remaining assumptions, identify the relevant failure modes, and give me a small prioritized remediation plan with tradeoffs, validation steps, and rollback or recovery notes. Do not apply changes.
Required inputs
Path to the Terraform file, replacing `<path-to-main.tf>`
Runtime (`terraform` or `tofu`) and exact version
Providers and target platform
State backend
Execution path such as local CLI or CI
Environment criticality: dev, shared, or prod
Suggested template by Skill Leaderboard, grounded in the linked source. Task evidence ↗
SKILL.md
name: terrasharkdescription: "Prevent Terraform/OpenTofu hallucinations by diagnosing and fixing failure modes: identity churn, secret exposure, blast-radius mistakes, CI drift, and compliance gate gaps. Use when generating, reviewing, refactoring, or migrating IaC and when building delivery/testing pipelines."
Terrashark: Failure-Mode Workflow for Terraform/OpenTofu
Conditional references (CRR; load only on detected signals):
references/conditional/backend-state-safety.md (backend is s3, azurerm, gcs, remote, cloud, pg, consul, or local, or task mentions backend migration, locking, state backup, or restore)
references/conditional/trusted-modules.md (provider is aws, azurerm, google, oci, or ibm)
Do not load multiple conditional references unless the task spans multiple detected backends, providers, or tools.
When a trusted registry module covers the requested resource and the user has not asked for raw HCL, default to that module with an exact version pin (see references/conditional/trusted-modules.md).
6) Validate before finalize
Always provide command sequence tailored to runtime and risk tier.
Never recommend direct production apply without reviewed plan and approval.
7) Output contract
Return:
assumptions and version floor
selected failure mode(s)
chosen remediation and tradeoffs
validation/test plan
rollback/recovery notes for destructive-impact changes
terrashark by LukasNiessen · The Skill Leaderboard