terraform
Skill33 starsChanged 35 days agoMITView on GitHub
Use when managing infrastructure as code with Terraform or OpenTofu. Covers module design, state management, drift, plan review, secrets, and applying changes without destroying production. Trigger on "terraform plan wants to destroy my database", "state lock is stuck", "how to structure terraform modules", "terraform drift from the console". Do not use for AWS CDK code — see the aws-cdk skill; for designing the architecture itself, see the cloud-architecture skill.
23 other projects use a version of this.
Adopted by
Most recently taken up by
- iliaal/ai-skillstheir own version, first seen Nov 7, 2026
- cloudfleetai/cloudfleet-plugin-claudetheir own version, first seen Nov 1, 2026
- maroffo/claude-forgetheir own version, first seen Oct 25, 2026
- iuliandita/skillstheir own version, first seen Oct 14, 2026
- DongDuong2001/pudo-code-systemtheir own version, first seen Oct 13, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use ansible, github-actions and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
julweberSkillansible
Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.
Also in 4 projects that use this
MicrosoftSkillgithub-actions
Use when creating, editing, reviewing, or troubleshooting GitHub Actions workflows in Scope.
Also in 5 projects that use this
garri333Skillcodex-cli
OpenAI Codex CLI mastery skill for installation, authentication, terminal commands, code generation from natural language, file editing, project scaffolding, and IDE integrations. Covers GPT-5.2 Instant/Thinking tiers and shell/container execution modes.
Also in 3 projects that use this
rogue-dev-studioSkillgithub-cli
GitHub CLI authentication and workflow configuration. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `github-cli` work when listed in TEAM.yaml or explicitly requested.
Also in 3 projects that use this
nilecuiSkillmermaid
Guide for creating mermaid diagrams. This skill should be used when users want to create a mermaid diagram (or update an existing diagram).
Also in 3 projects that use this
wrsmith108Skilldocker
Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.
Also in 3 projects that use this
Other versions23 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 23
- Mindrally/skills★ 275same name
- magnus919/agent-skills★ 172same name
- nitinjain999/platform-skills★ 71same name
- iliaal/ai-skills★ 45same name
- georgekhananaev/claude-skills-vault★ 28same name
- greedychipmunk/agent-skills★ 24same name
- maroffo/claude-forge★ 17same name
- G1Joshi/Agent-Skills★ 15same name
- iuliandita/skills★ 11same name
- benjaminwestern/google-engineer-skills★ 5same name
13 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 28
Import and drift reconciliation.
- Very specific: line 55
Never commit .tfstate. It contains secrets in plaintext, regardless of how they entered.
- Very specific: line 57
Avoid count for resources that may be reordered.
- Distinctive: line 58
Do not use Terraform to manage application deployment.
“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Terraform
Purpose
Manage infrastructure declaratively without the two events that define bad Terraform experiences: a plan nobody read that destroyed a database, and a state file that no longer matches reality.
When to Use
- Writing or reviewing Terraform configuration.
- Structuring modules and environments.
- Reviewing a plan before an apply that touches production.
- Recovering from state drift or a corrupted state file.
Capabilities
- Module design with clear inputs, outputs, and versioning.
- Remote state with locking, and workspace or directory-based environment separation.
- Plan review, including recognizing a destructive change before it runs.
- Import and drift reconciliation.
- Secrets handling that keeps values out of state where possible.
Inputs
- The existing configuration and state.
- The target environment and its blast radius.
- The plan output — always read before an apply.
Outputs
- Modules that are reusable and versioned.
- Remote state, locked, encrypted, and backed up.
- A reviewed plan with any resource replacement explicitly acknowledged.
Workflow
- Separate environments physically — Separate state files and separate directories or workspaces. A single state containing dev and prod is one typo away from an incident.
- Write modules with a narrow interface — Inputs that are actually variable, outputs that consumers need. A module with forty variables is a wrapper, not an abstraction.
- Plan and read the plan — Every
-/+is a destroy and recreate. On a database, a load balancer, or anything holding state, that is an outage. Never approve a plan you have not read line by line. - Lock the state — Remote backend with locking (S3 + DynamoDB, or the equivalent). Two concurrent applies against unlocked state will corrupt it.
- Pin everything — Provider versions, module versions, and the Terraform version itself. An unpinned provider will change behavior underneath you on an unrelated day.
- Reconcile drift explicitly — Manual changes happen.
terraform planshows them; decide to import, adopt, or revert. Ignoring drift means the next apply reverts someone's emergency fix.
Best Practices
prevent_destroyon stateful resources — databases, buckets, DNS zones. It converts a catastrophic mistake into an error message.- Never commit
.tfstate. It contains secrets in plaintext, regardless of how they entered. terraform applywithout a saved plan file re-plans, which means what you apply is not necessarily what you reviewed. Useterraform plan -out=tfplanand apply the file.- Avoid
countfor resources that may be reordered; usefor_eachwith a stable key.countreindexes, and reindexing destroys and recreates. - Do not use Terraform to manage application deployment. It is a poor fit for anything that changes more than a few times a day.
- Secrets belong in a secret manager, referenced by ARN or path. Anything passed as a variable ends up in state.
Examples
A module interface that is actually reusable:
# modules/postgres/variables.tf
variable "name" { type = string }
variable "environment" { type = string }
variable "instance_class" { type = string, default = "db.t4g.medium" }
variable "allocated_storage" { type = number, default = 50 }
variable "subnet_ids" { type = list(string) }
# modules/postgres/main.tf
resource "aws_db_instance" "this" {
identifier = "${var.name}-${var.environment}"
engine = "postgres"
engine_version = "16.3"
instance_class = var.instance_class
allocated_storage = var.allocated_storage
storage_encrypted = true
deletion_protection = var.environment == "prod"
backup_retention_period = var.environment == "prod" ? 30 : 1
# Password comes from Secrets Manager; it never appears in a .tfvars file.
manage_master_user_password = true
lifecycle {
prevent_destroy = true # a plan that would destroy this now fails
ignore_changes = [engine_version] # minor upgrades are applied by AWS, not us
}
}Reading a plan for the change that matters:
# aws_db_instance.this must be replaced
-/+ resource "aws_db_instance" "this" {
~ availability_zone = "eu-west-1a" -> "eu-west-1b" # forces replacementforces replacement on a database means: destroy the database, create a new empty one. This plan must never be applied. The correct response is to revert the change, not to approve and hope.
Notes
terraform state mvandterraform importare the tools for reconciling reality with configuration. Both are safe operations on the state file — but back the state up first, always.- OpenTofu is a drop-in fork of Terraform 1.5 and diverges gradually. Configuration written for either works on the other today; pin the binary and be explicit about which you use.
- A
terraform destroyin the wrong directory has ended careers.prevent_destroyand separate credentials per environment are cheap insurance.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

