agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
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
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill terraform --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill terraform -a windsurf -y
name: terraform description: 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. metadata: category: devops version: 1.0.0 tags: [terraform, iac, opentofu, state, modules]
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.
1. **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. 2. **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. 3. **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. 4. **Lock the state** — Remote backend with locking (S3 + DynamoDB, or the equivalent). Two concurrent applies against unlocked state will corrupt it. 5. **Pin everything** — Provider versions, module versions, and the Terraform version itself. An unpinned provider will change behavior underneath you on an unrelated day. 6. **Reconcile drift explicitly** — Manual changes happen. `terraform plan` shows them; decide to import, adopt, or revert. Ignoring drift means the next apply reverts someone's emergency fix.
**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 replacement`forces 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.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.