infra-as-code

infra-as-code is a skill for Claude Code, Codex from fmind/dot. It costs 40 tokens per session (1,250 once invoked), scanned A, original, MIT.

A guide for managing cloud infrastructure as code with OpenTofu or Terraform. Infrastructure as code means describing servers, networks, and other cloud resources in files that can be reviewed and applied.

In plain words
What is it for?
Use it to create or update OpenTofu/Terraform projects, inspect providers and state, generate plans, migrate configurations, and document infrastructure modules.
Why use it?
It helps make infrastructure changes predictable by checking configuration, creating a plan, documenting inputs and outputs, and keeping state and migrations under control.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or update OpenTofu/Terraform projects, inspect providers and state, generate plans, migrate configurations, and document infrastructure modules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmind/dot/infra-as-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fmind/dot --skill infra-as-code
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

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 infra-as-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/infra-as-code/github.svg)](https://agentmods.dev/skills/fmind/dot/infra-as-code)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/infra-as-code"><img src="https://agentmods.dev/badge/skills/fmind/dot/infra-as-code/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 infra-as-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmind/dot/infra-as-code"><img src="https://agentmods.dev/badge/skills/fmind/dot/infra-as-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,250 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.00040 $0.01250
Opus 5.5 $0.00016 $0.00500
Sonnet 5.5 $0.00008 $0.00250
Haiku 4.5 $0.00004 $0.00125

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

Security

Grade A, and why

infra-as-code 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 2d 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.

skills/infra-as-code/SKILL.md · 55 lines

How it starts

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

Infrastructure as Code

Manage infrastructure with OpenTofu (tofu); pin terraform in mise.toml only when a BSL-only feature or client mandate requires it.

Defaults

Workflow

  1. Confirm scope & init: check root module, backend, tofu workspace show, project, and auth; run mise run install on fresh clones.
  2. Isolate state: edit the smallest root module with a unique GCS prefix (in-app layout).
  3. Gate offline: run mise run check and mise run test (command = plan + mock_provider per main.tftest.hcl).
  4. Plan & CI: run mise run plan (tmp/plan.tfplan), never in Git hooks. In CI (tofu.yml), run uncredentialed validate on PRs, WIF plan on main, and apply only via workflow_dispatch (apply=true) behind environment: production.
  5. Apply authorized plans: inspect replacements, destroys, IAM, and cost in tofu show tmp/plan.tfplan, run tofu apply tmp/plan.tfplan, delete tmp/plan.tfplan, and confirm tofu plan -input=false -detailed-exitcode exits 0.

HCL Rules

  • Prefer for_each over count: keyed maps avoid cascading destroy/recreate on list shifts; use lifecycle { enabled = ... } (OpenTofu 1.11+) for conditional singletons.
  • Refactor declaratively: use moved, import, and removed blocks instead of manual tofu state edits.
  • Keep child modules/ pure: zero local-exec/remote-exec provisioners, no backend/provider blocks inside child modules/, and lifecycle { prevent_destroy = true } (or dynamic var.protect_stateful on OpenTofu 1.12+ for dev teardown) on stateful prod resources (DBs, KMS keys, state buckets).

Read the full file on GitHub · 55 lines

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. 2d ago Changed d40c9cc71a1d
  2. 4d ago Changed b51b38ade9f6
  3. 5d ago Changed 97de385187a9
  4. 7d ago Changed · +21 tokens per session 8b01118eda58
  5. 10d ago Changed f3f773e35923
  6. 12d ago Changed · -1 lines · -1 tokens per session 84a758d8f200
  7. 16d ago Changed 573a4d00345e
  8. 20d ago Changed · -5 lines f28b555326ad
  9. 21d ago Changed · -3 lines f1ebd025177c
  10. 24d ago First seen · 64 lines · 20 tokens per session scan A cc4864182a74

Subscribe to this mod's changes

infra-as-code is a skill published in the GitHub repository fmind/dot (14 stars, last pushed yesterday), licensed MIT. It adds 40 tokens to every session and 1,250 once invoked, about $0.0002 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-09-17.

Related

infra-as-code compared with skills from other repositories

infra-as-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
infra-as-codefmind/dotSkill14yesterdayMITA40Claude Code, Codex
cloud-runfmind/dotfilesSkill43mo agoMITA28Claude Code, Codex
google-cloud-operationsfmind/dotfilesSkill43mo agoMITA34Claude Code, Codex
terraform-stackfmind/dotfilesSkill43mo agoMITA45Claude Code, Codex
scaffold-terraformurmzd/dotfilesSkill6todayApache-2.0A115Claude Code
python-stackfmind/dotfilesSkill43mo agoMITA41Claude Code, Codex
misefmind/dotfilesSkill43mo agoMITA27Claude Code, Codex