From terraform
Format and validate Terraform code with the fmt / init / validate / tflint loop. Use after editing any .tf file, before committing Terraform changes, when asked to lint, format, validate, or check Terraform modules and root configurations, or when setting up tflint for a repository.
How this skill is triggered — by the user, by Claude, or both
Slash command
/terraform:terraform-validateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run this loop after editing Terraform and before every commit. Fix findings and repeat until all
Run this loop after editing Terraform and before every commit. Fix findings and repeat until all three stages are clean — never commit with failures.
From the repository root:
terraform fmt -recursive
This rewrites files in place. In CI or to check without writing, use
terraform fmt -recursive -check -diff.
Per changed module or root configuration (validation is per-directory, not monorepo-wide):
terraform -chdir=<module-dir> init -backend=false # first run only; downloads providers
terraform -chdir=<module-dir> validate
-backend=false skips state/backend configuration — validation needs providers, not state.
Validate catches type errors, unknown arguments, and missing required attributes.
tflint --init # once per clone; downloads rulesets (needs network)
tflint --chdir=<module-dir>
If the repository has no .tflint.hcl, offer to seed one from this skill's bundled
tflint.hcl — it enables the recommended Terraform preset plus naming-convention,
documented-variables/outputs, unused-declarations, and required-version/providers rules. Add a
provider-specific ruleset (AWS/Azure/GCP) only if the repository targets that provider; the
bundled config keeps it commented out.
Re-run the loop after fixing findings. The stages are ordered cheapest-first: fmt is instant, validate needs providers, tflint needs rulesets. A module is done when all three pass.
Notes:
terraform validate spawns provider plugins that communicate over local Unix sockets; in
sandboxed environments, ensure Unix-socket connections are permitted or run validation outside
the sandbox.terraform-style skill mechanically (documented
variables/outputs, required version/provider constraints, naming) — treat its findings as style
violations, not suggestions.npx claudepluginhub bitwise-media-group/skills --plugin terraformGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.