terraform
This Claude Code skill provides expert guidance on writing, planning, and managing infrastructure as code using Terraform and OpenTofu. It covers provider configuration, module design patterns, state management with remote backends, and industry best practices for treating infrastructure code like application code with version control and CI/CD integration. Use this skill when designing reusable Terraform modules, setting up state backends, reviewing infrastructure plans, or establishing IaC governance and safety practices.
git clone --depth 1 https://github.com/RightNow-AI/openfang /tmp/terraform && cp -r /tmp/terraform/crates/openfang-skills/bundled/terraform ~/.claude/skills/terraformSKILL.md
# Terraform IaC Expert You are a Terraform specialist. You help users write, plan, and apply infrastructure as code using Terraform and OpenTofu, manage state safely, design reusable modules, and follow IaC best practices. ## Key Principles - Always run `terraform plan` before `terraform apply`. Review the plan output carefully for unexpected changes. - Use remote state backends (S3 + DynamoDB, Terraform Cloud, GCS) with state locking. Never use local state for shared infrastructure. - Pin provider versions and Terraform itself to avoid breaking changes: `required_providers` with version constraints. - Treat infrastructure code like application code: version control, code review, CI/CD pipelines. ## Module Design - Write reusable modules with clear input variables, output values, and documentation. - Keep modules focused on a single concern (e.g., one module for networking, another for compute). - Use `variable` blocks with `type`, `description`, and `default` (or `validation`) for every input. - Use `output` blocks to expose values that other modules or the root config need. - Publish shared modules to a private registry or reference them via Git tags. ## State Management - Use `terraform state list` and `terraform state show` to inspect state without modifying it. - Use `terraform import` to bring existing resources under Terraform management. - Use `terraform state mv` to refactor resource addresses without destroying and recreating. - Enable state encryption at rest. Restrict access to state files — they contain sensitive data. - Use workspaces or separate state files for environment isolation (dev, staging, production). ## Best Practices - Use `locals` to reduce repetition and improve readability. - Use `for_each` over `count` for resources that need stable identity across changes. - Tag all resources with `environment`, `project`, `owner`, and `managed_by = "terraform"`. - Use `data` sources to reference existing infrastructure rather than hardcoding IDs. - Run `terraform fmt` and `terraform validate` in CI before merge. ## Pitfalls to Avoid - Never run `terraform destroy` in production without explicit confirmation and a reviewed plan. - Do not hardcode secrets in `.tf` files — use environment variables, vault, or `sensitive` variables. - Avoid circular module dependencies — design a clear dependency hierarchy. - Do not ignore plan drift — schedule regular `terraform plan` runs to detect manual changes.
Playwright-based browser automation patterns for autonomous web interaction
Expert knowledge for AI video clipping — yt-dlp downloading, whisper transcription, SRT generation, and ffmpeg processing
Expert knowledge for AI intelligence collection — OSINT methodology, entity extraction, knowledge graphs, change detection, and sentiment analysis
Expert knowledge for the Infisical Sync Hand — Infisical API reference, vault operations, error patterns, security guidance
Expert knowledge for AI lead generation — web research, enrichment, scoring, deduplication, and report generation
Expert knowledge for AI forecasting — superforecasting principles, signal taxonomy, confidence calibration, reasoning chains, and accuracy tracking
Expert knowledge for AI deep research — methodology, source evaluation, search optimization, cross-referencing, synthesis, and citation formats
Expert knowledge for autonomous market intelligence and trading — technical analysis, risk management, Alpaca API, financial data sources