terraform-validator

Validate Terraform configurations and generate structured JSON reports.

7|3|Updated May 4, 2026
One-click install
npx skills add https://github.com/nopperabbo/codebuddy2api --skill terraform-validator-nopperabbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-validator
Source: https://github.com/nopperabbo/codebuddy2api/tree/main/opencode-config/skills/_archived/terraform-validator
Command: npx skills add https://github.com/nopperabbo/codebuddy2api --skill terraform-validator-nopperabbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-hcl2, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Terraform configurations are prone to syntax errors, misconfigurations, and security gaps, requiring multiple tools to validate, lint, audit, and test across modules and environments. This Skill orchestrates a deterministic workflow that runs formatting, initialization, syntax validation, linting, and security checks to ensure configurations are clean, compliant, and production-ready.

Core Features & Use Cases

  • End-to-end validation of Terraform code across modules and environments.
  • Integrated security checks (Checkov) and linting (TFLint) with automated remediation guidance.
  • Useful for audits, compliance checks, and ensuring infrastructure as code quality before deployment.

Quick Start

Run the validator on your Terraform project directory to generate a structured report.

Frequently Asked Questions about terraform-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run security checks and linting on my Terraform configurations?

Terraform validation and security checks are performed by running formatting, initialization, syntax validation, linting with TFLint, and security audits with Checkov across your .tf files to ensure compliance. This orchestrates the entire workflow deterministically to produce a structured report.

What is the best way to validate Terraform modules before deployment?

The best way to validate Terraform modules is an end-to-end workflow applying formatting, init, validate, lint, and regression tests. This extracts provider and resource metadata to ensure your infrastructure as code is clean, compliant, and production-ready.

Does this Terraform validator work with Checkov and TFLint?

Yes, the Terraform validator integrates Checkov for security checks and TFLint for linting. It applies these tools automatically during the validation workflow to identify misconfigurations and provide automated remediation guidance.

Can I extract provider and resource metadata from multiple .tf files?

Yes, you can extract provider, module, and resource metadata by identifying and validating Terraform configurations across multiple .tf files. The process produces a structured JSON report detailing all findings and extracted infrastructure components.

Do I need python-hcl2 to parse and validate Terraform code?

Yes, python-hcl2 is required as a dependency to parse HCL2 syntax within .tf files. It enables the extraction of provider, module, and resource metadata required for comprehensive validation and security checks.

Why does my Terraform configuration fail compliance and security audits?

Terraform configurations fail security audits due to syntax errors, misconfigurations, and security gaps. Running an integrated validation workflow with Checkov and TFLint identifies these issues and provides remediation guidance to ensure compliance.