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.
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkitnpx agentmods add skills/morningstar202604/awesome-skillkit/terraform-patternsWrote 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.
[](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/terraform-patterns)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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
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.
- .gitignore 56 B
- assets/terraform/main.tf 247 B
- assets/terraform/modules/vpc/main.tf 77 B
- references/cicd-and-advanced-patterns.md 9.2 KB
- references/state-management.md 14 KB
- scripts/test_smoke_all.py 1.3 KB runs code
- scripts/tf_module_analyzer.py 14 KB runs code
- scripts/tf_security_scanner.py 18 KB runs code
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.
- 2mo ago Changed · -10 tokens per session 222f9586c551
- 2mo ago Changed 37949ac4e8b5
- 2mo ago Changed · -7 lines · +32 tokens per session 5f3272bee3ae
- 3mo ago First seen · 419 lines · 91 tokens per session scan A 8451c44877a8
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.
terraform-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| terraform-patternsMorningstar202604/awesome-skillkit | Skill | 0 | 2mo ago | Apache-2.0 | A | 123 | Claude Code, Codex |
| cloudflare-temporary-deployNousResearch/hermes-agent | Skill | 267k | today | MIT | A | 21 | Claude Code, Codex |
| tensorrt-llmNousResearch/hermes-agent | Skill | 267k | today | MIT | A | 18 | Claude Code, Codex |
| stripe-projectsNousResearch/hermes-agent | Skill | 267k | today | MIT | A | 15 | Claude Code, Codex |
| latchbio-integrationsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 45 | Claude Code, Codex |
| lambdasimlangwatch/langwatch | Skill | 5.1k | today | Apache-2.0 | A | 112 | Claude Code |
| langbot-deploylangbot-app/LangBot | Skill | 19k | today | Apache-2.0 | B | 104 | Claude Code, Codex |