Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "analyze Terraform modules", "scan IaC for security issues", "review Terraform configurations", "check infrastructure code for misconfigurations", or "audit cloud resources".
.claude/skills/borghei-terraform-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 139% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 71% | 0% |
> Category: Engineering > Domain: Infrastructure as Code
The Terraform Patterns skill provides automated analysis of Terraform configurations for module complexity, security misconfigurations, and infrastructure best practices. It catches open ports, public buckets, missing encryption, and overly permissive IAM policies before they reach production.
Before analyzing or scanning, confirm these inputs. If any is unknown or vague, ASK — do not assume:
--path; the subject)tf_module_analyzer vs tf_security_scanner)--min-severity; changes the report and CI pass/fail)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
bash# Analyze Terraform module structure and complexity python scripts/tf_module_analyzer.py --path ./modules/vpc # Scan for security misconfigurations python scripts/tf_security_scanner.py --path ./environments/production # JSON output for CI pipelines python scripts/tf_security_scanner.py --path . --format json # Recursive analysis of all modules python scripts/tf_module_analyzer.py --path . --recursive
Analyzes Terraform modules for complexity, structure, dependencies, and documentation quality.
| Feature | Description | |---------|-------------| | Complexity scoring | Scores modules by resource count, variable count, nesting | | Dependency mapping | Maps module dependencies and data source usage | | Variable analysis | Checks for missing types, defaults, descriptions | | Output completeness | Validates output documentation and coverage | | Naming conventions | Checks resource and variable naming patterns |
Scans Terraform configurations for security misconfigurations and compliance violations.
| Feature | Description | |---------|-------------| | Open ports | Detects 0.0.0.0/0 CIDR in security groups | | Public access | Flags public S3 buckets, databases, instances | | Encryption gaps | Checks for missing encryption at rest and in transit | | IAM overreach | Identifies wildcard actions and overly broad policies | | Logging gaps | Verifies CloudTrail, flow logs, access logging |
bash# Security gate python scripts/tf_security_scanner.py --path . --format json --min-severity high if [ $? -ne 0 ]; then echo "Security scan failed - blocking merge" exit 1 fi # Module quality check python scripts/tf_module_analyzer.py --path . --recursive --format json
modules/vpc/
main.tf # Primary resources
variables.tf # Input variables with descriptions
outputs.tf # Module outputs
versions.tf # Required providers and versions
locals.tf # Local values and computed expressions| Resource | Check | Rule | |----------|-------|------| | Security Groups | No 0.0.0.0/0 ingress | Restrict to known CIDRs | | S3 Buckets | No public ACLs | Use bucket policies instead | | RDS | No public access | Set publicly_accessible = false | | EBS/S3/RDS | Encryption enabled | Add encryption configuration | | IAM | No wildcard actions | Use least-privilege policies | | CloudTrail | Enabled in all regions | is_multi_region_trail = true | | VPC | Flow logs enabled | Create flow log resources |
| Score | Rating | Action | |-------|--------|--------| | 0-30 | Low | No action needed | | 31-60 | Medium | Consider splitting | | 61-80 | High | Should refactor | | 81-100 | Critical | Must refactor |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,646 | 22,935 | +38% | 1 | 1 | 0% | 1,345 | 3,210 | +139% | 0 | 0 | — |
case-02 | fail→fail | 22,080 | 3,018 | -86% | 1 | 1 | 0% | 3,532 | 1,527 | -57% | 0 | 0 | — |
case-03 | fail→fail | 15,377 | 20,028 | +30% | 1 | 1 | 0% | 2,459 | 2,653 | +8% | 0 | 0 | — |
case-04 | fail→pass | 14,866 | 9,102 | -39% | 1 | 1 | 0% | 1,977 | 2,480 | +25% | 0 | 0 | — |
case-05 | fail→pass | 25,386 | 2,933 | -88% | 1 | 1 | 0% | 2,053 | 1,591 | -23% | 0 | 0 | — |
case-06 | fail→fail | 12,894 | 1,933 | -85% | 1 | 1 | 0% | 1,898 | 1,423 | -25% | 0 | 0 | — |
case-07 | pass→pass | 4,026 | 5,927 | +47% | 1 | 1 | 0% | 616 | 2,035 | +230% | 0 | 0 | — |
case-08 | pass→pass | 5,510 | 3,186 | -42% | 1 | 1 | 0% | 903 | 1,667 | +85% | 0 | 0 | — |
case-09 | fail→pass | 9,164 | 3,996 | -56% | 1 | 1 | 0% | 1,424 | 1,785 | +25% | 0 | 0 | — |
case-10 | fail→pass | 6,693 | 3,210 | -52% | 1 | 1 | 0% | 954 | 1,629 | +71% | 0 | 0 | — |
case-11 | pass→pass | 9,907 | 8,257 | -17% | 1 | 1 | 0% | 1,785 | 2,511 | +41% | 0 | 0 | — |
case-12 | pass→pass | 9,645 | 6,441 | -33% | 1 | 1 | 0% | 1,708 | 2,229 | +31% | 0 | 0 | — |
case-13 | pass→pass | 10,243 | 3,166 | -69% | 1 | 1 | 0% | 1,587 | 1,511 | -5% | 0 | 0 | — |
case-14 | pass→pass | 8,496 | 4,086 | -52% | 1 | 1 | 0% | 1,223 | 1,768 | +45% | 0 | 0 | — |
case-15 | fail→pass | 6,239 | 3,796 | -39% | 1 | 1 | 0% | 1,025 | 1,760 | +72% | 0 | 0 | — |
case-16 | fail→pass | 5,267 | 6,920 | +31% | 1 | 1 | 0% | 672 | 2,120 | +215% | 0 | 0 | — |
case-17 | pass→pass | 9,598 | 6,024 | -37% | 1 | 1 | 0% | 1,514 | 2,054 | +36% | 0 | 0 | — |
case-18 | fail→pass | 12,930 | 11,974 | -7% | 1 | 1 | 0% | 1,918 | 3,023 | +58% | 0 | 0 | — |
case-19 | pass→pass | 10,006 | 1,841 | -82% | 1 | 1 | 0% | 1,554 | 1,360 | -12% | 0 | 0 | — |
case-20 | pass→pass | 12,441 | 9,879 | -21% | 1 | 1 | 0% | 2,394 | 3,151 | +32% | 0 | 0 | — |
case-21 | pass→pass | 9,888 | 7,251 | -27% | 1 | 1 | 0% | 1,702 | 2,366 | +39% | 0 | 0 | — |
case-22 | pass→pass | 18,459 | 19,339 | +5% | 1 | 1 | 0% | 2,766 | 3,840 | +39% | 0 | 0 | — |
case-23 | pass→pass | 12,736 | 12,870 | +1% | 1 | 1 | 0% | 2,229 | 3,330 | +49% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +35 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.