akin-ozer/cc-devops-skills/terraform-validator
Claude Code and agent skill by akin-ozer/cc-devops-skills
- community
Checking that the SKILL.md file is still in the repository.
Validate, lint, audit, or plan Terraform/.tf/HCL files; runs tflint, checkov, terraform validate.
Install
npx vskill@latest install akin-ozer/cc-devops-skills/terraform-validatorSKILL.md
Terraform Validator
Comprehensive toolkit for validating, linting, and testing Terraform configurations with automated workflows for syntax validation, security scanning, and intelligent documentation lookup.
⚠️ Critical Requirements Checklist
STOP: You MUST complete these steps in order. Do NOT skip any REQUIRED step.
| Step | Action | Required | |
|---|---|---|---|
| 1 | Run bash scripts/extract_tf_info_wrapper.sh <path> | ✅ REQUIRED | |
| 2 | Context7 lookup for ALL providers (explicit AND implicit); WebSearch fallback if not found | ✅ REQUIRED | |
| 3 | READ references/security_checklist.md | ✅ REQUIRED | |
| 4 | READ references/best_practices.md | ✅ REQUIRED | |
| 5 | Run terraform fmt | ✅ REQUIRED | |
| 6 | Run tflint (or note as skipped if unavailable) | Recommended | |
| 7 | Run terraform init (if not initialized) | ✅ REQUIRED | |
| 8 | Run terraform validate | ✅ REQUIRED | |
| 9 | Run bash scripts/run_checkov.sh <path> | ✅ REQUIRED | |
| 10 | Cross-reference findings with security_checklist.md sections | ✅ REQUIRED | |
| 11 | Generate report citing reference files | ✅ REQUIRED | |
| 12 | Run regression tests (bash tests/test_regression.sh) | ✅ REQUIRED | |
| 13 | Run lightweight CI checks (bash -n, py_compile, smoke) | ✅ REQUIRED |
IMPORTANT: Steps 3-4 (reading reference files) must be completed BEFORE running security scans. The reference files contain remediation patterns that MUST be cited in your report.
Context7 Fallback: If Context7 does not have a provider (common for: random, null, local, time, tls), use WebSearch:"terraform-provider-{name} hashicorp documentation"
When to Use This Skill
- Working with Terraform files (
.tf,.tfvars,.tfstate) - Validating Terraform configuration syntax and structure
- Linting and formatting HCL code
- Performing dry-run testing with
terraform plan - Debugging Terraform errors or misconfigurations
- Understanding custom Terraform providers or modules
- Security validation of Terraform configurations
External Documentation
| Tool | Documentation | |
|---|---|---|
| Terraform | developer.hashicorp.com/terraform | |
| TFLint | github.com/terraform-linters/tflint | |
| Checkov | checkov.io | |
| Trivy | aquasecurity.github.io/trivy |
Validation Workflow
IMPORTANT: Follow this workflow in order. Each step is REQUIRED unless explicitly marked optional.
Required Reference File Reading
You MUST read these reference files during validation:
| When | Reference File | Action | |
|---|---|---|---|
| Before security scan | references/security_checklist.md | Read to understand security checks and remediation patterns | |
| During validation | references/best_practices.md | Read to validate project structure, naming, and patterns | |
| If errors occur | references/common_errors.md | Read to find solutions for specific error messages | |
| If using Terraform 1.10+ | references/advanced_features.md | Read to understand ephemeral values, actions, list resources |
Required Script Usage
You MUST use these wrapper scripts instead of calling tools directly:
| Task | Script | Command | |
|---|---|---|---|
| Extract provider/module info | extract_tf_info_wrapper.sh | bash scripts/extract_tf_info_wrapper.sh <path> | |
| Run security scan | run_checkov.sh | bash scripts/run_checkov.sh <path> | |
| Install checkov (if missing) | install_checkov.sh | bash scripts/install_checkov.sh install |
Note:extract_tf_info_wrapper.shautomatically handles the python-hcl2 dependency. If system Python lackspython-hcl2, it creates/reuses a cached virtual environment under~/.cache/terraform-validator/by default.
Script Run Context (REQUIRED)
- Default working directory:
devops-skills-plugin/skills/terraform-validator - If running from elsewhere, use absolute script paths:
bash /absolute/path/to/terraform-validator/scripts/extract_tf_info_wrapper.sh <path>bash /absolute/path/to/terraform-validator/scripts/run_checkov.sh <path>bash /absolute/path/to/terraform-validator/scripts/install_checkov.sh install
Context7 Provider Documentation Lookup (REQUIRED)
For EVERY provider detected, you MUST lookup documentation via Context7:
Example for AWS provider:
Context7 Fallback to WebSearch (REQUIRED)
If Context7 does not find a provider, you MUST fall back to WebSearch:
WebSearch Fallback Example:
Note: HashiCorp utility providers (random, null, local, time, tls, archive, external, http) may not be indexed in Context7. Always fall back to WebSearch for these.
Detecting Implicit Providers (REQUIRED)
IMPORTANT: Providers can be used without being declared in required_providers. You MUST detect ALL providers:
Detection Methods
- Explicit Providers: Listed in
required_providersblock (from extract_tf_info_wrapper.sh output) - Implicit Providers: Inferred from resource type prefixes
Common Implicit Provider Patterns
| Resource Type Prefix | Provider Name | Context7 Lookup | |
|---|---|---|---|
random_* | random | terraform-provider-random | |
null_* | null | terraform-provider-null | |
local_* | local | terraform-provider-local | |
tls_* | tls | terraform-provider-tls | |
time_* | time | terraform-provider-time | |
archive_* | archive | terraform-provider-archive | |
http (data source) | http | terraform-provider-http | |
external (data source) | external | terraform-provider-external |
Workflow for Complete Provider Detection
Example
If extract_tf_info_wrapper.sh returns:
You MUST lookup BOTH:
terraform-provider-aws(explicit)terraform-provider-random(implicit - detected fromrandom_idresource)
Quick Reference Commands
Format and Lint
TFLint Configuration: See TFLint Ruleset documentation for plugin setup.
Validate Configuration
Security Scanning
MUST use wrapper script:
Detailed Security Scanning: You MUST readreferences/security_checklist.mdbefore running security scans to understand the checks and remediation patterns.
Security Finding Cross-Reference (REQUIRED)
When reporting security findings, you MUST cite specific sections from `security_checklist.md`:
Cross-Reference Mapping
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops-skills-plugin/skills/terraform-validator/SKILL.md
Popularity
- Repository stars
- 279
- Repository forks
- 31
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/akin-ozer/cc-devops-skills/terraform-validator)