terraform
Skill109 starsChanged 4 months agoMITView on GitHub
Operate Terraform and OpenTofu across the whole infrastructure lifecycle: module structure, state backends and locking, plan/apply workflow, drift detection, remote state, upgrade and refactor flows, and evidence-based diagnostics. Use when running or inspecting terraform plans, applies, state files, imports, or state surgery, or when the bundled tfops script should handle the task. Do not use for IaC methodology or cloud design decisions - those route up to platform-engineering.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- iliaal/ai-skillstheir own version, first seen Oct 3, 2026
- iuliandita/skillstheir own version, first seen Sep 24, 2026
- AvilaCarlosDev/openclaw-skillstheir own version, first seen Sep 19, 2026
- Rikinshah787/agent-skills-production-skillstheir own version, first seen Aug 10, 2026
- Jylhis/skillstheir own version, first seen Aug 5, 2026
- yoonation/ai-groundedtheir own version, first seen Jul 22, 2026
Used with
Projects with it also use ansible, github-actions and 3 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.
KubementatSkillansible
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 3 projects that use this
thomashartmSkillgithub-actions
Manage GitHub Actions workflows. Use when the user wants to list workflows, view run history, check running workflows, trigger workflow_dispatch, view logs, or cancel runs. Auto-detects repository from git remote. Triggers on phrases like "list workflows", "workflow runs", "trigger workflow", "start deploy", "github actions", "view logs", "cancel run", "running workflows".
Also in 4 projects that use this
OpenAISkillnextjs
Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.
Also in 3 projects that use this
akornmeierSkilldocker
Guide for using Docker - a containerization platform for building, running, and deploying applications in isolated containers. Use when containerizing applications, creating Dockerfiles, working with Docker Compose, managing images/containers, configuring networking and storage, optimizing builds, deploying to production, or implementing CI/CD pipelines with Docker.
Also in 4 projects that use this
VercelSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- Mindrally/skills★ 266same name
- iliaal/ai-skills★ 43same name
- georgekhananaev/claude-skills-vault★ 28same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- greedychipmunk/agent-skills★ 19same name
- iuliandita/skills★ 7same name
- DongDuong2001/pudo-code-system★ 5same name
- antoniodiaz02/opencode-devops-skills★ 4same name
- benjaminwestern/google-engineer-skills★ 4same name
- yoonation/ai-grounded★ 4same name
8 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 repository180 other files it gives its agents.
- agent-production-operations/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- forward-deployed-engineering/AGENTS.mdAGENTS.md
- production-excellence/AGENTS.mdAGENTS.md
- product-lifecycle/AGENTS.mdAGENTS.md
- tailscale/AGENTS.mdAGENTS.md
- workflow-architect/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- actuarial-risk-modelingSkill
- adr-authoringSkill
- agent-councilSkill
- agent-evals-and-observabilitySkill
- agent-production-operationsSkill
- agent-skillsSkill
- ai-governanceSkill
- ai-operating-economicsSkill
- analog-occultismSkill
- anydocSkill
- api-design-and-evolutionSkill
- artifact-pyramidsSkill
- ascii-city-engineSkill
- autogenSkill
- backend-engineeringSkill
- binary-analysisSkill
- bmadSkill
- brand-designerSkill
- c4-diagrammingSkill
- capacity-and-cost-engineeringSkill
- chief-of-staff-methodologySkill
- cli-builderSkill
- cncf-landscapeSkill
- color-managementSkill
- community-guidesSkill
- conditional-customer-successSkill
- confluence-cliSkill
- constrained-optimizationSkill
- crewaiSkill
- crmSkill
- crowdsecSkill
- cryptpadSkill
- cyberpunkSkill
- daily-life-discoverySkill
- data-architectSkill
- data-cleaningSkill
- data-engineeringSkill
- data-scientistSkill
- de-spinSkill
- digital-twinSkill
- docker-composeSkill
- documentsSkill
- dsm5Skill
- dspySkill
- electronicsSkill
- emailSkill
- enterprise-architectureSkill
- epubSkill
- esp32-developmentSkill
- ffmpegSkill
- financial-modelingSkill
- firefliesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 1 is distinctive, and 9 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Discover before assuming: Read the module layout, provider requirements, backend block, workspaces, terraform.lock.hcl, and CI invocation …
- Very specific: line 28
Plan first, apply after review: Every mutation goes through a visible plan (or tfops dry-run) and an explicit confirmation.
- Very specific: line 31
Keep evidence bounded: Never dump raw state files, backend credentials, or provider secrets into chat.
- Very specific: line 54
Review: read the plan as a diff of resources, not a wall of text — count creates/updates/destroys, check replaces (destroy-before-create), …
- Very specific: line 62
Use for_each/count for repetition, not code generation.
- Very specific: line 76
Use -target only for emergencies, never as a habit.
- Very specific: line 137
Never expose state files, backend credentials, provider secrets, or sensitive output values.
- Very specific: line 138
Never run apply, import, state push, or force-unlock without the mutation gate (--yes after a reviewed plan, or an explicit human …
- Distinctive: line 139
Never delete state or a resource just to "fix" drift — reconcile or import.
- Very specific: line 140
Never run a provider-specific procedure without checking the module's required_providers and version pins.
“Common” is measured: kept by at least 6 in 10 of the 16 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 / OpenTofu Operations
Use this skill to run, inspect, and repair Terraform and OpenTofu infrastructure safely: understand a module graph, verify state backends and locking, review plans before applies, find and fix drift, work with remote state, plan version upgrades and refactors, and diagnose failures with evidence. This is a tool skill for one named tool (Terraform and its drop-in OpenTofu fork share one agent workflow and one trigger). Design decisions and IaC methodology belong to platform-engineering and its references/infrastructure-as-code.md; this skill owns execution.
Operating contract
- Discover before assuming. Read the module layout, provider requirements, backend block, workspaces,
terraform.lock.hcl, and CI invocation before running anything. Never infer state from a config file — the state file is the source of truth for what exists. - Plan first, apply after review. Every mutation goes through a visible plan (or
tfopsdry-run) and an explicit confirmation. Never runapplywith unreviewed changes. - Lock and scope state. Confirm the backend supports locking and that the operator holds the lock before any state mutation. State surgery (
state mv,state rm,state push) is a reviewed, scoped operation with a backup. - Verify at the boundary. A green
applyis not proof of success: verify the external boundary (DNS, load balancer, API response) that the resource was supposed to satisfy, and check for drift on the next plan. - Keep evidence bounded. Never dump raw state files, backend credentials, or provider secrets into chat.
tfopsredacts nothing by itself but all outputs should be bounded summaries.
The tfops script
scripts/tfops is an agent-first wrapper around the terraform/tofu CLI. It works without a terraform binary for --help, doctor, and direct --state analysis, so an agent can inventory a state file anywhere.
scripts/tfops doctor --json # binary, config, backend, state availability
scripts/tfops state --state state.json --json # inspect a local state file directly
scripts/tfops plan --state state.json --json # state-level plan summary (no binary needed)
scripts/tfops plan --json # full plan via terraform plan -json
scripts/tfops apply --dry-run --json # preview only, never mutates
scripts/tfops apply --yes --json # mutation: requires --yes
scripts/tfops apply --yes --force --json # bypass the taint/drift guard after review
scripts/tfops import aws_instance.web i-0abc --dry-runMutation gate: apply and import refuse to run without --yes (exit 2); --dry-run previews without mutating; --force skips the taint/drift guard after the plan is reviewed. TERRAFORM env var overrides binary selection (terraform then tofu are auto-detected otherwise). Exit codes: 0 ok, 1 analysis/runtime error, 2 gate refusal, 127 binary missing, 124 timeout.
Operating loop
- Inventory: module tree, provider requirements, backend config, workspaces, lock file, state serial/lineage.
- Analyze:
terraform validate,tfops plan --json(or a state-file summary when the backend is unreachable). - Review: read the plan as a diff of resources, not a wall of text — count creates/updates/destroys, check replaces (destroy-before-create), spot-check sensitive changes.
- Apply: scoped, confirmed, with a backend lock held; verify the boundary afterwards.
- Drift-check: re-plan after changes and on a schedule; investigate diffs that should not exist.
Module structure
- One module per unit of composition: inputs (variables), outputs, and resources with a single responsibility. Call modules from a root module; keep the root thin.
- Pin providers (
required_providers) and module versions; committerraform.lock.hcl. - Use
for_each/countfor repetition, not code generation; usetemplatefilefor config injection, and treat provisioners as a last resort. - Structure conventions and composition patterns live in
references/01-modules-and-structure.md.
State backends and locking
- The backend owns state storage and locking. Default
localbackend stores state on disk; remote backends (S3+DynamoDB, GCS, Azure Storage, Terraform Cloud/OpenTofu Cloud, Consul) keep state off disk and enable collaboration. - Locking prevents concurrent writers: always confirm the lock is held during applies and state surgery. A stale lock blocks operations until released (
force-unlockonly after verifying no other run is active). - State holds secrets: encrypt the backend at rest, restrict read access, and mark sensitive values
sensitive = true. - Backend choice, migration (
terraform init -migrate-state/-reconfigure), and lock troubleshooting:references/02-state-and-backends.md.
Plan/apply workflow
planreads config + state + provider data and proposes a diff;applyrealizes it. Treatplanoutput as the contract the apply will fulfill.- Review destroys and replaces as the highest-risk changes; use
prevent_destroyandcreate_before_destroylifecycle rules where recreation is dangerous. - Use
-targetonly for emergencies, never as a habit;-auto-approveonly inside a reviewed CI/CD gate. - Full workflow, JSON plan output (
-json), and review checklists:references/03-plan-apply-workflow.md.
Drift detection
- Drift is the difference between declared config and actual infrastructure. A clean plan is the drift probe: schedule periodic plans and treat unexpected diffs as incidents.
- Distinguish intended drift (out-of-band manual change, external mutation) from unintended (config/state desync, provider bug).
- Remediation is
plan+ reviewedapply(reconcile), orimportwhen the resource was never managed; never delete-and-recreate as a default reflex. tfopsflags tainted resources in state analysis — those force replacement and should never be applied blind. Methods and cadence:references/04-drift-detection.md.
Remote state
- Remote backends make state shared, durable, and lockable; local state is for experiments only.
- Consume another stack's outputs with
data "terraform_remote_state"— reference by workspace/environment, never hand-copy outputs. - The state file is not the delivery artifact: remote state must be protected (encryption, ACLs, audit) and recoverable (versioning, backups, restore drills). Practices:
references/05-remote-state-and-collaboration.md.
Upgrade and refactor flows
- Upgrades: read the upgrade guides for the version span, validate with
terraform validate/tofu validate, run a plan, apply in a non-production environment first, and useterraform state replace-provider/state mvfor provider-version or address changes. - Refactors: rename or restructure resources with
movedblocks (plan-safe, no state surgery), or reviewedstate mvwhenmoveddoes not fit; never delete state to force recreation. - Version/support observations and step-by-step flows:
references/06-upgrades-and-refactors.md.
Diagnostics
Diagnose in evidence order: binary/version → config validation → backend + lock status → state serial/lineage → plan diff → apply error → boundary check.
- Lock errors: find the holder (backend-specific) before any
force-unlock. - State serial/lineage mismatches: a stale or foreign state; use
state pull/state pushonly with a backup and reviewed scope. tfops doctorgathers the first layer of evidence; failure patterns and their probes live inreferences/07-diagnostics.md.
Reference routing
| Load when | Reference |
| Module design, composition, or structure conventions | references/01-modules-and-structure.md |
| Backend choice, migration, or locking problems | references/02-state-and-backends.md |
| Planning, applying, or reviewing a change | references/03-plan-apply-workflow.md |
| Unexpected config-vs-reality differences | references/04-drift-detection.md |
| Shared or cross-stack state | references/05-remote-state-and-collaboration.md |
| Version bumps, provider migrations, or module refactors | references/06-upgrades-and-refactors.md |
| A failed apply, lock, or state error | references/07-diagnostics.md |
| Sources, version observations, and refresh procedure | references/00-source-index.md |
Included artifacts
scripts/tfops: agent-first wrapper (state analysis, plan/apply, gated mutations, JSON output).tests/test_tfops.py+tests/fixtures/fixture-state.json: deterministic tests against a bundled state fixture.references/: eight dated, source-indexed references covering the operational topics above.
Verification boundary
| Claim | Minimum evidence |
| Config is valid | terraform validate (or tofu validate) exit 0 |
| State is readable | tfops state --state FILE --json parses and inventories it |
| Plan is safe | Reviewed plan diff with counts of create/update/destroy/replace and no tainted resources applied blind |
| Apply succeeded | Apply exit 0 plus the external boundary the resource serves responds correctly |
| No drift | A clean re-plan immediately after apply and on the declared cadence |
Hard boundaries
- Never expose state files, backend credentials, provider secrets, or
sensitiveoutput values. - Never run
apply,import,state push, orforce-unlockwithout the mutation gate (--yesafter a reviewed plan, or an explicit human directive). - Never delete state or a resource just to "fix" drift — reconcile or import.
- Never run a provider-specific procedure without checking the module's
required_providersand version pins.
When not to use
- IaC methodology, tool selection, or cloud design decisions — route up to platform-engineering.
- Cloud provider depth (AWS/GCP/Azure service-by-service operations) — provider references and platform patterns live under
platform-engineering; this skill owns the Terraform/OpenTofu tool itself. - Ansible, Pulumi, CloudFormation, or CDK — different tools with their own operational contracts; only Terraform/OpenTofu live here.
- Designing a new module from scratch (composition, interfaces, versioning policy) — start from
platform-engineeringmethodology, then execute with this skill.
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.

