スキル一覧に戻る
poindexter12

tofu

by poindexter12

2🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: tofu description: | OpenTofu infrastructure-as-code reference for HCL syntax, state management, module design, and provider configuration. Use when working with OpenTofu configurations (.tf files), running tofu commands, troubleshooting state issues, or designing modules. Includes Proxmox provider patterns. Triggers: tofu, opentofu, tfstate, .tf files, HCL, modules, providers. agent: tofu-expert

OpenTofu Skill

Infrastructure-as-code reference for OpenTofu configurations, state management, and provider patterns.

OpenTofu is the open-source fork of Terraform, maintained by the Linux Foundation. Commands and syntax are nearly identical to Terraform.

Quick Reference

# Core workflow
tofu init              # Initialize, download providers
tofu validate          # Syntax validation
tofu fmt -recursive    # Format HCL files
tofu plan              # Preview changes
tofu apply             # Apply changes

# Inspection
tofu state list                    # List resources in state
tofu state show <resource>         # Show resource details
tofu graph | dot -Tsvg > graph.svg # Dependency graph

# Debug
TF_LOG=DEBUG tofu plan 2>debug.log

Core Workflow

init → validate → fmt → plan → apply
  1. init: Download providers, initialize backend
  2. validate: Check syntax and configuration validity
  3. fmt: Ensure consistent formatting
  4. plan: Preview what will change (review carefully)
  5. apply: Execute changes

Terraform Migration

OpenTofu is a drop-in replacement for Terraform:

# Replace terraform with tofu in commands
terraform init  →  tofu init
terraform plan  →  tofu plan
terraform apply →  tofu apply

# State files are compatible
# Provider configurations work the same
# Most modules work without changes

Key differences:

  • Different binary name (tofu vs terraform)
  • Some newer Terraform features may not be available yet
  • Provider registry defaults differ (can be configured)

Reference Files

Load on-demand based on task:

TopicFileWhen to Load
Troubleshootingtroubleshooting.mdCommon errors, debugging
Statestate-management.mdBackends, locking, operations
Modulesmodule-design.mdModule patterns, composition
Securitysecurity.mdSecrets, state security
Migrationmigration.mdTerraform → OpenTofu
Proxmox Gotchasproxmox/gotchas.mdCritical provider issues
Proxmox Authproxmox/authentication.mdProvider config, API tokens
Proxmox VMsproxmox/vm-qemu.mdproxmox_vm_qemu patterns

Validation Checklist

Before tofu apply:

  • tofu init completed successfully
  • tofu validate passes
  • tofu fmt applied
  • tofu plan reviewed (check destroy/replace operations)
  • Backend configured correctly (for team environments)
  • State locking enabled (if remote backend)
  • Sensitive variables marked sensitive = true
  • Provider versions pinned
  • No secrets in version control
  • Blast radius assessed (what could break?)

Variable Precedence

(highest to lowest)

  1. -var flag: tofu apply -var="name=value"
  2. -var-file flag: tofu apply -var-file=prod.tfvars
  3. *.auto.tfvars files (alphabetically)
  4. terraform.tfvars file
  5. TF_VAR_* environment variables
  6. Variable defaults in variables.tf

Provider Configuration

# versions.tf
terraform {
  required_version = ">= 1.6.0"  # OpenTofu version

  required_providers {
    proxmox = {
      source  = "Telmate/proxmox"
      version = "~> 3.0"
    }
  }
}

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です