agentleFS
mmccallammccalla/coding-agent-skill-library/skills/infrastructure-as-code/SKILL.md

infrastructure-as-code

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Manages declarative infrastructure with plan/apply workflows, drift control, secrets hygiene and review. Use when defining or changing cloud or platform resources through IaC rather than click-ops or CI alone.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use containerization and test-driven-development.

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.
  • mmondoraSkill

    containerization

    Docker best practices for cloud-native applications. Multi-stage builds, distroless images, security scanning, non-root users, Cloud Run orchestration. Use when writing Dockerfiles, configuring container builds, or deploying to Cloud Run/GKE.

    Also in 3 projects that use this

  • OpenAISkill

    test-driven-development

    Use when implementing any feature or bugfix, before writing implementation code

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 6

    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
  1. Very specific:

    Do not use this skill only to design build and deploy pipelines — use ci-cd-and-automation for pipeline safety.

    line 18
  2. Very specific:

    Do not use it only for dependency and supply-chain controls — use secure-sdlc-and-supply-chain when that skill is available.

    line 19
  3. Very specific:

    Do not use it only to decide landing zone or tenancy topology — use cloud-platform-architecture for platform design, then implement with …

    line 20
  4. Very specific:

    Do not use it only for progressive delivery of application releases — use release-engineering-and-progressive-delivery.

    line 21
  5. Distinctive:

    Keep infrastructure reproducible, reviewable and least-privilege by expressing desired state declaratively, previewing changes with …

    line 25
  6. Very specific:

    Run a plan (or preview) and review the exact create/update/destroy set before apply.

    line 31
  7. Distinctive:

    Verify with the narrowest useful checks (plan in CI, policy-as-code, smoke tests) and state residual risk for any manual exception.

    line 36
  8. Distinctive:

    Do not apply infrastructure changes without a reviewed plan when the change can destroy or expose resources.

    line 70
  9. Distinctive:

    Do not commit secrets, private keys or unrestricted cloud credentials into IaC or state artefacts.

    line 71
  10. Distinctive:

    Do not use CI/CD skill guidance alone as a substitute for declarative desired state and drift control.

    line 72
  11. Distinctive:

    Do not leave production drift untracked after emergency click-ops.

    line 73
  12. Distinctive:

    Do not grant apply roles broader than the modules being changed.

    line 74
  13. Very specific:

    Do not pin to floating latest providers or modules for production without an explicit risk acceptance.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 10 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Infrastructure as Code

When to use

Use this skill when infrastructure must be defined, reviewed and applied as declarative code: compute, network, identity, data stores, platform baselines and shared services. Apply it to plan/apply (or equivalent preview/deploy) workflows, drift detection, module design, state management, secrets handling and peer review of infrastructure changes. Use it whenever click-ops would create untracked, non-reproducible environments.

When not to use

  • Do not use this skill only to design build and deploy pipelines — use ci-cd-and-automation for pipeline safety; IaC may be invoked from CI but remains a separate concern.
  • Do not use it only for dependency and supply-chain controls — use secure-sdlc-and-supply-chain when that skill is available.
  • Do not use it only to decide landing zone or tenancy topology — use cloud-platform-architecture for platform design, then implement with IaC.
  • Do not use it only for progressive delivery of application releases — use release-engineering-and-progressive-delivery.

Objective

Keep infrastructure reproducible, reviewable and least-privilege by expressing desired state declaratively, previewing changes with plan/apply discipline, controlling drift, protecting secrets and requiring review before privileged applies.

Procedure

  1. Express the desired infrastructure state in declarative code (for example Terraform, OpenTofu, Bicep, CloudFormation or Pulumi) under version control.
  2. Separate configuration by environment and blast radius; avoid a single state file that couples unrelated systems when practical.
  3. Run a plan (or preview) and review the exact create/update/destroy set before apply; treat unexpected destroys as stop-the-line events.
  4. Apply only through an approved path (local with explicit approval, or CI with constrained credentials); record who applied what and when.
  5. Manage secrets outside the repository: inject via a secrets manager or OIDC-federated roles; never commit credentials or long-lived keys in code or state that is broadly readable.
  6. Detect and remediate drift: reconcile click-ops changes back into code or destroy unauthorised resources according to policy.
  7. Require peer review for privileged modules (identity, network, production data stores) and pin provider/module versions intentionally.
  8. Verify with the narrowest useful checks (plan in CI, policy-as-code, smoke tests) and state residual risk for any manual exception.

Required outputs or templates

# IaC change record

## Scope
- Resources / modules:
- Environments:
- State backend:

## Plan summary
- Creates:
- Updates:
- Destroys:
- Unexpected changes: none / <list>

## Secrets and identity
- Credentials path: OIDC / secrets manager / other
- No secrets in repo or world-readable state: yes / no

## Review
- Reviewer:
- Policy-as-code / checks:

## Apply
- Path: CI / approved local
- Drift notes:
- Residual risk:

Rules

  • Do not apply infrastructure changes without a reviewed plan when the change can destroy or expose resources.
  • Do not commit secrets, private keys or unrestricted cloud credentials into IaC or state artefacts.
  • Do not use CI/CD skill guidance alone as a substitute for declarative desired state and drift control.
  • Do not leave production drift untracked after emergency click-ops; reconcile promptly.
  • Do not grant apply roles broader than the modules being changed.
  • Do not pin to floating latest providers or modules for production without an explicit risk acceptance.

Related skills

  • ci-cd-and-automation
  • secure-sdlc-and-supply-chain
  • cloud-platform-architecture
  • release-engineering-and-progressive-delivery

References

Verification

  • Desired state is expressed declaratively in version control.
  • Plan/apply (or equivalent) preview was reviewed before apply.
  • Secrets are not stored in the repository.
  • Drift handling is stated for any manual change.
  • Review and least-privilege apply path are documented.
  • Residual infrastructure risk is recorded.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.