gracefullight/pkgs / .agents/skills/oma-tf-infra
oma-tf-infra
VerifiedCreate or review Terraform infrastructure and plans. Use for cloud resources, IAM, networking, state management, and infrastructure changes.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.0 KB |
| resources/checklist.md | markdown | 2.3 KB |
| resources/cost-optimization.md | markdown | 13.2 KB |
| resources/error-playbook.md | markdown | 2.8 KB |
| resources/examples.md | markdown | 1.5 KB |
| resources/execution-protocol.md | markdown | 6.1 KB |
| resources/iso-42001-infra.md | markdown | 6.8 KB |
| resources/multi-cloud-examples.md | markdown | 6.4 KB |
| resources/policy-testing-examples.md | markdown | 6.8 KB |
resources/execution-protocol.md
View on GitHub# TF Infra Agent: Execution Protocol
## Preparation
Use the task's scope, existing project conventions, and acceptance criteria. Follow `../../_shared/core/execution-policy.md` when it has not already been supplied. Read only references needed by the selected operation; consult lessons or recovery guides for an observed issue. Expand planning depth only when the change requires it.
## Step 1: Analyze
1. **Identify Cloud Provider**: Detect from `provider.tf`, backend config, or existing resources
2. Scan existing Terraform files for naming conventions, module patterns, and state configuration
3. Identify required services, resource dependencies, and security constraints
4. Load domain-specific references:
- `multi-cloud-examples.md` when creating compute, OIDC, or secret resources
- `cost-optimization.md` when sizing or cost review is needed
- `policy-testing-examples.md` when setting up policy enforcement or tests
- `iso-42001-infra.md` when AI governance, continuity, or architecture documentation is required
5. List assumptions and unknowns
## Step 2: Plan
1. Define resource naming using project conventions and `locals` block:
| Resource Type | Pattern | Examples |
|--------------|---------|----------|
| Compute | `{prefix}-{service}` | `fs-dev-api`, `fs-prod-web` |
| Database | `{prefix}-db` | `fs-dev-db`, `fs-prod-postgres` |
| Storage | `{prefix}-{purpose}` | `fs-dev-assets`, `fs-dev-tfstate` |
| IAM Role/SA | `{prefix}-{role}` | `fs-dev-api-role`, `fs-dev-deployer` |
| Network | `{prefix}-{type}` | `fs-dev-vpc`, `fs-dev-subnet` |
2. Plan file structure following project patterns:
```
apps/infra/
├── provider.tf # Provider configuration
├── versions.tf # Version constraints
├── variables.tf # Input variables
├── locals.tf # Local values and naming
├── backend.tf # State backend
├── compute.tf # Compute resources
├── database.tf # Databases
├── storage.tf # Object storage
├── networking.tf # VPC, subnets, LB, CDN
├── messaging.tf # Queues and messaging
├── iam.tf # IAM roles and policies
├── cicd-auth.tf # OIDC/workload identity
├── security.tf # Security groups, WAF, secrets
├── outputs.tf # Output values
└── terraform.tfvars # Variable values (gitignored)
```
3. Plan module interfaces following composability principles:
```
modules/
├── vpc/ # Reusable VPC module
│ ├── main.tf
│ ├── variables.tf
│ ├── outputs.tf
│ └── README.md
├── database/ # Reusable database module
└── compute/ # Reusable compute module
```
- Expose required variables only; provide sensible defaults for optional
- Export essential outputs only
- Document all inputs/outputs in README.md
- Version modules using Git tags or Terraform Registry
4. Choose an environment separation strategy:
- Prefer directory-per-environment (`envs/dev`, `envs/prod`) with isolated state backends for team setups
- CLI workspaces only for lightweight, same-config variants (shared backend is a blast-radius risk)
- Consider Terragrunt when many environments share identical module wiring
5. Identify security requirements (IAM, encryption, network boundaries)
6. Estimate cost impact for new resources (run Infracost when available)
## Step 3: Implement
1. Create/modify .tf files in dependency order (provider → backend → networking → compute → outputs)
2. Use `locals` for environment-specific naming and tags
3. Apply consistent tags: Environment, Project, Owner, CostCenter
4. Use `for_each` over `count` for resource collections
5. Set `depends_on` for explicit resource ordering where needed
6. Design composable modules with:
- Required variables only, sensible defaults for optional
- Essential outputs only
- Documented inputs/outputs
7. Run `terraform validate` and `terraform fmt`
8. Run `terraform plan` and review output
## Infrastructure Testing Levels
| Level | Tool | Purpose |
|-------|------|---------|
| Unit | `terraform validate` | Syntax, variable types |
| Static Analysis | TFLint, Checkov, Trivy (`trivy config`) | Best practices, security |
| Module Tests | `terraform test` (TF >= 1.6, `.tftest.hcl`) | Module logic via plan/apply assertions |
| Integration | Terratest | Resource creation verification |
| Compliance | OPA/Sentinel | Organizational policy enforcement |
| E2E | Custom scripts | Full workflow validation |
See `policy-testing-examples.md` for native `terraform test`, Terratest, and CI/CD integration examples.
## Step 4: Verify
1. Run `checklist.md` self-verification
2. Use applicable `../../_shared/core/common-checklist.md` sections for cross-domain checks
3. Confirm:
- `terraform validate` passes
- `terraform plan` shows expected changes only
- No secrets in .tf files
- All resources tagged
- IAM follows least privilege
- Cost impact acceptable
4. For AI systems: verify IAM, logging, encryption, monitoring, and retention controls documented
5. For continuity: verify RTO/RPO, failover, backup, and restore documented
## Output Format
When creating new infrastructure, provide:
1. Cloud provider identified from context
2. Complete HCL code blocks for each resource
3. Required variable definitions with types and descriptions
4. Outputs for resource IDs and endpoints
5. Migration notes if importing existing resources
6. Cost estimation considerations
7. For AI systems: infrastructure control notes covering access, logging, encryption, monitoring, and retention
8. For continuity-sensitive systems: RTO/RPO, failover, backup, and restore notes
9. For architecture documentation requests: stakeholder/concern/view/rationale notes
When reviewing terraform plan, provide:
1. Summary of changes (add/change/destroy counts)
2. Risk assessment for destructive changes
3. Provider-specific considerations
4. Confirmation checklist before apply
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |