[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FJBP6DNHTTK8316D986VSY":3,"skill-same:01M6FJBP6DNHTTK8316D986VSY":53},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6FJBP6DNHTTK8316D986VSY","terraform-best-practices",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fterramate-io\u002Fagent-skills\u002Fterraform-best-practices\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[23,24,25],"best practices","terraform","terraform best practices","2026-11-10 10:12:30",false,"# Terraform Best Practices\n\nComprehensive optimization guide for Terraform and Infrastructure as Code, maintained by Terramate. Contains 37 rules across 10 categories, prioritized by impact to guide automated refactoring and code generation.\n\n## When to Apply\n\nReference these guidelines when:\n- Writing new Terraform modules or configurations\n- Implementing infrastructure patterns (AWS, GCP, Azure, etc.)\n- Reviewing code for security and reliability issues\n- Refactoring existing Terraform\u002FOpenTofu code\n- Optimizing state management and performance\n- Setting up team workflows and governance\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Organization & Workflow | CRITICAL | `org-` |\n| 2 | State Management | CRITICAL | `state-` |\n| 3 | Security Best Practices | CRITICAL | `security-` |\n| 4 | Module Design | HIGH | `module-` |\n| 5 | Resource Organization | MEDIUM-HIGH | `resource-` |\n| 6 | Variable & Output Patterns | MEDIUM | `variable-`, `output-` |\n| 7 | Language Best Practices | MEDIUM | `language-` |\n| 8 | Provider Configuration | MEDIUM | `provider-` |\n| 9 | Performance Optimization | LOW-MEDIUM | `perf-` |\n| 10 | Testing & Validation | LOW | `test-` |\n\n## Quick Reference\n\n### 1. Organization & Workflow (CRITICAL) - 5 rules\n\n- `org-version-control` - All Terraform code in version control\n- `org-workspaces` - One workspace per environment per configuration\n- `org-access-control` - Control who can change what infrastructure\n- `org-change-workflow` - Formal process for infrastructure changes\n- `org-audit-logging` - Track all infrastructure changes\n\n### 2. State Management (CRITICAL) - 3 rules\n\n- `state-remote-backend` - Always use remote state backends\n- `state-locking` - Enable state locking to prevent corruption\n- `state-import` - Import existing infrastructure into Terraform\n\n### 3. Security Best Practices (CRITICAL) - 3 rules\n\n- `security-no-hardcoded-secrets` - Never hardcode secrets in code\n- `security-credentials` - Use proper credential management (OIDC, Vault, IAM roles)\n- `security-iam-least-privilege` - Follow least privilege principle\n\n### 4. Module Design (HIGH) - 5 rules\n\n- `module-single-responsibility` - One module per logical component\n- `module-naming` - Use consistent naming conventions (terraform-\u003CPROVIDER>-\u003CNAME>)\n- `module-versioning` - Version all module references\n- `module-composition` - Compose modules like building blocks\n- `module-registry` - Use existing community\u002Fshared modules\n\n### 5. Resource Organization (MEDIUM-HIGH) - 5 rules\n\n- `resource-naming` - Use consistent naming conventions\n- `resource-tagging` - Tag all resources for cost tracking\n- `resource-lifecycle` - Use lifecycle blocks (prevent_destroy, ignore_changes)\n- `resource-count-vs-foreach` - Prefer for_each over count\n- `resource-immutable` - Prefer immutable infrastructure patterns\n\n### 6. Variable & Output Patterns (MEDIUM) - 6 rules\n\n- `variable-types` - Use specific types, positive naming, nullable\n- `variable-validation` - Add validation rules for early error detection\n- `variable-sensitive` - Mark secrets as sensitive, no defaults\n- `variable-descriptions` - Document all variables with descriptions\n- `output-descriptions` - Document all outputs with descriptions\n- `output-no-secrets` - Never output secrets directly\n\n### 7. Language Best Practices (MEDIUM) - 5 rules\n\n- `language-no-heredoc-json` - Use jsonencode\u002Fyamlencode, not HEREDOC\n- `language-locals` - Use locals to name complex expressions\n- `language-linting` - Run terraform fmt and tflint\n- `language-data-sources` - Use data sources instead of hardcoding\n- `language-dynamic-blocks` - Use dynamic blocks for DRY code\n\n### 8. Provider Configuration (MEDIUM) - 1 rule\n\n- `provider-version-constraints` - Pin provider versions\n\n### 9. Performance Optimization (LOW-MEDIUM) - 2 rules\n\n- `perf-parallelism` - Tune parallelism for large deployments\n- `perf-debug` - Enable debug logging for troubleshooting\n\n### 10. Testing & Validation (LOW) - 2 rules\n\n- `test-strategies` - Testing pyramid (validate, lint, plan, integration)\n- `test-policy-as-code` - Implement policy checks (OPA, Checkov, tfsec)\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules\u002Fstate-remote-backend.md\nrules\u002Fsecurity-no-hardcoded-secrets.md\nrules\u002Fmodule-versioning.md\n```\n\nEach rule file contains:\n- Brief explanation of why it matters\n- Incorrect code example with explanation\n- Correct code example with explanation\n- Additional context and references\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fterramate-io\u002Fagent-skills\u002Fterraform-best-practices",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill terraform-best-practices",{"tool":45,"command":46},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill terraform-best-practices",{"tool":48,"command":49},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill terraform-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fterramate-io\u002Fagent-skills\u002Fterraform-best-practices\u002FSKILL.md",true,[],[54,66,76,85,91,98],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":62,"publishedAt":26},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[59],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[63,64,65],"model","model hierarchy","model hierarchy skill",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":72,"publishedAt":26},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[71],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},[73,74,75],"MCP","zoom","zoom mcp",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":26},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[82,83,84,74],"sdk","zoom apps sdk","apps",{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":26},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":97,"publishedAt":26},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[96],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},[93],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":26},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[100]]