agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-terraform/SKILL.md

senior-terraform

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing, writing, reviewing, refactoring, or troubleshooting infrastructure as code with Terraform or OpenTofu (also Pulumi or CloudFormation concepts), including modules, providers, state and backends, workspaces, plans, drift, imports, moved blocks, variables and secrets, or policy checks.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    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. Distinctive:

    Read the current plan for the target environment before changing code.

    line 15
  2. Very specific:

    Never run apply, destroy, state rm/mv, or import against shared or production state without explicit authorization.

    line 16
  3. Distinctive:

    Keep modules focused with typed, validated variables and documented outputs.

    line 21
  4. Very specific:

    Use moved blocks for refactors and import blocks for adoption so resources are not destroyed and recreated.

    line 22
  5. Very specific:

    Never commit secrets; read them from a secret manager or variables marked sensitive.

    line 23
  6. Very specific:

    Prefer explicit dependencies through references.

    line 24
  7. Very specific:

    Run terraform fmt -check, validate, the project's linters and policy checks, and plan for each affected environment.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

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

Senior Terraform

Role

Change infrastructure through reviewed plans only: small modules, safe state handling, no accidental destroys, and no secrets in code or state outputs.

Before Editing

  1. Inspect Terraform/OpenTofu and provider versions, backend and state locking, module structure, environments (workspaces or directories), variable files, CI plan/apply flow, and policy tooling (tflint, tfsec/Trivy, Checkov, OPA).
  2. Read the current plan for the target environment before changing code; understand what already drifts.
  3. Never run apply, destroy, state rm/mv, or import against shared or production state without explicit authorization.

Implementation Rules

  • Pin required_version and provider versions; commit the lock file.
  • Keep modules focused with typed, validated variables and documented outputs. Avoid deep module nesting and hard-coded environment values.
  • Use moved blocks for refactors and import blocks for adoption so resources are not destroyed and recreated. Use prevent_destroy or lifecycle rules for critical data resources.
  • Never commit secrets; read them from a secret manager or variables marked sensitive. Remember state can contain secrets: use an encrypted remote backend with locking and restricted access.
  • Prefer explicit dependencies through references; use depends_on only when no reference exists. Avoid count/for_each key changes that recreate resources.
  • Tag resources consistently for ownership and cost.

Testing and Verification

Run terraform fmt -check, validate, the project's linters and policy checks, and plan for each affected environment. Read the plan: list every create, update, replace, and destroy and confirm each is intended.

Review Checklist

  • Does the plan contain any unexpected replace or destroy?
  • Are versions pinned and the lock file updated deliberately?
  • Are secrets kept out of code, outputs, and logs?
  • Is the change applied through the normal reviewed pipeline with a rollback path?

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.