Skip to main content
skill CX Codex

terraform-best-practices — Claude Code skill for Terraform

This skill guides Terraform code reviews and authoring, covering file layout, modules, state, and security. Use it when shaping infrastructure configuration.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add c0x12c/ai-toolkit --skill terraform-best-practices -a claude-code
Open on GitHub

What terraform-best-practices does

The skill lays out conventions for splitting configuration across files and environments, naming resources and variables, and defining module inputs and outputs. It also covers pinned module versions, remote state, and references between stacks.

Security guidance includes sensitive variables, encrypted storage, private databases, and security-group rules. It flags patterns such as secrets in code, wildcard IAM permissions, unpinned modules, and state without locking. Its S3 backend example uses DynamoDB for locking, so the backend setup needs to account for that.

The CI/CD section outlines formatting checks, validation, and a plan on pull requests, followed by applying after a merge. It advises against automatic applies on pull requests and recommends passing secrets through CI environment variables. This is a reference for Terraform conventions, not a replacement for checking the settings in your own configuration.

What it helps with

  • organize Terraform configuration by file and environment
  • choose consistent names for resources and variables
  • define reusable modules with pinned versions
  • configure remote state and locking
  • spot secrets and unsafe settings in Terraform code

Example prompts for the agent

  • Review these Terraform files for secrets and unsafe settings.
  • Suggest a file layout for this Terraform configuration.
  • Check this module and its callers for unpinned versions and interface issues.

How to install terraform-best-practices

1Skills CLI (Vercel)

npx skills add c0x12c/ai-toolkit --skill terraform-best-practices -a claude-code

2Manually: put the files in place

~/.claude/skills/terraform-best-practices/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/terraform-best-practices/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about terraform-best-practices

How do I install terraform-best-practices in Claude Code?

Run npx skills add c0x12c/ai-toolkit --skill terraform-best-practices -a claude-code. The skill file is located at ~/.claude/skills/terraform-best-practices/SKILL.md.

What does terraform-best-practices do?

It provides Terraform guidance for configuration layout, module design, state management, and security reviews.

How does the skill handle Terraform state locking?

Its S3 backend example uses DynamoDB for locking. It also shows how to read outputs from another stack with terraform_remote_state.

Similar skills

All skills for DevOps and infrastructure →

From the same set33

terraform-service-scaffold Generates service-level Terraform infrastructure with AWS modules, environment configurations, and ArgoCD GitOps templates. CX Codex +1 ★ 109repo stars terraform-security-audit Reviews Terraform files for security issues across six areas and returns a pass-or-fail report. Run it before a deployment or when reviewing a new service. CX Codex +1 ★ 109repo stars terraform-review Walks Terraform changes through an 8-category checklist and returns a verdict: Approved, Needs Changes or Blocked. Useful before merging an infrastructure PR. CX Codex +1 ★ 109repo stars terraform-module-creator Builds clean Terraform modules with separate resource files, strict variable validation, and outputs. Ideal for turning messy root configurations into shared infrastructure blocks. CX Codex +1 ★ 109repo stars startup-pipeline Moves a startup idea through four stages: brainstorm, validation, market research and pitch materials. Gates between stages stop weak ideas early. CX Codex +1 ★ 109repo stars service-debugging A structured backend troubleshooting runbook that guides the agent from symptom gathering and log analysis to root-cause isolation. CX Codex +1 ★ 109repo stars security-checklist Audits Micronaut/Kotlin backends for access control, input checks, injection risks, and data exposure. Use it during implementation or review. CX Codex +1 ★ 109repo stars python-testing-strategies A skill that tells your coding agent how to test FastAPI apps: pytest-asyncio, httpx AsyncClient, data factories and the checks every endpoint needs. CX Codex +1 ★ 109repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor