Writes, tests, and converts Terraform Policy files (.policy.hcl, .policytest.hcl) and migrates Sentinel policies to tfpolicy.
How this skill is triggered — by the user, by Claude, or both
Slash command
/terraform-policy-code:terraform-policyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**UTILITY SKILL** — INVOKES: [tfpolicy-author](references/tfpolicy-author.md) | [tfpolicy-test](references/tfpolicy-test.md)
README.mdevals/eval.yamlevals/tasks/negative-trigger-1.yamlevals/tasks/positive-trigger-1.yamlevals/tasks/positive-trigger-2.yamlexamples/README.mdexamples/conversion/cloudfront-associated-with-waf/README.mdexamples/conversion/cloudfront-associated-with-waf/cloudfront-associated-with-waf.policy.hclexamples/conversion/cloudfront-associated-with-waf/cloudfront-associated-with-waf.sentinelexamples/conversion/cloudtrail-server-side-encryption-enabled/README.mdexamples/conversion/cloudtrail-server-side-encryption-enabled/cloudtrail-server-side-encryption-enabled.policy.hclexamples/conversion/cloudtrail-server-side-encryption-enabled/cloudtrail-server-side-encryption-enabled.sentinelexamples/conversion/dms-endpoint-should-be-ssl-configured/README.mdexamples/conversion/dms-endpoint-should-be-ssl-configured/dms-endpoint-should-be-ssl-configured.policy.hclexamples/conversion/dms-endpoint-should-be-ssl-configured/dms-endpoint-should-be-ssl-configured.sentinelexamples/conversion/dms-endpoints-should-use-ssl/README.mdexamples/conversion/dms-endpoints-should-use-ssl/dms-endpoints-should-use-ssl.policy.hclexamples/conversion/dms-endpoints-should-use-ssl/dms-endpoints-should-use-ssl.sentinelexamples/conversion/ec2-network-acl-should-have-subnet-ids/README.mdexamples/conversion/ec2-network-acl-should-have-subnet-ids/ec2-network-acl-should-have-subnet-ids.policy.hclUTILITY SKILL — INVOKES: tfpolicy-author | tfpolicy-test
.policy.hcl policy from a description or requirement.sentinel policy to Terraform Policy.policytest.hcl test file.tftest.hcl files for Terraform modules — use terraform-testterraform-style-guide| Task | Sub-skill |
|---|---|
Write or convert a .policy.hcl policy | tfpolicy-author |
Write or debug a .policytest.hcl test | tfpolicy-test |
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-author
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-test
npx claudepluginhub hashicorp/agent-skills --plugin terraform-policy-codeGenerates executable compliance policies from natural language inputs in OPA Rego, AWS Config Rules (Python), Sentinel, Terraform, or Checkov formats. Useful for IaC security and CI/CD governance.
Guides best-practice authoring and provides a read-only policy gate for AWS Terraform generated by migration skills. Loads during terraform/ directory phases to enforce security posture and produce deterministic policy verdicts.
Guides Terraform and OpenTofu best practices for module hierarchy, testing approaches, CI/CD integration, and production patterns. Useful for structuring IaC projects and reviewing configurations.