/whetstone:ia-terraformfrom whetstone
Provides guidance on Terraform and OpenTofu configuration, modules, testing, state management, and HCL review. Useful when working with IaC patterns, tfvars, tftest, or state migration.
Ships in whetstone. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
apply or destroy. Before applying, deleting a resource block, or adding ignore_changes or prevent_destroy, read plan-and-state-safety.md.| File | Purpose |
|---|---|
terraform.tf | Terraform + provider version requirements |
providers.tf | Provider configurations |
main.tf | Primary resources and data sources |
variables.tf | Input variables (alphabetical) |
outputs.tf | Output values (alphabetical) |
locals.tf | Local values |
web_api, not webAPI or web-apiaws_instance.web_api not aws_instance.web_api_instancethis for singleton resources (one of that type per module)vpc_cidr_block not cidrResources: count/for_each (blank line after) → arguments → nested blocks → tags → depends_on → lifecycle (last)
Variables: description → type → default → validation → nullable
Every variable needs type + description. Every output needs description. Mark secrets sensitive = true.
| Type | Scope | Example |
|---|---|---|
| Resource Module | Single logical group | VPC + subnets, SG + rules |
| Infrastructure Module | Collection of resource modules | Networking + compute for one region |
| Composition | Complete infrastructure | Spans regions/accounts |
module-name/
├── main.tf, variables.tf, outputs.tf, versions.tf
├── examples/
│ ├── minimal/
│ └── complete/
└── tests/
└── defaults.tftest.hcl
Keep modules small (single responsibility). examples/ double as documentation and integration test fixtures. Semantic versioning for all published modules.
| Scenario | Use |
|---|---|
| Boolean toggle (create or skip) | count = condition ? 1 : 0 |
| Named/keyed items that may reorder | for_each = toset(list) or map |
| Fixed identical replicas | count = N |
Default to for_each: removing a middle item from a count list recreates all subsequent resources. Use count only for boolean conditionals or truly identical replicas.
| Component | Strategy | Example |
|---|---|---|
| Terraform | Pin minor | required_version = "~> 1.9.0" |
| Providers | Pin major | version = "~> 5.0" |
| Modules (prod) | Pin exact | version = "5.1.2" |
| Modules (dev) | Allow patch | version = "~> 5.1.0" |
Key modern features: moved blocks (1.1+), optional() with defaults (1.3+), native testing (1.6+), mock providers (1.7+), removed blocks (1.7+), cross-variable validation (1.9+), write-only arguments (1.11+).
Stacks (HCP; check current release status): orchestrates multiple configs as a single deployment unit. Evaluate for multi-environment patterns.
use_lockfile = true (1.10+), Azure Blob, GCS, or Terraform Cloud. Never local state for shared infrastructure. DynamoDB-based S3 locking (dynamodb_table) is deprecated and slated for removal; prefer use_lockfile. Both may be set at once while migrating an existing table off.terraform { encryption { key_provider "pbkdf2" "k" {...} method "aes_gcm" "m" { keys = key_provider.pbkdf2.k } state { method = method.aes_gcm.m } plan { method = method.aes_gcm.m } } } encrypts state and plan files client-side (or via TF_ENCRYPTION). Roll out with a fallback { method = method.unencrypted.x } so existing plaintext state still loads, and never rename a key provider or method without a fallback block. OpenTofu also accepts var.*/local.* in backend {} arguments and in module source/version (resolved at init; no state or provider-function references); the same HCL is a hard error in Terraform ("A backend block cannot refer to named values")..tfstate, .terraform/, or *.tfplan. Always commit .terraform.lock.hcl.sensitive = true redacts CLI output (plan, apply, terraform output) only; the value is still stored in plaintext state. Keep secrets out of state in this order: provider-managed secrets (for example manage_master_user_password = true), then an ephemeral resource (1.10+) feeding a write-only *_wo argument (1.11+). Write-only values never enter plan or state, so changing one produces no diff: increment its *_wo_version companion argument (a provider convention, not enforced by core) to push a rotation.default_tags on provider for consistent resource tagging.0.0.0.0/0 ingress without explicit justification.terraform fmt -recursive rewrites files), then verify (terraform validate && tflint && trivy config .)moved blocks with from and to addresses for refactoring resource names/modules without destroy-recreate. Retain historical moves for downstream upgrades; remove only after every affected state has migrated, or as an explicitly breaking module release.terraform force-unlock <ID>, only after confirming no other operation runningterraform plan -refresh-only -out=refresh.tfplan. Review and obtain approval before applying that file.terraform plan '-replace=ADDR' -out=replace.tfplan, substituting the resource instance address. Review and obtain approval before applying that file.import blocks (1.5+) for declarative import, or terraform import ADDR IDUse locals with try() to control deletion ordering without explicit depends_on:
locals {
vpc_id = try(aws_vpc_ipv4_cidr_block_association.this[0].vpc_id, aws_vpc.this.id, "")
}
This forces Terraform to destroy subnets before CIDR associations, which prevents deletion errors.
cidrsubnet(var.vpc_cidr, 8, count.index) for calculated subnet CIDRs; never hardcode subnetsprovider "aws" { alias = "eu_west_1" } + providers = { aws = aws.eu_west_1 } in module blocksRun before declaring done:
terraform fmt -check && terraform validate && tflint && trivy config .
All commands must pass with zero errors. Inspect providers, data sources, provisioners, and external commands before selecting test files. Include safe plan tests and fully mocked apply tests in completion checks. Keep real-service or infrastructure tests behind the task's authorization and cost boundary. Pass the root-relative test filename, such as terraform test -filter=tests/vpc_unit_test.tftest.hcl, and verify that the intended file completed at least one run; an exit code alone can accept an unknown filter with no tests selected. Use the checked selection recipe in native-test-patterns.md.
Read the relevant reference before implementing or reviewing the matching behavior:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
29 skills in this plugin
/ia-agent-native-architectureDesign agent-native applications where agents replace UI users as the primary actor. Use when designing MCP tools, agent-loop architectures, system prompt design, hooks policy, shared-workspace file patterns, or self-modifying agent systems./ia-brainstormingPre-implementation exploration: deep interview, approach comparison, design doc. Use when exploring a vague feature idea, clarifying ambiguous requirements, or comparing approaches before coding. For the full workflow, use the ia-brainstorm command (Claude Code)./ia-code-reviewStructured code reviews with severity-ranked findings and deep multi-agent mode. Use when performing a code review, auditing code quality, or critiquing PRs, MRs, or diffs, including a diff or patch pasted inline, even when the review looks quick from reading it. For the full multi-agent workflow, use the ia-review command (/ia-review in Claude Code)./ia-cpp-systemsModern C++ patterns: RAII and ownership, rule of zero/five, exceptions and error handling, API and ABI boundaries, templates, and CMake tooling. Use when writing, reviewing, refactoring, or debugging C++, working with smart pointers, move semantics, memory leaks, template errors, or gtest. For plain C, see ia-c-systems./ia-c-systemsC patterns for systems code, libraries, and native extensions: module layout, function decomposition, status-enum errors, memory safety, undefined behavior, and performance measurement. Use when writing, reviewing, refactoring, or debugging C, working with malloc lifetimes, buffer overflows, sanitizers, or Valgrind, or building native extensions. For C++, see ia-cpp-systems./ia-debuggingSystematic root-cause debugging with verification. Use for errors, stack traces, broken tests, flaky tests, regressions, or anything not working as expected, including a pasted stack trace or failing test whose cause looks obvious from reading it. For validating bug reports before fixing, use bug-reproduction-validator agent.npx claudepluginhub iliaal/whetstone --plugin whetstoneOther plugins' skills for the same job