Terraform
Skill 16 of 20
Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy).
1 minute · 185 words · 5 sections
Install
npx skills add hashicorp/agent-skills --skill terraform-policynpx skills add hashicorp/agent-skills/plugin marketplace add hashicorp/agent-skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
UTILITY SKILL — INVOKES: tfpolicy-author (opens in a new tab) | tfpolicy-test (opens in a new tab)
.policy.hcl policy from a description or requirement.sentinel policy to Terraform Policy.policytest.hcl test fileBefore giving authoring or testing instructions, check the installed tfpolicy CLI version and tailor guidance accordingly:
0.1.x, do not require policy { required_providers { ... } }; generate policies compatible with tfpolicy 0.1.x syntax and behavior.0.2.0 or newer, include a top-level policy { required_providers { ... } } block when authoring .policy.hcl. It is mandatory for tfpolicy validate; version-range validation is best effort, and wildcard targets such as resource_policy "*" are not schema-validated.0.1.x and 0.2.0+ paths..tftest.hcl files for Terraform modules — use terraform-testterraform-style-guide| Task | Sub-skill |
|---|---|
Write or convert a .policy.hcl policy | tfpolicy-author (opens in a new tab) |
Write or debug a .policytest.hcl test | tfpolicy-test (opens in a new tab) |
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-author
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-testWrite, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy, write a policy.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
plugins/terraform/skills/terraform-policy/SKILL.mdmain, last pushed 21 September 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: plugins/packer/skills/*/SKILL.md, plugins/terraform/skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by HashiCorp, declaring 2 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./hashicorp/agent-skills.md, and each skill at its own .md URL.54 files · 328 KB
Everything this skill ships beside its prose. 38 of them are set here as subchapters of skill 16; the other 16 are described rather than reproduced.
Documentation the agent loads on demand, rather than up front.
Everything else published alongside the skill.
examples/conversion/cloudfront-associated-with-waf/2 files · 1 KB
examples/conversion/cloudtrail-server-side-encryption-enabled/2 files · 1 KB
examples/conversion/dms-endpoint-should-be-ssl-configured/2 files · 1 KB
examples/conversion/dms-endpoints-should-use-ssl/2 files · 1 KB
examples/conversion/ec2-network-acl-should-have-subnet-ids/2 files · 2 KB
examples/conversion/ec2-vpc-default-security-group-no-traffic/2 files · 2 KB
examples/conversion/efs-access-point-should-enforce-user-identity/2 files · 1 KB
examples/conversion/elasticache-redis-replication-group-encryption-at-transit-enabled/2 files · 1 KB
examples/conversion/elasticsearch-encrypted-at-rest/2 files · 1 KB
examples/conversion/elasticsearch-https-required/2 files · 2 KB
examples/conversion/elasticsearch-in-vpc-only/2 files · 1 KB
examples/conversion/eventbridge-custom-event-bus-should-have-attached-policy/2 files · 2 KB
examples/conversion/s3-block-public-access-bucket-level/2 files · 2 KB
examples/conversion/s3-bucket-should-have-object-lock-enabled/2 files · 2 KB
examples/conversion/secretsmanager-auto-rotation-enabled-check/2 files · 2 KB
examples/conversion/step-functions-state-machine-logging-enabled/2 files · 1 KB
examples/1 file · 3 KB
16 SENTINELs · 33 KB. Bytes rather than text, so they are not reproduced here. Browse them on GitHub (opens in a new tab)