opentofu-patterns
Skill2 starsChanged 8 days agoMITView on GitHub
OpenTofu and Terraform patterns for config-driven refactoring (moved, import, removed), for_each vs count, variables and secrets in state, version pinning and the lock file, fmt/validate in CI, and review-time anti-patterns. Use whenever the project contains `.tf`/`.tfvars` files or a `.terraform.lock.hcl`, OR the user asks about OpenTofu, Terraform, HCL, state, providers, or modules, even if neither tool is mentioned by name.
In this repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- auditSkill
- backup-patternsSkill
- bash-patternsSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- drf-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- javascript-patternsSkill
- logging-patternsSkill
- referenceSkill
- metaSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- prSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- security-patternsSkill
- slop-patternsSkill
- storybook-patternsSkill
- tailwind-patternsSkill
- test-patternsSkill
- typescript-patternsSkill
- unslopSkill
- vps-provisioningSkill
- vue-patternsSkill
- wcag-auditSkill
- writeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Default assumption: OpenTofu 1.12.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTofu patterns
Default assumption: OpenTofu 1.12. Most rules hold for Terraform too, since the language is shared.
- Features marked "OpenTofu 1.11+" or "1.12+" are OpenTofu releases; check Terraform's own docs before using one in a Terraform project.
- Adapt advice to
required_versionin the project'sversions.tf(or wherever theterraform {}block lives) and to which CLI the project runs (tofuorterraform).
Reference files
| File | Covers |
| reference/refactoring-and-state.md | moved, import, removed blocks, lifecycle, what state holds |
| reference/configuration.md | for_each vs count, enabled, variables, pinning and the lock file, provisioners |
| reference/workflow.md | fmt and validate in checks, and what the kit's guard blocks |
| reference/anti-patterns.md | Seven review-time anti-patterns with severity calls |
References
- OpenTofu docs: https://opentofu.org/docs/
- What's new in OpenTofu: https://opentofu.org/docs/intro/whats-new/
- Terraform language docs: https://developer.hashicorp.com/terraform/language
Version notes
Checked: 2026-09-26 against https://opentofu.org/docs and the GitHub releases of opentofu/opentofu and hashicorp/terraform
- OpenTofu 1.12.6 (2026-08-19); 1.12:
lifecycle { destroy = false }, andprevent_destroymay refer to variables. 1.13.0-rc1 (2026-09-17) is a release candidate, not covered. - OpenTofu 1.11: the
enabledmeta-argument, ephemeral resources, variables and outputs, and write-only attributes. - Terraform 1.16.4 (2026-09-23), for reference only.
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.

