devopsinfraascode
Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when: reviewing .prompt.md, .agent.md, SKILL.md, or .instructions.md files for contradictions, ambiguity, persona consistency, cognitive load, coverage gaps, and composition conflicts.
Use when: checking xanadAssistant workspace health, install status, repair reasons, or lockfile validity before proposing install, update, repair, or restore operations.
Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline.
Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security.
Use when: reviewing DevOps changes for pipeline safety, secret hygiene, permissions, rollback, and deployment risk.
Use when: writing or reviewing API and code documentation, including docstrings, OpenAPI patterns, and parameter tables.
| name | devopsInfraAsCode |
| description | Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection. |
| type | reference |
| version | 1.0 |
| license | MIT |
Skill metadata: version "1.0"; tags [devops, iac, terraform, pulumi]; recommended tools [].
Use this skill when writing or reviewing Terraform, Pulumi, or similar IaC definitions.
devopsContainersdevopsCiCdterraform plan output before terraform apply.infra/
main.tf # root module entry point
variables.tf # input variable declarations
outputs.tf # output value declarations
versions.tf # required_providers + terraform version constraint
modules/
networking/ # reusable module
database/
<project>-<environment>-<resource-type>-<purpose>
Example: myapp-prod-sg-api, myapp-staging-rds-main
variable "environment" {
description = "Deployment environment (dev, staging, prod)."
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "environment must be dev, staging, or prod."
}
}
description and type.validation blocks for values with a bounded set.default = "" as a placeholder — omit default to make the variable required.terraform {
backend "s3" {
bucket = "myapp-tfstate"
key = "prod/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "myapp-tfstate-lock" # required for locking
encrypt = true
}
}
terraform.tfstate or terraform.tfstate.backup to git.version = "~> 3.0".Run terraform plan in CI on a schedule (not just on PR) to detect out-of-band changes:
- name: Drift check
run: terraform plan -detailed-exitcode
# Exit code 2 = changes present — fail the check
| Anti-pattern | Fix |
|---|---|
| Hardcoded AWS account IDs or region strings | Use data.aws_caller_identity and variables |
count = 0 to disable a resource | Use for_each with an empty map |
Secrets in .tfvars committed to git | Use a secrets manager or CI secret injection |
terraform apply without plan in CI | Always plan first; require approval for prod |
| No version constraints on providers | Pin: version = "~> 5.0" |