Help us improve
Share bugs, ideas, or general feedback.
From infra-review
Use when reviewing Terraform test files (.tftest.hcl), assessing test coverage, or designing new tests for components using mock_provider and plan-only assertions
npx claudepluginhub infraspecdev/tesseract --plugin infra-reviewHow this skill is triggered — by the user, by Claude, or both
Slash command
/infra-review:terraform-test-coverageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Test quality assessment for Terraform components using the native `terraform test` framework (`.tftest.hcl` files). Evaluates coverage across 6 dimensions and provides patterns for `mock_provider`, `override_resource`, and plan-only assertions.
Guides writing Terraform tests in .tftest.hcl: run blocks, assertions, provider mocks, module validation, plan/apply modes, and CI/CD pipelines.
Validates, lints, audits, and plans Terraform HCL files using tflint, checkov, terraform validate/fmt/init; enforces security checklists and best practices.
Guides Terraform and OpenTofu best practices including module design, naming conventions, directory structure, testing, and CI/CD patterns for infrastructure-as-code.
Share bugs, ideas, or general feedback.
Test quality assessment for Terraform components using the native terraform test framework (.tftest.hcl files). Evaluates coverage across 6 dimensions and provides patterns for mock_provider, override_resource, and plan-only assertions.
.tftest.hcl files for coverage gapsterraform validate / terraform fmtterraform-security-audit skill.tftest.hcl files and you are not asked to create themAssess each component against these 6 dimensions (see test-patterns.md for HCL examples):
run block with command = plan, valid inputs, assertions on key resource attributesvalidation block has a test using expect_failures.tftest.hcl files in the componentvariables.tf to list all required variables, validation blocks, and feature toggle flagsrun block, determine which dimension(s) it coverstemplates.mdvalidation block MUST have a matching expect_failures testmock_provider is required for plan-only tests -- do not rely on real AWS credentialsoverride_resource to provide mock CIDR values since allocations happen at apply time| Mistake | Why It Happens | Correct Approach |
|---|---|---|
| Happy path test with zero assertions | Developer assumes "plan succeeds" is sufficient | Assert on specific resource attributes (count, CIDR, tags) |
Missing expect_failures for validations | Validation blocks seem self-documenting | Every validation block needs an explicit negative test |
| Testing feature toggle in one state only | Enabled state is the default, so it "works" | Test both enabled and disabled; verify resource count is 0 when disabled |
| Hardcoding AZ names without mock | Tests fail in different regions | Use override_data on data.aws_availability_zones |
| Skipping CIDR overlap checks | Subnets "look right" in small configs | Use distinct() assertion to verify no CIDR overlap programmatically |
| No edge case for single AZ | Multi-AZ is the common path | Single-AZ is a valid deployment; test az_count = 1 explicitly |
test-patterns.md -- HCL code examples for each coverage dimension and mock_provider patternstemplates.md -- Coverage assessment output template