infra-as-code

infra-as-code is a skill for Claude Code, Codex from fmind/dot. It costs 20 tokens per session (1,601 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 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,601 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.00020 $0.01601
Opus 5.5 $0.00008 $0.00640
Sonnet 5.5 $0.00004 $0.00320
Haiku 4.5 $0.00002 $0.00160

Measured today against content hash c85aec792f2f, 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 today.

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 · 61 lines

How it starts

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

Infrastructure as Code

Canonical infrastructure as code with OpenTofu (the open-source Terraform fork; the binary is tofu). A repository that needs a BSL-licensed feature or employer-mandated HashiCorp Terraform pins terraform in its own mise configuration and documents the deviation.

Defaults

  • Default to OpenTofu via mise: opentofu tool, tofu binary; verify provider, backend, state, and language-feature compatibility before a Terraform migration.
  • Use the template tasks and hooks: mise.toml exposes the canonical vocabulary per mise — check fans out to format, validate, lint (tflint), scan (trivy), and leaks; lefthook.yml wires the hooks per lefthook.
  • Generate docs with terraform-docs: mise run build injects the inputs/outputs table between the TF_DOCS markers in README.md (add them once at scaffold time) per terraform-docs.yml, without cloud access.
  • Authenticate without service-account keys: Application Default Credentials locally; Workload Identity Federation in CI per github-actions.

Workflow

  1. Resolve the target: identify the root module, backend, workspace (tofu workspace show), cloud project, credentials, and the authorized change scope. A fresh clone runs mise run install first: validation, linting, and tests need tofu init providers and tflint --init rulesets.
  2. Edit minimally: change the smallest root module that owns the resource; keep one state per concern (one GCS prefix per small root module: smaller blast radius, faster plans).
  3. Check before planning: run mise run check and mise run test; tests stay offline only while every provider is mocked (the starter's mock_provider), otherwise plan-mode tests can authenticate, refresh state, and read data sources. Native tests over tests/*.tftest.hcl use command = plan (main.tftest.hcl); encode "must never happen" rules (public buckets, missing labels) as check:scan trivy findings or plan-test assertions.
  4. Plan explicitly: mise run plan writes tmp/plan.tfplan for the selected backend, workspace, and cloud target; feed secrets per State and secrets below. A plan can access APIs, state, and data sources, so keep plan and apply out of automatic gates.
  5. Review the plan: read tofu show tmp/plan.tfplan and flag every replacement, destroy, IAM change, and cost-relevant resource before asking for apply authority.
  6. Apply the reviewed plan when authorized: tofu apply tmp/plan.tfplan against the same target, then delete the saved plan.
  7. Verify: re-read the changed resources and run the same target's plan with its secret inputs, e.g. sops exec-env secrets.enc.env 'tofu plan -input=false -detailed-exitcode'; exit 0 means no remaining drift, 2 means pending changes, 1 is an error.

Read the full file on GitHub · 61 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. today Changed c85aec792f2f
  2. 4d ago Changed 6880c2c7cc4e
  3. 9d ago Changed · -2 lines b9af8b8a3a52
  4. 11d ago Changed 4bca80edc7d3
  5. 12d ago Changed · -7 lines · -2 tokens per session 8e00a248adf5
  6. 14d ago Changed 8d9f57541aa4
  7. 20d ago Changed 9202eeefc999
  8. 23d ago Changed d3cff11216c2
  9. 29d ago First seen · 70 lines · 22 tokens per session scan A 67afb522e061

Subscribe to this mod's changes

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

Other skills, from other repositories

cloud-run

Deploy container services to Google Cloud Run with Artifact Registry, keyless CI identity, Secret Manager, ko, or Dockerfiles.

fmind/dotfiles · 28 tokens

google-cloud-operations

Operate Google Cloud with gcloud: pin account, configuration, project, and billing context for IAM, APIs, logs, and audits outside deployment.

fmind/dotfiles · 34 tokens

terraform-stack

Canonical infrastructure-as-code stack — OpenTofu-first with tflint, trivy config scans, terraform-docs, native tests, and GCS state. Use for any Terraform or OpenTofu work.

fmind/dotfiles · 45 tokens

dotfiles-bootstrap

Bootstrap a workstation with the dotfiles framework. Takes a GitHub user / owner+repo / explicit clone URL and runs dot init (which shells out to chezmoi) with the right safety prompts. Honors the active agent profile (ask / plan / apply / audit) so it defaults to dry-run in safer modes and full apply in apply.

sebastienrousseau/dotfiles · 88 tokens

vibe

Delegate a coding task to a cheap AI model (Mistral Vibe by default, but any provider Vibe knows about — DeepSeek, Gemini Flash, etc.) and supervise the result via git diff. Claude orchestrates, the cheap model codes. Claude consumes 500-1500 tokens per delegation regardless of how many file reads the delegate does…

sebastienrousseau/dotfiles · 137 tokens

scaffold-terraform

Scaffold a Terraform infrastructure project with CI/CD (plan on PR, apply on push), AWS OIDC auth, .envrc, and standard files. Uses terraform CLI as the native tool. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating infrastructure repos, or when the user mentions…

urmzd/dotfiles · 115 tokens