Agent skill

Terraform Patterns

by borghei in borghei/Claude-Skills

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…

MITAuto-check passedDevOps & Cloud

Install Terraform Patterns

skills CLI
$ npx skills add borghei/Claude-Skills --skill terraform-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install borghei/Claude-Skills terraform-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering/terraform-patterns .claude/skills/terraform-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
terraform-patterns
GitHub stars
881
Token cost
~1.3k tokens
SKILL.md length
441 words
Files
5 (incl. scripts, references)
Skills in repo
349
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 5 steps: Scan - Run tf_security_scanner.py across… → Triage - Prioritize critical findings… → Remediate - Apply recommended fixes per… → …
  • Asks to analyze Terraform modules
  • SKILL.md covers Overview, Clarify First, Quick Start and Tools Overview, plus 3 more sections
  • Runs Python scripts from its folder; calls python

What it does

Terraform Patterns is an agent skill from borghei/Claude-Skills. 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".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `references/terraform-patterns.md`, `scripts/tf_module_analyzer.py` and `scripts/tf_security_scanner.py`).

It sits in DevOps & Cloud, covering Infrastructure as code. It works with Terraform. The repository describes itself as: 385 AI skills, 77 expert agents, and 900 stdlib Python tools for every team: engineering, PM, marketing, C-level, compliance, business ops, research, and a LinkedIn toolkit… The licence is MIT.

When your agent uses it

  • Asks to analyze Terraform modules
  • Scan IaC for security issues
  • Review Terraform configurations
  • Check infrastructure code for misconfigurations

Example prompts

  • “analyze Terraform modules”
  • “scan IaC for security issues”
  • “review Terraform configurations”
  • “/terraform-patterns”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Scan - Run tf_security_scanner.py across all environments
  2. Triage - Prioritize critical findings (public data, open access)
  3. Remediate - Apply recommended fixes per finding
  4. Verify - Re-scan to confirm fixes resolved issues
  5. Gate - Add scanner to PR checks for continuous enforcement

What it can do on your machine

Read from SKILL.md and the folder at commit 4a698e8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Terraform Patterns loads about 1.3k tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 441 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from borghei/Claude-Skills at commit 4a698e8, republished under its MIT licence (© borghei). 441 words, ~1,328 tokens.

Download SKILL.mdSave it as .claude/skills/terraform-patterns/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
terraform-patterns
description
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".
license
MIT + Commons Clause
metadata.version
1.0.0
metadata.author
borghei
metadata.category
engineering
metadata.domain
infrastructure-as-code
metadata.updated
2026-04-02
metadata.tags
terraform, iac, security, cloud, infrastructure

Terraform Patterns

Category: Engineering Domain: Infrastructure as Code

Overview

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.

Clarify First

Before analyzing or scanning, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Target path — the module or environment directory to analyze (--path; the subject)
  • Task — module complexity/quality analysis vs security misconfiguration scan (selects tf_module_analyzer vs tf_security_scanner)
  • Minimum severity / gate — the severity bar for findings and whether it blocks a PR (--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.

Quick Start

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

Tools Overview

tf_module_analyzer.py

Analyzes Terraform modules for complexity, structure, dependencies, and documentation quality.

FeatureDescription
Complexity scoringScores modules by resource count, variable count, nesting
Dependency mappingMaps module dependencies and data source usage
Variable analysisChecks for missing types, defaults, descriptions
Output completenessValidates output documentation and coverage
Naming conventionsChecks resource and variable naming patterns
tf_security_scanner.py

Scans Terraform configurations for security misconfigurations and compliance violations.

FeatureDescription
Open portsDetects 0.0.0.0/0 CIDR in security groups
Public accessFlags public S3 buckets, databases, instances
Encryption gapsChecks for missing encryption at rest and in transit
IAM overreachIdentifies wildcard actions and overly broad policies
Logging gapsVerifies CloudTrail, flow logs, access logging

Workflows

Show full SKILL.md (187 more words)Show less
Security Review Workflow
  1. Scan - Run tf_security_scanner.py across all environments
  2. Triage - Prioritize critical findings (public data, open access)
  3. Remediate - Apply recommended fixes per finding
  4. Verify - Re-scan to confirm fixes resolved issues
  5. Gate - Add scanner to PR checks for continuous enforcement
Module Quality Workflow
  1. Analyze - Run tf_module_analyzer.py on each module
  2. Score - Review complexity scores, identify modules over threshold
  3. Refactor - Break down modules scoring above 70/100 complexity
  4. Document - Fill in missing variable and output descriptions
  5. Standardize - Apply consistent naming and file organization
CI Integration
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

Reference Documentation

Common Patterns Quick Reference

Module Structure
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
Security Checklist
ResourceCheckRule
Security GroupsNo 0.0.0.0/0 ingressRestrict to known CIDRs
S3 BucketsNo public ACLsUse bucket policies instead
RDSNo public accessSet publicly_accessible = false
EBS/S3/RDSEncryption enabledAdd encryption configuration
IAMNo wildcard actionsUse least-privilege policies
CloudTrailEnabled in all regionsis_multi_region_trail = true
VPCFlow logs enabledCreate flow log resources
Complexity Scoring
ScoreRatingAction
0-30LowNo action needed
31-60MediumConsider splitting
61-80HighShould refactor
81-100CriticalMust refactor

© borghei, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in engineering/terraform-patterns of borghei/Claude-Skills.

  • SKILL.md
  • examples/main.tf
  • references/terraform-patterns.md
  • scripts/tf_module_analyzer.py
  • scripts/tf_security_scanner.py

Open the folder on GitHubat commit 4a698e8

Compare with similar skills

Terraform Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Terraform Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Terraform Patterns this skillborghei/Claude-Skills881—~1.3kAutomated safety check: PassMIT
Terraform and OpenTofu Guideagentscope-ai/QwenPaw35k6 repos~4.2kAutomated safety check: PassApache-2.0
Terraform Skillantonbabenko/terraform-skill2.4k1 repos~5.1kAutomated safety check: PassApache-2.0
Review Docshashicorp/terraform-provider-aws11k—~1.3kAutomated safety check: PassMPL-2.0
Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit2606 repos~1.1kAutomated safety check: NotesCustom licence
Cloudflarehodgef/apiker1277 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Terraform and OpenTofu Guide

    agentscope-ai/QwenPaw

    Guidance for writing and testing Terraform and OpenTofu code: module structure, naming, test approaches, CI/CD workflows, state handling and security scanning.

    35k GitHub starsUsed in 6 repos~4.2k tokens
    DevOps & CloudAuto-check passed
  • Terraform Skill

    antonbabenko/terraform-skill

    A skill your agent uses when writing, reviewing, or debugging Terraform/OpenTofu modules, tests, CI, scans, or state ops - diagnoses failure mode (identity churn, secrets, blast radius, CI drift…

    2.4k GitHub starsUsed in 1 repo~5.1k tokens
    DevOps & CloudAuto-check passed
  • Review Docs

    hashicorp/terraform-provider-aws

    Official

    Review a Terraform AWS Provider PR's end-user documentation (website/docs//.markdown): whether docs are needed, description openings, argument/attribute style, section structure, tags wording, code…

    11k GitHub stars~1.3k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    260 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Cloudflare

    hodgef/apiker

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Terravision Cloud Diagrams

    patrickchugh/terravision

    Draw cloud architecture diagrams for AWS, Azure or GCP with the official provider icon sets, using TerraVision.

    1.6k GitHub stars~5.6k tokensUpdated yesterday
    DevOps & CloudAuto-check: notes

More from borghei/Claude-Skills

All 349 skills in this repo
  • Agents In The Team

    borghei/Claude-Skills

    Run delivery when AI coding and ops agents take tickets. An agent skill from borghei/Claude-Skills.

    881 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • AI Content Disclosure

    borghei/Claude-Skills

    Check AI-generated marketing content and reviews for required disclosures under the EU AI Act, FTC rules and platform AI-label policies.

    881 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • AI Prototyping

    borghei/Claude-Skills

    Idea to AI-generated prototype to customer validation to engineering handoff.

    881 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Analytics Engineer

    borghei/Claude-Skills

    Analytics engineering across data modeling, dbt, transformation, and semantic layers.

    881 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ansoff Matrix

    borghei/Claude-Skills

    Ansoff Matrix — 4-quadrant framework for growth options: market penetration, market/product development, and diversification.

    881 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Brainstorm Okrs

    borghei/Claude-Skills

    OKR brainstorming and validation using the Radical Focus framework — outcome objectives, measurable key results, counter-metrics.

    881 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Terraform Patterns

What does Terraform Patterns do?

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…. Terraform Patterns is an agent skill from borghei/Claude-Skills. 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".

When should I use Terraform Patterns?

Terraform Patterns fits situations like: asks to analyze Terraform modules; scan IaC for security issues; review Terraform configurations; check infrastructure code for misconfigurations.

How do I install Terraform Patterns in Claude Code?

Run `npx skills add borghei/Claude-Skills --skill terraform-patterns -a claude-code`. Or copy the skill folder (engineering/terraform-patterns in borghei/Claude-Skills) into .claude/skills/terraform-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Terraform Patterns in Codex?

Run `npx skills add borghei/Claude-Skills --skill terraform-patterns -a codex`. Or copy the skill folder (engineering/terraform-patterns in borghei/Claude-Skills) into .agents/skills/terraform-patterns in your project. Codex loads it when a task matches its description.

Can I use Terraform Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add borghei/Claude-Skills --skill terraform-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/terraform-patterns, .gemini/skills/terraform-patterns, .github/skills/terraform-patterns and .opencode/skills/terraform-patterns in your project.

What does Terraform Patterns need to run?

Going by SKILL.md and its folder, Terraform Patterns needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Terraform Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Terraform Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Terraform Patterns use?

Terraform Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Terraform Patterns use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 883 tokens, read only when the agent opens those files.

What are the alternatives to Terraform Patterns?

Skills that share tags, products or a category with Terraform Patterns: Terraform and OpenTofu Guide (agentscope-ai/QwenPaw, 35k stars), Terraform Skill (antonbabenko/terraform-skill, 2.4k stars), Review Docs (hashicorp/terraform-provider-aws, 11k stars) and Senior DevOps Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Terraform Patterns?

borghei (a GitHub user) maintains it in borghei/Claude-Skills, which has 881 GitHub stars. The repository holds 349 skills in this directory. The repository was last updated on October 7, 2026.

Source: borghei/Claude-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.