Skip to content
Back to skills

Opentofu Patterns

ASecurity

OpenTofu and Terraform patterns for moved, import, and removed blocks, for_each, state secrets, and the lock file. Load before any edit to a .tf or .tfvars file, however small, and for HCL questions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added October 5, 2026
ai-agentsterraformbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add ku5ic/claude-kit --skill opentofu-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Opentofu Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Opentofu Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ku5ic-opentofu-patterns/badge)](https://www.skillsdirectory.com/skills/ku5ic-opentofu-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: opentofu-patterns
description: OpenTofu and Terraform patterns for moved, import, and removed blocks, for_each, state secrets, and the lock file. Load before any edit to a .tf or .tfvars file, however small, and for HCL questions.
---

# OpenTofu patterns

Default assumption: OpenTofu 1.13, per the OpenTofu changelog. Most rules hold for Terraform too.

A row applies when `required_version` in the `terraform {}` block allows only releases at or above its version, for the CLI the project runs. A row marked OpenTofu is an OpenTofu release; its Terraform version, where one exists, is in the row.

## Reference files

Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.

| Before                                                                                                                                                     | Read                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing HCL, or raising `required_version` or the `tofu` CLI                                                                                               | [reference/upgrades.md](reference/upgrades.md)           |
| Writing, changing, or reviewing OpenTofu or Terraform code                                                                                                 | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Writing variables, modules, provider requirements, a backend, the lock file, an `import`, `moved`, or `removed` block, or `depends_on`, or applying a plan | [reference/practices.md](reference/practices.md)         |
| Running or wiring `fmt`, `validate`, TFLint, or Trivy                                                                                                      | [reference/tooling.md](reference/tooling.md)             |

Files in this skill

  • SKILL.md2.6 KB
  • reference/anti-patterns.md2 KB
  • reference/configuration.md1.9 KB
  • reference/refactoring-and-state.md2.4 KB
  • reference/workflow.md920 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.