terraform-patterns

terraform-patterns is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 123 tokens per session (4,687 once invoked), scanned A, original, Apache-2.0.

A development aid for designing and reviewing Terraform infrastructure code. Terraform lets you describe cloud and other infrastructure in files so it can be planned and managed consistently.

In plain words
What is it for?
Use it to review Terraform, design or refactor modules, plan state backends and provider settings, check security, and shape CI/CD plan-and-apply workflows.
Why use it?
It helps prevent disorganized modules, insecure settings, exposed secrets, and infrastructure changes that drift from the intended configuration.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/tf_module_analyzer.py ./modules/vpc.

Good fit Use it to review Terraform, design or refactor modules, plan state backends and provider settings, check security, and shape CI/CD plan-and-apply workflows.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit
agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/terraform-patterns

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/terraform-patterns/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/terraform-patterns)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/terraform-patterns"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/terraform-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/terraform-patterns"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/terraform-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00123 $0.04687
Opus 5.5 $0.00049 $0.01875
Sonnet 5.5 $0.00025 $0.00937
Haiku 4.5 $0.00012 $0.00469

Measured 2mo ago against content hash 37949ac4e8b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

terraform-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/test_smoke_all.py, scripts/tf_module_analyzer.py, scripts/tf_security_scanner.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

expert-teams/teams/fullstack-web-team/skills/terraform-patterns/SKILL.md · 412 lines

How it starts

The opening of the file, as written. The whole thing — 412 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Terraform Patterns

可预期的基础设施。安全的状态。可组合的模块。零漂移。

一套带明确主张的 Terraform 工作流,把失控的 HCL 变成结构良好、安全、生产级的基础设施代码。覆盖模块设计、状态管理、provider 模式、安全加固与 CI/CD 集成。

这不是 Terraform 教程——这是一组具体决策,关于如何写出不会在凌晨 3 点出事的基础设施代码。

斜杠命令

命令 作用
/terraform:review 分析 Terraform 代码的反模式、安全问题与结构问题
/terraform:module 设计或重构 Terraform 模块,规范 inputs、outputs 与组合
/terraform:security 审计 Terraform 代码的安全漏洞、密钥暴露与 IAM 配置错误

何时激活

识别用户的这些表达:

  • "Review this Terraform code"
  • "Design a Terraform module for..."
  • "My Terraform state is..."
  • "Set up remote state backend"
  • "Multi-region Terraform deployment"
  • "Terraform security review"
  • "Module structure best practices"
  • "Terraform CI/CD pipeline"
  • 任何涉及 .tf 文件、HCL、Terraform 模块、状态管理、provider 配置、基础设施即代码的请求

用户有 .tf 文件,或想用 Terraform 创建基础设施 → 本技能适用。

输入清单

扫描前一次性收集。缺输入时用这句话向用户问一次:"要审计 Terraform 代码,请一次性提供:Terraform 目录路径、目标云厂商/后端类型、是否含多环境隔离。"

输入 必需 说明
Terraform 目录 是 .tf 目录树的路径,如 ./terraform——两个脚本的位置参数
云 / 后端类型 state review 需要 AWS / GCP / Azure / Terraform Cloud——决定后端建议
环境隔离策略 state review 需要 独立目录 vs workspaces vs Terragrunt
模块范围 /terraform:module 需要 模块负责什么(networking、compute……)以及消费方是谁

前置自检

python3 --version        # 预期:Python ≥ 3.8。两个脚本均仅依赖标准库。
ls scripts/tf_module_analyzer.py scripts/tf_security_scanner.py
                         # 预期:两个文件全部列出。
ls <tf-dir>/*.tf         # 预期:至少一个 .tf 文件。为空 → 目录不对。
  • Python 缺失或版本过旧 → 安装 Python ≥ 3.8,然后停止。
  • 脚本文件缺失 → 目录不对;cd 到本技能目录重新检查,然后停止。
  • 目标目录没有 .tf 文件 → 与用户确认路径;不要扫一棵空树还称之为 review。

工作流

/terraform:review — Terraform 代码评审

步骤 1:分析现状
  • 动作: 读目标目录所有 .tf 文件;识别模块结构(扁平 vs 嵌套);统计 resources、data sources、variables、outputs;核对命名约定。
  • 预期: 一份可在报告中引用的清单(计数 + 结构)。
  • 失败时: 目录不可读 → 与用户确认路径;不要评审一棵猜出来的树。
步骤 2:套用评审清单
MODULE STRUCTURE
├── Variables have descriptions and type constraints
├── Outputs expose only what consumers need
├── Resources use consistent naming: {provider}_{type}_{purpose}
├── Locals used for computed values and DRY expressions
└── No hardcoded values — everything parameterized or in locals

STATE & BACKEND
├── Remote backend configured (S3, GCS, Azure Blob, Terraform Cloud)
├── State locking enabled (DynamoDB for S3, native for others)
├── State encryption at rest enabled
├── No secrets stored in state (or state access is restricted)
└── Workspaces or directory isolation for environments

PROVIDERS
├── Version constraints use pessimistic operator: ~> 5.0
├── Required providers block in terraform {} block
├── Provider aliases for multi-region or multi-account
└── No provider configuration in child modules

SECURITY
├── No hardcoded secrets, keys, or passwords
├── IAM follows least-privilege principle
├── Encryption enabled for storage, databases, secrets
├── Security groups are not overly permissive (no 0.0.0.0/0 ingress on sensitive ports)
└── Sensitive variables marked with sensitive = true

Read the full file on GitHub · 412 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · -10 tokens per session 222f9586c551
  2. 2mo ago Changed 37949ac4e8b5
  3. 2mo ago Changed · -7 lines · +32 tokens per session 5f3272bee3ae
  4. 3mo ago First seen · 419 lines · 91 tokens per session scan A 8451c44877a8

Subscribe to this mod's changes

terraform-patterns is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 123 tokens to every session and 4,687 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

terraform-patterns compared with skills from other repositories

terraform-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
terraform-patternsMorningstar202604/awesome-skillkitSkill02mo agoApache-2.0A123Claude Code, Codex
cloudflare-temporary-deployNousResearch/hermes-agentSkill267ktodayMITA21Claude Code, Codex
tensorrt-llmNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
stripe-projectsNousResearch/hermes-agentSkill267ktodayMITA15Claude Code, Codex
latchbio-integrationsynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A45Claude Code, Codex
lambdasimlangwatch/langwatchSkill5.1ktodayApache-2.0A112Claude Code
langbot-deploylangbot-app/LangBotSkill19ktodayApache-2.0B104Claude Code, Codex