terraform-linting
Skill8 starsChanged 6 months agoApache-2.0View on GitHub
Lint and format Terraform code using tflint and terraform fmt/validate according to standard conventions. Use when asked to lint, format, or check style issues in Terraform files.
- Installs packages
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run this skill when asked to lint, format, or check style for Terraform code.
- Very specific: line 17
If tflint is not installed, inform the user and ask before installing:
- Very specific: line 66
Only run auto-fix commands after showing the user what will change and getting explicit confirmation.
- Very specific: line 74
All variables have a description and, where sensible, a type constraint.
- Distinctive: line 75
No hardcoded credentials, account IDs, or ARNs — use variables or data sources.
- Very specific: line 80
NEVER install tflint without asking the user first.
- Very specific: line 81
NEVER run terraform init against a real backend without asking the user first — offer to run validate only if the working directory is …
- Distinctive: line 82
Always run in check/diff mode first — only apply auto-fixes after the user confirms.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Terraform Linting Skill
Run this skill when asked to lint, format, or check style for Terraform code.
Step 1 — Detect available tooling
which terraform tflint 2>/dev/null
ls .tflint.hcl 2>/dev/nullIf tflint is not installed, inform the user and ask before installing:
brew install tflintterraform fmt and terraform validate ship with the Terraform CLI, so no separate install is needed for those.
Step 2 — Run formatting check
terraform fmt -recursive -check -diffShow the diff to the user before applying any formatting changes.
Step 3 — Run validation
terraform validateRequires terraform init to have been run in the directory first — if it fails with a missing-provider error, inform the user rather than running init yourself if it would touch a real backend.
Step 4 — Run the linter
tflint --recursiveRespect the project's .tflint.hcl if present (enabled plugins/rules) — do not override it. If no .tflint.hcl exists, run with default rules and mention that a config file could be added.
Report all findings grouped by file, with line numbers and rule names (e.g. terraform_deprecated_index, aws_instance_invalid_type).
Step 5 — Apply fixes (only with user confirmation)
terraform fmt -recursive
tflint --fix --recursiveOnly run auto-fix commands after showing the user what will change and getting explicit confirmation. Most tflint findings (e.g. deprecated syntax, unused variables, invalid instance types) require manual review even when a --fix is available.
Standard conventions enforced
- Formatting is always
terraform fmt-compliant (2-space indentation, aligned=signs). - Resource and variable names:
snake_case, descriptive, no redundant type prefixes (e.g.aws_instance.web, notaws_instance.aws_instance_web). - All variables have a
descriptionand, where sensible, atypeconstraint. - No hardcoded credentials, account IDs, or ARNs — use variables or data sources.
- Provider versions are pinned via
required_providersin aversions.tfor the root module.
Rules
- NEVER install
tflintwithout asking the user first. - NEVER run
terraform initagainst a real backend without asking the user first — offer to runvalidateonly if the working directory is already initialized. - Always run in check/diff mode first — only apply auto-fixes after the user confirms.
- Respect the project's existing
.tflint.hcl— do not suggest a different ruleset without asking. - Report the exact command run and its full output — do not summarize away findings.
- Flag any hardcoded secret-looking string (access keys, tokens, passwords) as a security finding regardless of whether
tflintcatches it.
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- vault-cliSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

