Agent skill

Terraform Patterns

by vibeeval in vibeeval/vibecosystem

Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices.

MITAuto-check passedDevOps & Cloud

Install Terraform Patterns

skills CLI
$ npx skills add vibeeval/vibecosystem --skill terraform-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vibeeval/vibecosystem terraform-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vibeeval/vibecosystem.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/terraform-patterns .claude/skills/terraform-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
terraform-patterns
GitHub stars
531
Token cost
~1.6k tokens
SKILL.md length
165 words
Files
1
Skills in repo
144
Repo updated
First seen
Licence
MIT

At a glance

Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices.

  • Tasks that involve Infrastructure as code
  • SKILL.md covers Module Composition, Root Module Composition, State Management and Resource Lifecycle, plus 4 more sections
  • Calls terraform
  • Tasks that involve State management

What it does

Terraform Patterns is an agent skill from vibeeval/vibecosystem. Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Infrastructure as code and State management. It works with Terraform. The repository describes itself as: AI software team for Claude Code - 138 agents, 295 skills, 73 hooks. Self-learning, multi-agent swarm, autonomous skill evolution. The licence is MIT.

When your agent uses it

  • Tasks that involve Infrastructure as code
  • Tasks that involve State management

Example prompts

  • “/terraform-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit 3b763b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • terraform

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Terraform Patterns loads about 1.6k tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 165 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vibeeval/vibecosystem at commit 3b763b1, republished under its MIT licence (© vibeeval). 165 words, ~1,594 tokens.

Download SKILL.mdSave it as .claude/skills/terraform-patterns/SKILL.md (or your agent's skills folder).
name
terraform-patterns
description
Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices.

Terraform Patterns

Production Terraform patterns for maintainable infrastructure-as-code.

Module Composition

hcl
# modules/vpc/main.tf - Reusable VPC module
variable "name" {
  type        = string
  description = "VPC name prefix"
}

variable "cidr" {
  type    = string
  default = "10.0.0.0/16"
}

variable "azs" {
  type    = list(string)
  default = ["us-east-1a", "us-east-1b", "us-east-1c"]
}

resource "aws_vpc" "main" {
  cidr_block           = var.cidr
  enable_dns_hostnames = true
  enable_dns_support   = true

  tags = {
    Name        = var.name
    ManagedBy   = "terraform"
    Environment = terraform.workspace
  }
}

resource "aws_subnet" "private" {
  count             = length(var.azs)
  vpc_id            = aws_vpc.main.id
  cidr_block        = cidrsubnet(var.cidr, 8, count.index)
  availability_zone = var.azs[count.index]

  tags = {
    Name = "${var.name}-private-${var.azs[count.index]}"
    Tier = "private"
  }
}

output "vpc_id" {
  value = aws_vpc.main.id
}

output "private_subnet_ids" {
  value = aws_subnet.private[*.id]
}

Root Module Composition

hcl
# environments/production/main.tf
terraform {
  required_version = ">= 1.5.0"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"    # Pin major version, allow minor updates
    }
  }

  backend "s3" {
    bucket         = "mycompany-terraform-state"
    key            = "production/terraform.tfstate"
    region         = "us-east-1"
    dynamodb_table = "terraform-locks"    # State locking
    encrypt        = true
  }
}

module "vpc" {
  source = "../../modules/vpc"
  name   = "prod"
  cidr   = "10.0.0.0/16"
  azs    = ["us-east-1a", "us-east-1b", "us-east-1c"]
}

module "database" {
  source    = "../../modules/rds"
  vpc_id    = module.vpc.vpc_id
  subnet_ids = module.vpc.private_subnet_ids

  instance_class    = "db.r6g.xlarge"
  allocated_storage = 100
  multi_az          = true
}

module "app" {
  source     = "../../modules/ecs-service"
  vpc_id     = module.vpc.vpc_id
  subnet_ids = module.vpc.private_subnet_ids

  container_image = "myapp:${var.app_version}"
  desired_count   = 3
  cpu             = 512
  memory          = 1024

  environment_variables = {
    DATABASE_URL = module.database.connection_string
    LOG_LEVEL    = "info"
  }
}

State Management

hcl
# Remote state data source: reference other state files safely
data "terraform_remote_state" "networking" {
  backend = "s3"
  config = {
    bucket = "mycompany-terraform-state"
    key    = "networking/terraform.tfstate"
    region = "us-east-1"
  }
}

# Use outputs from networking state
module "app" {
  source     = "../../modules/ecs-service"
  vpc_id     = data.terraform_remote_state.networking.outputs.vpc_id
  subnet_ids = data.terraform_remote_state.networking.outputs.private_subnet_ids
}

Resource Lifecycle

hcl
resource "aws_instance" "app" {
  ami           = var.ami_id
  instance_type = var.instance_type

  lifecycle {
    # Create new before destroying old (zero-downtime replacement)
    create_before_destroy = true

    # Prevent accidental deletion of critical resources
    prevent_destroy = true

    # Ignore changes made outside Terraform (e.g., auto-scaling tags)
    ignore_changes = [tags["LastScaleEvent"]]
  }
}

# Import existing resources
import {
  to = aws_s3_bucket.existing
  id = "my-existing-bucket-name"
}

Variables and Validation

hcl
variable "environment" {
  type        = string
  description = "Deployment environment"

  validation {
    condition     = contains(["development", "staging", "production"], var.environment)
    error_message = "Environment must be development, staging, or production."
  }
}

variable "instance_count" {
  type    = number
  default = 2

  validation {
    condition     = var.instance_count >= 1 && var.instance_count <= 20
    error_message = "Instance count must be between 1 and 20."
  }
}

# Local values for computed configuration
locals {
  common_tags = {
    Environment = var.environment
    Project     = var.project_name
    ManagedBy   = "terraform"
    Team        = var.team
  }

  is_production = var.environment == "production"
  replica_count = local.is_production ? 3 : 1
}

Dynamic Blocks and for_each

hcl
# for_each over map (preferred over count for named resources)
variable "services" {
  type = map(object({
    port        = number
    health_path = string
    replicas    = number
  }))
}

resource "aws_ecs_service" "services" {
  for_each = var.services

  name            = each.key
  cluster         = aws_ecs_cluster.main.id
  desired_count   = each.value.replicas
  task_definition = aws_ecs_task_definition.tasks[each.key].arn
}

# Dynamic block for security group rules
resource "aws_security_group" "app" {
  name   = "${var.name}-sg"
  vpc_id = var.vpc_id

  dynamic "ingress" {
    for_each = var.ingress_rules
    content {
      from_port   = ingress.value.port
      to_port     = ingress.value.port
      protocol    = "tcp"
      cidr_blocks = ingress.value.cidr_blocks
      description = ingress.value.description
    }
  }
}

Checklist

  • Pin provider versions with ~> (allow patch, lock major/minor)
  • Remote state with locking (S3 + DynamoDB or Terraform Cloud)
  • Separate state files per environment (not workspaces for prod vs dev)
  • prevent_destroy on databases, S3 buckets, and IAM roles
  • Variable validation blocks for all user-facing inputs
  • Common tags via locals applied to every resource
  • Use for_each over count (survives reordering without recreation)
  • Run terraform plan in CI, terraform apply requires approval

Anti-Patterns

  • Single state file for all environments: one bad apply affects everything
  • Hardcoded values: use variables with defaults and validation
  • Using count with lists: removing item N recreates items N+1 through end
  • No state locking: concurrent applies corrupt state
  • Monolithic root module: 500+ resources in one state (split by lifecycle)
  • Storing secrets in .tf files: use AWS Secrets Manager or Vault references
  • Not pinning provider versions: surprise breaking changes on next init

© vibeeval, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/terraform-patterns of vibeeval/vibecosystem.

Open the folder on GitHubat commit 3b763b1

Compare with similar skills

Terraform Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Terraform Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Terraform Patterns this skillvibeeval/vibecosystem531—~1.6kAutomated safety check: PassMIT
Sdaf State ManagementAzure/sap-automation145—~1.7kAutomated safety check: PassMIT
Terraform Specialistdavila7/claude-code-templates32k7 repos~2.3kAutomated safety check: PassMIT
TerraformRightNow-AI/openfang18k—~645Automated safety check: PassApache-2.0
Terraform Provider Upgradethomast1906/github-copilot-agent-skills202—~3.9kAutomated safety check: PassNone
Oma Tf Infrafirst-fluke/oh-my-agent1.3k—~2.8kAutomated safety check: PassMIT

Similar skills

  • Sdaf State Management

    Azure/sap-automation

    Official

    Inspect and repair SDAF Terraform state safely before any reviewed import/remove.

    145 GitHub stars~1.7k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Terraform Specialist

    davila7/claude-code-templates

    Expert Terraform/OpenTofu specialist mastering advanced IaC automation, state management, and enterprise infrastructure patterns.

    32k GitHub starsUsed in 7 repos~2.3k tokens
    DevOps & CloudAuto-check passed
  • Terraform

    RightNow-AI/openfang

    Terraform IaC expert for providers, modules, state management, and planning

    18k GitHub stars~645 tokensUpdated 3 mo ago
    DevOps & CloudAuto-check passed
  • Terraform Provider Upgrade

    thomast1906/github-copilot-agent-skills

    Safe Terraform provider upgrades with automatic resource migration, breaking change detection, and state management using moved blocks.

    202 GitHub stars~3.9k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Oma Tf Infra

    first-fluke/oh-my-agent

    Infrastructure-as-code specialist for multi-cloud provisioning using Terraform across any provider (AWS, GCP, Azure, Oracle Cloud).

    1.3k GitHub stars~2.8k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Oma Tf Infra

    first-fluke/oh-my-agent

    Create or review Terraform infrastructure and plans. An agent skill from first-fluke/oh-my-agent.

    1.3k GitHub stars~2.8k tokensUpdated yesterday
    DevOps & CloudAuto-check passed

More from vibeeval/vibecosystem

All 144 skills in this repo
  • Agent Benchmark

    vibeeval/vibecosystem

    Framework for measuring and tracking agent response quality over time.

    531 GitHub stars~2.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Differential Review

    vibeeval/vibecosystem

    Security-focused differential code review with blast radius analysis, risk-adaptive depth (DEEP/FOCUSED/SURGICAL), git history correlation, and structured finding format.

    531 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Factcheck Guard

    vibeeval/vibecosystem

    A skill your agent uses when making any factual claim about the codebase — existence, absence, or behavior.

    531 GitHub stars~2.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Fp Check

    vibeeval/vibecosystem

    Systematic false positive verification for security findings.

    531 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • N8n Workflows

    vibeeval/vibecosystem

    n8n otomasyon workflow'lari. An agent skill from vibeeval/vibecosystem.

    531 GitHub stars~3.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Notepad System

    vibeeval/vibecosystem

    A skill your agent uses when context compression is imminent, when resuming a session, or when preserving critical decisions across long tasks.

    531 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Terraform Patterns

What does Terraform Patterns do?

Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices. Terraform Patterns is an agent skill from vibeeval/vibecosystem. Module composition, state management, workspace strategy, provider versioning, and infrastructure-as-code best practices.

When should I use Terraform Patterns?

Terraform Patterns fits situations like: tasks that involve Infrastructure as code; tasks that involve State management.

How do I install Terraform Patterns in Claude Code?

Run `npx skills add vibeeval/vibecosystem --skill terraform-patterns -a claude-code`. Or copy the skill folder (skills/terraform-patterns in vibeeval/vibecosystem) into .claude/skills/terraform-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Terraform Patterns in Codex?

Run `npx skills add vibeeval/vibecosystem --skill terraform-patterns -a codex`. Or copy the skill folder (skills/terraform-patterns in vibeeval/vibecosystem) into .agents/skills/terraform-patterns in your project. Codex loads it when a task matches its description.

Can I use Terraform Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vibeeval/vibecosystem --skill terraform-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/terraform-patterns, .gemini/skills/terraform-patterns, .github/skills/terraform-patterns and .opencode/skills/terraform-patterns in your project.

What does Terraform Patterns need to run?

Going by SKILL.md and its folder, Terraform Patterns needs the command-line tools its instructions call (terraform).

Does Terraform Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Terraform Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Terraform Patterns use?

Terraform Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Terraform Patterns use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Terraform Patterns?

Skills that share tags, products or a category with Terraform Patterns: Sdaf State Management (Azure/sap-automation, 145 stars), Terraform Specialist (davila7/claude-code-templates, 32k stars), Terraform (RightNow-AI/openfang, 18k stars) and Terraform Provider Upgrade (thomast1906/github-copilot-agent-skills, 202 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Terraform Patterns?

vibeeval (a GitHub user) maintains it in vibeeval/vibecosystem, which has 531 GitHub stars. The repository holds 144 skills in this directory. The repository was last updated on August 8, 2026.

Source: vibeeval/vibecosystem on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.