writing-infrastructure-code

writing-infrastructure-code is a skill for Claude Code from ancoleman/ai-design-components. It costs 61 tokens per session (3,450 once invoked), scanned A, original, MIT.

A guide to Infrastructure as Code, a way to define and manage cloud resources with files or programs instead of setting them up manually. It covers Terraform, OpenTofu, Pulumi, and AWS CDK.

In plain words
What is it for?
Use it to provision networks, servers, databases, and storage; manage multi-cloud or hybrid systems; and connect infrastructure changes to CI/CD pipelines.
Why use it?
It helps make infrastructure repeatable, reviewable, and easier to manage across environments. It also explains shared state, reusable modules, and detecting changes made outside the code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the infrastructure-skills plugin — 12 skills shipped together

Good fit Use it to provision networks, servers, databases, and storage; manage multi-cloud or hybrid systems; and connect infrastructure changes to CI/CD pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ancoleman/ai-design-components/writing-infrastructure-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 ancoleman/ai-design-components --skill writing-infrastructure-code
Clone the repo
git clone --depth 1 https://github.com/ancoleman/ai-design-components

Made for: Claude Code.

Or install infrastructure-skills, the plugin that ships this one along with the rest of its 12 skills.

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 writing-infrastructure-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/ancoleman/ai-design-components/writing-infrastructure-code/github.svg)](https://agentmods.dev/skills/ancoleman/ai-design-components/writing-infrastructure-code)
Your own site
<a href="https://agentmods.dev/skills/ancoleman/ai-design-components/writing-infrastructure-code"><img src="https://agentmods.dev/badge/skills/ancoleman/ai-design-components/writing-infrastructure-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 writing-infrastructure-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/ancoleman/ai-design-components/writing-infrastructure-code"><img src="https://agentmods.dev/badge/skills/ancoleman/ai-design-components/writing-infrastructure-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,450 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.00061 $0.03450
Opus 5.5 $0.00024 $0.01380
Sonnet 5.5 $0.00012 $0.00690
Haiku 4.5 $0.00006 $0.00345

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

Security

Grade A, and why

writing-infrastructure-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 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (examples/pulumi/typescript/index.ts, scripts/drift-check.sh, scripts/validate-terraform.sh), 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.

skills/writing-infrastructure-code/SKILL.md · 486 lines

How it starts

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

Infrastructure as Code

Provision and manage cloud infrastructure using code-based automation tools. This skill covers tool selection, state management, module design, and operational patterns across Terraform/OpenTofu, Pulumi, and AWS CDK.

When to Use

Use this skill when:

  • Provisioning cloud infrastructure (compute, networking, databases, storage)
  • Migrating from manual infrastructure to code-based workflows
  • Designing reusable infrastructure modules
  • Implementing multi-cloud or hybrid-cloud deployments
  • Establishing state management and drift detection patterns
  • Integrating infrastructure provisioning into CI/CD pipelines
  • Evaluating IaC tools (Terraform vs Pulumi vs CDK)

Common requests:

  • "Create a Terraform module for VPC provisioning"
  • "Set up remote state with locking for team collaboration"
  • "Compare Pulumi vs Terraform for our use case"
  • "Design composable infrastructure modules"
  • "Implement drift detection for existing infrastructure"

Core Concepts

Infrastructure as Code Fundamentals

Key Principles:

  1. Declarative vs Imperative - Describe desired state (Terraform) or program infrastructure (Pulumi)
  2. Idempotency - Same input produces same output, safe to re-run
  3. Version Control - Infrastructure changes tracked in Git
  4. State Management - Track actual infrastructure state
  5. Module Composition - Reusable, versioned infrastructure components

Benefits:

  • Reproducibility (same code = same infrastructure)
  • Auditability (Git history shows all changes)
  • Collaboration (code reviews for infrastructure changes)
  • Automation (CI/CD deploys infrastructure)
  • Disaster recovery (rebuild from code)

Tool Selection Framework

Choose IaC tools based on team composition and cloud strategy:

Terraform/OpenTofu - Declarative, HCL-based

  • Multi-cloud and hybrid-cloud deployments
  • Operations/SRE teams prefer declarative approach
  • Largest provider ecosystem (AWS, GCP, Azure, 3000+ providers)
  • Mature module registry and community

Read the full file on GitHub · 486 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. 1mo ago First seen · 486 lines · 61 tokens per session scan A 936a6ece04e7

Subscribe to this mod's changes

writing-infrastructure-code is a skill published in the GitHub repository ancoleman/ai-design-components (524 stars, last pushed 10mo ago), licensed MIT. It adds 61 tokens to every session and 3,450 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-03.

Related

Other skills, from other repositories

cost-optimization

Audit and reduce infrastructure and tooling costs without sacrificing reliability or velocity. Use this skill when reviewing monthly cloud or SaaS spend, finding unused resources, rightsizing infrastructure, negotiating vendor contracts, deciding what to consolidate, or planning for budget cuts. Triggers on cost…

rampstackco/claude-skills · 101 tokens

monitoring-and-alerting

Design and run a monitoring system for a website or web app. Use this skill when setting up uptime checks, defining SLOs, configuring error tracking, choosing what to alert on, designing on-call rotations, or fixing alert fatigue. Triggers on monitoring, alerts, uptime, SLO, SLA, error rate, on-call, pager, alert…

rampstackco/claude-skills · 99 tokens

launch-runbook

Plan and execute a launch runbook covering pre-launch verification, go-live procedures, DNS cutover, post-launch monitoring, and rollback procedures. Use this skill whenever the user is preparing to launch a website or product, planning a DNS cutover, building a go-live checklist, or executing a launch day. Triggers…

rampstackco/claude-skills · 127 tokens

netlify-development

Best practices for building and deploying Netlify sites, covering serverless and edge functions, Netlify Blobs storage, the Image CDN, and build configuration. Use when writing Netlify Functions or Edge Functions, configuring netlify.toml or redirects/headers, managing environment variables across deploy contexts…

Mindrally/skills · 78 tokens

agents-v2-py

Build container-based Foundry Agents with Azure AI Projects SDK (ImageBasedHostedAgentDefinition). Use when creating hosted agents with custom container images in Azure AI Foundry.

lingxling/awesome-skills-cn · 39 tokens

cloudflare-development

Cloudflare Workers, Pages, KV, D1, R2, and Durable Objects development best practices for edge computing applications.

Mindrally/skills · 29 tokens