infrastructure-as-code
Skill8 starsChanged 9 days agoMITView on GitHub
Writes and changes cloud infrastructure safely with Terraform/OpenTofu, Bicep, Pulumi, or CloudFormation/CDK - remote state, pinned modules and providers, plan review before apply, replacement and data-loss checks, drift, imports, policy scanning and CI. Use when editing .tf, .bicep, Pulumi or CDK code, reviewing a plan or what-if output, setting up state backends, importing existing resources, or building an IaC pipeline. Not for Kubernetes manifests (use kubernetes-deployments).
15 other projects use a version of this.
Adopted by
Most recently taken up by
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- pfangueiro/claude-code-agentstheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- Indium-AI-Labs/indium-agentkittheir own version, first seen Nov 1, 2026
- KMaruthi2002/universal-llm-skillstheir own version, first seen Oct 25, 2026
- Ionate-Technologies/indium-agentkittheir own version, first seen Oct 20, 2026
Used with
Projects with it also use data-pipeline-design, feature-flag-lifecycle and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Indium-AI-LabsSkilldata-pipeline-design
Design batch or incremental ETL and ELT pipelines and warehouse models: grain, partitioning, idempotent loads, late-arriving data, data quality tests, PII controls, and cost monitoring, before building them. Use when adding or changing a dbt model, warehouse table, scheduled transformation, or ingestion job. Not for transactional schema design (use the database-design skill) or event-sourced stores (use the event-sourcing-architecture skill).
Also in 3 projects that use this
WanbinyuSkillfeature-flag-lifecycle
Manage feature flag add, rollout, and removal. Use when introducing flags or cleaning old flags, or Chinese "特性开关", "feature flag", "灰度", "删 flag". Prevent eternal flags.
Also in 3 projects that use this
PantaniSkillmcp-server-development
Implementation patterns for the ableton-mind TypeScript MCP server: Zod tools, resources, prompts, bridge client, verify loop, transactions and idempotency.
Also in 3 projects that use this
ffsshhttiikkSkillquery-optimization
Database query optimization
Also in 3 projects that use this
dkprogSkilldependency-management
Apply when wiring dependencies, integrating external services, or designing interfaces between modules. Ensures loose coupling through dependency injection, interface segregation, and proper abstraction boundaries.
Also in 4 projects that use this
travisjneumanSkilldata-engineering
ETL/ELT pipelines, data warehousing (BigQuery, Snowflake, Redshift), stream processing (Kafka, Spark Streaming), orchestration (Airflow, Dagster, Prefect), dbt transformations, and data lake architecture. Use when building data pipelines, designing warehouse schemas, or implementing real-time data processing.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- kid-sid/claude-spellbook★ 190same name
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
- robisson/build-like-amazon-agent-skills★ 16same name
- drewid74/ai_skills★ 8same name
- pfangueiro/claude-code-agents★ 7same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- AxlZero21/Skills★ 1same name
- jasoncrawford/claude-skills★ 1same name
- KMaruthi2002/universal-llm-skills★ 1same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- api-designSkill
- auth-implementationSkill
- background-jobsSkill
- building-agentsSkill
- caching-strategiesSkill
- ci-cd-pipelinesSkill
- cloud-cost-optimizationSkill
- codebase-onboardingSkill
- code-review-changesSkill
- concurrency-patternsSkill
- database-migrationsSkill
- database-schema-designSkill
- database-testingSkill
- data-pipelinesSkill
- data-privacy-retentionSkill
- dependency-upgradesSkill
- design-docsSkill
- design-systemsSkill
- dockerfilesSkill
- domain-driven-designSkill
- event-driven-architectureSkill
- file-storage-uploadsSkill
- frontend-securitySkill
- git-workflowSkill
- graphql-apisSkill
- grpc-servicesSkill
- incident-responseSkill
- internationalizationSkill
- kubernetes-deploymentsSkill
- large-scale-migrationsSkill
- legacy-refactoringSkill
- llm-evalsSkill
- llm-integrationSkill
- mcp-serversSkill
- micro-frontendsSkill
- ml-experimentsSkill
- monorepo-managementSkill
- nosql-designSkill
- observabilitySkill
- orm-patternsSkill
- performance-profilingSkill
- postgres-operationsSkill
- rag-systemsSkill
- react-patternsSkill
- realtime-apisSkill
- resilience-patternsSkill
- root-cause-debuggingSkill
- search-integrationSkill
- security-auditSkill
- seo-and-ssrSkill
- sql-optimizationSkill
- system-designSkill
- test-strategySkill
- threat-modelingSkill
- typescript-patternsSkill
- unit-testingSkill
- verify-before-doneSkill
- web-accessibilitySkill
- web-performanceSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 32
Before asking, show the user a summary of the plan: counts of add/change/destroy and every replacement or deletion by name.
- Distinctive: line 44
Default: follow what the repository already uses.
- Distinctive: line 49
Make the smallest change: Follow existing module structure and naming.
- Distinctive: line 74
Always confirm the selected workspace/stack and cloud account before planning.
- Very specific: line 80
Keep modules small and purposeful (a network, a database, a service).
- Distinctive: line 81
Don't wrap a single resource in a module just to rename its arguments.
- Very specific: line 87
Stop managing a resource without deleting it with a removed block or terraform state rm (confirm first).
- Distinctive: line 98
No secrets in code or committed variable files.
- Distinctive: line 99
Prefer resources that generate and store secrets inside the cloud (managed identities, generated DB passwords stored in a vault) over …
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Infrastructure as Code
Infrastructure code deletes real things. The plan (or what-if / preview / diff) is the source of truth for what will happen, so read it every time, and never apply, destroy or change state without the user's explicit confirmation.
When to use
- Writing or modifying Terraform/OpenTofu, Bicep/ARM, Pulumi, CloudFormation or CDK code.
- Reviewing a plan before it is applied.
- Setting up state, environments, modules or an IaC CI pipeline.
- Importing hand-made resources into code, or fixing drift.
Safety rules (read first)
The agent may run without asking: formatting, validation, linting, scanning, and plan/preview commands that do not change infrastructure (terraform fmt, validate, plan; az deployment group what-if; pulumi preview; cdk diff, cdk synth).
The agent must stop and get explicit confirmation before:
terraform apply/tofu apply/destroy, any-auto-approveterraform state rm,state mv,import(CLI),force-unlock,taint/-replaceaz deployment ... create(and never--mode Completewithout a separate, explicit OK: it deletes resources not in the template)az stack ... create/set/delete(deployment stacks), especially with--action-on-unmanage deleteResourcesordeleteAll, which delete resourcespulumi up,pulumi destroy,pulumi state deletecdk deploy,cdk destroy, executing a CloudFormation change set- Any command against a production account, subscription or project, including read-only
plan/what-if, unless the user has already said the agent may use production credentials for previews
Before asking, show the user a summary of the plan: counts of add/change/destroy and every replacement or deletion by name.
Choose the tool
| Tool | Clouds | Language | State | Preview command |
| Terraform | Any (large provider ecosystem) | HCL | State file in a backend | terraform plan |
| OpenTofu | Same as Terraform (open-source fork, MPL license) | HCL | State file; supports client-side state encryption | tofu plan |
| Bicep (compiles to ARM) | Azure | Bicep DSL | Azure itself (no state file) | az deployment group what-if |
| Pulumi | Any | TypeScript, Python, Go, C#, Java, YAML | Pulumi Cloud or self-managed backend | pulumi preview --diff |
| CloudFormation / CDK | AWS | YAML/JSON / TS, Python, Java, C#, Go | AWS (stacks) | Change sets / cdk diff |
Default: follow what the repository already uses. For a new multi-cloud or multi-vendor setup choose Terraform or OpenTofu; for Azure-only teams Bicep is a strong option; for AWS-only teams that want a general-purpose language, CDK.
Workflow for a change
- Find the root module / stack and environment you are changing, and which backend and account it targets. Confirm the target with the user if it could be production.
- Make the smallest change. Follow existing module structure and naming. Add tags/labels the repo requires (owner, environment, cost center).
- Format and validate:
terraform fmt -recursiveandterraform validate(ortofu),az bicep build --file main.bicep,pulumi preview,cdk synth. - Lint and scan (see Policy and scanning).
- Produce a plan and save it:
terraform plan -out=tfplan, then read it withterraform show tfplan(orterraform show -json tfplanfor tooling). - Review the plan with references/plan-review-checklist.md. Look first for
destroy,must be replacedand# forces replacement. - Summarize for the user: what changes, every deletion/replacement, data-loss risk, downtime risk, cost impact if known.
- Apply only the reviewed plan, only after confirmation:
terraform apply tfplan. Applying a saved plan guarantees you apply what was reviewed. - Verify the resources and the application after apply, and that a fresh plan shows no changes.
State
- Use a remote backend with locking: S3 (Terraform 1.10+ supports S3-native lock files with
use_lockfile = true; older setups use a DynamoDB lock table, now deprecated, so check the version),azurerm(Blob Storage lease locking),gcs, or HCP Terraform / Terraform Enterprise. Pulumi: Pulumi Cloud or an object-storage backend. - State contains secrets in plain text (passwords, keys, connection strings). Encrypt the bucket/container, restrict access to the pipeline and a few admins, enable versioning for recovery.
sensitive = trueonly hides values from CLI output. They are still in state.- Never commit
*.tfstate,*.tfstate.backup,.terraform/, or tfvars files that contain secrets. Do commit.terraform.lock.hcl. - One state per environment and per blast radius. A single giant state makes every plan slow and every mistake big.
Environments
| Approach | Good for | Watch out |
| Separate root directories (or stacks) per environment, sharing modules | Production isolation, different backends and credentials per env | Some duplication of root config |
| Terraform CLI workspaces | Short-lived or identical copies (feature environments) | Same backend and credentials; easy to run in the wrong workspace; not strong isolation |
| Separate accounts / subscriptions / projects per environment | Strongest isolation (recommended for prod) | More setup; needs automation |
Always confirm the selected workspace/stack and cloud account before planning.
Versions and modules
- Pin Terraform/OpenTofu with
required_versionand providers withrequired_providers(version = "~> 5.0"style constraints). Upgrade providers deliberately (seedependency-upgrades), regenerating the lock file withterraform init -upgradeand reviewing the diff. - Pin modules: registry modules with
version, git modules with?ref=a tag or commit SHA. Never track a moving branch. - Keep modules small and purposeful (a network, a database, a service). Expose variables with types, descriptions and
validationblocks; output only what callers need. - Don't wrap a single resource in a module just to rename its arguments.
Refactoring without destroying
- Renaming or moving resources changes their address, which plans as destroy + create. Use
movedblocks (Terraform) or aliases (Pulumi) so state follows the code. - Bring existing resources under management with
importblocks (Terraform 1.5+) orpulumi import, then iterate until the plan shows no changes. - Stop managing a resource without deleting it with a
removedblock orterraform state rm(confirm first). - Protect critical resources:
lifecycle { prevent_destroy = true }, CloudFormationDeletionPolicy: RetainorSnapshot, Azure resource locks, deletion protection flags on databases.
Drift
- Detect:
terraform plan -refresh-only, or a scheduledterraform plan -detailed-exitcodein CI (exit code 2 means changes are pending).pulumi refresh --preview-only; CloudFormation drift detection; Bicep what-if. - Decide per difference: update code to match reality, or re-apply code to undo the manual change. Ask the user which; manual changes are sometimes emergency fixes.
- Reduce drift by removing console write access for managed resources.
Secrets
- No secrets in code or committed variable files. Read them from a secret manager (data sources), or pass via the pipeline's secret store.
- Prefer resources that generate and store secrets inside the cloud (managed identities, generated DB passwords stored in a vault) over passing values through IaC.
Policy and scanning
| Purpose | Tools |
| Lint | tflint (provider rule sets), az bicep lint, cfn-lint |
| Security misconfiguration | Checkov, Trivy (trivy config .; tfsec's checks now live in Trivy), KICS |
| Policy as code | OPA/Conftest on plan JSON, Sentinel (HCP Terraform), Azure Policy, AWS Config rules |
| Cost diff in PRs | Infracost (see cloud-cost-optimization) |
CI/CD flow
- On pull request:
fmt -check,validate, lint, scan,planfor each affected environment; post a plan summary on the PR. - Require review of the plan, not just the code.
- On merge: apply the saved plan from the same commit, with a manual approval gate for production.
- Authenticate the pipeline to the cloud with OIDC federation, not long-lived keys (see
ci-cd-pipelines). - Allow only one apply per state at a time (pipeline concurrency group plus state locking).
Anti-patterns
- Applying without reading the plan, or running
applythat re-plans instead of applying the reviewed plan. - Ignoring
forces replacementon databases, disks, DNS zones or networks. Replacement can mean data loss and downtime. - Hand-editing state or using
state rmto "fix" errors without understanding why. - Click-ops on managed resources, which then get reverted on the next apply.
- One state for everything, so a typo in a tag plan touches the production database.
- Unpinned providers and modules, so the same code plans differently next week.
- Secrets in tfvars committed to git.
--mode Complete/destroyused as cleanup without listing what will be deleted.
Done when
- Code is formatted, validates, and passes lint and security scans (or findings are explained).
- A saved plan has been reviewed; every delete and replacement is listed and approved by the user.
- Apply ran only after explicit confirmation, and a follow-up plan shows no changes.
- State is remote, locked, encrypted and not in git; versions are pinned and the lock file is committed.
References
- references/plan-review-checklist.md — read before summarizing any plan, what-if, preview or diff for the user.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

