iac
Skill1 starsChanged 9 months agoMITView on GitHub
Designs and reviews Infrastructure as Code - Terraform/Pulumi/CloudFormation patterns, state management, module design, change safety, and drift detection. Use when provisioning infrastructure, reviewing IaC changes, or debugging infrastructure issues.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
- acartine/ostermantheir own version, first seen Jan 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ffsshhttiikk/opencode-agents-skills★ 2same name
- acartine/osterman★ 1same name
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 repository48 other files it gives its agents.
- accessibilitySkill
- api-designSkill
- api-integrationSkill
- architectSkill
- async-patternsSkill
- best-practicesSkill
- bugSkill
- buildSkill
- cachingSkill
- ci-cdSkill
- config-managementSkill
- containerizeSkill
- database-designSkill
- data-modelingSkill
- data-pipelineSkill
- debug-latencySkill
- dependency-updateSkill
- deploySkill
- dev-setupSkill
- docsSkill
- error-handlingSkill
- estimateSkill
- feature-flag-opsSkill
- git-recoverySkill
- i18nSkill
- incidentSkill
- load-testingSkill
- loggingSkill
- migrateSkill
- monitoringSkill
- observability-debugSkill
- onboardSkill
- perfSkill
- phase-gateSkill
- pr-authorSkill
- qaSkill
- refactorSkill
- reviewSkill
- rollbackSkill
- schema-evolutionSkill
- scope-checkSkill
- security-auditSkill
- state-managementSkill
- tech-debtSkill
- tech-stackSkill
- telemetrySkill
- testingSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Everything in code: If it exists in production, it's defined in code.
- Distinctive: line 13
Plan before apply: Always review the diff before making changes.
- Distinctive: line 112
Inputs are explicit: - no hardcoded values inside modules
- Distinctive: line 116
Version your modules: - use git tags or registry versions
- Very specific: line 155
Never hardcode secrets in IaC files: Not even in .tfvars.
- Distinctive: line 166
When someone makes a manual change that doesn't match the code:
- Distinctive: line 172
If there's drift:
- Distinctive: line 174
If manual change was correct: update the code to match
- Distinctive: line 195
Never apply without a plan review
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Infrastructure as Code
IaC makes infrastructure reproducible, reviewable, and version-controlled. It also makes it possible to delete your production database with a typo. Respect the power.
Core Principles
- Everything in code. If it exists in production, it's defined in code. No manual console changes.
- Plan before apply. Always review the diff before making changes. Always.
- Small changes. One concern per PR. Don't refactor modules while adding a new service.
- Immutable infrastructure. Replace, don't mutate. New AMI > patch existing server.
- Blast radius awareness. Know what a change can destroy before you apply it.
Tool Comparison
| Feature | Terraform | Pulumi | CloudFormation | CDK |
| Language | HCL | Python/TS/Go | YAML/JSON | Python/TS |
| State | Remote (S3, etc.) | Pulumi Cloud / self-managed | AWS-managed | AWS-managed |
| Multi-cloud | Yes | Yes | AWS only | AWS only |
| Learning curve | Low-medium | Lower (real language) | Medium | Medium |
| Community | Largest | Growing | AWS-focused | AWS-focused |
Project Structure
infrastructure/
├── modules/ # Reusable modules
│ ├── vpc/
│ ├── database/
│ ├── service/
│ └── monitoring/
├── environments/ # Environment-specific config
│ ├── dev/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── terraform.tfvars
│ ├── staging/
│ └── production/
├── global/ # Shared resources (DNS, IAM)
└── README.mdRules:
- Separate state per environment (dev state can't affect prod)
- Modules are reusable (same module, different parameters per env)
- Environment differences are in variables, not in code duplication
State Management
State is the mapping between your code and real infrastructure. Lose it or corrupt it and you're in trouble.
Remote State (Required for Teams)
# Terraform: S3 + DynamoDB for locking
terraform {
backend "s3" {
bucket = "mycompany-terraform-state"
key = "production/main.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-locks"
encrypt = true
}
}State Rules
- Never edit state manually (unless you truly understand the consequences)
- Lock state during operations (prevents concurrent modifications)
- Encrypt state at rest (it contains secrets and resource details)
- Separate state per environment (one state file per env)
- Back up state (enable versioning on the state bucket)
State Operations (Use Rarely, Carefully)
# Import existing resource into state
terraform import aws_s3_bucket.my_bucket my-existing-bucket
# Remove resource from state (without destroying it)
terraform state rm aws_s3_bucket.my_bucket
# Move resource within state (rename without destroy/recreate)
terraform state mv aws_s3_bucket.old_name aws_s3_bucket.new_nameModule Design
Good Module
module "api_service" {
source = "../modules/service"
name = "order-api"
environment = "production"
image = "order-api:v1.2.3"
cpu = 512
memory = 1024
port = 3000
replicas = 3
database_url = module.database.connection_string
vpc_id = module.vpc.id
subnet_ids = module.vpc.private_subnet_ids
}Module Principles
- Inputs are explicit - no hardcoded values inside modules
- Outputs expose what consumers need - connection strings, IDs, ARNs
- Defaults are sensible - dev-friendly defaults, override for prod
- Scope is clear - a module does one thing (a service, a database, a VPC)
- Version your modules - use git tags or registry versions
Change Safety
The Plan Review
terraform plan -out=tfplan # Always save the planIn the plan output, check:
+ create- new resources (usually safe)~ update in-place- modify existing (review what's changing)-/+ destroy and recreate- DANGEROUS - resource will be deleted and recreated- destroy- DANGEROUS - resource will be deleted
Dangerous Changes (Require Extra Review)
| Change | Risk | Mitigation |
| Rename a resource | Destroy + recreate | Use moved block or state mv |
| Change resource type | Destroy + recreate | Import new, remove old from state |
| Modify immutable fields | Destroy + recreate | Check if the field triggers replacement |
| Remove a resource | Deletion | Verify it's truly unused |
| Change database instance type | Potential downtime | Check if it requires restart |
| Modify security groups | Access changes | Review rules before and after |
Protect Critical Resources
resource "aws_rds_instance" "production" {
# ...
lifecycle {
prevent_destroy = true # Terraform will refuse to destroy this
}
}Secrets in IaC
Never hardcode secrets in IaC files. Not even in .tfvars.
| Approach | How |
| Environment variables | TF_VAR_database_password |
| Secret manager reference | data.aws_secretsmanager_secret_version |
| CI/CD secrets | Injected during pipeline execution |
| SOPS / age | Encrypted files in repo, decrypted at apply time |
Drift Detection
When someone makes a manual change that doesn't match the code:
terraform plan # Shows diff between code and realityIf there's drift:
- Don't just apply - understand what changed and why
- If manual change was correct: update the code to match
- If manual change was wrong: apply to restore code's state
- Prevent future drift: enforce "no console changes" policy, use CI/CD for all changes
CI/CD for Infrastructure
PR opened:
→ terraform fmt -check (formatting)
→ terraform validate (syntax)
→ terraform plan (show what would change)
→ Post plan output as PR comment
PR merged to main:
→ terraform plan (regenerate)
→ Manual approval gate (for production)
→ terraform apply
→ Verify health checksRules:
- Never apply without a plan review
- Production requires manual approval
- Plan output visible in PR (reviewers see what will change)
- State locking prevents concurrent applies
Reference:
reference/iac-patterns.md- tool comparison, state management strategies, module patterns, common resource table, drift remediation, secrets handling, tagging strategy.
Review Checklist
- Plan reviewed - no unexpected destroys or recreates
- Secrets not hardcoded (using secret manager or env vars)
- Critical resources have
prevent_destroy - State is remote, encrypted, and locked
- Module inputs are explicit (no hidden assumptions)
- Environment differences are in variables, not code
- Naming is consistent and includes environment
- Tags applied for cost tracking and ownership
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.

