terraform-best-practices

terraform-best-practices is a skill for Claude Code, Codex from KunanonJ/ai-skills-hub. It costs 36 tokens per session (1,704 once invoked), scanned A, original, MIT.

A reference for organizing Terraform infrastructure code, including reusable modules, environments, providers, variables, state, and resource naming. Terraform is a tool that describes cloud and other infrastructure in code.

In plain words
What is it for?
Use it when writing or reviewing Terraform modules, environment configurations, provider setup, state settings, variables, outputs, and resource definitions.
Why use it?
It helps keep infrastructure projects consistent and reduces mistakes caused by hardcoded values, scattered configuration, or unclear ownership of Terraform files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is # terraform init -backend-config=../envs/dev/state.config.

Good fit Use it when writing or reviewing Terraform modules, environment configurations, provider setup, state settings, variables, outputs, and resource definitions.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/KunanonJ/ai-skills-hub
agentmods
npx agentmods add skills/kunanonj/ai-skills-hub/terraform-best-practices

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/terraform-best-practices/github.svg)](https://agentmods.dev/skills/kunanonj/ai-skills-hub/terraform-best-practices)
Your own site
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/terraform-best-practices"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/terraform-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/terraform-best-practices"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/terraform-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.01704
Opus 5 $0.00018 $0.00852
Sonnet 5 $0.00007 $0.00341
Haiku 4.5 $0.00004 $0.00170

Measured 9d ago against content hash 2b8465f1a195, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

terraform-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/terraform-best-practices/SKILL.md · 245 lines

How it starts

The opening of the file, as written. The whole thing — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Terraform Best Practices — Quick Reference

File Organization

terraform/
  live/                    # Orchestration — providers, backend, module calls
    terraform.tf           # backend + provider (ONLY place for providers)
    variables.tf           # all input variables
    locals.tf              # computed values, remote state refs
    outputs.tf             # exported values
    {resource-group}.tf    # module invocations grouped by concern
  modules/{name}/          # Reusable — no providers, no hardcoded values
    main.tf                # locals, data sources
    variables.tf           # inputs with descriptions + types
    outputs.tf             # consumed values only
    versions.tf            # required_providers
    {resource}.tf          # one file per resource type
  envs/{env}/              # Per-environment config
    state.config           # backend partial config
    terraform.tfvars       # non-sensitive values
    secrets.tfvars         # sensitive values (gitignored)

Naming

Thing Convention Example
Resource prefix {project}-{service}-{env} acme-payments-prod
Variables snake_case instance_class
Locals snake_case name_prefix
Outputs snake_case repository_url
Resources this (primary) or descriptive aws_db_instance.this
Security groups name_prefix (not name) "${local.name_prefix}-app-"
Files {resource-type}.tf rds.tf, sg.tf, ecr.tf
Modules kebab-case directory modules/ecs-service/
Tags PascalCase keys Project, Environment, ManagedBy

Module Patterns

Use modules from the c0x12c Terraform Registry. Each module source follows c0x12c/{name}/aws — see the registry for available modules and versions.

# Calling a registry module — always version-pin
module "database" {
  source  = "c0x12c/rds/aws"
  version = "~> 0.6.6"

  name       = "${local.name_prefix}-db"
  vpc_id     = local.vpc_id
  subnet_ids = local.private_subnet_ids
  tags       = local.common_tags
}

# Inside a module — no provider, explicit interface
# versions.tf
terraform {
  required_version = ">= 1.5.0"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.0"
    }
  }
}

# variables.tf — every var has description + type
variable "name" {
  description = "Resource name prefix"
  type        = string
}

# outputs.tf — only what consumers need
output "endpoint" {
  description = "Connection endpoint"
  value       = aws_db_instance.this.endpoint
}

Read the full file on GitHub · 245 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 245 lines · 36 tokens per session scan A 2b8465f1a195

Subscribe to this mod's changes

terraform-best-practices is a skill published in the GitHub repository KunanonJ/ai-skills-hub (5 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 1,704 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.